Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / WXDialog / progressdlg.cpp
blob4a34a075717199cb5671ada874658080fe77274f
1 /*=========================================================================
3 Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
4 Module: $RCSfile: progressdlg.cpp,v $
5 Language: C++
6 Date: $Date: 2005/06/30 19:54:14 $
7 Version: $Revision: 1.1 $
9 Author: Jorgen Bodde
11 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
12 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
14 This software is distributed WITHOUT ANY WARRANTY; without even
15 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 PURPOSE. See the above copyright notices for more information.
18 =========================================================================*/
20 #if defined(__GNUG__) && !defined(__APPLE__)
21 #pragma implementation "progressdlg.h"
22 #endif
24 // For compilers that support precompilation, includes "wx/wx.h".
25 #include "wx/wxprec.h"
27 #ifdef __BORLANDC__
28 #pragma hdrstop
29 #endif
31 #ifndef WX_PRECOMP
32 #include "wx/wx.h"
33 #endif
35 ////@begin includes
36 ////@end includes
38 #include "progressdlg.h"
40 ////@begin XPM images
41 ////@end XPM images
43 /*!
44 * CMProgressDialog type definition
47 IMPLEMENT_DYNAMIC_CLASS( CMProgressDialog, wxDialog )
49 /*!
50 * CMProgressDialog event table definition
53 BEGIN_EVENT_TABLE( CMProgressDialog, wxDialog )
55 ////@begin CMProgressDialog event table entries
56 EVT_BUTTON( ID_CMAKE_BUTTON, CMProgressDialog::OnCmakeCancelClick )
58 ////@end CMProgressDialog event table entries
60 END_EVENT_TABLE()
62 /*!
63 * CMProgressDialog constructors
66 CMProgressDialog::CMProgressDialog( )
70 CMProgressDialog::CMProgressDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
72 Create(parent, id, caption, pos, size, style);
75 /*!
76 * CMProgressDialog creator
79 bool CMProgressDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
81 ////@begin CMProgressDialog member initialisation
82 m_textMessage = NULL;
83 m_progress = NULL;
84 ////@end CMProgressDialog member initialisation
86 ////@begin CMProgressDialog creation
87 SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
88 wxDialog::Create( parent, id, caption, pos, size, style );
90 CreateControls();
91 GetSizer()->Fit(this);
92 GetSizer()->SetSizeHints(this);
93 Centre();
94 ////@end CMProgressDialog creation
96 m_cancelPressed = false;
97 m_cancelling = false;
99 return TRUE;
103 * Control creation for CMProgressDialog
106 void CMProgressDialog::CreateControls()
108 ////@begin CMProgressDialog content construction
109 CMProgressDialog* itemDialog1 = this;
111 wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
112 itemDialog1->SetSizer(itemBoxSizer2);
114 itemBoxSizer2->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
116 m_textMessage = new wxStaticText( itemDialog1, wxID_STATIC, _("Please wait while CMake configures ..."), wxDefaultPosition, wxDefaultSize, 0 );
117 itemBoxSizer2->Add(m_textMessage, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5);
119 wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
120 itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
122 m_progress = new wxGauge( itemDialog1, ID_CMAKE_PROGRESS, 100, wxDefaultPosition, wxSize(250, 20), wxGA_HORIZONTAL );
123 m_progress->SetValue(0);
124 itemBoxSizer5->Add(m_progress, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
126 wxButton* itemButton7 = new wxButton( itemDialog1, ID_CMAKE_BUTTON, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
127 itemBoxSizer2->Add(itemButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
129 itemBoxSizer2->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);
131 ////@end CMProgressDialog content construction
135 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CMAKE_BUTTON
138 void CMProgressDialog::OnCmakeCancelClick( wxCommandEvent& event )
140 m_cancelPressed = true;
144 * Should we show tooltips?
147 bool CMProgressDialog::ShowToolTips()
149 return TRUE;
153 * Get bitmap resources
156 wxBitmap CMProgressDialog::GetBitmapResource( const wxString& name )
158 // Bitmap retrieval
159 ////@begin CMProgressDialog bitmap retrieval
160 return wxNullBitmap;
161 ////@end CMProgressDialog bitmap retrieval
165 * Get icon resources
168 wxIcon CMProgressDialog::GetIconResource( const wxString& name )
170 // Icon retrieval
171 ////@begin CMProgressDialog icon retrieval
172 return wxNullIcon;
173 ////@end CMProgressDialog icon retrieval