]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/frame.h
Add XRC handler for wxBannerWindow and a test for it to the xrc sample.
[wxWidgets.git] / include / wx / motif / frame.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/frame.h
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
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MOTIF_FRAME_H_
13 #define _WX_MOTIF_FRAME_H_
14
15 class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
16 {
17 public:
18 wxFrame() { Init(); }
19 wxFrame(wxWindow *parent,
20 wxWindowID id,
21 const wxString& title,
22 const wxPoint& pos = wxDefaultPosition,
23 const wxSize& size = wxDefaultSize,
24 long style = wxDEFAULT_FRAME_STYLE,
25 const wxString& name = wxFrameNameStr)
26 {
27 Init();
28
29 Create(parent, id, title, pos, size, style, name);
30 }
31
32 bool Create(wxWindow *parent,
33 wxWindowID id,
34 const wxString& title,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
37 long style = wxDEFAULT_FRAME_STYLE,
38 const wxString& name = wxFrameNameStr);
39
40 virtual ~wxFrame();
41
42 virtual bool Show(bool show = true);
43
44 // Set menu bar
45 void SetMenuBar(wxMenuBar *menu_bar);
46
47 // Set title
48 void SetTitle(const wxString& title);
49
50 // Set icon
51 virtual void SetIcons(const wxIconBundle& icons);
52
53 #if wxUSE_STATUSBAR
54 virtual void PositionStatusBar();
55 #endif // wxUSE_STATUSBAR
56
57 // Create toolbar
58 #if wxUSE_TOOLBAR
59 virtual wxToolBar* CreateToolBar(long style = -1,
60 wxWindowID id = wxID_ANY,
61 const wxString& name = wxToolBarNameStr);
62 virtual void SetToolBar(wxToolBar *toolbar);
63 virtual void PositionToolBar();
64 #endif // wxUSE_TOOLBAR
65
66 // Implementation only from now on
67 // -------------------------------
68
69 void OnSysColourChanged(wxSysColourChangedEvent& event);
70 void OnActivate(wxActivateEvent& event);
71
72 virtual void ChangeFont(bool keepOriginalSize = true);
73 virtual void ChangeBackgroundColour();
74 virtual void ChangeForegroundColour();
75 WXWidget GetMenuBarWidget() const;
76 WXWidget GetShellWidget() const { return m_frameShell; }
77 WXWidget GetWorkAreaWidget() const { return m_workArea; }
78 WXWidget GetClientAreaWidget() const { return m_clientArea; }
79 WXWidget GetTopWidget() const { return m_frameShell; }
80
81 virtual WXWidget GetMainWidget() const { return m_mainWidget; }
82
83 // The widget that can have children on it
84 WXWidget GetClientWidget() const;
85 bool GetVisibleStatus() const { return m_visibleStatus; }
86 void SetVisibleStatus( bool status ) { m_visibleStatus = status; }
87
88 bool PreResize();
89
90 // for generic/mdig.h
91 virtual void DoGetClientSize(int *width, int *height) const;
92
93 private:
94 // common part of all ctors
95 void Init();
96
97 // set a single icon for the frame
98 void DoSetIcon( const wxIcon& icon );
99
100 //// Motif-specific
101 WXWidget m_frameShell;
102 WXWidget m_workArea;
103 WXWidget m_clientArea;
104 bool m_visibleStatus;
105 bool m_iconized;
106
107 virtual void DoGetSize(int *width, int *height) const;
108 virtual void DoSetSize(int x, int y,
109 int width, int height,
110 int sizeFlags = wxSIZE_AUTO);
111 virtual void DoSetClientSize(int width, int height);
112
113 private:
114 virtual bool XmDoCreateTLW(wxWindow* parent,
115 wxWindowID id,
116 const wxString& title,
117 const wxPoint& pos,
118 const wxSize& size,
119 long style,
120 const wxString& name);
121
122
123
124 DECLARE_EVENT_TABLE()
125 DECLARE_DYNAMIC_CLASS(wxFrame)
126 };
127
128 #endif // _WX_MOTIF_FRAME_H_
129