]> git.saurik.com Git - wxWidgets.git/blame - include/wx/univ/dialog.h
Remove unused wxLocale::GetUntranslatedString().
[wxWidgets.git] / include / wx / univ / dialog.h
CommitLineData
0e0de6b8 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/univ/dialog.h
0e0de6b8
VS
3// Purpose: wxDialog class
4// Author: Vaclav Slavik
5// Created: 2001/09/16
0e0de6b8 6// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
65571936 7// Licence: wxWindows licence
0e0de6b8
VS
8/////////////////////////////////////////////////////////////////////////////
9
10#ifndef _WX_UNIV_DIALOG_H_
11#define _WX_UNIV_DIALOG_H_
12
53a2db12 13extern WXDLLIMPEXP_DATA_CORE(const char) wxDialogNameStr[];
b5dbe15d
VS
14class WXDLLIMPEXP_FWD_CORE wxWindowDisabler;
15class WXDLLIMPEXP_FWD_CORE wxEventLoop;
0e0de6b8
VS
16
17// Dialog boxes
53a2db12 18class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase
0e0de6b8
VS
19{
20public:
6463b9f5 21 wxDialog() { Init(); }
0e0de6b8 22
0e0de6b8
VS
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,
6463b9f5
JS
29 const wxString& name = wxDialogNameStr)
30 {
31 Init();
32 Create(parent, id, title, pos, size, style, name);
33 }
0e0de6b8
VS
34
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);
41
a562f4fb
VZ
42 virtual ~wxDialog();
43
44 // is the dialog in modal state right now?
0e0de6b8
VS
45 virtual bool IsModal() const;
46
a290fa5a 47 // For now, same as Show(true) but returns return code
0e0de6b8
VS
48 virtual int ShowModal();
49
50 // may be called to terminate the dialog with the given return code
51 virtual void EndModal(int retCode);
52
a290fa5a 53 // returns true if we're in a modal loop
0e0de6b8
VS
54 bool IsModalShowing() const;
55
555f645a 56 virtual bool Show(bool show = true);
0e0de6b8
VS
57
58 // implementation only from now on
59 // -------------------------------
60
61 // event handlers
62 void OnCloseWindow(wxCloseEvent& event);
63 void OnOK(wxCommandEvent& event);
64 void OnApply(wxCommandEvent& event);
65 void OnCancel(wxCommandEvent& event);
66
67protected:
68 // common part of all ctors
69 void Init();
70
71private:
72 // while we are showing a modal dialog we disable the other windows using
73 // this object
74 wxWindowDisabler *m_windowDisabler;
a562f4fb 75
0e0de6b8
VS
76 // modal dialog runs its own event loop
77 wxEventLoop *m_eventLoop;
a562f4fb 78
0e0de6b8
VS
79 // is modal right now?
80 bool m_isShowingModal;
81
82 DECLARE_DYNAMIC_CLASS(wxDialog)
83 DECLARE_EVENT_TABLE()
84};
85
86#endif
87 // _WX_UNIV_DIALOG_H_