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