]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
cb8cc250 | 2 | // Name: wx/gtk/mdi.h |
d2824cdb | 3 | // Purpose: TDI-based MDI implementation for wxGTK |
c801d85f | 4 | // Author: Robert Roebling |
d2824cdb | 5 | // Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes |
58614078 RR |
6 | // Id: $Id$ |
7 | // Copyright: (c) 1998 Robert Roebling | |
d2824cdb | 8 | // (c) 2008 Vadim Zeitlin |
65571936 | 9 | // Licence: wxWindows licence |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
0416c418 PC |
12 | #ifndef _WX_GTK_MDI_H_ |
13 | #define _WX_GTK_MDI_H_ | |
c801d85f | 14 | |
0416c418 | 15 | #include "wx/frame.h" |
c801d85f | 16 | |
cca410b3 PC |
17 | class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame; |
18 | class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow; | |
19 | ||
d2824cdb VZ |
20 | typedef struct _GtkNotebook GtkNotebook; |
21 | ||
c801d85f KB |
22 | //----------------------------------------------------------------------------- |
23 | // wxMDIParentFrame | |
24 | //----------------------------------------------------------------------------- | |
25 | ||
d2824cdb | 26 | class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase |
c801d85f | 27 | { |
ab2b3dd4 | 28 | public: |
f6bcfd97 BP |
29 | wxMDIParentFrame() { Init(); } |
30 | wxMDIParentFrame(wxWindow *parent, | |
31 | wxWindowID id, | |
32 | const wxString& title, | |
33 | const wxPoint& pos = wxDefaultPosition, | |
34 | const wxSize& size = wxDefaultSize, | |
35 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, | |
36 | const wxString& name = wxFrameNameStr) | |
37 | { | |
38 | Init(); | |
39 | ||
40 | (void)Create(parent, id, title, pos, size, style, name); | |
41 | } | |
42 | ||
d2824cdb VZ |
43 | bool Create(wxWindow *parent, |
44 | wxWindowID id, | |
45 | const wxString& title, | |
46 | const wxPoint& pos = wxDefaultPosition, | |
47 | const wxSize& size = wxDefaultSize, | |
48 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, | |
49 | const wxString& name = wxFrameNameStr); | |
c801d85f | 50 | |
d2824cdb VZ |
51 | // we don't store the active child in m_currentChild unlike the base class |
52 | // version so override this method to find it dynamically | |
53 | virtual wxMDIChildFrame *GetActiveChild() const; | |
f6bcfd97 | 54 | |
d2824cdb VZ |
55 | // implement base class pure virtuals |
56 | // ---------------------------------- | |
f6bcfd97 | 57 | |
ab2b3dd4 RR |
58 | virtual void ActivateNext(); |
59 | virtual void ActivatePrevious(); | |
716b7364 | 60 | |
d2824cdb VZ |
61 | static bool IsTDI() { return true; } |
62 | ||
f6bcfd97 | 63 | // implementation |
ab2b3dd4 | 64 | |
ab2b3dd4 RR |
65 | bool m_justInserted; |
66 | ||
ab2b3dd4 | 67 | virtual void OnInternalIdle(); |
f6bcfd97 BP |
68 | |
69 | protected: | |
70 | void Init(); | |
cca410b3 | 71 | virtual void DoGetClientSize(int* width, int* height) const; |
f6bcfd97 | 72 | |
8487f887 RR |
73 | private: |
74 | friend class wxMDIChildFrame; | |
f6bcfd97 | 75 | |
8487f887 | 76 | DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) |
c801d85f KB |
77 | }; |
78 | ||
79 | //----------------------------------------------------------------------------- | |
80 | // wxMDIChildFrame | |
81 | //----------------------------------------------------------------------------- | |
82 | ||
d2824cdb | 83 | class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame |
c801d85f | 84 | { |
8487f887 | 85 | public: |
d2824cdb VZ |
86 | wxMDIChildFrame() { Init(); } |
87 | wxMDIChildFrame(wxMDIParentFrame *parent, | |
88 | wxWindowID id, | |
89 | const wxString& title, | |
90 | const wxPoint& pos = wxDefaultPosition, | |
91 | const wxSize& size = wxDefaultSize, | |
92 | long style = wxDEFAULT_FRAME_STYLE, | |
93 | const wxString& name = wxFrameNameStr) | |
94 | { | |
95 | Init(); | |
96 | ||
97 | Create(parent, id, title, pos, size, style, name); | |
98 | } | |
99 | ||
100 | bool Create(wxMDIParentFrame *parent, | |
101 | wxWindowID id, | |
102 | const wxString& title, | |
103 | const wxPoint& pos = wxDefaultPosition, | |
104 | const wxSize& size = wxDefaultSize, | |
105 | long style = wxDEFAULT_FRAME_STYLE, | |
106 | const wxString& name = wxFrameNameStr); | |
885df446 VZ |
107 | |
108 | virtual ~wxMDIChildFrame(); | |
f6bcfd97 | 109 | |
8487f887 RR |
110 | virtual void SetMenuBar( wxMenuBar *menu_bar ); |
111 | virtual wxMenuBar *GetMenuBar() const; | |
c801d85f | 112 | |
8487f887 | 113 | virtual void Activate(); |
f6bcfd97 | 114 | |
d2824cdb VZ |
115 | virtual void SetTitle(const wxString& title); |
116 | ||
117 | // implementation | |
3811dacb | 118 | |
f6bcfd97 BP |
119 | void OnActivate( wxActivateEvent& event ); |
120 | void OnMenuHighlight( wxMenuEvent& event ); | |
121 | ||
716b7364 | 122 | wxMenuBar *m_menuBar; |
ab2b3dd4 | 123 | bool m_justInserted; |
f6bcfd97 | 124 | |
d2824cdb VZ |
125 | private: |
126 | void Init(); | |
885df446 | 127 | |
d2824cdb | 128 | GtkNotebook *GTKGetNotebook() const; |
b2e10dac | 129 | |
f6bcfd97 | 130 | DECLARE_EVENT_TABLE() |
8487f887 | 131 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) |
c801d85f KB |
132 | }; |
133 | ||
134 | //----------------------------------------------------------------------------- | |
135 | // wxMDIClientWindow | |
136 | //----------------------------------------------------------------------------- | |
137 | ||
d2824cdb | 138 | class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase |
c801d85f | 139 | { |
ab2b3dd4 | 140 | public: |
d2824cdb | 141 | wxMDIClientWindow() { } |
5a0a15cf | 142 | ~wxMDIClientWindow(); |
d2824cdb VZ |
143 | |
144 | virtual bool CreateClient(wxMDIParentFrame *parent, | |
145 | long style = wxVSCROLL | wxHSCROLL); | |
8487f887 RR |
146 | |
147 | private: | |
48200154 PC |
148 | virtual void AddChildGTK(wxWindowGTK* child); |
149 | ||
8487f887 | 150 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) |
c801d85f KB |
151 | }; |
152 | ||
0416c418 | 153 | #endif // _WX_GTK_MDI_H_ |