]>
Commit | Line | Data |
---|---|---|
fb896a32 DE |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/cocoa/frame.h | |
3 | // Purpose: wxFrame class | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2003/03/16 | |
fb896a32 | 7 | // Copyright: (c) 2003 David Elliott |
65571936 | 8 | // Licence: wxWindows licence |
fb896a32 DE |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_COCOA_FRAME_H_ | |
12 | #define _WX_COCOA_FRAME_H_ | |
13 | ||
b5dbe15d VS |
14 | class WXDLLIMPEXP_FWD_CORE wxMenuBar; |
15 | class WXDLLIMPEXP_FWD_CORE wxStatusBar; | |
fb896a32 | 16 | |
53a2db12 | 17 | class WXDLLIMPEXP_CORE wxFrame: public wxFrameBase |
fb896a32 DE |
18 | { |
19 | DECLARE_EVENT_TABLE() | |
20 | DECLARE_DYNAMIC_CLASS(wxFrame) | |
21 | // ------------------------------------------------------------------------ | |
22 | // initialization | |
23 | // ------------------------------------------------------------------------ | |
24 | public: | |
25 | wxFrame() { Init(); } | |
26 | wxFrame(wxWindow *parent, | |
27 | wxWindowID winid, | |
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) | |
33 | { | |
34 | Init(); | |
35 | Create(parent, winid, title, pos, size, style, name); | |
36 | } | |
37 | ||
38 | virtual ~wxFrame(); | |
39 | ||
40 | bool Create(wxWindow *parent, | |
41 | wxWindowID winid, | |
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); | |
47 | protected: | |
48 | void Init(); | |
49 | // ------------------------------------------------------------------------ | |
50 | // Cocoa specifics | |
51 | // ------------------------------------------------------------------------ | |
24c7767f | 52 | public: |
8ded703d | 53 | virtual wxMenuBar* GetAppMenuBar(wxCocoaNSWindow *win); |
514e7b7b DE |
54 | // Returns the NSView for non-client drawing |
55 | virtual WX_NSView GetNonClientNSView(); | |
448cbf1d DE |
56 | |
57 | // Helper function to position status/tool bars | |
2cda55c5 | 58 | // Also called by native toolbar to force a size update |
448cbf1d | 59 | void UpdateFrameNSView(); |
205fef01 DE |
60 | |
61 | virtual void CocoaDelegate_wxMenuItemAction(WX_NSMenuItem menuItem); | |
62 | virtual bool CocoaDelegate_validateMenuItem(WX_NSMenuItem menuItem); | |
2cda55c5 DE |
63 | protected: |
64 | virtual void CocoaSetWxWindowSize(int width, int height); | |
448cbf1d DE |
65 | |
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; | |
fb896a32 DE |
69 | // ------------------------------------------------------------------------ |
70 | // Implementation | |
71 | // ------------------------------------------------------------------------ | |
72 | public: | |
24c7767f DE |
73 | virtual void AttachMenuBar(wxMenuBar *mbar); |
74 | virtual void DetachMenuBar(); | |
75 | virtual void SetMenuBar(wxMenuBar *menubar); | |
fb896a32 DE |
76 | |
77 | // implementation only from now on | |
78 | // ------------------------------- | |
79 | ||
80 | // override some more virtuals | |
fb896a32 DE |
81 | |
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; | |
a58a6614 | 85 | |
448cbf1d DE |
86 | // create the main status bar by calling OnCreateStatusBar() |
87 | virtual wxStatusBar* CreateStatusBar(int number = 1, | |
c4c178c1 | 88 | long style = wxSTB_DEFAULT_STYLE, |
448cbf1d DE |
89 | wxWindowID winid = 0, |
90 | const wxString& name = | |
91 | wxStatusLineNameStr); | |
92 | // sets the main status bar | |
93 | void SetStatusBar(wxStatusBar *statBar); | |
1d2412f7 | 94 | #if wxUSE_TOOLBAR |
448cbf1d DE |
95 | // create main toolbar bycalling OnCreateToolBar() |
96 | virtual wxToolBar* CreateToolBar(long style = -1, | |
1c4e8f38 | 97 | wxWindowID winid = wxID_ANY, |
448cbf1d DE |
98 | const wxString& name = wxToolBarNameStr); |
99 | // sets the main tool bar | |
100 | virtual void SetToolBar(wxToolBar *toolbar); | |
1d2412f7 | 101 | #endif //wxUSE_TOOLBAR |
a58a6614 | 102 | protected: |
a58a6614 | 103 | void PositionStatusBar(); |
fb896a32 DE |
104 | }; |
105 | ||
106 | #endif // _WX_COCOA_FRAME_H_ |