]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/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"
24 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr
;
25 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
27 class WXDLLEXPORT wxMenuBar
;
28 class WXDLLEXPORT wxStatusBar
;
30 class WXDLLEXPORT wxFrame
: public wxWindow
{
32 DECLARE_DYNAMIC_CLASS(wxFrame
)
36 inline wxFrame(wxWindow
*parent
,
38 const wxString
& title
,
39 const wxPoint
& pos
= wxDefaultPosition
,
40 const wxSize
& size
= wxDefaultSize
,
41 long style
= wxDEFAULT_FRAME_STYLE
,
42 const wxString
& name
= wxFrameNameStr
)
44 Create(parent
, id
, title
, pos
, size
, style
, name
);
49 bool Create(wxWindow
*parent
,
51 const wxString
& title
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
54 long style
= wxDEFAULT_FRAME_STYLE
,
55 const wxString
& name
= wxFrameNameStr
);
57 virtual bool Destroy();
58 void SetClientSize(int width
, int height
);
59 void GetClientSize(int *width
, int *height
) const;
61 void GetSize(int *width
, int *height
) const ;
62 void GetPosition(int *x
, int *y
) const ;
63 void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
64 void ClientToScreen(int *x
, int *y
) const;
65 void ScreenToClient(int *x
, int *y
) const;
67 void OnSize(wxSizeEvent
& event
);
68 void OnMenuHighlight(wxMenuEvent
& event
);
69 void OnActivate(wxActivateEvent
& event
);
70 void OnIdle(wxIdleEvent
& event
);
71 void OnCloseWindow(wxCloseEvent
& event
);
76 void SetMenuBar(wxMenuBar
*menu_bar
);
77 virtual wxMenuBar
*GetMenuBar() const ;
80 void SetTitle(const wxString
& title
);
81 wxString
GetTitle() const ;
83 void Centre(int direction
= wxBOTH
);
85 // Call this to simulate a menu command
86 virtual void Command(int id
);
87 virtual void ProcessCommand(int id
);
90 virtual void SetIcon(const wxIcon
& icon
);
93 virtual wxStatusBar
* CreateStatusBar(int number
=1, long style
= wxST_SIZEGRIP
, wxWindowID id
= 0,
94 const wxString
& name
= "statusBar");
95 inline wxStatusBar
*GetStatusBar() const { return m_frameStatusBar
; }
96 virtual void PositionStatusBar();
97 virtual wxStatusBar
*OnCreateStatusBar(int number
, long style
, wxWindowID id
,
98 const wxString
& name
);
101 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
|wxTB_HORIZONTAL
, wxWindowID id
= -1, const wxString
& name
= wxToolBarNameStr
);
102 virtual wxToolBar
*OnCreateToolBar(long style
, wxWindowID id
, const wxString
& name
);
103 // If made known to the frame, the frame will manage it automatically.
104 virtual inline void SetToolBar(wxToolBar
*toolbar
) { m_frameToolBar
= toolbar
; }
105 virtual inline wxToolBar
*GetToolBar() const { return m_frameToolBar
; }
106 virtual void PositionToolBar();
108 // Set status line text
109 virtual void SetStatusText(const wxString
& text
, int number
= 0);
111 // Set status line widths
112 virtual void SetStatusWidths(int n
, const int widths_field
[]);
114 // Hint to tell framework which status bar to use
115 // TODO: should this go into a wxFrameworkSettings class perhaps?
116 static void UseNativeStatusBar(bool useNative
) { m_useNativeStatusBar
= useNative
; };
117 static bool UsesNativeStatusBar() { return m_useNativeStatusBar
; };
119 // Fit frame around subwindows
123 virtual void Iconize(bool iconize
);
125 virtual bool IsIconized() const ;
128 inline bool Iconized() const { return IsIconized(); }
130 // Is the frame maximized?
131 virtual bool IsMaximized(void) const ;
133 virtual void Maximize(bool maximize
);
135 // Responds to colour changes
136 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
138 // Query app for menu item updates (called from OnIdle)
139 void DoMenuUpdates();
140 void DoMenuUpdates(wxMenu
* menu
, wxWindow
* focusWin
);
142 // Checks if there is a toolbar, and returns the first free client position
143 virtual wxPoint
GetClientAreaOrigin() const;
146 wxMenuBar
* m_frameMenuBar
;
147 wxStatusBar
* m_frameStatusBar
;
150 static bool m_useNativeStatusBar
;
151 wxToolBar
* m_frameToolBar
;
153 DECLARE_EVENT_TABLE()