]>
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 virtual bool Destroy(void);
87 virtual bool Show(bool bShow
);
88 virtual void Iconize(bool bIconize
);
89 virtual bool IsIconized(void) const;
91 virtual bool IsTopLevel(void) const { return TRUE
; }
93 void SetModal(bool bFlag
);
94 virtual bool IsModal(void) const;
97 // For now, same as Show(TRUE) but returns return code
99 virtual int ShowModal(void);
100 virtual void EndModal(int nRetCode
);
103 // Returns TRUE if we're in a modal loop
105 bool IsModalShowing() const;
107 #if WXWIN_COMPATIBILITY
108 bool Iconized() const { return IsIconized(); };
112 // Implementation only from now on
113 // -------------------------------
120 void OnCharHook(wxKeyEvent
& rEvent
);
121 void OnCloseWindow(wxCloseEvent
& rEvent
);
124 // May be called to terminate the dialog with the given return code
130 void OnOK(wxCommandEvent
& rEvent
);
131 void OnApply(wxCommandEvent
& rEvent
);
132 void OnCancel(wxCommandEvent
& rEvent
);
135 // Responds to colour changes
137 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
142 virtual MRESULT
OS2WindowProc( WXUINT uMessage
148 // Override more base class virtuals
150 virtual void DoSetClientSize( int nWidth
153 virtual void DoGetPosition( int* pnX
157 // Show modal dialog and enter modal loop
159 void DoShowModal(void);
162 // Common part of all ctors
167 wxWindow
* m_pOldFocus
;
170 // While we are showing a modal dialog we disable the other windows using
173 class wxWindowDisabler
* m_pWindowDisabler
;
175 DECLARE_DYNAMIC_CLASS(wxDialog
)
176 DECLARE_EVENT_TABLE()
177 }; // end of CLASS wxDialog
179 #endif // _WX_DIALOG_H_