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
8 // Copyright: (c) 1998 Julian Smart
9 // (c) 2008 Vadim Zeitlin
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_MOTIF_MDI_H_
14 #define _WX_MOTIF_MDI_H_
16 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxMDIParentFrameBase
19 wxMDIParentFrame() { Init(); }
20 wxMDIParentFrame(wxWindow
*parent
,
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
)
30 Create(parent
, id
, title
, pos
, size
, style
, name
);
33 bool Create(wxWindow
*parent
,
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
);
41 virtual ~wxMDIParentFrame();
43 // implement base class pure virtuals
44 // ----------------------------------
46 static bool IsTDI() { return true; }
48 virtual void ActivateNext() { /* TODO */ }
49 virtual void ActivatePrevious() { /* TODO */ }
54 // Set the child's menubar into the parent frame
55 void SetChildMenuBar(wxMDIChildFrame
* frame
);
57 wxMenuBar
* GetActiveMenuBar() const { return m_activeMenuBar
; }
59 // Redirect events to active child first
60 virtual bool ProcessEvent(wxEvent
& event
);
62 void OnSize(wxSizeEvent
& event
);
63 void OnActivate(wxActivateEvent
& event
);
64 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
65 void OnMenuHighlight(wxMenuEvent
& event
);
67 void SetMenuBar(wxMenuBar
*menu_bar
);
70 wxMenuBar
*m_activeMenuBar
;
76 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
79 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxTDIChildFrame
83 wxMDIChildFrame(wxMDIParentFrame
*parent
,
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
)
91 Create(parent
, id
, title
, pos
, size
, style
, name
);
94 bool Create(wxMDIParentFrame
*parent
,
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
);
102 virtual ~wxMDIChildFrame();
106 void SetMenuBar(wxMenuBar
*menu_bar
);
107 void SetTitle(const wxString
& title
);
110 virtual void SetIcon(const wxIcon
& icon
);
111 virtual void SetIcons(const wxIconBundle
& icons
);
113 // Override wxFrame 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 ;
128 virtual bool IsTopLevel() const { return false; }
130 // Is the frame maximized? Returns true for
131 // wxMDIChildFrame due to the tabbed implementation.
132 virtual bool IsMaximized(void) const ;
134 bool Show(bool show
);
136 WXWidget
GetMainWidget() const { return m_mainWidget
; };
137 WXWidget
GetTopWidget() const { return m_mainWidget
; };
138 WXWidget
GetClientWidget() const { return m_mainWidget
; };
141 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
144 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxMDIClientWindowBase
147 wxMDIClientWindow() { }
148 virtual ~wxMDIClientWindow();
150 virtual bool CreateClient(wxMDIParentFrame
*parent
,
151 long style
= wxVSCROLL
| wxHSCROLL
);
154 void OnPageChanged(wxBookCtrlEvent
& event
);
156 int FindPage(const wxNotebookPage
* page
);
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
);
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 ;
168 wxNotebook
*m_notebook
;
171 DECLARE_EVENT_TABLE()
172 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
175 #endif // _WX_MOTIF_MDI_H_