+ // Raising any frame is supposed to show it but wxFrame Raise()
+ // implementation doesn't work for MDI child frames in most forms so
+ // forward this to Activate() which serves the same purpose by default.
+ virtual void Raise() { Activate(); }
+
+protected:
+ wxMDIParentFrame *m_mdiParent;
+};
+
+// ----------------------------------------------------------------------------
+// wxTDIChildFrame: child frame used by TDI implementations
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxTDIChildFrame : public wxMDIChildFrameBase
+{
+public:
+ // override wxFrame methods for this non top-level window
+
+#if wxUSE_STATUSBAR
+ // no status bars
+ //
+ // TODO: MDI children should have their own status bars, why not?
+ virtual wxStatusBar* CreateStatusBar(int WXUNUSED(number) = 1,
+ long WXUNUSED(style) = 1,
+ wxWindowID WXUNUSED(id) = 1,
+ const wxString& WXUNUSED(name)
+ = wxEmptyString)
+ { return NULL; }
+
+ virtual wxStatusBar *GetStatusBar() const
+ { return NULL; }
+ virtual void SetStatusText(const wxString &WXUNUSED(text),
+ int WXUNUSED(number)=0)
+ { }
+ virtual void SetStatusWidths(int WXUNUSED(n),
+ const int WXUNUSED(widths)[])
+ { }
+#endif // wxUSE_STATUSBAR
+
+#if wxUSE_TOOLBAR
+ // no toolbar
+ //
+ // TODO: again, it should be possible to have tool bars
+ virtual wxToolBar *CreateToolBar(long WXUNUSED(style),
+ wxWindowID WXUNUSED(id),
+ const wxString& WXUNUSED(name))
+ { return NULL; }
+ virtual wxToolBar *GetToolBar() const { return NULL; }
+#endif // wxUSE_TOOLBAR
+
+ // no icon
+ virtual void SetIcons(const wxIconBundle& WXUNUSED(icons)) { }
+
+ // title is used as the tab label
+ virtual wxString GetTitle() const { return m_title; }
+ virtual void SetTitle(const wxString& title) = 0;
+
+ // no maximize etc
+ virtual void Maximize(bool WXUNUSED(maximize) = true) { }
+ virtual bool IsMaximized() const { return true; }
+ virtual bool IsAlwaysMaximized() const { return true; }
+ virtual void Iconize(bool WXUNUSED(iconize) = true) { }
+ virtual bool IsIconized() const { return false; }
+ virtual void Restore() { }
+
+ virtual bool ShowFullScreen(bool WXUNUSED(show),
+ long WXUNUSED(style)) { return false; }
+ virtual bool IsFullScreen() const { return false; }
+
+
+ // we need to override these functions to ensure that a child window is
+ // created even though we derive from wxFrame -- basically we make it
+ // behave as just a wxWindow by short-circuiting wxTLW changes to the base
+ // class behaviour
+
+ virtual void AddChild(wxWindowBase *child) { wxWindow::AddChild(child); }
+
+ virtual bool Destroy() { return wxWindow::Destroy(); }
+
+ // extra platform-specific hacks
+#ifdef __WXMSW__
+ virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const
+ {
+ return wxWindow::MSWGetStyle(flags, exstyle);
+ }
+
+ virtual WXHWND MSWGetParent() const
+ {
+ return wxWindow::MSWGetParent();
+ }
+
+ WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
+ {
+ return wxWindow::MSWWindowProc(message, wParam, lParam);
+ }
+#endif // __WXMSW__
+
+protected:
+ virtual void DoGetSize(int *width, int *height) const
+ {
+ wxWindow::DoGetSize(width, height);
+ }
+
+ virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags)
+ {
+ wxWindow::DoSetSize(x, y, width, height, sizeFlags);
+ }
+
+ virtual void DoGetClientSize(int *width, int *height) const
+ {
+ wxWindow::DoGetClientSize(width, height);
+ }
+
+ virtual void DoSetClientSize(int width, int height)
+ {
+ wxWindow::DoSetClientSize(width, height);
+ }
+
+ // no size hints
+ virtual void DoSetSizeHints(int WXUNUSED(minW), int WXUNUSED(minH),
+ int WXUNUSED(maxW), int WXUNUSED(maxH),
+ int WXUNUSED(incW), int WXUNUSED(incH)) { }
+
+ wxString m_title;
+};
+
+// ----------------------------------------------------------------------------
+// wxMDIClientWindowBase: child of parent frame, parent of children frames
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxMDIClientWindowBase : public wxWindow
+{
+public:
+ /*
+ The derived class must provide the default ctor only (CreateClient()
+ will be called later).
+ */
+
+ // Can be overridden in the derived classes but the base class version must
+ // be usually called first to really create the client window.
+ virtual bool CreateClient(wxMDIParentFrame *parent,
+ long style = wxVSCROLL | wxHSCROLL) = 0;
+};
+
+// ----------------------------------------------------------------------------
+// Include the port-specific implementation of the base classes defined above
+// ----------------------------------------------------------------------------
+
+// wxUSE_GENERIC_MDI_AS_NATIVE may be predefined to force the generic MDI
+// implementation use even on the platforms which usually don't use it
+//
+// notice that generic MDI can still be used without this, but you would need
+// to explicitly use wxGenericMDIXXX classes in your code (and currently also
+// add src/generic/mdig.cpp to your build as it's not compiled in if generic
+// MDI is not used by default -- but this may change later...)
+#ifndef wxUSE_GENERIC_MDI_AS_NATIVE
+ // wxUniv always uses the generic MDI implementation and so do the ports
+ // without native version (although wxCocoa seems to have one -- but it's
+ // probably not functional?)
+ #if defined(__WXCOCOA__) || \
+ defined(__WXMOTIF__) || \
+ defined(__WXPM__) || \
+ defined(__WXUNIVERSAL__)
+ #define wxUSE_GENERIC_MDI_AS_NATIVE 1
+ #else
+ #define wxUSE_GENERIC_MDI_AS_NATIVE 0
+ #endif
+#endif // wxUSE_GENERIC_MDI_AS_NATIVE
+
+#if wxUSE_GENERIC_MDI_AS_NATIVE