1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/dialog.h
3 // Purpose: wxDialog class
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_UNIV_DIALOG_H_
11 #define _WX_UNIV_DIALOG_H_
13 extern WXDLLIMPEXP_DATA_CORE(const char) wxDialogNameStr
[];
14 class WXDLLIMPEXP_FWD_CORE wxWindowDisabler
;
15 class WXDLLIMPEXP_FWD_CORE wxEventLoop
;
18 class WXDLLIMPEXP_CORE wxDialog
: public wxDialogBase
21 wxDialog() { Init(); }
23 // Constructor with no modal flag - the new convention.
24 wxDialog(wxWindow
*parent
, wxWindowID id
,
25 const wxString
& title
,
26 const wxPoint
& pos
= wxDefaultPosition
,
27 const wxSize
& size
= wxDefaultSize
,
28 long style
= wxDEFAULT_DIALOG_STYLE
,
29 const wxString
& name
= wxDialogNameStr
)
32 Create(parent
, id
, title
, pos
, size
, style
, name
);
35 bool Create(wxWindow
*parent
, wxWindowID id
,
36 const wxString
& title
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
,
39 long style
= wxDEFAULT_DIALOG_STYLE
,
40 const wxString
& name
= wxDialogNameStr
);
44 // is the dialog in modal state right now?
45 virtual bool IsModal() const;
47 // For now, same as Show(true) but returns return code
48 virtual int ShowModal();
50 // may be called to terminate the dialog with the given return code
51 virtual void EndModal(int retCode
);
53 // returns true if we're in a modal loop
54 bool IsModalShowing() const;
56 virtual bool Show(bool show
= true);
58 // implementation only from now on
59 // -------------------------------
62 void OnCloseWindow(wxCloseEvent
& event
);
63 void OnOK(wxCommandEvent
& event
);
64 void OnApply(wxCommandEvent
& event
);
65 void OnCancel(wxCommandEvent
& event
);
68 // common part of all ctors
72 // while we are showing a modal dialog we disable the other windows using
74 wxWindowDisabler
*m_windowDisabler
;
76 // modal dialog runs its own event loop
77 wxEventLoop
*m_eventLoop
;
79 // is modal right now?
80 bool m_isShowingModal
;
82 DECLARE_DYNAMIC_CLASS(wxDialog
)