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