1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/dialog.h
3 // Purpose: wxDialog class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 WXDLLEXPORT_DATA(extern const wxChar
) wxDialogNameStr
[];
19 class WXDLLEXPORT wxDialogModalData
;
24 class WXDLLEXPORT wxDialog
: public wxDialogBase
28 inline wxDialog() { Init(); }
31 wxDialog(wxWindow
*parent
, wxWindowID id
,
32 const wxString
& title
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
35 long style
= wxDEFAULT_DIALOG_STYLE
,
36 const wxString
& name
= wxDialogNameStr
)
40 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
43 bool Create( wxWindow
* pParent
45 ,const wxString
& rsTitle
46 ,const wxPoint
& rPos
= wxDefaultPosition
47 ,const wxSize
& rSize
= wxDefaultSize
48 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
49 ,const wxString
& rsName
= wxDialogNameStr
53 // return true if we're showing the dialog modally
54 virtual bool IsModal() const { return m_modalData
!= NULL
; }
56 // show the dialog modally and return the value passed to EndModal()
57 virtual int ShowModal();
59 // may be called to terminate the dialog with the given return code
60 virtual void EndModal(int retCode
);
62 // implementation only from now on
63 // -------------------------------
65 // override some base class virtuals
66 virtual bool Show(bool show
= true);
71 void OnCloseWindow(wxCloseEvent
& rEvent
);
76 void OnOK(wxCommandEvent
& rEvent
);
77 void OnApply(wxCommandEvent
& rEvent
);
78 void OnCancel(wxCommandEvent
& rEvent
);
81 // Responds to colour changes
83 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
88 virtual MRESULT
OS2WindowProc( WXUINT uMessage
92 #if WXWIN_COMPATIBILITY_2_6
94 // Constructor with a modal flag, but no window id - the old convention
95 wxDEPRECATED( wxDialog( wxWindow
* pParent
96 ,const wxString
& rsTitle
102 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
103 ,const wxString
& rsName
= wxDialogNameStr
106 // just call Show() or ShowModal()
107 wxDEPRECATED( void SetModal(bool bFlag
) );
110 wxDEPRECATED( bool IsModalShowing() const );
112 #endif // WXWIN_COMPATIBILITY_2_6
116 // find the window to use as parent for this dialog if none has been
117 // specified explicitly by the user
121 wxWindow
*FindSuitableParent() const;
124 // Common part of all ctors
128 // end either modal or modeless dialog
129 void EndDialog(int rc
);
132 wxWindow
* m_pOldFocus
;
133 bool m_endModalCalled
; // allow for closing within InitDialog
135 // this pointer is non-NULL only while the modal event loop is running
136 wxDialogModalData
*m_modalData
;
139 // While we are showing a modal dialog we disable the other windows using
142 class wxWindowDisabler
* m_pWindowDisabler
;
144 DECLARE_DYNAMIC_CLASS(wxDialog
)
145 DECLARE_EVENT_TABLE()
146 DECLARE_NO_COPY_CLASS(wxDialog
)
147 }; // end of CLASS wxDialog
149 #endif // _WX_DIALOG_H_