]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/frame.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFrame class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "frame.h"
19 #include "wx/window.h"
20 #include "wx/toolbar.h"
23 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr
;
24 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
26 class WXDLLEXPORT wxMenuBar
;
27 class WXDLLEXPORT wxStatusBar
;
29 class WXDLLEXPORT wxFrame
: public wxWindow
{
31 DECLARE_DYNAMIC_CLASS(wxFrame
)
35 inline wxFrame(wxWindow
*parent
,
37 const wxString
& title
,
38 const wxPoint
& pos
= wxDefaultPosition
,
39 const wxSize
& size
= wxDefaultSize
,
40 long style
= wxDEFAULT_FRAME_STYLE
,
41 const wxString
& name
= wxFrameNameStr
)
43 Create(parent
, id
, title
, pos
, size
, style
, name
);
48 bool Create(wxWindow
*parent
,
50 const wxString
& title
,
51 const wxPoint
& pos
= wxDefaultPosition
,
52 const wxSize
& size
= wxDefaultSize
,
53 long style
= wxDEFAULT_FRAME_STYLE
,
54 const wxString
& name
= wxFrameNameStr
);
56 virtual bool Destroy();
57 void SetClientSize(int width
, int height
);
58 void GetClientSize(int *width
, int *height
) const;
60 void GetSize(int *width
, int *height
) const ;
61 void GetPosition(int *x
, int *y
) const ;
62 void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
64 virtual bool OnClose();
66 void OnSize(wxSizeEvent
& event
);
67 void OnMenuHighlight(wxMenuEvent
& event
);
68 void OnActivate(wxActivateEvent
& event
);
69 void OnIdle(wxIdleEvent
& event
);
70 void OnCloseWindow(wxCloseEvent
& event
);
75 void SetMenuBar(wxMenuBar
*menu_bar
);
76 virtual wxMenuBar
*GetMenuBar() const ;
79 void SetTitle(const wxString
& title
);
80 inline wxString
GetTitle() const { return m_title
; }
82 void Centre(int direction
= wxBOTH
);
84 // Call this to simulate a menu command
85 virtual void Command(int id
);
86 virtual void ProcessCommand(int id
);
89 virtual void SetIcon(const wxIcon
& icon
);
92 virtual wxStatusBar
* CreateStatusBar(int number
=1, long style
= wxST_SIZEGRIP
, wxWindowID id
= 0,
93 const wxString
& name
= "statusBar");
94 inline wxStatusBar
*GetStatusBar() const { return m_frameStatusBar
; }
95 virtual void PositionStatusBar();
96 virtual wxStatusBar
*OnCreateStatusBar(int number
, long style
, wxWindowID id
,
97 const wxString
& name
);
100 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
|wxTB_HORIZONTAL
, wxWindowID id
= -1, const wxString
& name
= wxToolBarNameStr
);
101 virtual wxToolBar
*OnCreateToolBar(long style
, wxWindowID id
, const wxString
& name
);
102 // If made known to the frame, the frame will manage it automatically.
103 virtual void SetToolBar(wxToolBar
*toolbar
) ;
104 virtual wxToolBar
*GetToolBar() const ;
105 virtual void PositionToolBar();
107 // Set status line text
108 virtual void SetStatusText(const wxString
& text
, int number
= 0);
110 // Set status line widths
111 virtual void SetStatusWidths(int n
, const int widths_field
[]);
113 // Hint to tell framework which status bar to use
114 // TODO: should this go into a wxFrameworkSettings class perhaps?
115 static void UseNativeStatusBar(bool useNative
) { m_useNativeStatusBar
= useNative
; };
116 static bool UsesNativeStatusBar() { return m_useNativeStatusBar
; };
118 // Fit frame around subwindows
122 virtual void Iconize(bool iconize
);
124 virtual bool IsIconized() const ;
127 inline bool Iconized() const { return IsIconized(); }
129 virtual void Maximize(bool maximize
);
131 // Responds to colour changes
132 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
134 // Query app for menu item updates (called from OnIdle)
135 void DoMenuUpdates();
136 void DoMenuUpdates(wxMenu
* menu
);
138 // Checks if there is a toolbar, and returns the first free client position
139 virtual wxPoint
GetClientAreaOrigin() const;
141 virtual void Raise();
142 virtual void Lower();
144 virtual void CaptureMouse();
145 virtual void ReleaseMouse();
149 WXWidget
GetMenuBarWidget() const ;
150 inline WXWidget
GetShellWidget() const { return m_frameShell
; }
151 inline WXWidget
GetWorkAreaWidget() const { return m_workArea
; }
152 inline WXWidget
GetClientAreaWidget() const { return m_clientArea
; }
154 // The widget that can have children on it
155 WXWidget
GetClientWidget() const;
156 bool GetVisibleStatus() const { return m_visibleStatus
; }
161 wxMenuBar
* m_frameMenuBar
;
162 wxStatusBar
* m_frameStatusBar
;
165 static bool m_useNativeStatusBar
;
166 wxToolBar
* m_frameToolBar
;
170 WXWidget m_frameShell
;
171 WXWidget m_frameWidget
;
173 WXWidget m_clientArea
;
174 // WXWidget m_menuBarWidget;
175 bool m_visibleStatus
;
178 DECLARE_EVENT_TABLE()