1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/frame.h
3 // Purpose: wxFrame class
4 // Author: David Elliott
7 // Copyright: (c) 2003 David Elliott
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_COCOA_FRAME_H_
12 #define _WX_COCOA_FRAME_H_
14 class WXDLLIMPEXP_FWD_CORE wxMenuBar
;
15 class WXDLLIMPEXP_FWD_CORE wxStatusBar
;
17 class WXDLLIMPEXP_CORE wxFrame
: public wxFrameBase
20 DECLARE_DYNAMIC_CLASS(wxFrame
)
21 // ------------------------------------------------------------------------
23 // ------------------------------------------------------------------------
26 wxFrame(wxWindow
*parent
,
28 const wxString
& title
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
31 long style
= wxDEFAULT_FRAME_STYLE
,
32 const wxString
& name
= wxFrameNameStr
)
35 Create(parent
, winid
, title
, pos
, size
, style
, name
);
40 bool Create(wxWindow
*parent
,
42 const wxString
& title
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
45 long style
= wxDEFAULT_FRAME_STYLE
,
46 const wxString
& name
= wxFrameNameStr
);
49 // ------------------------------------------------------------------------
51 // ------------------------------------------------------------------------
53 virtual wxMenuBar
* GetAppMenuBar(wxCocoaNSWindow
*win
);
54 // Returns the NSView for non-client drawing
55 virtual WX_NSView
GetNonClientNSView();
57 // Helper function to position status/tool bars
58 // Also called by native toolbar to force a size update
59 void UpdateFrameNSView();
61 virtual void CocoaDelegate_wxMenuItemAction(WX_NSMenuItem menuItem
);
62 virtual bool CocoaDelegate_validateMenuItem(WX_NSMenuItem menuItem
);
64 virtual void CocoaSetWxWindowSize(int width
, int height
);
66 virtual void CocoaReplaceView(WX_NSView oldView
, WX_NSView newView
);
67 // frameNSView is used whenever a statusbar/generic toolbar are present
68 WX_NSView m_frameNSView
;
69 // ------------------------------------------------------------------------
71 // ------------------------------------------------------------------------
73 virtual void AttachMenuBar(wxMenuBar
*mbar
);
74 virtual void DetachMenuBar();
75 virtual void SetMenuBar(wxMenuBar
*menubar
);
77 // implementation only from now on
78 // -------------------------------
80 // override some more virtuals
82 // get the origin of the client area (which may be different from (0, 0)
83 // if the frame has a toolbar) in client coordinates
84 virtual wxPoint
GetClientAreaOrigin() const;
86 // create the main status bar by calling OnCreateStatusBar()
87 virtual wxStatusBar
* CreateStatusBar(int number
= 1,
88 long style
= wxSTB_DEFAULT_STYLE
,
90 const wxString
& name
=
92 // sets the main status bar
93 void SetStatusBar(wxStatusBar
*statBar
);
95 // create main toolbar bycalling OnCreateToolBar()
96 virtual wxToolBar
* CreateToolBar(long style
= -1,
97 wxWindowID winid
= wxID_ANY
,
98 const wxString
& name
= wxToolBarNameStr
);
99 // sets the main tool bar
100 virtual void SetToolBar(wxToolBar
*toolbar
);
101 #endif //wxUSE_TOOLBAR
103 void PositionStatusBar();
106 #endif // _WX_COCOA_FRAME_H_