]> git.saurik.com Git - wxWidgets.git/blame - include/wx/univ/dialog.h
Wrappers for *ToText
[wxWidgets.git] / include / wx / univ / dialog.h
CommitLineData
0e0de6b8
VS
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)
65571936 8// Licence: wxWindows licence
0e0de6b8
VS
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_UNIV_DIALOG_H_
12#define _WX_UNIV_DIALOG_H_
13
12028905 14#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
0e0de6b8
VS
15 #pragma interface "univdialog.h"
16#endif
17
18WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
19class WXDLLEXPORT wxWindowDisabler;
20class WXDLLEXPORT wxEventLoop;
21
22// Dialog boxes
23class WXDLLEXPORT wxDialog : public wxDialogBase
24{
25public:
6463b9f5 26 wxDialog() { Init(); }
0e0de6b8 27
0e0de6b8
VS
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,
6463b9f5
JS
34 const wxString& name = wxDialogNameStr)
35 {
36 Init();
37 Create(parent, id, title, pos, size, style, name);
38 }
0e0de6b8
VS
39
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);
46
a562f4fb
VZ
47 virtual ~wxDialog();
48
49 // is the dialog in modal state right now?
0e0de6b8
VS
50 virtual bool IsModal() const;
51
52 // For now, same as Show(TRUE) but returns return code
53 virtual int ShowModal();
54
55 // may be called to terminate the dialog with the given return code
56 virtual void EndModal(int retCode);
57
58 // returns TRUE if we're in a modal loop
59 bool IsModalShowing() const;
60
9facc126 61 bool Show(bool show = TRUE);
0e0de6b8
VS
62
63 // implementation only from now on
64 // -------------------------------
65
66 // event handlers
67 void OnCloseWindow(wxCloseEvent& event);
68 void OnOK(wxCommandEvent& event);
69 void OnApply(wxCommandEvent& event);
70 void OnCancel(wxCommandEvent& event);
71
72protected:
73 // common part of all ctors
74 void Init();
75
76private:
77 // while we are showing a modal dialog we disable the other windows using
78 // this object
79 wxWindowDisabler *m_windowDisabler;
a562f4fb 80
0e0de6b8
VS
81 // modal dialog runs its own event loop
82 wxEventLoop *m_eventLoop;
a562f4fb 83
0e0de6b8
VS
84 // is modal right now?
85 bool m_isShowingModal;
86
87 DECLARE_DYNAMIC_CLASS(wxDialog)
88 DECLARE_EVENT_TABLE()
89};
90
91#endif
92 // _WX_UNIV_DIALOG_H_