//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-// GCC implementation
-//-----------------------------------------------------------------------------
-
-#ifdef __GNUG__
- #pragma implementation "derivdlg.h"
-#endif
-
-//-----------------------------------------------------------------------------
-// Standard wxWindows headers
+// Standard wxWidgets headers
//-----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx/wx.h".
//-----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx/wx.h".
//-----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(PreferencesDialog, wxDialog)
//-----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(PreferencesDialog, wxDialog)
- EVT_BUTTON( XRCID( "my_button" ), PreferencesDialog::OnMyButtonClicked )
- EVT_UPDATE_UI(XRCID( "my_checkbox" ), PreferencesDialog::OuUpdateUIMyCheckbox )
+ EVT_BUTTON( XRCID( "my_button" ), PreferencesDialog::OnMyButtonClicked )
+ EVT_UPDATE_UI(XRCID( "my_checkbox" ), PreferencesDialog::OnUpdateUIMyCheckbox )
// Note that the ID here isn't a XRCID, it is one of the standard wx ID's.
EVT_BUTTON( wxID_OK, PreferencesDialog::OnOK )
END_EVENT_TABLE()
// Note that the ID here isn't a XRCID, it is one of the standard wx ID's.
EVT_BUTTON( wxID_OK, PreferencesDialog::OnOK )
END_EVENT_TABLE()
//-----------------------------------------------------------------------------
// Constructor (Notice how small and easy it is)
PreferencesDialog::PreferencesDialog(wxWindow* parent)
//-----------------------------------------------------------------------------
// Constructor (Notice how small and easy it is)
PreferencesDialog::PreferencesDialog(wxWindow* parent)
-{
- wxXmlResource::Get()->LoadDialog(this, parent, wxT("derived_dialog"));
-}
-
-// Destructor. (Empty, as I don't need anything special done when destructing).
-PreferencesDialog::~PreferencesDialog()
}
//-----------------------------------------------------------------------------
// Private members (including the event handlers)
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
// Private members (including the event handlers)
//-----------------------------------------------------------------------------
- // since the event that was passed into this function already has the
- // is a pointer to the right control. However,
+ // since the event that was passed into this function already has the
+ // is a pointer to the right control. However,
// this is the XRCCTRL way (which is more obvious as to what is going on).
myCheckBoxIsChecked = XRCCTRL(*this, "my_checkbox", wxCheckBox)->IsChecked();
// this is the XRCCTRL way (which is more obvious as to what is going on).
myCheckBoxIsChecked = XRCCTRL(*this, "my_checkbox", wxCheckBox)->IsChecked();
- // Now call either Enable(TRUE) or Enable(FALSE) on the textctrl, depending
- // on the value of that boolean.
- XRCCTRL(*this, "my_textctrl", wxTextCtrl)->Enable(myCheckBoxIsChecked);
+ // Now call either Enable(true) or Enable(false) on the textctrl, depending
+ // on the value of that boolean.
+ XRCCTRL(*this, "my_textctrl", wxTextCtrl)->Enable(myCheckBoxIsChecked);
{
// Construct a message dialog (An extra parameters to put a cancel button on).
wxMessageDialog msgDlg2(this, _("Press OK to close Derived dialog, or Cancel to abort"),
_("Overriding base class OK button handler"),
wxOK | wxCANCEL | wxCENTER );
{
// Construct a message dialog (An extra parameters to put a cancel button on).
wxMessageDialog msgDlg2(this, _("Press OK to close Derived dialog, or Cancel to abort"),
_("Overriding base class OK button handler"),
wxOK | wxCANCEL | wxCENTER );
// Show the message dialog, and if it returns wxID_OK (ie they clicked on OK button)...
if (msgDlg2.ShowModal() == wxID_OK)
{
// Show the message dialog, and if it returns wxID_OK (ie they clicked on OK button)...
if (msgDlg2.ShowModal() == wxID_OK)
{
EndModal( wxID_OK );
// You could also have used event.Skip() which would then skip up
// to the wxDialog's event table and see if there was a EVT_BUTTON
EndModal( wxID_OK );
// You could also have used event.Skip() which would then skip up
// to the wxDialog's event table and see if there was a EVT_BUTTON