BUG: fix some bad changes in progress calc
[cmake.git] / Source / WXDialog / optionsdlg.cpp
blob9968acb176e5be7cb202547a618046e2a8136556
1 /*=========================================================================
3 Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
4 Module: $RCSfile: optionsdlg.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 "optionsdlg.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 "optionsdlg.h"
40 ////@begin XPM images
41 ////@end XPM images
43 /*!
44 * CMOptionsDlg type definition
47 IMPLEMENT_DYNAMIC_CLASS( CMOptionsDlg, wxDialog )
49 /*!
50 * CMOptionsDlg event table definition
53 BEGIN_EVENT_TABLE( CMOptionsDlg, wxDialog )
55 ////@begin CMOptionsDlg event table entries
56 EVT_CHECKBOX( ID_CHECKBOX_CLOSECMAKE, CMOptionsDlg::OnButtonOK )
58 ////@end CMOptionsDlg event table entries
60 END_EVENT_TABLE()
62 /*!
63 * CMOptionsDlg constructors
66 CMOptionsDlg::CMOptionsDlg( )
70 CMOptionsDlg::CMOptionsDlg( 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 * CMOptionsDlg creator
79 bool CMOptionsDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
81 ////@begin CMOptionsDlg member initialisation
82 m_closeAfterGenerate = NULL;
83 ////@end CMOptionsDlg member initialisation
85 ////@begin CMOptionsDlg creation
86 SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
87 wxDialog::Create( parent, id, caption, pos, size, style );
89 CreateControls();
90 Centre();
91 ////@end CMOptionsDlg creation
92 return TRUE;
95 /*!
96 * Control creation for CMOptionsDlg
99 void CMOptionsDlg::CreateControls()
101 ////@begin CMOptionsDlg content construction
102 CMOptionsDlg* itemDialog1 = this;
104 wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
105 itemDialog1->SetSizer(itemBoxSizer2);
107 wxNotebook* itemNotebook3 = new wxNotebook( itemDialog1, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxNB_TOP );
109 wxPanel* itemPanel4 = new wxPanel( itemNotebook3, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
110 wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
111 itemPanel4->SetSizer(itemBoxSizer5);
113 itemBoxSizer5->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
115 m_closeAfterGenerate = new wxCheckBox( itemPanel4, ID_CHECKBOX_CLOSECMAKE, _("Close down CMakeSetup after generation of project"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
116 m_closeAfterGenerate->SetValue(FALSE);
117 itemBoxSizer5->Add(m_closeAfterGenerate, 0, wxALIGN_LEFT|wxALL, 5);
119 itemNotebook3->AddPage(itemPanel4, _("General"));
121 itemBoxSizer2->Add(itemNotebook3, 1, wxGROW|wxALL|wxFIXED_MINSIZE, 5);
123 wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
124 itemBoxSizer2->Add(itemBoxSizer8, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);
126 wxButton* itemButton9 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
127 itemBoxSizer8->Add(itemButton9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
129 wxButton* itemButton10 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
130 itemBoxSizer8->Add(itemButton10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
132 ////@end CMOptionsDlg content construction
136 * Should we show tooltips?
139 bool CMOptionsDlg::ShowToolTips()
141 return TRUE;
145 * Get bitmap resources
148 wxBitmap CMOptionsDlg::GetBitmapResource( const wxString& name )
150 // Bitmap retrieval
151 ////@begin CMOptionsDlg bitmap retrieval
152 return wxNullBitmap;
153 ////@end CMOptionsDlg bitmap retrieval
157 * Get icon resources
160 wxIcon CMOptionsDlg::GetIconResource( const wxString& name )
162 // Icon retrieval
163 ////@begin CMOptionsDlg icon retrieval
164 return wxNullIcon;
165 ////@end CMOptionsDlg icon retrieval
168 void CMOptionsDlg::SetConfig(wxConfig *cfg)
170 bool boolval;
172 // close after generation
173 cfg->Read(CM_CLOSEAFTERGEN, &boolval, CM_CLOSEAFTERGEN_DEF);
174 m_closeAfterGenerate->SetValue(boolval);
177 void CMOptionsDlg::GetConfig(wxConfig *cfg)
179 // close after generation
180 cfg->Write(CM_CLOSEAFTERGEN, m_closeAfterGenerate->GetValue());
184 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_CLOSECMAKE
187 void CMOptionsDlg::OnButtonOK( wxCommandEvent& event )
189 ////@begin wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_CLOSECMAKE in CMOptionsDlg.
190 // Before editing this code, remove the block markers.
191 event.Skip();
192 ////@end wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_CLOSECMAKE in CMOptionsDlg.