1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDialog class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr
;
19 class WXDLLEXPORT wxDialogModalData
;
24 class WXDLLEXPORT wxDialog
: public wxDialogBase
28 inline wxDialog() { Init(); }
31 // Constructor with a modal flag, but no window id - the old convention
33 inline wxDialog( wxWindow
* pParent
34 ,const wxString
& rsTitle
40 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
41 ,const wxString
& rsName
= wxDialogNameStr
44 long lModalStyle
= lStyle
? wxDIALOG_MODAL
: wxDIALOG_MODELESS
;
50 ,wxSize(nWidth
, nHeight
)
57 // Constructor with no modal flag - the new convention.
59 inline wxDialog( wxWindow
* pParent
61 ,const wxString
& rsTitle
62 ,const wxPoint
& rPos
= wxDefaultPosition
63 ,const wxSize
& rSize
= wxDefaultSize
64 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
65 ,const wxString
& rsName
= wxDialogNameStr
78 bool Create( wxWindow
* pParent
80 ,const wxString
& rsTitle
81 ,const wxPoint
& rPos
= wxDefaultPosition
82 ,const wxSize
& rSize
= wxDefaultSize
83 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
84 ,const wxString
& rsName
= wxDialogNameStr
88 void SetModal(bool bFlag
);
89 virtual bool IsModal(void) const;
91 // For now, same as Show(TRUE) but returns return code
92 virtual int ShowModal();
94 // may be called to terminate the dialog with the given return code
95 virtual void EndModal(int retCode
);
98 // Returns TRUE if we're in a modal loop
100 bool IsModalShowing() const;
103 // Implementation only from now on
104 // -------------------------------
108 // Override some base class virtuals
110 virtual bool Show(bool bShow
);
115 void OnCharHook(wxKeyEvent
& rEvent
);
116 void OnCloseWindow(wxCloseEvent
& rEvent
);
121 void OnOK(wxCommandEvent
& rEvent
);
122 void OnApply(wxCommandEvent
& rEvent
);
123 void OnCancel(wxCommandEvent
& rEvent
);
126 // Responds to colour changes
128 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
133 virtual MRESULT
OS2WindowProc( WXUINT uMessage
140 // Show modal dialog and enter modal loop
142 void DoShowModal(void);
145 // Common part of all ctors
150 wxWindow
* m_pOldFocus
;
152 // this pointer is non-NULL only while the modal event loop is running
153 wxDialogModalData
*m_modalData
;
156 // While we are showing a modal dialog we disable the other windows using
159 class wxWindowDisabler
* m_pWindowDisabler
;
161 DECLARE_DYNAMIC_CLASS(wxDialog
)
162 DECLARE_EVENT_TABLE()
163 }; // end of CLASS wxDialog
165 #endif // _WX_DIALOG_H_