]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/frame.h
Added MSWPositionForWxMenu() method which is used to translate wxWindows
[wxWidgets.git] / include / wx / cocoa / frame.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/frame.h
3 // Purpose: wxFrame class
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2003/03/16
7 // RCS-ID: $Id:
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_COCOA_FRAME_H_
13 #define _WX_COCOA_FRAME_H_
14
15 class WXDLLEXPORT wxMenuBar;
16 class WXDLLEXPORT wxStatusBar;
17
18 class WXDLLEXPORT wxFrame: public wxFrameBase
19 {
20 DECLARE_EVENT_TABLE()
21 DECLARE_DYNAMIC_CLASS(wxFrame)
22 // ------------------------------------------------------------------------
23 // initialization
24 // ------------------------------------------------------------------------
25 public:
26 wxFrame() { Init(); }
27 wxFrame(wxWindow *parent,
28 wxWindowID winid,
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)
34 {
35 Init();
36 Create(parent, winid, title, pos, size, style, name);
37 }
38
39 virtual ~wxFrame();
40
41 bool Create(wxWindow *parent,
42 wxWindowID winid,
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);
48 protected:
49 void Init();
50 // ------------------------------------------------------------------------
51 // Cocoa specifics
52 // ------------------------------------------------------------------------
53 public:
54 virtual wxMenuBar* GetAppMenuBar(wxCocoaNSWindow *win);
55 // Returns the NSView for non-client drawing
56 virtual WX_NSView GetNonClientNSView();
57
58 // Helper function to position status/tool bars
59 // Also called by native toolbar to force a size update
60 void UpdateFrameNSView();
61 protected:
62 virtual void CocoaSetWxWindowSize(int width, int height);
63
64 virtual void CocoaReplaceView(WX_NSView oldView, WX_NSView newView);
65 // frameNSView is used whenever a statusbar/generic toolbar are present
66 WX_NSView m_frameNSView;
67 // ------------------------------------------------------------------------
68 // Implementation
69 // ------------------------------------------------------------------------
70 public:
71 virtual void AttachMenuBar(wxMenuBar *mbar);
72 virtual void DetachMenuBar();
73 virtual void SetMenuBar(wxMenuBar *menubar);
74
75 // implementation only from now on
76 // -------------------------------
77
78 // override some more virtuals
79
80 // get the origin of the client area (which may be different from (0, 0)
81 // if the frame has a toolbar) in client coordinates
82 virtual wxPoint GetClientAreaOrigin() const;
83
84 // create the main status bar by calling OnCreateStatusBar()
85 virtual wxStatusBar* CreateStatusBar(int number = 1,
86 long style = wxST_SIZEGRIP,
87 wxWindowID winid = 0,
88 const wxString& name =
89 wxStatusLineNameStr);
90 // sets the main status bar
91 void SetStatusBar(wxStatusBar *statBar);
92 #if wxUSE_TOOLBAR
93 // create main toolbar bycalling OnCreateToolBar()
94 virtual wxToolBar* CreateToolBar(long style = -1,
95 wxWindowID winid = -1,
96 const wxString& name = wxToolBarNameStr);
97 // sets the main tool bar
98 virtual void SetToolBar(wxToolBar *toolbar);
99 #endif //wxUSE_TOOLBAR
100 protected:
101 void PositionStatusBar();
102 };
103
104 #endif // _WX_COCOA_FRAME_H_