]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/dialog.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDialog class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "dialog.h"
21 WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr
;
23 WXDLLEXPORT_DATA(extern const wxChar
*) wxDialogNameStr
;
25 class WXDLLEXPORT wxMacToolTip
;
28 class WXDLLEXPORT wxDialog
: public wxDialogBase
30 DECLARE_DYNAMIC_CLASS(wxDialog
)
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
)
42 long modalStyle
= modal
? wxDIALOG_MODAL
: wxDIALOG_MODELESS
;
43 Create(parent
, -1, title
, wxPoint(x
, y
), wxSize(width
, height
),
44 style
| modalStyle
, name
);
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
)
55 Create(parent
, id
, title
, pos
, size
, style
, name
);
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
);
67 virtual bool Destroy();
69 void Iconize(bool iconize
);
70 virtual bool IsIconized() const;
72 virtual bool IsTopLevel() const { return TRUE
; }
74 void SetModal(bool flag
);
75 virtual bool IsModal() const;
77 // For now, same as Show(TRUE) but returns return code
78 virtual int ShowModal();
80 // may be called to terminate the dialog with the given return code
81 virtual void EndModal(int retCode
);
83 // returns TRUE if we're in a modal loop
84 bool IsModalShowing() const;
86 #if WXWIN_COMPATIBILITY
87 bool Iconized() const { return IsIconized(); };
95 void OnCharHook(wxKeyEvent
& event
);
96 void OnCloseWindow(wxCloseEvent
& event
);
99 void OnOK(wxCommandEvent
& event
);
100 void OnApply(wxCommandEvent
& event
);
101 void OnCancel(wxCommandEvent
& event
);
103 // Responds to colour changes
104 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
106 // override more base class virtuals
107 virtual void DoGetPosition(int *x
, int *y
) const;
108 virtual void DoSetClientSize(int width
, int height
);
110 // show modal dialog and enter modal loop
114 DECLARE_EVENT_TABLE()