]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/mdi.h
disable the test under Windows as it hangs and prevents buildbot from working
[wxWidgets.git] / include / wx / motif / mdi.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/mdi.h
3 // Purpose: MDI (Multiple Document Interface) classes.
4 // Author: Julian Smart
5 // Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) 1998 Julian Smart
9 // (c) 2008 Vadim Zeitlin
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_MOTIF_MDI_H_
14 #define _WX_MOTIF_MDI_H_
15
16 class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
17 {
18 public:
19 wxMDIParentFrame() { Init(); }
20 wxMDIParentFrame(wxWindow *parent,
21 wxWindowID id,
22 const wxString& title,
23 const wxPoint& pos = wxDefaultPosition,
24 const wxSize& size = wxDefaultSize,
25 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
26 const wxString& name = wxFrameNameStr)
27 {
28 Init();
29
30 Create(parent, id, title, pos, size, style, name);
31 }
32
33 bool Create(wxWindow *parent,
34 wxWindowID id,
35 const wxString& title,
36 const wxPoint& pos = wxDefaultPosition,
37 const wxSize& size = wxDefaultSize,
38 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
39 const wxString& name = wxFrameNameStr);
40
41 virtual ~wxMDIParentFrame();
42
43 // implement base class pure virtuals
44 // ----------------------------------
45
46 static bool IsTDI() { return true; }
47
48 virtual void ActivateNext() { /* TODO */ }
49 virtual void ActivatePrevious() { /* TODO */ }
50
51
52 // Implementation
53
54 // Set the child's menubar into the parent frame
55 void SetChildMenuBar(wxMDIChildFrame* frame);
56
57 wxMenuBar* GetActiveMenuBar() const { return m_activeMenuBar; }
58
59 // Redirect events to active child first
60 virtual bool ProcessEvent(wxEvent& event);
61
62 void OnSize(wxSizeEvent& event);
63 void OnActivate(wxActivateEvent& event);
64 void OnSysColourChanged(wxSysColourChangedEvent& event);
65 void OnMenuHighlight(wxMenuEvent& event);
66
67 void SetMenuBar(wxMenuBar *menu_bar);
68
69 protected:
70 wxMenuBar *m_activeMenuBar;
71
72 private:
73 void Init();
74
75 DECLARE_EVENT_TABLE()
76 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
77 };
78
79 class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame
80 {
81 public:
82 wxMDIChildFrame() { }
83 wxMDIChildFrame(wxMDIParentFrame *parent,
84 wxWindowID id,
85 const wxString& title,
86 const wxPoint& pos = wxDefaultPosition,
87 const wxSize& size = wxDefaultSize,
88 long style = wxDEFAULT_FRAME_STYLE,
89 const wxString& name = wxFrameNameStr)
90 {
91 Create(parent, id, title, pos, size, style, name);
92 }
93
94 bool Create(wxMDIParentFrame *parent,
95 wxWindowID id,
96 const wxString& title,
97 const wxPoint& pos = wxDefaultPosition,
98 const wxSize& size = wxDefaultSize,
99 long style = wxDEFAULT_FRAME_STYLE,
100 const wxString& name = wxFrameNameStr);
101
102 virtual ~wxMDIChildFrame();
103
104
105 // Set menu bar
106 void SetMenuBar(wxMenuBar *menu_bar);
107 void SetTitle(const wxString& title);
108
109 // Set icon
110 virtual void SetIcon(const wxIcon& icon);
111 virtual void SetIcons(const wxIconBundle& icons );
112
113 // Override wxFrame operations
114 void CaptureMouse();
115 void ReleaseMouse();
116 void Raise();
117 void Lower(void);
118
119 // MDI operations
120 virtual void Maximize();
121 virtual void Maximize(bool WXUNUSED(maximize)) { };
122 inline void Minimize() { Iconize(true); };
123 virtual void Iconize(bool iconize);
124 virtual void Restore();
125 virtual void Activate();
126 virtual bool IsIconized() const ;
127
128 virtual bool IsTopLevel() const { return false; }
129
130 // Is the frame maximized? Returns true for
131 // wxMDIChildFrame due to the tabbed implementation.
132 virtual bool IsMaximized(void) const ;
133
134 bool Show(bool show);
135
136 WXWidget GetMainWidget() const { return m_mainWidget; };
137 WXWidget GetTopWidget() const { return m_mainWidget; };
138 WXWidget GetClientWidget() const { return m_mainWidget; };
139
140 protected:
141 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
142 };
143
144 class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
145 {
146 public:
147 wxMDIClientWindow() { }
148 virtual ~wxMDIClientWindow();
149
150 virtual bool CreateClient(wxMDIParentFrame *parent,
151 long style = wxVSCROLL | wxHSCROLL);
152
153 // Implementation
154 void OnPageChanged(wxBookCtrlEvent& event);
155
156 int FindPage(const wxNotebookPage* page);
157
158 protected:
159 virtual void DoSetSize(int x, int y,
160 int width, int height,
161 int sizeFlags = wxSIZE_AUTO);
162 virtual void DoSetClientSize(int width, int height);
163
164 virtual void DoGetClientSize(int *width, int *height) const;
165 virtual void DoGetSize(int *width, int *height) const ;
166 virtual void DoGetPosition(int *x, int *y) const ;
167
168 wxNotebook *m_notebook;
169
170 private:
171 DECLARE_EVENT_TABLE()
172 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
173 };
174
175 #endif // _WX_MOTIF_MDI_H_