]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/dialog.h
wxRTC: fixed guidelines overwriting adjacent cell borders; corrected capitalisation...
[wxWidgets.git] / include / wx / osx / dialog.h
CommitLineData
6762286d 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/osx/dialog.h
6762286d
SC
3// Purpose: wxDialog class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 1998-01-01
6762286d
SC
7// Copyright: (c) Stefan Csomor
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_DIALOG_H_
12#define _WX_DIALOG_H_
13
14#include "wx/panel.h"
15
6762286d 16class WXDLLIMPEXP_FWD_CORE wxMacToolTip ;
62068535 17class WXDLLIMPEXP_FWD_CORE wxModalEventLoop ;
6762286d
SC
18
19// Dialog boxes
20class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase
21{
22 DECLARE_DYNAMIC_CLASS(wxDialog)
23
24public:
25 wxDialog() { Init(); }
26
27 // Constructor with no modal flag - the new convention.
28 wxDialog(wxWindow *parent, wxWindowID id,
29 const wxString& title,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = wxDEFAULT_DIALOG_STYLE,
33 const wxString& name = wxDialogNameStr)
34 {
35 Init();
36 Create(parent, id, title, pos, size, style, name);
37 }
38
39 bool Create(wxWindow *parent, wxWindowID id,
40 const wxString& title,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize,
43 long style = wxDEFAULT_DIALOG_STYLE,
44 const wxString& name = wxDialogNameStr);
45
46 virtual ~wxDialog();
47
48// virtual bool Destroy();
49 virtual bool Show(bool show = true);
50
4d572a2c 51 // return true if we're showing the dialog modally
6762286d
SC
52 virtual bool IsModal() const;
53
4d572a2c 54 // show the dialog modally and return the value passed to EndModal()
6762286d 55 virtual int ShowModal();
ce00f59b 56
9482c644 57 virtual void ShowWindowModal();
6762286d
SC
58
59 // may be called to terminate the dialog with the given return code
60 virtual void EndModal(int retCode);
ce00f59b 61
445e564f
SC
62 static bool OSXHasModalDialogsOpen();
63 static void OSXBeginModalDialog();
64 static void OSXEndModalDialog();
6762286d
SC
65
66 // implementation
67 // --------------
68
4d572a2c 69 wxDialogModality GetModality() const;
ce00f59b 70
bfa92264
KO
71#if wxOSX_USE_COCOA
72 virtual void ModalFinishedCallback(void* WXUNUSED(panel), int WXUNUSED(returnCode)) {}
73#endif
74
4d572a2c 75protected:
ce00f59b 76 // show window modal dialog
4d572a2c 77 void DoShowWindowModal();
6762286d 78
62068535
SC
79 // end window modal dialog.
80 void EndWindowModal();
81
6762286d
SC
82 // mac also takes command-period as cancel
83 virtual bool IsEscapeKey(const wxKeyEvent& event);
84
9482c644 85
bfa92264 86 wxDialogModality m_modality;
ce00f59b 87
62068535 88 wxModalEventLoop* m_eventLoop;
bfa92264 89
6762286d
SC
90private:
91 void Init();
6762286d
SC
92};
93
5c6eb3a8 94#endif
6762286d 95 // _WX_DIALOG_H_