]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/dialog.h
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
;
22 class WXDLLEXPORT wxDialog
: public wxDialogBase
26 inline wxDialog() { Init(); }
29 // Constructor with a modal flag, but no window id - the old convention
31 inline wxDialog( wxWindow
* pParent
32 ,const wxString
& rsTitle
38 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
39 ,const wxString
& rsName
= wxDialogNameStr
42 long lModalStyle
= lStyle
? wxDIALOG_MODAL
: wxDIALOG_MODELESS
;
48 ,wxSize(nWidth
, nHeight
)
55 // Constructor with no modal flag - the new convention.
57 inline wxDialog( wxWindow
* pParent
59 ,const wxString
& rsTitle
60 ,const wxPoint
& rPos
= wxDefaultPosition
61 ,const wxSize
& rSize
= wxDefaultSize
62 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
63 ,const wxString
& rsName
= wxDialogNameStr
76 bool Create( wxWindow
* pParent
78 ,const wxString
& rsTitle
79 ,const wxPoint
& rPos
= wxDefaultPosition
80 ,const wxSize
& rSize
= wxDefaultSize
81 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
82 ,const wxString
& rsName
= wxDialogNameStr
86 void SetModal(bool bFlag
);
87 virtual bool IsModal(void) const;
89 // For now, same as Show(TRUE) but returns return code
90 virtual int ShowModal();
92 // may be called to terminate the dialog with the given return code
93 virtual void EndModal(int retCode
);
96 // Returns TRUE if we're in a modal loop
98 bool IsModalShowing() const;
101 // Implementation only from now on
102 // -------------------------------
106 // Override some base class virtuals
108 virtual bool Show(bool bShow
);
113 void OnCharHook(wxKeyEvent
& rEvent
);
114 void OnCloseWindow(wxCloseEvent
& rEvent
);
119 void OnOK(wxCommandEvent
& rEvent
);
120 void OnApply(wxCommandEvent
& rEvent
);
121 void OnCancel(wxCommandEvent
& rEvent
);
124 // Responds to colour changes
126 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
131 virtual MRESULT
OS2WindowProc( WXUINT uMessage
138 // Show modal dialog and enter modal loop
140 void DoShowModal(void);
143 // Common part of all ctors
148 wxWindow
* m_pOldFocus
;
151 // While we are showing a modal dialog we disable the other windows using
154 class wxWindowDisabler
* m_pWindowDisabler
;
156 DECLARE_DYNAMIC_CLASS(wxDialog
)
157 DECLARE_EVENT_TABLE()
158 }; // end of CLASS wxDialog
160 #endif // _WX_DIALOG_H_