]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/stubs/frame.h
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"
26 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr
;
27 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
29 class WXDLLEXPORT wxMenuBar
;
30 class WXDLLEXPORT wxStatusBar
;
32 class WXDLLEXPORT wxFrame
: public wxWindow
{
34 DECLARE_DYNAMIC_CLASS(wxFrame
)
38 inline wxFrame(wxWindow
*parent
,
40 const wxString
& title
,
41 const wxPoint
& pos
= wxDefaultPosition
,
42 const wxSize
& size
= wxDefaultSize
,
43 long style
= wxDEFAULT_FRAME_STYLE
,
44 const wxString
& name
= wxFrameNameStr
)
46 Create(parent
, id
, title
, pos
, size
, style
, name
);
51 bool Create(wxWindow
*parent
,
53 const wxString
& title
,
54 const wxPoint
& pos
= wxDefaultPosition
,
55 const wxSize
& size
= wxDefaultSize
,
56 long style
= wxDEFAULT_FRAME_STYLE
,
57 const wxString
& name
= wxFrameNameStr
);
59 virtual bool Destroy();
60 void SetClientSize(int width
, int height
);
61 void GetClientSize(int *width
, int *height
) const;
63 void GetSize(int *width
, int *height
) const ;
64 void GetPosition(int *x
, int *y
) const ;
65 void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
66 void ClientToScreen(int *x
, int *y
) const;
67 void ScreenToClient(int *x
, int *y
) const;
69 void OnSize(wxSizeEvent
& event
);
70 void OnMenuHighlight(wxMenuEvent
& event
);
71 void OnActivate(wxActivateEvent
& event
);
72 void OnIdle(wxIdleEvent
& event
);
73 void OnCloseWindow(wxCloseEvent
& event
);
78 void SetMenuBar(wxMenuBar
*menu_bar
);
79 virtual wxMenuBar
*GetMenuBar() const ;
82 void SetTitle(const wxString
& title
);
83 wxString
GetTitle() const ;
85 void Centre(int direction
= wxBOTH
);
87 // Call this to simulate a menu command
88 virtual void Command(int id
);
89 virtual void ProcessCommand(int id
);
92 virtual void SetIcon(const wxIcon
& icon
);
95 virtual wxStatusBar
* CreateStatusBar(int number
=1, long style
= wxST_SIZEGRIP
, wxWindowID id
= 0,
96 const wxString
& name
= "statusBar");
97 inline wxStatusBar
*GetStatusBar() const { return m_frameStatusBar
; }
98 virtual void PositionStatusBar();
99 virtual wxStatusBar
*OnCreateStatusBar(int number
, long style
, wxWindowID id
,
100 const wxString
& name
);
103 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
|wxTB_HORIZONTAL
, wxWindowID id
= -1, const wxString
& name
= wxToolBarNameStr
);
104 virtual wxToolBar
*OnCreateToolBar(long style
, wxWindowID id
, const wxString
& name
);
105 // If made known to the frame, the frame will manage it automatically.
106 virtual inline void SetToolBar(wxToolBar
*toolbar
) { m_frameToolBar
= toolbar
; }
107 virtual inline wxToolBar
*GetToolBar() const { return m_frameToolBar
; }
108 virtual void PositionToolBar();
110 // Set status line text
111 virtual void SetStatusText(const wxString
& text
, int number
= 0);
113 // Set status line widths
114 virtual void SetStatusWidths(int n
, const int widths_field
[]);
116 // Hint to tell framework which status bar to use
117 // TODO: should this go into a wxFrameworkSettings class perhaps?
118 static void UseNativeStatusBar(bool useNative
) { m_useNativeStatusBar
= useNative
; };
119 static bool UsesNativeStatusBar() { return m_useNativeStatusBar
; };
121 // Fit frame around subwindows
125 virtual void Iconize(bool iconize
);
127 virtual bool IsIconized() const ;
130 inline bool Iconized() const { return IsIconized(); }
132 // Is the frame maximized?
133 virtual bool IsMaximized(void) const ;
135 virtual void Maximize(bool maximize
);
137 // Responds to colour changes
138 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
140 // Query app for menu item updates (called from OnIdle)
141 void DoMenuUpdates();
142 void DoMenuUpdates(wxMenu
* menu
, wxWindow
* focusWin
);
144 // Checks if there is a toolbar, and returns the first free client position
145 virtual wxPoint
GetClientAreaOrigin() const;
148 wxMenuBar
* m_frameMenuBar
;
149 wxStatusBar
* m_frameStatusBar
;
152 static bool m_useNativeStatusBar
;
153 wxToolBar
* m_frameToolBar
;
155 DECLARE_EVENT_TABLE()