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
26 wxDialog() { Init(); }
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
)
37 Create(parent
, id
, title
, pos
, size
, style
, name
);
40 bool Create(wxWindow
*parent
, wxWindowID id
,
41 const wxString
& title
,
42 const wxPoint
& pos
= wxDefaultPosition
,
43 const wxSize
& size
= wxDefaultSize
,
44 long style
= wxDEFAULT_DIALOG_STYLE
,
45 const wxString
& name
= wxDialogNameStr
);
49 // is the dialog in modal state right now?
50 virtual bool IsModal() const;
52 // For now, same as Show(TRUE) but returns return code
53 virtual int ShowModal();
55 // may be called to terminate the dialog with the given return code
56 virtual void EndModal(int retCode
);
58 // returns TRUE if we're in a modal loop
59 bool IsModalShowing() const;
61 bool Show(bool show
= TRUE
);
63 // implementation only from now on
64 // -------------------------------
67 void OnCloseWindow(wxCloseEvent
& event
);
68 void OnOK(wxCommandEvent
& event
);
69 void OnApply(wxCommandEvent
& event
);
70 void OnCancel(wxCommandEvent
& event
);
73 // common part of all ctors
77 // while we are showing a modal dialog we disable the other windows using
79 wxWindowDisabler
*m_windowDisabler
;
81 // modal dialog runs its own event loop
82 wxEventLoop
*m_eventLoop
;
84 // is modal right now?
85 bool m_isShowingModal
;
87 DECLARE_DYNAMIC_CLASS(wxDialog
)