class WXDLLEXPORT wxDialog : public wxDialogBase, protected wxCocoaNSPanel
{
DECLARE_DYNAMIC_CLASS(wxDialog)
- DECLARE_EVENT_TABLE()
WX_DECLARE_COCOA_OWNER(NSPanel,NSWindow,NSWindow)
// ------------------------------------------------------------------------
// initialization
// may be called to terminate the dialog with the given return code
virtual void EndModal(int retCode);
-
-// ------------------------------------------------------------------------
-// Event handlers
-// ------------------------------------------------------------------------
-protected:
- void OnCloseWindow(wxCloseEvent& event);
- // Standard buttons
- void OnOK(wxCommandEvent& event);
- void OnApply(wxCommandEvent& event);
- void OnCancel(wxCommandEvent& event);
-
- // end either modal or modeless dialog
- void EndDialog(int rc);
-
};
#endif // _WX_COCOA_DIALOG_H_
wxDialogBase() { Init(); }
virtual ~wxDialogBase() { }
- void Init();
+ // public wxDialog API, to be implemented by the derived classes
+ virtual int ShowModal() = 0;
+ virtual void EndModal(int retCode) = 0;
+ virtual bool IsModal() const = 0;
+
// Modal dialogs have a return code - usually the id of the last
// pressed button
// could do something different if needed
virtual bool IsEscapeKey(const wxKeyEvent& event);
+ // end either modal or modeless dialog, for the modal dialog rc is used as
+ // the dialog return code
+ void EndDialog(int rc);
+
// The return code from modal dialog
int m_returnCode;
int m_escapeId;
private:
+ // common part of all ctors
+ void Init();
+
// handle Esc key presses
void OnCharHook(wxKeyEvent& event);
+ // handle closing the dialog window
+ void OnCloseWindow(wxCloseEvent& event);
+
+ // handle the standard buttons
+ void OnOK(wxCommandEvent& event);
+ void OnApply(wxCommandEvent& event);
+ void OnCancel(wxCommandEvent& event);
+
+ // update the background colour
+ void OnSysColourChanged(wxSysColourChangedEvent& event);
+
+
DECLARE_NO_COPY_CLASS(wxDialogBase)
DECLARE_EVENT_TABLE()
WX_DECLARE_CONTROL_CONTAINER();
const wxString &name = wxDialogNameStr );
~wxDialog() {}
- void OnApply( wxCommandEvent &event );
- void OnCancel( wxCommandEvent &event );
- void OnOK( wxCommandEvent &event );
- void OnPaint( wxPaintEvent& event );
- void OnCloseWindow( wxCloseEvent& event );
-
virtual bool Show( bool show = TRUE );
virtual int ShowModal();
virtual void EndModal( int retCode );
bool m_modalShowing;
-protected:
+private:
// common part of all ctors
void Init();
-private:
- DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxDialog)
};
// implementation
// --------------
- // event handlers
- void OnCloseWindow(wxCloseEvent& event);
-
- // Standard buttons
- void OnOK(wxCommandEvent& event);
- void OnApply(wxCommandEvent& event);
- void OnCancel(wxCommandEvent& event);
-
- // Responds to colour changes
- void OnSysColourChanged(wxSysColourChangedEvent& event);
-
// show modal dialog and enter modal loop
void DoShowModal();
private:
void Init();
+
bool m_isModalStyle;
- DECLARE_EVENT_TABLE()
};
#endif
virtual void ChangeFont(bool keepOriginalSize = true);
virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour();
- inline WXWidget GetTopWidget() const { return m_mainWidget; }
- inline WXWidget GetClientWidget() const { return m_mainWidget; }
-
- // Standard buttons
- void OnOK(wxCommandEvent& event);
- void OnApply(wxCommandEvent& event);
- void OnCancel(wxCommandEvent& event);
-
- // Responds to colour changes
- void OnSysColourChanged(wxSysColourChangedEvent& event);
-
- void OnCloseWindow(wxCloseEvent& event);
+ WXWidget GetTopWidget() const { return m_mainWidget; }
+ WXWidget GetClientWidget() const { return m_mainWidget; }
private:
virtual bool XmDoCreateTLW(wxWindow* parent,
protected:
virtual void DoSetSize(int x, int y,
- int width, int height,
- int sizeFlags = wxSIZE_AUTO);
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height);
virtual void Raise();
- // event handlers
- void OnCloseWindow(wxCloseEvent& event);
-
- // Standard buttons
- void OnOK(wxCommandEvent& event);
- void OnApply(wxCommandEvent& event);
- void OnCancel(wxCommandEvent& event);
-
- // Responds to colour changes
- void OnSysColourChanged(wxSysColourChangedEvent& event);
-
#ifdef __POCKETPC__
// Responds to the OK button in a PocketPC titlebar. This
// can be overridden, or you can change the id used for
// common part of all ctors
void Init();
- // end either modal or modeless dialog
- void EndDialog(int rc);
-
private:
wxWindow* m_oldFocus;
bool m_endModalCalled; // allow for closing within InitDialog
wxDialogModalData *m_modalData;
DECLARE_DYNAMIC_CLASS(wxDialog)
- DECLARE_EVENT_TABLE()
DECLARE_NO_COPY_CLASS(wxDialog)
};
// override some base class virtuals
virtual bool Show(bool show = true);
- //
- // Event handlers
- //
- void OnCloseWindow(wxCloseEvent& rEvent);
-
- //
- // Standard buttons
- //
- void OnOK(wxCommandEvent& rEvent);
- void OnApply(wxCommandEvent& rEvent);
- void OnCancel(wxCommandEvent& rEvent);
-
- //
- // Responds to colour changes
- //
- void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
-
//
// Callbacks
//
//
void Init(void);
- // end either modal or modeless dialog
- void EndDialog(int rc);
-
private:
wxWindow* m_pOldFocus;
bool m_endModalCalled; // allow for closing within InitDialog
virtual void Raise();
- // event handlers
- void OnCharHook(wxKeyEvent& event);
- void OnCloseWindow(wxCloseEvent& event);
-
- // Standard buttons
- void OnOK(wxCommandEvent& event);
- void OnApply(wxCommandEvent& event);
- void OnCancel(wxCommandEvent& event);
-
protected:
// find the window to use as parent for this dialog if none has been
// specified explicitly by the user
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
-BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
- EVT_BUTTON(wxID_OK, wxDialog::OnOK)
- EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
- EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
- EVT_CLOSE(wxDialog::OnCloseWindow)
-END_EVENT_TABLE()
-
WX_IMPLEMENT_COCOA_OWNER(wxDialog,NSPanel,NSWindow,NSWindow)
void wxDialog::Init()
Show(false);
}
-void wxDialog::EndDialog(int retCode)
-{
- if(IsModal())
- EndModal(retCode);
- else
- Show(false);
-}
-
-void wxDialog::OnCloseWindow(wxCloseEvent& event)
-{
- // We'll send a Cancel message by default,
- // which may close the dialog.
- // Check for looping if the Cancel event handler calls Close().
-
- // Note that if a cancel button and handler aren't present in the dialog,
- // nothing will happen when you close the dialog via the window manager, or
- // via Close().
- // We wouldn't want to destroy the dialog by default, since the dialog may have been
- // created on the stack.
- // However, this does mean that calling dialog->Close() won't delete the dialog
- // unless the handler for wxID_CANCEL does so. So use Destroy() if you want to be
- // sure to destroy the dialog.
- // The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog.
- // ALWAYS VETO THIS EVENT!!!!
- event.Veto();
-
- static wxList closing;
-
- if ( closing.Member(this) )
- {
- wxLogDebug(wxT("WARNING: Attempting to recursively call Close for dialog"));
- return;
- }
-
- closing.Append(this);
-
- wxLogTrace(wxTRACE_COCOA,wxT("Sending Cancel Event"));
- wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
- cancelEvent.SetEventObject( this );
- GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
-
- closing.DeleteObject(this);
-}
-
-// Standard buttons
-void wxDialog::OnOK(wxCommandEvent& event)
-{
- if ( Validate() && TransferDataFromWindow() )
- {
- EndDialog(wxID_OK);
- }
-}
-
-void wxDialog::OnApply(wxCommandEvent& event)
-{
- if (Validate())
- TransferDataFromWindow();
- // TODO probably need to disable the Apply button until things change again
-}
-
-void wxDialog::OnCancel(wxCommandEvent& event)
-{
- wxLogTrace(wxTRACE_COCOA,wxT("Cancelled!"));
- EndDialog(wxID_CANCEL);
-}
// ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxDialogBase, wxTopLevelWindow)
+ EVT_BUTTON(wxID_OK, wxDialogBase::OnOK)
+ EVT_BUTTON(wxID_APPLY, wxDialogBase::OnApply)
+ EVT_BUTTON(wxID_CANCEL, wxDialogBase::OnCancel)
+
+ EVT_CLOSE(wxDialogBase::OnCloseWindow)
+
EVT_CHAR_HOOK(wxDialogBase::OnCharHook)
+
WX_EVENT_TABLE_CONTROL_CONTAINER(wxDialogBase)
END_EVENT_TABLE()
return true;
}
+void wxDialogBase::EndDialog(int rc)
+{
+ if ( IsModal() )
+ EndModal(rc);
+ else
+ Hide();
+}
+
bool wxDialogBase::IsEscapeKey(const wxKeyEvent& event)
{
// for most platforms, Esc key is used to close the dialogs
event.Skip();
}
+void wxDialogBase::OnOK(wxCommandEvent& WXUNUSED(event))
+{
+ if ( Validate() && TransferDataFromWindow() )
+ {
+ EndDialog(wxID_OK);
+ }
+}
+
+void wxDialogBase::OnApply(wxCommandEvent& WXUNUSED(event))
+{
+ if ( Validate() )
+ TransferDataFromWindow();
+
+ // TODO probably need to disable the Apply button until things change again
+}
+
+void wxDialogBase::OnCancel(wxCommandEvent& WXUNUSED(event))
+{
+ EndDialog(wxID_CANCEL);
+}
+
+void wxDialogBase::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
+{
+ // We'll send a Cancel message by default, which may close the dialog.
+ // Check for looping if the Cancel event handler calls Close().
+
+ // Note that if a cancel button and handler aren't present in the dialog,
+ // nothing will happen when you close the dialog via the window manager, or
+ // via Close(). We wouldn't want to destroy the dialog by default, since
+ // the dialog may have been created on the stack. However, this does mean
+ // that calling dialog->Close() won't delete the dialog unless the handler
+ // for wxID_CANCEL does so. So use Destroy() if you want to be sure to
+ // destroy the dialog. The default OnCancel (above) simply ends a modal
+ // dialog, and hides a modeless dialog.
+
+ // VZ: this is horrible and MT-unsafe. Can't we reuse some of these global
+ // lists here? don't dare to change it now, but should be done later!
+ static wxList closing;
+
+ if ( closing.Member(this) )
+ return;
+
+ closing.Append(this);
+
+ wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
+ cancelEvent.SetEventObject( this );
+ GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
+
+ closing.DeleteObject(this);
+}
+
+void wxDialogBase::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
+{
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
+ Refresh();
+}
// wxDialog
//-----------------------------------------------------------------------------
-BEGIN_EVENT_TABLE(wxDialog,wxDialogBase)
- EVT_BUTTON (wxID_OK, wxDialog::OnOK)
- EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
- EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
- EVT_CLOSE (wxDialog::OnCloseWindow)
-END_EVENT_TABLE()
-
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxTopLevelWindow)
void wxDialog::Init()
return wxTopLevelWindow::Create(parent, id, title, pos, size, style, name);
}
-void wxDialog::OnApply( wxCommandEvent &WXUNUSED(event) )
-{
- if (Validate())
- TransferDataFromWindow();
-}
-
-void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
-{
- if (IsModal())
- {
- EndModal(wxID_CANCEL);
- }
- else
- {
- SetReturnCode(wxID_CANCEL);
- Show(false);
- }
-}
-
-void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
-{
- if (Validate() && TransferDataFromWindow())
- {
- if (IsModal())
- {
- EndModal(wxID_OK);
- }
- else
- {
- SetReturnCode(wxID_OK);
- Show(false);
- }
- }
-}
-
-void wxDialog::OnPaint( wxPaintEvent& WXUNUSED(event) )
-{
- // yes
-}
-
-void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
-{
- // We'll send a Cancel message by default,
- // which may close the dialog.
- // Check for looping if the Cancel event handler calls Close().
-
- // Note that if a cancel button and handler aren't present in the dialog,
- // nothing will happen when you close the dialog via the window manager, or
- // via Close().
- // We wouldn't want to destroy the dialog by default, since the dialog may have been
- // created on the stack.
- // However, this does mean that calling dialog->Close() won't delete the dialog
- // unless the handler for wxID_CANCEL does so. So use Destroy() if you want to be
- // sure to destroy the dialog.
- // The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog.
-
- static wxList s_closing;
-
- if (s_closing.Member(this))
- return; // no loops
-
- s_closing.Append(this);
-
- wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
- cancelEvent.SetEventObject( this );
- GetEventHandler()->ProcessEvent(cancelEvent);
- s_closing.DeleteObject(this);
-}
-
bool wxDialog::Show( bool show )
{
if (!show && IsModal())
SetModal(false);
}
-// Standard buttons
-void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
-{
- if ( Validate() && TransferDataFromWindow() )
- EndModal(wxID_OK);
-}
-
-void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
-{
- if (Validate())
- TransferDataFromWindow();
-
- // TODO probably need to disable the Apply button until things change again
-}
-
-void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
-{
- EndModal(wxID_CANCEL);
-}
-
-void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
-{
- // We'll send a Cancel message by default,
- // which may close the dialog.
- // Check for looping if the Cancel event handler calls Close().
-
- // Note that if a cancel button and handler aren't present in the dialog,
- // nothing will happen when you close the dialog via the window manager, or
- // via Close().
- // We wouldn't want to destroy the dialog by default, since the dialog may have been
- // created on the stack.
- // However, this does mean that calling dialog->Close() won't delete the dialog
- // unless the handler for wxID_CANCEL does so. So use Destroy() if you want to be
- // sure to destroy the dialog.
- // The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog.
-
- static wxList closing;
-
- if ( closing.Member(this) )
- return;
-
- closing.Append(this);
-
- wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
- cancelEvent.SetEventObject( this );
- GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
-
- closing.DeleteObject(this);
-}
-
-void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
-{
- SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
- Refresh();
-}
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
-BEGIN_EVENT_TABLE(wxDialog, wxTopLevelWindow)
- EVT_BUTTON(wxID_OK, wxDialog::OnOK)
- EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
- EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
- EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
- EVT_CLOSE(wxDialog::OnCloseWindow)
-END_EVENT_TABLE()
-
-
wxDialog::wxDialog()
{
m_modalShowing = false;
SetModal(false);
}
-// Standard buttons
-void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
-{
- if ( Validate() && TransferDataFromWindow() )
- {
- if ( IsModal() )
- EndModal(wxID_OK);
- else
- {
- SetReturnCode(wxID_OK);
- this->Show(false);
- }
- }
-}
-
-void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
-{
- if (Validate())
- TransferDataFromWindow();
- // TODO probably need to disable the Apply button until things change again
-}
-
-void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
-{
- if ( IsModal() )
- EndModal(wxID_CANCEL);
- else
- {
- SetReturnCode(wxID_CANCEL);
- this->Show(false);
- }
-}
-
-void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
-{
- // We'll send a Cancel message by default,
- // which may close the dialog.
- // Check for looping if the Cancel event handler calls Close().
-
- // Note that if a cancel button and handler aren't present in the dialog,
- // nothing will happen when you close the dialog via the window manager, or
- // via Close().
- // We wouldn't want to destroy the dialog by default, since the dialog may have been
- // created on the stack.
- // However, this does mean that calling dialog->Close() won't delete the dialog
- // unless the handler for wxID_CANCEL does so. So use Destroy() if you want to be
- // sure to destroy the dialog.
- // The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog.
-
- static wxList closing;
-
- if ( closing.Member(this) )
- return;
-
- closing.Append(this);
-
- wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
- cancelEvent.SetEventObject( this );
- GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
-
- closing.DeleteObject(this);
-}
-
// Destroy the window (delayed, if a managed window)
bool wxDialog::Destroy()
{
return true;
}
-void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
-{
- SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
- Refresh();
-}
-
void wxDialog::ChangeFont(bool keepOriginalSize)
{
wxWindow::ChangeFont(keepOriginalSize);
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
#endif
-BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
- EVT_BUTTON(wxID_OK, wxDialog::OnOK)
- EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
- EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
-
- EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
-
- EVT_CLOSE(wxDialog::OnCloseWindow)
-END_EVENT_TABLE()
-
// ----------------------------------------------------------------------------
// wxDialogModalData
// ----------------------------------------------------------------------------
Hide();
}
-void wxDialog::EndDialog(int rc)
-{
- if ( IsModal() )
- EndModal(rc);
- else
- Hide();
-}
-
// ----------------------------------------------------------------------------
// wxWin event handlers
// ----------------------------------------------------------------------------
-// Standard buttons
-void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
-{
- if ( Validate() && TransferDataFromWindow() )
- {
- EndDialog(wxID_OK);
- }
-}
-
-void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
-{
- if ( Validate() )
- TransferDataFromWindow();
-
- // TODO probably need to disable the Apply button until things change again
-}
-
-void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
-{
- EndDialog(wxID_CANCEL);
-}
-
-void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
-{
- // We'll send a Cancel message by default, which may close the dialog.
- // Check for looping if the Cancel event handler calls Close().
-
- // Note that if a cancel button and handler aren't present in the dialog,
- // nothing will happen when you close the dialog via the window manager, or
- // via Close(). We wouldn't want to destroy the dialog by default, since
- // the dialog may have been created on the stack. However, this does mean
- // that calling dialog->Close() won't delete the dialog unless the handler
- // for wxID_CANCEL does so. So use Destroy() if you want to be sure to
- // destroy the dialog. The default OnCancel (above) simply ends a modal
- // dialog, and hides a modeless dialog.
-
- // VZ: this is horrible and MT-unsafe. Can't we reuse some of these global
- // lists here? don't dare to change it now, but should be done later!
- static wxList closing;
-
- if ( closing.Member(this) )
- return;
-
- closing.Append(this);
-
- wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
- cancelEvent.SetEventObject( this );
- GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
-
- closing.DeleteObject(this);
-}
-
-void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
-{
- SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
- Refresh();
-}
-
#ifdef __POCKETPC__
// Responds to the OK button in a PocketPC titlebar. This
// can be overridden, or you can change the id used for
Hide();
} // end of wxDialog::EndModal
-void wxDialog::EndDialog(int rc)
-{
- if ( IsModal() )
- EndModal(rc);
- else
- Hide();
-}
-
-// ----------------------------------------------------------------------------
-// wxWin event handlers
-// ----------------------------------------------------------------------------
-
-void wxDialog::OnApply( wxCommandEvent& WXUNUSED(rEvent) )
-{
- if (Validate())
- TransferDataFromWindow();
-} // end of wxDialog::OnApply
-
-// Standard buttons
-void wxDialog::OnOK( wxCommandEvent& WXUNUSED(rEvent) )
-{
- if ( Validate() && TransferDataFromWindow() )
- {
- EndDialog(wxID_OK);
- }
-} // end of wxDialog::OnOK
-
-void wxDialog::OnCancel( wxCommandEvent& WXUNUSED(rEvent) )
-{
- EndDialog(wxID_CANCEL);
-} // end of wxDialog::OnCancel
-
-void wxDialog::OnCloseWindow( wxCloseEvent& WXUNUSED(rEvent) )
-{
- //
- // We'll send a Cancel message by default, which may close the dialog.
- // Check for looping if the Cancel event handler calls Close().
- //
- // Note that if a cancel button and handler aren't present in the dialog,
- // nothing will happen when you close the dialog via the window manager, or
- // via Close().
- // We wouldn't want to destroy the dialog by default, since the dialog may have been
- // created on the stack.
- // However, this does mean that calling dialog->Close() won't delete the dialog
- // unless the handler for wxID_CANCEL does so. So use Destroy() if you want to be
- // sure to destroy the dialog.
- // The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog.
- //
-
- //
- // Ugh??? This is not good but until I figure out a global list it'll have to do
- //
- static wxList closing;
-
- if ( closing.Member(this) )
- return;
-
- closing.Append(this);
-
- wxCommandEvent vCancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
-
- vCancelEvent.SetEventObject( this );
- GetEventHandler()->ProcessEvent(vCancelEvent); // This may close the dialog
-
- closing.DeleteObject(this);
-} // end of wxDialog::OnCloseWindow
-
-void wxDialog::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(rEvent) )
-{
- SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
- Refresh();
-} // end of wxDialog::OnSysColourChanged
-
MRESULT wxDialog::OS2WindowProc( WXUINT uMessage, WXWPARAM wParam, WXLPARAM lParam )
{
MRESULT rc = 0;
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
#endif
-BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
- EVT_BUTTON(wxID_OK, wxDialog::OnOK)
- EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
- EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
-
- EVT_CLOSE(wxDialog::OnCloseWindow)
-END_EVENT_TABLE()
-
// ----------------------------------------------------------------------------
// wxDialogModalData
// ----------------------------------------------------------------------------
{
}
-// ----------------------------------------------------------------------------
-// wxWin event handlers
-// ----------------------------------------------------------------------------
-
-// Standard buttons
-void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
-{
-}
-
-void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
-{
-}
-
-void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
-{
-}
-
-void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
-{
-}