]>
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 wxMenuItem
;
17 class WXDLLEXPORT wxStatusBar
;
19 class WXDLLEXPORT wxFrame
: public wxFrameBase
22 DECLARE_DYNAMIC_CLASS(wxFrame
)
23 // ------------------------------------------------------------------------
25 // ------------------------------------------------------------------------
28 wxFrame(wxWindow
*parent
,
30 const wxString
& title
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
33 long style
= wxDEFAULT_FRAME_STYLE
,
34 const wxString
& name
= wxFrameNameStr
)
37 Create(parent
, winid
, title
, pos
, size
, style
, name
);
42 bool Create(wxWindow
*parent
,
44 const wxString
& title
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 long style
= wxDEFAULT_FRAME_STYLE
,
48 const wxString
& name
= wxFrameNameStr
);
51 // ------------------------------------------------------------------------
53 // ------------------------------------------------------------------------
55 virtual void Cocoa_wxMenuItemAction(wxMenuItem
& item
);
57 // Helper function to position status/tool bars
58 void UpdateFrameNSView();
60 virtual void CocoaReplaceView(WX_NSView oldView
, WX_NSView newView
);
61 // frameNSView is used whenever a statusbar/generic toolbar are present
62 WX_NSView m_frameNSView
;
63 // ------------------------------------------------------------------------
65 // ------------------------------------------------------------------------
67 void AttachMenuBar(wxMenuBar
*mbar
);
70 // implementation only from now on
71 // -------------------------------
73 // override some more virtuals
74 virtual bool Show( bool show
= true );
76 // get the origin of the client area (which may be different from (0, 0)
77 // if the frame has a toolbar) in client coordinates
78 virtual wxPoint
GetClientAreaOrigin() const;
80 // create the main status bar by calling OnCreateStatusBar()
81 virtual wxStatusBar
* CreateStatusBar(int number
= 1,
82 long style
= wxST_SIZEGRIP
,
84 const wxString
& name
=
86 // sets the main status bar
87 void SetStatusBar(wxStatusBar
*statBar
);
88 // create main toolbar bycalling OnCreateToolBar()
89 virtual wxToolBar
* CreateToolBar(long style
= -1,
90 wxWindowID winid
= -1,
91 const wxString
& name
= wxToolBarNameStr
);
92 // sets the main tool bar
93 virtual void SetToolBar(wxToolBar
*toolbar
);
95 void PositionStatusBar();
96 // override base class virtuals
97 virtual void DoGetClientSize(int *width
, int *height
) const;
98 virtual void DoSetClientSize(int width
, int height
);
101 #endif // _WX_COCOA_FRAME_H_