]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/dialog.h
added some trivial macros for exception handling
[wxWidgets.git] / include / wx / mac / dialog.h
CommitLineData
0dbd6262
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: dialog.h
3// Purpose: wxDialog class
a31a5f85 4// Author: Stefan Csomor
0dbd6262 5// Modified by:
a31a5f85 6// Created: 1998-01-01
0dbd6262 7// RCS-ID: $Id$
a31a5f85 8// Copyright: (c) Stefan Csomor
d921af51 9// Licence: wxWindows licence
0dbd6262
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_DIALOG_H_
13#define _WX_DIALOG_H_
14
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
0dbd6262
SC
16#pragma interface "dialog.h"
17#endif
18
19#include "wx/panel.h"
20
c4e41ce3 21WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
0dbd6262 22
e7549107
SC
23WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
24
25class WXDLLEXPORT wxMacToolTip ;
26
0dbd6262 27// Dialog boxes
e7549107 28class WXDLLEXPORT wxDialog : public wxDialogBase
0dbd6262 29{
e7549107
SC
30 DECLARE_DYNAMIC_CLASS(wxDialog)
31
0dbd6262 32public:
e7549107
SC
33 wxDialog();
34
35 // Constructor with a modal flag, but no window id - the old convention
36 wxDialog(wxWindow *parent,
37 const wxString& title, bool modal,
38 int x = -1, int y= -1, int width = 500, int height = 500,
39 long style = wxDEFAULT_DIALOG_STYLE,
40 const wxString& name = wxDialogNameStr)
41 {
42 long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
43 Create(parent, -1, title, wxPoint(x, y), wxSize(width, height),
44 style | modalStyle, name);
45 }
46
47 // Constructor with no modal flag - the new convention.
48 wxDialog(wxWindow *parent, wxWindowID id,
49 const wxString& title,
50 const wxPoint& pos = wxDefaultPosition,
51 const wxSize& size = wxDefaultSize,
52 long style = wxDEFAULT_DIALOG_STYLE,
53 const wxString& name = wxDialogNameStr)
54 {
55 Create(parent, id, title, pos, size, style, name);
56 }
57
58 bool Create(wxWindow *parent, wxWindowID id,
59 const wxString& title,
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
62 long style = wxDEFAULT_DIALOG_STYLE,
63 const wxString& name = wxDialogNameStr);
64
65 ~wxDialog();
66
a15eb0a5 67// virtual bool Destroy();
59a9a6bc 68 bool Show(bool show = true);
e7549107 69
05adb9d2
SC
70 void SetModal(bool flag);
71 virtual bool IsModal() const;
e7549107 72
05adb9d2
SC
73 // For now, same as Show(TRUE) but returns return code
74 virtual int ShowModal();
75
76 // may be called to terminate the dialog with the given return code
77 virtual void EndModal(int retCode);
78
79 // returns TRUE if we're in a modal loop
80 bool IsModalShowing() const;
e7549107 81
05adb9d2
SC
82 // implementation
83 // --------------
e7549107 84
05adb9d2 85 // event handlers
e7549107 86 void OnCharHook(wxKeyEvent& event);
e7549107
SC
87 void OnCloseWindow(wxCloseEvent& event);
88
e7549107
SC
89 // Standard buttons
90 void OnOK(wxCommandEvent& event);
91 void OnApply(wxCommandEvent& event);
92 void OnCancel(wxCommandEvent& event);
93
94 // Responds to colour changes
95 void OnSysColourChanged(wxSysColourChangedEvent& event);
96
05adb9d2
SC
97 // show modal dialog and enter modal loop
98 void DoShowModal();
0dbd6262 99
e7549107
SC
100private:
101 DECLARE_EVENT_TABLE()
0dbd6262
SC
102};
103
104#endif
105 // _WX_DIALOG_H_