]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/frame.h
build fixes
[wxWidgets.git] / include / wx / cocoa / frame.h
CommitLineData
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
1c4e8f38 7// RCS-ID: $Id$
fb896a32 8// Copyright: (c) 2003 David Elliott
65571936 9// Licence: wxWindows licence
fb896a32
DE
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_COCOA_FRAME_H_
13#define _WX_COCOA_FRAME_H_
14
b5dbe15d
VS
15class WXDLLIMPEXP_FWD_CORE wxMenuBar;
16class WXDLLIMPEXP_FWD_CORE wxStatusBar;
fb896a32 17
1c4e8f38 18class WXDLLEXPORT wxFrame: public wxFrameBase
fb896a32
DE
19{
20 DECLARE_EVENT_TABLE()
21 DECLARE_DYNAMIC_CLASS(wxFrame)
22// ------------------------------------------------------------------------
23// initialization
24// ------------------------------------------------------------------------
25public:
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);
48protected:
49 void Init();
50// ------------------------------------------------------------------------
51// Cocoa specifics
52// ------------------------------------------------------------------------
24c7767f 53public:
8ded703d 54 virtual wxMenuBar* GetAppMenuBar(wxCocoaNSWindow *win);
514e7b7b
DE
55 // Returns the NSView for non-client drawing
56 virtual WX_NSView GetNonClientNSView();
448cbf1d
DE
57
58 // Helper function to position status/tool bars
2cda55c5 59 // Also called by native toolbar to force a size update
448cbf1d 60 void UpdateFrameNSView();
205fef01
DE
61
62 virtual void CocoaDelegate_wxMenuItemAction(WX_NSMenuItem menuItem);
63 virtual bool CocoaDelegate_validateMenuItem(WX_NSMenuItem menuItem);
2cda55c5
DE
64protected:
65 virtual void CocoaSetWxWindowSize(int width, int height);
448cbf1d
DE
66
67 virtual void CocoaReplaceView(WX_NSView oldView, WX_NSView newView);
68 // frameNSView is used whenever a statusbar/generic toolbar are present
69 WX_NSView m_frameNSView;
fb896a32
DE
70// ------------------------------------------------------------------------
71// Implementation
72// ------------------------------------------------------------------------
73public:
24c7767f
DE
74 virtual void AttachMenuBar(wxMenuBar *mbar);
75 virtual void DetachMenuBar();
76 virtual void SetMenuBar(wxMenuBar *menubar);
fb896a32
DE
77
78 // implementation only from now on
79 // -------------------------------
80
81 // override some more virtuals
fb896a32
DE
82
83 // get the origin of the client area (which may be different from (0, 0)
84 // if the frame has a toolbar) in client coordinates
85 virtual wxPoint GetClientAreaOrigin() const;
a58a6614 86
448cbf1d
DE
87 // create the main status bar by calling OnCreateStatusBar()
88 virtual wxStatusBar* CreateStatusBar(int number = 1,
89 long style = wxST_SIZEGRIP,
90 wxWindowID winid = 0,
91 const wxString& name =
92 wxStatusLineNameStr);
93 // sets the main status bar
94 void SetStatusBar(wxStatusBar *statBar);
1d2412f7 95#if wxUSE_TOOLBAR
448cbf1d
DE
96 // create main toolbar bycalling OnCreateToolBar()
97 virtual wxToolBar* CreateToolBar(long style = -1,
1c4e8f38 98 wxWindowID winid = wxID_ANY,
448cbf1d
DE
99 const wxString& name = wxToolBarNameStr);
100 // sets the main tool bar
101 virtual void SetToolBar(wxToolBar *toolbar);
1d2412f7 102#endif //wxUSE_TOOLBAR
a58a6614 103protected:
a58a6614 104 void PositionStatusBar();
fb896a32
DE
105};
106
107#endif // _WX_COCOA_FRAME_H_