1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/dialog.h
3 // Purpose: wxDialog class
4 // Author: David Elliott
7 // Copyright: David Elliott
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_COCOA_DIALOG_H_
12 #define _WX_COCOA_DIALOG_H_
15 // NOTE: we don't need panel.h, but other things expect it to be included
17 #include "wx/cocoa/NSPanel.h"
19 // ========================================================================
21 // ========================================================================
22 class WXDLLIMPEXP_CORE wxDialog
: public wxDialogBase
, protected wxCocoaNSPanel
24 DECLARE_DYNAMIC_CLASS(wxDialog
)
25 WX_DECLARE_COCOA_OWNER(NSPanel
,NSWindow
,NSWindow
)
26 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
30 wxDialog() { Init(); }
32 #if WXWIN_COMPATIBILITY_2_6
33 // Constructor with a modal flag, but no window id - the old convention
34 wxDialog(wxWindow
*parent
,
35 const wxString
& title
, bool WXUNUSED(modal
),
36 int x
= wxDefaultCoord
, int y
= wxDefaultCoord
, int width
= 500, int height
= 500,
37 long style
= wxDEFAULT_DIALOG_STYLE
,
38 const wxString
& name
= wxDialogNameStr
)
41 Create(parent
, wxID_ANY
, title
, wxPoint(x
, y
), wxSize(width
, height
),
44 #endif // WXWIN_COMPATIBILITY_2_6
46 // Constructor with no modal flag - the new convention.
47 wxDialog(wxWindow
*parent
, wxWindowID winid
,
48 const wxString
& title
,
49 const wxPoint
& pos
= wxDefaultPosition
,
50 const wxSize
& size
= wxDefaultSize
,
51 long style
= wxDEFAULT_DIALOG_STYLE
,
52 const wxString
& name
= wxDialogNameStr
)
55 Create(parent
, winid
, title
, pos
, size
, style
, name
);
58 bool Create(wxWindow
*parent
, wxWindowID winid
,
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
);
69 // ------------------------------------------------------------------------
71 // ------------------------------------------------------------------------
73 virtual void CocoaDelegate_windowWillClose(void);
74 virtual bool Cocoa_canBecomeMainWindow(bool &canBecome
)
75 { canBecome
= true; return true; }
77 // ------------------------------------------------------------------------
79 // ------------------------------------------------------------------------
81 virtual bool Show(bool show
= true);
83 void SetModal(bool flag
);
84 virtual bool IsModal() const { return m_isModal
; }
87 // For now, same as Show(true) but returns return code
88 virtual int ShowModal();
90 // may be called to terminate the dialog with the given return code
91 virtual void EndModal(int retCode
);
94 #endif // _WX_COCOA_DIALOG_H_