]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/frame.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/frame.h
3 // Purpose: wxFrame class
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COCOA_FRAME_H_
13 #define _WX_COCOA_FRAME_H_
15 class WXDLLEXPORT wxMenuBar
;
16 class WXDLLEXPORT wxStatusBar
;
18 class WXDLLEXPORT wxFrame
: public wxFrameBase
21 DECLARE_DYNAMIC_CLASS(wxFrame
)
22 // ------------------------------------------------------------------------
24 // ------------------------------------------------------------------------
27 wxFrame(wxWindow
*parent
,
29 const wxString
& title
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
32 long style
= wxDEFAULT_FRAME_STYLE
,
33 const wxString
& name
= wxFrameNameStr
)
36 Create(parent
, winid
, title
, pos
, size
, style
, name
);
41 bool Create(wxWindow
*parent
,
43 const wxString
& title
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
46 long style
= wxDEFAULT_FRAME_STYLE
,
47 const wxString
& name
= wxFrameNameStr
);
50 // ------------------------------------------------------------------------
52 // ------------------------------------------------------------------------
54 virtual wxMenuBar
* GetAppMenuBar() { return GetMenuBar(); }
55 // Returns the NSView for non-client drawing
56 virtual WX_NSView
GetNonClientNSView();
58 virtual void CocoaSetWxWindowSize(int width
, int height
);
60 // Helper function to position status/tool bars
61 void UpdateFrameNSView();
63 virtual void CocoaReplaceView(WX_NSView oldView
, WX_NSView newView
);
64 // frameNSView is used whenever a statusbar/generic toolbar are present
65 WX_NSView m_frameNSView
;
66 // ------------------------------------------------------------------------
68 // ------------------------------------------------------------------------
70 virtual void AttachMenuBar(wxMenuBar
*mbar
);
71 virtual void DetachMenuBar();
72 virtual void SetMenuBar(wxMenuBar
*menubar
);
74 // implementation only from now on
75 // -------------------------------
77 // override some more virtuals
79 // get the origin of the client area (which may be different from (0, 0)
80 // if the frame has a toolbar) in client coordinates
81 virtual wxPoint
GetClientAreaOrigin() const;
83 // create the main status bar by calling OnCreateStatusBar()
84 virtual wxStatusBar
* CreateStatusBar(int number
= 1,
85 long style
= wxST_SIZEGRIP
,
87 const wxString
& name
=
89 // sets the main status bar
90 void SetStatusBar(wxStatusBar
*statBar
);
92 // create main toolbar bycalling OnCreateToolBar()
93 virtual wxToolBar
* CreateToolBar(long style
= -1,
94 wxWindowID winid
= -1,
95 const wxString
& name
= wxToolBarNameStr
);
96 // sets the main tool bar
97 virtual void SetToolBar(wxToolBar
*toolbar
);
98 #endif //wxUSE_TOOLBAR
100 void PositionStatusBar();
103 #endif // _WX_COCOA_FRAME_H_