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