]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/dialog.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/dialog.h
3 // Purpose: wxDialog class
4 // Author: David Elliott
8 // Copyright: David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COCOA_DIALOG_H_
13 #define _WX_COCOA_DIALOG_H_
16 // NOTE: we don't need panel.h, but other things expect it to be included
18 #include "wx/cocoa/NSPanel.h"
20 // ========================================================================
22 // ========================================================================
23 class WXDLLEXPORT wxDialog
: public wxDialogBase
, protected wxCocoaNSPanel
25 DECLARE_DYNAMIC_CLASS(wxDialog
)
26 WX_DECLARE_COCOA_OWNER(NSPanel
,NSWindow
,NSWindow
)
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
31 wxDialog() { Init(); }
33 #if WXWIN_COMPATIBILITY_2_6
34 // Constructor with a modal flag, but no window id - the old convention
35 wxDialog(wxWindow
*parent
,
36 const wxString
& title
, bool WXUNUSED(modal
),
37 int x
= wxDefaultCoord
, int y
= wxDefaultCoord
, int width
= 500, int height
= 500,
38 long style
= wxDEFAULT_DIALOG_STYLE
,
39 const wxString
& name
= wxDialogNameStr
)
42 Create(parent
, wxID_ANY
, title
, wxPoint(x
, y
), wxSize(width
, height
),
45 #endif // WXWIN_COMPATIBILITY_2_6
47 // Constructor with no modal flag - the new convention.
48 wxDialog(wxWindow
*parent
, wxWindowID winid
,
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
)
56 Create(parent
, winid
, title
, pos
, size
, style
, name
);
59 bool Create(wxWindow
*parent
, wxWindowID winid
,
60 const wxString
& title
,
61 const wxPoint
& pos
= wxDefaultPosition
,
62 const wxSize
& size
= wxDefaultSize
,
63 long style
= wxDEFAULT_DIALOG_STYLE
,
64 const wxString
& name
= wxDialogNameStr
);
70 // ------------------------------------------------------------------------
72 // ------------------------------------------------------------------------
74 virtual void CocoaDelegate_windowWillClose(void);
75 virtual bool Cocoa_canBecomeMainWindow(bool &canBecome
)
76 { canBecome
= true; return true; }
78 // ------------------------------------------------------------------------
80 // ------------------------------------------------------------------------
82 virtual bool Show(bool show
= true);
84 void SetModal(bool flag
);
85 virtual bool IsModal() const { return m_isModal
; }
88 // For now, same as Show(true) but returns return code
89 virtual int ShowModal();
91 // may be called to terminate the dialog with the given return code
92 virtual void EndModal(int retCode
);
95 #endif // _WX_COCOA_DIALOG_H_