]>
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
;
49 ,wxSize(nWidth
, nHeight
)
56 // Constructor with no modal flag - the new convention.
58 inline wxDialog( wxWindow
* pParent
60 ,const wxString
& rsTitle
61 ,const wxPoint
& rPos
= wxDefaultPosition
62 ,const wxSize
& rSize
= wxDefaultSize
63 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
64 ,const wxString
& rsName
= wxDialogNameStr
77 bool Create( wxWindow
* pParent
79 ,const wxString
& rsTitle
80 ,const wxPoint
& rPos
= wxDefaultPosition
81 ,const wxSize
& rSize
= wxDefaultSize
82 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
83 ,const wxString
& rsName
= wxDialogNameStr
87 virtual bool Destroy(void);
88 virtual bool Show(bool bShow
);
89 virtual void Iconize(bool bIconize
);
90 virtual bool IsIconized(void) const;
92 virtual bool IsTopLevel(void) const { return TRUE
; }
94 void SetModal(bool bFlag
);
95 virtual bool IsModal(void) const;
98 // For now, same as Show(TRUE) but returns return code
100 virtual int ShowModal(void);
101 virtual void EndModal(int nRetCode
);
104 // Returns TRUE if we're in a modal loop
106 bool IsModalShowing() const;
108 #if WXWIN_COMPATIBILITY
109 bool Iconized() const { return IsIconized(); };
113 // Implementation only from now on
114 // -------------------------------
121 void OnCharHook(wxKeyEvent
& rEvent
);
122 void OnCloseWindow(wxCloseEvent
& rEvent
);
125 // May be called to terminate the dialog with the given return code
131 void OnOK(wxCommandEvent
& rEvent
);
132 void OnApply(wxCommandEvent
& rEvent
);
133 void OnCancel(wxCommandEvent
& rEvent
);
136 // Responds to colour changes
138 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
143 virtual MRESULT
OS2WindowProc( WXUINT uMessage
149 // Override more base class virtuals
151 virtual void DoSetClientSize( int nWidth
154 virtual void DoGetPosition( int* pnX
158 // Show modal dialog and enter modal loop
160 void DoShowModal(void);
163 // Common part of all ctors
168 wxWindow
* m_pOldFocus
;
171 // While we are showing a modal dialog we disable the other windows using
174 class wxWindowDisabler
* m_pWindowDisabler
;
176 DECLARE_DYNAMIC_CLASS(wxDialog
)
177 DECLARE_EVENT_TABLE()
178 }; // end of CLASS wxDialog
180 #endif // _WX_DIALOG_H_