1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: TDI-based MDI implementation for wxGTK1
4 // Author: Robert Roebling
5 // Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
6 // Copyright: (c) 1998 Robert Roebling
7 // (c) 2008 Vadim Zeitlin
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GTK1_MDI_H_
12 #define _WX_GTK1_MDI_H_
16 class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame
;
17 class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow
;
19 typedef struct _GtkNotebook GtkNotebook
;
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxMDIParentFrameBase
28 wxMDIParentFrame() { Init(); }
29 wxMDIParentFrame(wxWindow
*parent
,
31 const wxString
& title
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
35 const wxString
& name
= wxFrameNameStr
)
39 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
42 bool Create(wxWindow
*parent
,
44 const wxString
& title
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
48 const wxString
& name
= wxFrameNameStr
);
50 // we don't store the active child in m_currentChild unlike the base class
51 // version so override this method to find it dynamically
52 virtual wxMDIChildFrame
*GetActiveChild() const;
54 // implement base class pure virtuals
55 // ----------------------------------
57 virtual void ActivateNext();
58 virtual void ActivatePrevious();
60 static bool IsTDI() { return true; }
66 virtual void GtkOnSize( int x
, int y
, int width
, int height
);
67 virtual void OnInternalIdle();
72 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
75 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
79 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxTDIChildFrame
82 wxMDIChildFrame() { Init(); }
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
)
93 Create(parent
, id
, title
, pos
, size
, style
, name
);
96 bool Create(wxMDIParentFrame
*parent
,
98 const wxString
& title
,
99 const wxPoint
& pos
= wxDefaultPosition
,
100 const wxSize
& size
= wxDefaultSize
,
101 long style
= wxDEFAULT_FRAME_STYLE
,
102 const wxString
& name
= wxFrameNameStr
);
104 virtual ~wxMDIChildFrame();
106 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
107 virtual wxMenuBar
*GetMenuBar() const;
109 virtual void Activate();
111 virtual void SetTitle(const wxString
& title
);
115 void OnActivate( wxActivateEvent
& event
);
116 void OnMenuHighlight( wxMenuEvent
& event
);
118 wxMenuBar
*m_menuBar
;
119 GtkNotebookPage
*m_page
;
125 GtkNotebook
*GTKGetNotebook() const;
127 DECLARE_EVENT_TABLE()
128 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
131 //-----------------------------------------------------------------------------
133 //-----------------------------------------------------------------------------
135 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxMDIClientWindowBase
138 wxMDIClientWindow() { }
140 virtual bool CreateClient(wxMDIParentFrame
*parent
,
141 long style
= wxVSCROLL
| wxHSCROLL
);
144 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
147 #endif // _WX_GTK1_MDI_H_