1 /*=========================================================================
3 Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
4 Module: $RCSfile: progressdlg.cpp,v $
6 Date: $Date: 2005/06/30 19:54:14 $
7 Version: $Revision: 1.1 $
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"
24 // For compilers that support precompilation, includes "wx/wx.h".
25 #include "wx/wxprec.h"
38 #include "progressdlg.h"
44 * CMProgressDialog type definition
47 IMPLEMENT_DYNAMIC_CLASS( CMProgressDialog
, wxDialog
)
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
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
);
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
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
);
91 GetSizer()->Fit(this);
92 GetSizer()->SetSizeHints(this);
94 ////@end CMProgressDialog creation
96 m_cancelPressed
= false;
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()
153 * Get bitmap resources
156 wxBitmap
CMProgressDialog::GetBitmapResource( const wxString
& name
)
159 ////@begin CMProgressDialog bitmap retrieval
161 ////@end CMProgressDialog bitmap retrieval
168 wxIcon
CMProgressDialog::GetIconResource( const wxString
& name
)
171 ////@begin CMProgressDialog icon retrieval
173 ////@end CMProgressDialog icon retrieval