]>
Commit | Line | Data |
---|---|---|
9b6dbb09 | 1 | ///////////////////////////////////////////////////////////////////////////// |
1c4f8f8d | 2 | // Name: wx/motif/frame.h |
9b6dbb09 JS |
3 | // Purpose: wxFrame class |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
af0bb3b1 | 9 | // Licence: wxWindows licence |
9b6dbb09 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
1c4f8f8d VZ |
12 | #ifndef _WX_MOTIF_FRAME_H_ |
13 | #define _WX_MOTIF_FRAME_H_ | |
9b6dbb09 JS |
14 | |
15 | #ifdef __GNUG__ | |
83df96d6 | 16 | #pragma interface "frame.h" |
9b6dbb09 JS |
17 | #endif |
18 | ||
1c4f8f8d | 19 | class WXDLLEXPORT wxFrame : public wxFrameBase |
bfc6fde4 | 20 | { |
9b6dbb09 | 21 | public: |
1c4f8f8d | 22 | wxFrame() { Init(); } |
bfc6fde4 | 23 | wxFrame(wxWindow *parent, |
83df96d6 JS |
24 | wxWindowID id, |
25 | const wxString& title, | |
26 | const wxPoint& pos = wxDefaultPosition, | |
27 | const wxSize& size = wxDefaultSize, | |
28 | long style = wxDEFAULT_FRAME_STYLE, | |
29 | const wxString& name = wxFrameNameStr) | |
bfc6fde4 | 30 | { |
1c4f8f8d | 31 | Init(); |
83df96d6 | 32 | |
bfc6fde4 VZ |
33 | Create(parent, id, title, pos, size, style, name); |
34 | } | |
83df96d6 | 35 | |
bfc6fde4 | 36 | bool Create(wxWindow *parent, |
83df96d6 JS |
37 | wxWindowID id, |
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); | |
43 | ||
1c4f8f8d | 44 | virtual ~wxFrame(); |
83df96d6 | 45 | |
a6e2b3a8 | 46 | virtual bool Show(bool show = TRUE); |
83df96d6 | 47 | |
bfc6fde4 VZ |
48 | // Set menu bar |
49 | void SetMenuBar(wxMenuBar *menu_bar); | |
83df96d6 | 50 | |
bfc6fde4 VZ |
51 | // Set title |
52 | void SetTitle(const wxString& title); | |
53 | wxString GetTitle() const { return m_title; } | |
83df96d6 | 54 | |
bfc6fde4 VZ |
55 | // Set icon |
56 | virtual void SetIcon(const wxIcon& icon); | |
f618020a MB |
57 | virtual void SetIcons(const wxIconBundle& icons); |
58 | ||
1c4f8f8d | 59 | #if wxUSE_STATUSBAR |
bfc6fde4 | 60 | virtual void PositionStatusBar(); |
1c4f8f8d | 61 | #endif // wxUSE_STATUSBAR |
83df96d6 | 62 | |
bfc6fde4 | 63 | // Create toolbar |
1ccbb61a | 64 | #if wxUSE_TOOLBAR |
bfc6fde4 | 65 | virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr); |
bfc6fde4 | 66 | virtual void PositionToolBar(); |
1ccbb61a | 67 | #endif // wxUSE_TOOLBAR |
83df96d6 | 68 | |
bfc6fde4 VZ |
69 | // Iconize |
70 | virtual void Iconize(bool iconize); | |
83df96d6 | 71 | |
1c4f8f8d | 72 | virtual bool IsIconized() const; |
83df96d6 | 73 | |
bfc6fde4 VZ |
74 | // Is the frame maximized? Returns FALSE under Motif (but TRUE for |
75 | // wxMDIChildFrame due to the tabbed implementation). | |
1c4f8f8d | 76 | virtual bool IsMaximized() const; |
83df96d6 | 77 | |
bfc6fde4 | 78 | virtual void Maximize(bool maximize); |
83df96d6 | 79 | |
bfc6fde4 VZ |
80 | virtual void Raise(); |
81 | virtual void Lower(); | |
83df96d6 | 82 | |
1c4f8f8d | 83 | virtual void Restore(); |
83df96d6 | 84 | |
1c4f8f8d VZ |
85 | // Implementation only from now on |
86 | // ------------------------------- | |
83df96d6 | 87 | |
1c4f8f8d VZ |
88 | void OnSysColourChanged(wxSysColourChangedEvent& event); |
89 | void OnActivate(wxActivateEvent& event); | |
83df96d6 | 90 | |
bfc6fde4 VZ |
91 | virtual void ChangeFont(bool keepOriginalSize = TRUE); |
92 | virtual void ChangeBackgroundColour(); | |
93 | virtual void ChangeForegroundColour(); | |
1c4f8f8d | 94 | WXWidget GetMenuBarWidget() const; |
bfc6fde4 VZ |
95 | WXWidget GetShellWidget() const { return m_frameShell; } |
96 | WXWidget GetWorkAreaWidget() const { return m_workArea; } | |
97 | WXWidget GetClientAreaWidget() const { return m_clientArea; } | |
98 | WXWidget GetTopWidget() const { return m_frameShell; } | |
83df96d6 | 99 | |
1c4f8f8d | 100 | virtual WXWidget GetMainWidget() const { return m_frameWidget; } |
83df96d6 | 101 | |
bfc6fde4 VZ |
102 | // The widget that can have children on it |
103 | WXWidget GetClientWidget() const; | |
104 | bool GetVisibleStatus() const { return m_visibleStatus; } | |
83df96d6 | 105 | |
bfc6fde4 | 106 | bool PreResize(); |
83df96d6 | 107 | |
449f38b5 | 108 | protected: |
1c4f8f8d VZ |
109 | // common part of all ctors |
110 | void Init(); | |
f618020a MB |
111 | |
112 | // set a single icon for the frame | |
113 | void DoSetIcon( const wxIcon& icon ); | |
114 | ||
bfc6fde4 | 115 | //// Motif-specific |
bfc6fde4 VZ |
116 | WXWidget m_frameShell; |
117 | WXWidget m_frameWidget; | |
118 | WXWidget m_workArea; | |
119 | WXWidget m_clientArea; | |
bfc6fde4 | 120 | wxString m_title; |
1c4f8f8d VZ |
121 | bool m_visibleStatus; |
122 | bool m_iconized; | |
83df96d6 | 123 | |
1c4f8f8d VZ |
124 | virtual void DoGetClientSize(int *width, int *height) const; |
125 | virtual void DoGetSize(int *width, int *height) const; | |
126 | virtual void DoGetPosition(int *x, int *y) const; | |
bfc6fde4 | 127 | virtual void DoSetSize(int x, int y, |
83df96d6 JS |
128 | int width, int height, |
129 | int sizeFlags = wxSIZE_AUTO); | |
bfc6fde4 | 130 | virtual void DoSetClientSize(int width, int height); |
83df96d6 | 131 | |
bfc6fde4 VZ |
132 | private: |
133 | DECLARE_EVENT_TABLE() | |
83df96d6 | 134 | DECLARE_DYNAMIC_CLASS(wxFrame) |
9b6dbb09 JS |
135 | }; |
136 | ||
137 | #endif | |
83df96d6 | 138 | // _WX_MOTIF_FRAME_H_ |