]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/frame.h
ae5e085877ab879194629b07b61d97c52c261ca1
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFrame class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "frame.h"
19 #include "wx/window.h"
20 #include "wx/toolbar.h"
24 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr
;
25 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
27 class WXDLLEXPORT wxMenuBar
;
28 class WXDLLEXPORT wxStatusBar
;
29 class WXDLLEXPORT wxMacToolTip
;
31 class WXDLLEXPORT wxFrame
: public wxWindow
{
33 DECLARE_DYNAMIC_CLASS(wxFrame
)
37 inline wxFrame(wxWindow
*parent
,
39 const wxString
& title
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
,
42 long style
= wxDEFAULT_FRAME_STYLE
,
43 const wxString
& name
= wxFrameNameStr
)
45 Create(parent
, id
, title
, pos
, size
, style
, name
);
50 bool Create(wxWindow
*parent
,
52 const wxString
& title
,
53 const wxPoint
& pos
= wxDefaultPosition
,
54 const wxSize
& size
= wxDefaultSize
,
55 long style
= wxDEFAULT_FRAME_STYLE
,
56 const wxString
& name
= wxFrameNameStr
);
58 virtual bool Destroy();
60 void OnSize(wxSizeEvent
& event
);
61 void OnMenuHighlight(wxMenuEvent
& event
);
62 void OnActivate(wxActivateEvent
& event
);
63 void OnIdle(wxIdleEvent
& event
);
64 void OnCloseWindow(wxCloseEvent
& event
);
67 void SetMenuBar(wxMenuBar
*menu_bar
);
68 virtual wxMenuBar
*GetMenuBar() const ;
70 // Call this to simulate a menu command
71 virtual void Command(int id
);
72 virtual void ProcessCommand(int id
);
75 virtual void SetIcon(const wxIcon
& icon
);
78 virtual wxStatusBar
* CreateStatusBar(int number
=1, long style
= wxST_SIZEGRIP
, wxWindowID id
= 0,
79 const wxString
& name
= "statusBar");
80 inline wxStatusBar
*GetStatusBar() const { return m_frameStatusBar
; }
81 virtual void PositionStatusBar();
82 virtual wxStatusBar
*OnCreateStatusBar(int number
, long style
, wxWindowID id
,
83 const wxString
& name
);
88 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
|wxTB_HORIZONTAL
, wxWindowID id
= -1, const wxString
& name
= wxToolBarNameStr
);
89 virtual wxToolBar
*OnCreateToolBar(long style
, wxWindowID id
, const wxString
& name
);
90 // If made known to the frame, the frame will manage it automatically.
91 virtual inline void SetToolBar(wxToolBar
*toolbar
) { m_frameToolBar
= toolbar
; }
92 virtual inline wxToolBar
*GetToolBar() const { return m_frameToolBar
; }
93 virtual void PositionToolBar();
97 // Set status line text
98 virtual void SetStatusText(const wxString
& text
, int number
= 0);
100 // Set status line widths
101 virtual void SetStatusWidths(int n
, const int widths_field
[]);
103 // Hint to tell framework which status bar to use
104 // TODO: should this go into a wxFrameworkSettings class perhaps?
105 static void UseNativeStatusBar(bool useNative
) { m_useNativeStatusBar
= useNative
; };
106 static bool UsesNativeStatusBar() { return m_useNativeStatusBar
; };
108 // Fit frame around subwindows
112 virtual void Iconize(bool iconize
);
114 virtual bool IsIconized() const ;
117 inline bool Iconized() const { return IsIconized(); }
119 // Is the frame maximized?
120 virtual bool IsMaximized(void) const ;
122 virtual void Maximize(bool maximize
);
124 // Responds to colour changes
125 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
127 // Query app for menu item updates (called from OnIdle)
128 void DoMenuUpdates();
129 void DoMenuUpdates(wxMenu
* menu
);
131 // Checks if there is a toolbar, and returns the first free client position
132 virtual wxPoint
GetClientAreaOrigin() const;
133 virtual void GetClientSize(int *x
, int *y
) const ;
134 virtual void DoSetClientSize(int clientwidth
, int clientheight
) ;
136 // tooltip management
138 wxMacToolTip
* GetToolTipCtrl() const { return m_hwndToolTip
; }
139 void SetToolTipCtrl(wxMacToolTip
*tt
) { m_hwndToolTip
= wxMacToolTip
; }
143 wxMenuBar
* m_frameMenuBar
;
144 wxStatusBar
* m_frameStatusBar
;
147 static bool m_useNativeStatusBar
;
149 wxToolBar
* m_frameToolBar
;
152 DECLARE_EVENT_TABLE()