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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
15 #pragma interface "univdialog.h"
18 WXDLLEXPORT_DATA(extern const wxChar
*) wxDialogNameStr
;
19 class WXDLLEXPORT wxWindowDisabler
;
20 class WXDLLEXPORT wxEventLoop
;
23 class WXDLLEXPORT wxDialog
: public wxDialogBase
28 // Constructor with no modal flag - the new convention.
29 wxDialog(wxWindow
*parent
, wxWindowID id
,
30 const wxString
& title
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
33 long style
= wxDEFAULT_DIALOG_STYLE
,
34 const wxString
& name
= wxDialogNameStr
);
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 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
)