]> git.saurik.com Git - wxWidgets.git/blob - include/wx/univ/dialog.h
Added MSWPositionForWxMenu() method which is used to translate wxWindows
[wxWidgets.git] / include / wx / univ / dialog.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dialog.h
3 // Purpose: wxDialog class
4 // Author: Vaclav Slavik
5 // Created: 2001/09/16
6 // RCS-ID: $Id$
7 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_UNIV_DIALOG_H_
12 #define _WX_UNIV_DIALOG_H_
13
14 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
15 #pragma interface "univdialog.h"
16 #endif
17
18 WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
19 class WXDLLEXPORT wxWindowDisabler;
20 class WXDLLEXPORT wxEventLoop;
21
22 // Dialog boxes
23 class WXDLLEXPORT wxDialog : public wxDialogBase
24 {
25 public:
26 wxDialog();
27
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);
35
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);
42
43 virtual ~wxDialog();
44
45 // is the dialog in modal state right now?
46 virtual bool IsModal() const;
47
48 // For now, same as Show(TRUE) but returns return code
49 virtual int ShowModal();
50
51 // may be called to terminate the dialog with the given return code
52 virtual void EndModal(int retCode);
53
54 // returns TRUE if we're in a modal loop
55 bool IsModalShowing() const;
56
57 bool Show(bool show = TRUE);
58
59 // implementation only from now on
60 // -------------------------------
61
62 // event handlers
63 void OnCloseWindow(wxCloseEvent& event);
64 void OnOK(wxCommandEvent& event);
65 void OnApply(wxCommandEvent& event);
66 void OnCancel(wxCommandEvent& event);
67
68 protected:
69 // common part of all ctors
70 void Init();
71
72 private:
73 // while we are showing a modal dialog we disable the other windows using
74 // this object
75 wxWindowDisabler *m_windowDisabler;
76
77 // modal dialog runs its own event loop
78 wxEventLoop *m_eventLoop;
79
80 // is modal right now?
81 bool m_isShowingModal;
82
83 DECLARE_DYNAMIC_CLASS(wxDialog)
84 DECLARE_EVENT_TABLE()
85 };
86
87 #endif
88 // _WX_UNIV_DIALOG_H_