]>
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 | |
65571936 | 9 | // Licence: wxWindows licence |
9b6dbb09 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
1c4f8f8d VZ |
12 | #ifndef _WX_MOTIF_FRAME_H_ |
13 | #define _WX_MOTIF_FRAME_H_ | |
9b6dbb09 | 14 | |
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
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(); |
f9dae779 | 32 | |
bfc6fde4 VZ |
33 | Create(parent, id, title, pos, size, style, name); |
34 | } | |
f9dae779 | 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); | |
f9dae779 | 43 | |
1c4f8f8d | 44 | virtual ~wxFrame(); |
798a4529 | 45 | |
a6e2b3a8 | 46 | virtual bool Show(bool show = TRUE); |
798a4529 | 47 | |
bfc6fde4 VZ |
48 | // Set menu bar |
49 | void SetMenuBar(wxMenuBar *menu_bar); | |
f9dae779 | 50 | |
bfc6fde4 VZ |
51 | // Set title |
52 | void SetTitle(const wxString& title); | |
f9dae779 | 53 | |
bfc6fde4 VZ |
54 | // Set icon |
55 | virtual void SetIcon(const wxIcon& icon); | |
f618020a MB |
56 | virtual void SetIcons(const wxIconBundle& icons); |
57 | ||
1c4f8f8d | 58 | #if wxUSE_STATUSBAR |
bfc6fde4 | 59 | virtual void PositionStatusBar(); |
1c4f8f8d | 60 | #endif // wxUSE_STATUSBAR |
f9dae779 | 61 | |
bfc6fde4 | 62 | // Create toolbar |
1ccbb61a | 63 | #if wxUSE_TOOLBAR |
f9dae779 | 64 | virtual wxToolBar* CreateToolBar(long style = -1, |
46675b46 MB |
65 | wxWindowID id = -1, |
66 | const wxString& name = wxToolBarNameStr); | |
67 | virtual void SetToolBar(wxToolBar *toolbar); | |
bfc6fde4 | 68 | virtual void PositionToolBar(); |
1ccbb61a | 69 | #endif // wxUSE_TOOLBAR |
f9dae779 | 70 | |
1c4f8f8d VZ |
71 | // Implementation only from now on |
72 | // ------------------------------- | |
f9dae779 | 73 | |
1c4f8f8d VZ |
74 | void OnSysColourChanged(wxSysColourChangedEvent& event); |
75 | void OnActivate(wxActivateEvent& event); | |
f9dae779 | 76 | |
bfc6fde4 VZ |
77 | virtual void ChangeFont(bool keepOriginalSize = TRUE); |
78 | virtual void ChangeBackgroundColour(); | |
79 | virtual void ChangeForegroundColour(); | |
1c4f8f8d | 80 | WXWidget GetMenuBarWidget() const; |
bfc6fde4 VZ |
81 | WXWidget GetShellWidget() const { return m_frameShell; } |
82 | WXWidget GetWorkAreaWidget() const { return m_workArea; } | |
83 | WXWidget GetClientAreaWidget() const { return m_clientArea; } | |
84 | WXWidget GetTopWidget() const { return m_frameShell; } | |
f9dae779 | 85 | |
798a4529 | 86 | virtual WXWidget GetMainWidget() const { return m_mainWidget; } |
f9dae779 | 87 | |
bfc6fde4 VZ |
88 | // The widget that can have children on it |
89 | WXWidget GetClientWidget() const; | |
90 | bool GetVisibleStatus() const { return m_visibleStatus; } | |
798a4529 MB |
91 | void SetVisibleStatus( bool status ) { m_visibleStatus = status; } |
92 | ||
bfc6fde4 | 93 | bool PreResize(); |
798a4529 | 94 | |
46675b46 MB |
95 | void SendSizeEvent(); |
96 | ||
798a4529 | 97 | // for generic/mdig.h |
f9dae779 | 98 | virtual void DoGetClientSize(int *width, int *height) const; |
798a4529 | 99 | private: |
1c4f8f8d VZ |
100 | // common part of all ctors |
101 | void Init(); | |
f618020a MB |
102 | |
103 | // set a single icon for the frame | |
104 | void DoSetIcon( const wxIcon& icon ); | |
105 | ||
bfc6fde4 | 106 | //// Motif-specific |
bfc6fde4 | 107 | WXWidget m_frameShell; |
bfc6fde4 VZ |
108 | WXWidget m_workArea; |
109 | WXWidget m_clientArea; | |
1c4f8f8d VZ |
110 | bool m_visibleStatus; |
111 | bool m_iconized; | |
f9dae779 | 112 | |
1c4f8f8d | 113 | virtual void DoGetSize(int *width, int *height) const; |
bfc6fde4 | 114 | virtual void DoSetSize(int x, int y, |
83df96d6 JS |
115 | int width, int height, |
116 | int sizeFlags = wxSIZE_AUTO); | |
bfc6fde4 | 117 | virtual void DoSetClientSize(int width, int height); |
f9dae779 | 118 | |
bfc6fde4 | 119 | private: |
798a4529 MB |
120 | virtual bool DoCreate( wxWindow* parent, wxWindowID id, |
121 | const wxString& title, | |
122 | const wxPoint& pos, | |
123 | const wxSize& size, | |
124 | long style, | |
125 | const wxString& name ); | |
126 | virtual void DoDestroy(); | |
127 | ||
bfc6fde4 | 128 | DECLARE_EVENT_TABLE() |
798a4529 | 129 | DECLARE_DYNAMIC_CLASS(wxFrame) |
9b6dbb09 JS |
130 | }; |
131 | ||
132 | #endif | |
83df96d6 | 133 | // _WX_MOTIF_FRAME_H_ |