]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/classic/dialog.h
Revert last change, which made it impossible to set a custom text color and then...
[wxWidgets.git] / include / wx / mac / classic / dialog.h
CommitLineData
52479aef
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
65571936 9// Licence: wxWindows licence
52479aef
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_DIALOG_H_
13#define _WX_DIALOG_H_
14
52479aef
SC
15#include "wx/panel.h"
16
17WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
18
19WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
20
21class WXDLLEXPORT wxMacToolTip ;
22
23// Dialog boxes
24class WXDLLEXPORT wxDialog : public wxDialogBase
25{
26 DECLARE_DYNAMIC_CLASS(wxDialog)
27
28public:
70cbdcca 29 wxDialog() { Init(); }
52479aef
SC
30
31 // Constructor with a modal flag, but no window id - the old convention
32 wxDialog(wxWindow *parent,
33 const wxString& title, bool modal,
34 int x = -1, int y= -1, int width = 500, int height = 500,
35 long style = wxDEFAULT_DIALOG_STYLE,
36 const wxString& name = wxDialogNameStr)
37 {
70cbdcca
DE
38 Init();
39 m_isModalStyle = modal;
52479aef 40 Create(parent, -1, title, wxPoint(x, y), wxSize(width, height),
70cbdcca 41 style, name);
52479aef
SC
42 }
43
44 // Constructor with no modal flag - the new convention.
45 wxDialog(wxWindow *parent, wxWindowID id,
46 const wxString& title,
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& size = wxDefaultSize,
49 long style = wxDEFAULT_DIALOG_STYLE,
50 const wxString& name = wxDialogNameStr)
51 {
70cbdcca 52 Init();
52479aef
SC
53 Create(parent, id, title, pos, size, style, name);
54 }
55
56 bool Create(wxWindow *parent, wxWindowID id,
57 const wxString& title,
58 const wxPoint& pos = wxDefaultPosition,
59 const wxSize& size = wxDefaultSize,
60 long style = wxDEFAULT_DIALOG_STYLE,
61 const wxString& name = wxDialogNameStr);
62
63 ~wxDialog();
64
65// virtual bool Destroy();
555f645a 66 virtual bool Show(bool show = true);
52479aef
SC
67
68 void SetModal(bool flag);
69 virtual bool IsModal() const;
70
71 // For now, same as Show(TRUE) but returns return code
72 virtual int ShowModal();
73
74 // may be called to terminate the dialog with the given return code
75 virtual void EndModal(int retCode);
76
77 // returns TRUE if we're in a modal loop
78 bool IsModalShowing() const;
79
80 // implementation
81 // --------------
82
83 // event handlers
84 void OnCharHook(wxKeyEvent& event);
85 void OnCloseWindow(wxCloseEvent& event);
86
87 // Standard buttons
88 void OnOK(wxCommandEvent& event);
89 void OnApply(wxCommandEvent& event);
90 void OnCancel(wxCommandEvent& event);
91
92 // Responds to colour changes
93 void OnSysColourChanged(wxSysColourChangedEvent& event);
94
95 // show modal dialog and enter modal loop
96 void DoShowModal();
97
98private:
70cbdcca
DE
99 void Init();
100 bool m_isModalStyle;
52479aef
SC
101 DECLARE_EVENT_TABLE()
102};
103
104#endif
105 // _WX_DIALOG_H_