]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/frame.h
c342d83c90c928c5e2db4d30277e5728acb871b7
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();
59 virtual bool IsTopLevel() const { return TRUE
; }
61 void OnSize(wxSizeEvent
& event
);
62 void OnMenuHighlight(wxMenuEvent
& event
);
63 void OnActivate(wxActivateEvent
& event
);
64 void OnIdle(wxIdleEvent
& event
);
65 void OnCloseWindow(wxCloseEvent
& event
);
68 void SetMenuBar(wxMenuBar
*menu_bar
);
69 virtual wxMenuBar
*GetMenuBar() const ;
71 // Call this to simulate a menu command
72 virtual void Command(int id
);
73 virtual void ProcessCommand(int id
);
76 virtual void SetIcon(const wxIcon
& icon
);
79 virtual wxStatusBar
* CreateStatusBar(int number
=1, long style
= wxST_SIZEGRIP
, wxWindowID id
= 0,
80 const wxString
& name
= "statusBar");
81 inline wxStatusBar
*GetStatusBar() const { return m_frameStatusBar
; }
82 virtual void PositionStatusBar();
83 virtual wxStatusBar
*OnCreateStatusBar(int number
, long style
, wxWindowID id
,
84 const wxString
& name
);
89 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
|wxTB_HORIZONTAL
, wxWindowID id
= -1, const wxString
& name
= wxToolBarNameStr
);
90 virtual wxToolBar
*OnCreateToolBar(long style
, wxWindowID id
, const wxString
& name
);
91 // If made known to the frame, the frame will manage it automatically.
92 virtual inline void SetToolBar(wxToolBar
*toolbar
) { m_frameToolBar
= toolbar
; }
93 virtual inline wxToolBar
*GetToolBar() const { return m_frameToolBar
; }
94 virtual void PositionToolBar();
98 // Set status line text
99 virtual void SetStatusText(const wxString
& text
, int number
= 0);
101 // Set status line widths
102 virtual void SetStatusWidths(int n
, const int widths_field
[]);
104 // Hint to tell framework which status bar to use
105 // TODO: should this go into a wxFrameworkSettings class perhaps?
106 static void UseNativeStatusBar(bool useNative
) { m_useNativeStatusBar
= useNative
; };
107 static bool UsesNativeStatusBar() { return m_useNativeStatusBar
; };
109 // Fit frame around subwindows
113 virtual void Iconize(bool iconize
);
115 virtual bool IsIconized() const ;
118 inline bool Iconized() const { return IsIconized(); }
120 // Is the frame maximized?
121 virtual bool IsMaximized(void) const ;
123 virtual void Maximize(bool maximize
);
125 // Responds to colour changes
126 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
128 // Query app for menu item updates (called from OnIdle)
129 // Query app for menu item updates (called from OnIdle)
130 void DoMenuUpdates();
131 void DoMenuUpdates(wxMenu
* menu
, wxWindow
* focusWin
);
133 // Checks if there is a toolbar, and returns the first free client position
134 virtual wxPoint
GetClientAreaOrigin() const;
135 virtual void DoGetClientSize(int *x
, int *y
) const ;
136 virtual void DoSetClientSize(int clientwidth
, int clientheight
) ;
138 // tooltip management
140 wxMacToolTip
* GetToolTipCtrl() const { return m_hwndToolTip
; }
141 void SetToolTipCtrl(wxMacToolTip
*tt
) { m_hwndToolTip
= tt
; }
142 wxMacToolTip
* m_hwndToolTip
;
146 wxMenuBar
* m_frameMenuBar
;
147 wxStatusBar
* m_frameStatusBar
;
150 static bool m_useNativeStatusBar
;
152 wxToolBar
* m_frameToolBar
;
155 DECLARE_EVENT_TABLE()