1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDialog class
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_UNIV_DIALOG_H_
12 #define _WX_UNIV_DIALOG_H_
14 extern WXDLLIMPEXP_DATA_CORE(const char) wxDialogNameStr
[];
15 class WXDLLIMPEXP_FWD_CORE wxWindowDisabler
;
16 class WXDLLIMPEXP_FWD_CORE wxEventLoop
;
19 class WXDLLIMPEXP_CORE wxDialog
: public wxDialogBase
22 wxDialog() { Init(); }
24 // Constructor with no modal flag - the new convention.
25 wxDialog(wxWindow
*parent
, wxWindowID id
,
26 const wxString
& title
,
27 const wxPoint
& pos
= wxDefaultPosition
,
28 const wxSize
& size
= wxDefaultSize
,
29 long style
= wxDEFAULT_DIALOG_STYLE
,
30 const wxString
& name
= wxDialogNameStr
)
33 Create(parent
, id
, title
, pos
, size
, style
, name
);
36 bool Create(wxWindow
*parent
, wxWindowID id
,
37 const wxString
& title
,
38 const wxPoint
& pos
= wxDefaultPosition
,
39 const wxSize
& size
= wxDefaultSize
,
40 long style
= wxDEFAULT_DIALOG_STYLE
,
41 const wxString
& name
= wxDialogNameStr
);
45 // is the dialog in modal state right now?
46 virtual bool IsModal() const;
48 // For now, same as Show(true) but returns return code
49 virtual int ShowModal();
51 // may be called to terminate the dialog with the given return code
52 virtual void EndModal(int retCode
);
54 // returns true if we're in a modal loop
55 bool IsModalShowing() const;
57 virtual bool Show(bool show
= true);
59 // implementation only from now on
60 // -------------------------------
63 void OnCloseWindow(wxCloseEvent
& event
);
64 void OnOK(wxCommandEvent
& event
);
65 void OnApply(wxCommandEvent
& event
);
66 void OnCancel(wxCommandEvent
& event
);
69 // common part of all ctors
73 // while we are showing a modal dialog we disable the other windows using
75 wxWindowDisabler
*m_windowDisabler
;
77 // modal dialog runs its own event loop
78 wxEventLoop
*m_eventLoop
;
80 // is modal right now?
81 bool m_isShowingModal
;
83 DECLARE_DYNAMIC_CLASS(wxDialog
)