]>
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
);
114 void OnCharHook(wxKeyEvent
& rEvent
);
115 void OnCloseWindow(wxCloseEvent
& rEvent
);
120 void OnOK(wxCommandEvent
& rEvent
);
121 void OnApply(wxCommandEvent
& rEvent
);
122 void OnCancel(wxCommandEvent
& rEvent
);
125 // Responds to colour changes
127 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
132 virtual MRESULT
OS2WindowProc( WXUINT uMessage
139 // Show modal dialog and enter modal loop
141 void DoShowModal(void);
144 // Common part of all ctors
149 wxWindow
* m_pOldFocus
;
152 // While we are showing a modal dialog we disable the other windows using
155 class wxWindowDisabler
* m_pWindowDisabler
;
157 DECLARE_DYNAMIC_CLASS(wxDialog
)
158 DECLARE_EVENT_TABLE()
159 }; // end of CLASS wxDialog
161 #endif // _WX_DIALOG_H_