Review/simplify/cleanup MDI classes for all platforms and introduce base
classes for wxMDI{Parent,Child}Frame and wxMDIClientWindow. Also use generic MDI implementation for wxMotif as it seems to be more functional and definitely is more maintained (we probably should use the generic version for wxGTK too). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
// Name: wx/cocoa/mdi.h
|
||||
// Purpose: wxMDIParentFrame, wxMDIChildFrame, wxMDIClientWindow
|
||||
// Author: David Elliott
|
||||
// Modified by:
|
||||
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
||||
// Created: 2003/09/08
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2003 David Elliott
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -24,7 +25,7 @@ WX_DECLARE_EXPORTED_LIST(wxMDIChildFrame, wxCocoaMDIChildFrameList);
|
||||
// ========================================================================
|
||||
// wxMDIParentFrame
|
||||
// ========================================================================
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
|
||||
{
|
||||
friend class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
DECLARE_EVENT_TABLE()
|
||||
@@ -76,17 +77,16 @@ protected:
|
||||
// Implementation
|
||||
// ------------------------------------------------------------------------
|
||||
public:
|
||||
wxMDIChildFrame *GetActiveChild() const;
|
||||
void SetActiveChild(wxMDIChildFrame *child);
|
||||
|
||||
wxMDIClientWindow *GetClientWindow() const;
|
||||
virtual wxMDIClientWindow *OnCreateClient();
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
static bool IsTDI() { return false; }
|
||||
|
||||
virtual void ActivateNext() { /* TODO */ }
|
||||
virtual void ActivatePrevious() { /* TODO */ }
|
||||
|
||||
virtual void Cascade() {}
|
||||
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) {}
|
||||
virtual void ArrangeIcons() {}
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
protected:
|
||||
wxMDIClientWindow *m_clientWindow;
|
||||
wxMDIChildFrame *m_currentChild;
|
||||
@@ -150,14 +150,15 @@ protected:
|
||||
// ========================================================================
|
||||
// wxMDIClientWindow
|
||||
// ========================================================================
|
||||
class wxMDIClientWindow: public wxWindow
|
||||
class wxMDIClientWindow : public wxMDIClientWindowBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||
public:
|
||||
wxMDIClientWindow();
|
||||
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
|
||||
virtual ~wxMDIClientWindow();
|
||||
virtual bool CreateClient( wxMDIParentFrame *parent, long style = 0 );
|
||||
wxMDIClientWindow() { }
|
||||
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent,
|
||||
long style = wxHSCROLL | wxVSCROLL);
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||
};
|
||||
|
||||
#endif // __WX_COCOA_MDI_H__
|
||||
|
@@ -2,334 +2,260 @@
|
||||
// Name: wx/generic/mdig.h
|
||||
// Purpose: Generic MDI (Multiple Document Interface) classes
|
||||
// Author: Hans Van Leemputten
|
||||
// Modified by:
|
||||
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
||||
// Created: 29/07/2002
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Hans Van Leemputten
|
||||
// Copyright: (c) 2002 Hans Van Leemputten
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MDIG_H_
|
||||
#define _WX_MDIG_H_
|
||||
#ifndef _WX_GENERIC_MDIG_H_
|
||||
#define _WX_GENERIC_MDIG_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/frame.h"
|
||||
#include "wx/panel.h"
|
||||
#include "wx/notebook.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxBookCtrlBase;
|
||||
class WXDLLIMPEXP_FWD_CORE wxBookCtrlEvent;
|
||||
class WXDLLIMPEXP_FWD_CORE wxIcon;
|
||||
class WXDLLIMPEXP_FWD_CORE wxIconBundle;
|
||||
class WXDLLIMPEXP_FWD_CORE wxNotebook;
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxStatusLineNameStr[];
|
||||
#if wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
#define wxGenericMDIParentFrame wxMDIParentFrame
|
||||
#define wxGenericMDIChildFrame wxMDIChildFrame
|
||||
#define wxGenericMDIClientWindow wxMDIClientWindow
|
||||
#else // !wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericMDIParentFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericMDIChildFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericMDIClientWindow;
|
||||
#endif // wxUSE_GENERIC_MDI_AS_NATIVE/!wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericMDIParentFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericMDIClientWindow;
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericMDIChildFrame;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericMDIParentFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericMDIParentFrame: public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxGenericMDIParentFrame : public wxMDIParentFrameBase
|
||||
{
|
||||
public:
|
||||
wxGenericMDIParentFrame();
|
||||
wxGenericMDIParentFrame() { Init(); }
|
||||
wxGenericMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, winid, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxGenericMDIParentFrame();
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr );
|
||||
|
||||
// implement base class pure virtuals
|
||||
static bool IsTDI() { return true; }
|
||||
|
||||
virtual void ActivateNext() { AdvanceActive(true); }
|
||||
virtual void ActivatePrevious() { AdvanceActive(false); }
|
||||
|
||||
#if wxUSE_MENUS
|
||||
wxMenu* GetWindowMenu() const { return m_pWindowMenu; };
|
||||
void SetWindowMenu(wxMenu* pMenu);
|
||||
virtual void SetWindowMenu(wxMenu* pMenu);
|
||||
|
||||
virtual void SetMenuBar(wxMenuBar *pMenuBar);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
void SetChildMenuBar(wxGenericMDIChildFrame *pChild);
|
||||
|
||||
virtual bool ProcessEvent(wxEvent& event);
|
||||
|
||||
wxGenericMDIChildFrame *GetActiveChild() const;
|
||||
inline void SetActiveChild(wxGenericMDIChildFrame* pChildFrame);
|
||||
virtual wxGenericMDIClientWindow *OnCreateGenericClient();
|
||||
|
||||
wxGenericMDIClientWindow *GetClientWindow() const;
|
||||
virtual wxGenericMDIClientWindow *OnCreateClient();
|
||||
|
||||
virtual void Cascade() { /* Has no effect */ }
|
||||
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) { }
|
||||
virtual void ArrangeIcons() { /* Has no effect */ }
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
// implementation only from now on
|
||||
void WXSetChildMenuBar(wxGenericMDIChildFrame *child);
|
||||
void WXUpdateChildTitle(wxGenericMDIChildFrame *child);
|
||||
void WXActivateChild(wxGenericMDIChildFrame *child);
|
||||
void WXRemoveChild(wxGenericMDIChildFrame *child);
|
||||
bool WXIsActiveChild(wxGenericMDIChildFrame *child) const;
|
||||
bool WXIsInsideChildHandler(wxGenericMDIChildFrame *child) const;
|
||||
|
||||
// return the book control used by the client window to manage the pages
|
||||
wxBookCtrlBase *GetBookCtrl() const;
|
||||
|
||||
protected:
|
||||
wxGenericMDIClientWindow *m_pClientWindow;
|
||||
wxGenericMDIChildFrame *m_pActiveChild;
|
||||
#if wxUSE_MENUS
|
||||
wxMenu *m_pWindowMenu;
|
||||
wxMenuBar *m_pMyMenuBar;
|
||||
wxMenuBar *m_pMyMenuBar;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
protected:
|
||||
// advance the activation forward or backwards
|
||||
void AdvanceActive(bool forward);
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
#if wxUSE_MENUS
|
||||
void RemoveWindowMenu(wxMenuBar *pMenuBar);
|
||||
void AddWindowMenu(wxMenuBar *pMenuBar);
|
||||
|
||||
void DoHandleMenu(wxCommandEvent &event);
|
||||
void OnWindowMenu(wxCommandEvent& event);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
void OnClose(wxCloseEvent& event);
|
||||
|
||||
// return the client window, may be NULL if we hadn't been created yet
|
||||
wxGenericMDIClientWindow *GetGenericClientWindow() const;
|
||||
|
||||
// close all children, return false if any of them vetoed it
|
||||
bool CloseAll();
|
||||
|
||||
|
||||
// this pointer is non-NULL if we're currently inside our ProcessEvent()
|
||||
// and we forwarded the event to this child (as we do with menu events)
|
||||
wxMDIChildFrameBase *m_childHandler;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericMDIParentFrame)
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericMDIChildFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericMDIChildFrame: public wxPanel
|
||||
class WXDLLIMPEXP_CORE wxGenericMDIChildFrame : public wxTDIChildFrame
|
||||
{
|
||||
public:
|
||||
wxGenericMDIChildFrame();
|
||||
wxGenericMDIChildFrame( wxGenericMDIParentFrame *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr );
|
||||
wxGenericMDIChildFrame() { Init(); }
|
||||
wxGenericMDIChildFrame(wxGenericMDIParentFrame *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, winid, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxGenericMDIParentFrame *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxGenericMDIChildFrame();
|
||||
bool Create( wxGenericMDIParentFrame *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr );
|
||||
|
||||
// implement MDI operations
|
||||
virtual void Activate();
|
||||
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
||||
virtual wxMenuBar *GetMenuBar() const;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
virtual wxString GetTitle() const { return m_title; }
|
||||
virtual void SetTitle(const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
|
||||
virtual void Activate();
|
||||
virtual bool TryParent(wxEvent& event);
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// no status bars
|
||||
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
|
||||
long WXUNUSED(style) = 1,
|
||||
wxWindowID WXUNUSED(winid) = 1,
|
||||
const wxString& WXUNUSED(name) = wxEmptyString)
|
||||
{ return (wxStatusBar*)NULL; }
|
||||
// implementation only from now on
|
||||
|
||||
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
|
||||
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
|
||||
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
|
||||
wxGenericMDIParentFrame* GetGenericMDIParent() const
|
||||
{
|
||||
#if wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
return GetMDIParent();
|
||||
#else // generic != native
|
||||
return m_mdiParentGeneric;
|
||||
#endif
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
// no toolbar bars
|
||||
virtual wxToolBar* CreateToolBar( long WXUNUSED(style),
|
||||
wxWindowID WXUNUSED(winid),
|
||||
const wxString& WXUNUSED(name) )
|
||||
{ return (wxToolBar*)NULL; }
|
||||
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
|
||||
#endif
|
||||
|
||||
// no icon
|
||||
void SetIcon(const wxIcon& WXUNUSED(icon)) { }
|
||||
virtual void SetIcons( const wxIconBundle& WXUNUSED(icons) ) { }
|
||||
|
||||
// no maximize etc
|
||||
virtual void Maximize( bool WXUNUSED(maximize) = true) { /* Has no effect */ }
|
||||
virtual void Restore() { /* Has no effect */ }
|
||||
virtual void Iconize(bool WXUNUSED(iconize) = true) { /* Has no effect */ }
|
||||
virtual bool IsMaximized() const { return true; }
|
||||
virtual bool IsIconized() const { return false; }
|
||||
virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style)) { return false; }
|
||||
virtual bool IsFullScreen() const { return false; }
|
||||
|
||||
virtual bool IsTopLevel() const { return false; }
|
||||
|
||||
void OnMenuHighlight(wxMenuEvent& event);
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
|
||||
// The next 2 are copied from top level...
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
void SetMDIParentFrame(wxGenericMDIParentFrame* parentFrame);
|
||||
wxGenericMDIParentFrame* GetMDIParentFrame() const;
|
||||
}
|
||||
|
||||
protected:
|
||||
wxGenericMDIParentFrame *m_pMDIParentFrame;
|
||||
wxRect m_MDIRect;
|
||||
wxString m_Title;
|
||||
wxString m_title;
|
||||
|
||||
#if wxUSE_MENUS
|
||||
wxMenuBar *m_pMenuBar;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
#if !wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
wxGenericMDIParentFrame *m_mdiParentGeneric;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
void Init();
|
||||
|
||||
virtual void DoMoveWindow(int x, int y, int width, int 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)) {}
|
||||
|
||||
// This function needs to be called when a size change is confirmed,
|
||||
// we needed this function to prevent any body from the outside
|
||||
// changing the panel... it messes the UI layout when we would allow it.
|
||||
void ApplyMDIChildFrameRect();
|
||||
|
||||
private:
|
||||
void OnMenuHighlight(wxMenuEvent& event);
|
||||
void OnClose(wxCloseEvent& event);
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericMDIChildFrame)
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
friend class wxGenericMDIClientWindow;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericMDIClientWindow
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericMDIClientWindow: public wxNotebook
|
||||
class WXDLLIMPEXP_CORE wxGenericMDIClientWindow : public wxMDIClientWindowBase
|
||||
{
|
||||
public:
|
||||
wxGenericMDIClientWindow();
|
||||
wxGenericMDIClientWindow( wxGenericMDIParentFrame *parent, long style = 0 );
|
||||
virtual ~wxGenericMDIClientWindow();
|
||||
virtual bool CreateClient( wxGenericMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
|
||||
wxGenericMDIClientWindow() { }
|
||||
|
||||
virtual int SetSelection(size_t nPage);
|
||||
// unfortunately we need to provide our own version of CreateClient()
|
||||
// because of the difference in the type of the first parameter and
|
||||
// implement the base class pure virtual method in terms of it
|
||||
// (CreateGenericClient() is virtual itself to allow customizing the client
|
||||
// window creation by overriding it in the derived classes)
|
||||
virtual bool CreateGenericClient(wxWindow *parent);
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent,
|
||||
long WXUNUSED(style) = wxVSCROLL | wxHSCROLL)
|
||||
{
|
||||
return CreateGenericClient(parent);
|
||||
}
|
||||
|
||||
protected:
|
||||
// implementation only
|
||||
wxBookCtrlBase *GetBookCtrl() const;
|
||||
wxGenericMDIChildFrame *GetChild(size_t pos) const;
|
||||
int FindChild(wxGenericMDIChildFrame *child) const;
|
||||
|
||||
private:
|
||||
void PageChanged(int OldSelection, int newSelection);
|
||||
|
||||
void OnPageChanged(wxBookCtrlEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
private:
|
||||
// the notebook containing all MDI children as its pages
|
||||
wxNotebook *m_notebook;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericMDIClientWindow)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// inline functions implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Define normal wxMDI classes based on wxGenericMDI
|
||||
*/
|
||||
|
||||
#ifndef wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
#if defined(__WXUNIVERSAL__) || defined(__WXPM__) || defined(__WXCOCOA__)
|
||||
#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
|
||||
|
||||
class wxMDIChildFrame ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMDIParentFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxGenericMDIParentFrame
|
||||
inline bool
|
||||
wxGenericMDIParentFrame::
|
||||
WXIsInsideChildHandler(wxGenericMDIChildFrame *child) const
|
||||
{
|
||||
public:
|
||||
wxMDIParentFrame() {}
|
||||
wxMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
:wxGenericMDIParentFrame(parent, winid, title, pos, size, style, name)
|
||||
{
|
||||
}
|
||||
return child == m_childHandler;
|
||||
}
|
||||
|
||||
wxMDIChildFrame * GetActiveChild() const ;
|
||||
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMDIChildFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxGenericMDIChildFrame
|
||||
{
|
||||
public:
|
||||
wxMDIChildFrame() {}
|
||||
|
||||
wxMDIChildFrame( wxGenericMDIParentFrame *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr )
|
||||
:wxGenericMDIChildFrame(parent, winid, title, pos, size, style, name)
|
||||
{
|
||||
}
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMDIClientWindow
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxGenericMDIClientWindow
|
||||
{
|
||||
public:
|
||||
wxMDIClientWindow() {}
|
||||
|
||||
wxMDIClientWindow( wxGenericMDIParentFrame *parent, long style = 0 )
|
||||
:wxGenericMDIClientWindow(parent, style)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_MDIG_H_
|
||||
#endif // _WX_GENERIC_MDIG_H_
|
||||
|
@@ -1,9 +1,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/mdi.h
|
||||
// Purpose:
|
||||
// Purpose: TDI-based MDI implementation for wxGTK
|
||||
// Author: Robert Roebling
|
||||
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -15,11 +17,13 @@
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
||||
|
||||
typedef struct _GtkNotebook GtkNotebook;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMDIParentFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
|
||||
{
|
||||
public:
|
||||
wxMDIParentFrame() { Init(); }
|
||||
@@ -36,29 +40,28 @@ public:
|
||||
(void)Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
virtual ~wxMDIParentFrame();
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr );
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
wxMDIChildFrame *GetActiveChild() const;
|
||||
// we don't store the active child in m_currentChild unlike the base class
|
||||
// version so override this method to find it dynamically
|
||||
virtual wxMDIChildFrame *GetActiveChild() const;
|
||||
|
||||
wxMDIClientWindow *GetClientWindow() const;
|
||||
virtual wxMDIClientWindow *OnCreateClient();
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual void Cascade() {}
|
||||
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) {}
|
||||
virtual void ArrangeIcons() {}
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
|
||||
static bool IsTDI() { return true; }
|
||||
|
||||
// implementation
|
||||
|
||||
wxMDIClientWindow *m_clientWindow;
|
||||
bool m_justInserted;
|
||||
|
||||
virtual void OnInternalIdle();
|
||||
@@ -77,95 +80,54 @@ private:
|
||||
// wxMDIChildFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame
|
||||
{
|
||||
public:
|
||||
wxMDIChildFrame();
|
||||
wxMDIChildFrame( wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr );
|
||||
wxMDIChildFrame() { Init(); }
|
||||
wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxMDIChildFrame();
|
||||
bool Create( wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr );
|
||||
|
||||
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
||||
virtual wxMenuBar *GetMenuBar() const;
|
||||
|
||||
virtual void AddChild( wxWindowBase *child );
|
||||
|
||||
virtual void Activate();
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// no status bars
|
||||
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
|
||||
long WXUNUSED(style) = 1,
|
||||
wxWindowID WXUNUSED(id) = 1,
|
||||
const wxString& WXUNUSED(name) = wxEmptyString)
|
||||
{ return (wxStatusBar*)NULL; }
|
||||
virtual void SetTitle(const wxString& title);
|
||||
|
||||
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
|
||||
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
|
||||
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
|
||||
#endif
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
// no toolbar
|
||||
virtual wxToolBar* CreateToolBar( long WXUNUSED(style),
|
||||
wxWindowID WXUNUSED(id),
|
||||
const wxString& WXUNUSED(name) )
|
||||
{ return (wxToolBar*)NULL; }
|
||||
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
// no icon
|
||||
virtual void SetIcons(const wxIconBundle& icons )
|
||||
{ wxTopLevelWindowBase::SetIcons(icons); }
|
||||
|
||||
// no title
|
||||
virtual void SetTitle( const wxString &title );
|
||||
|
||||
// no maximize etc
|
||||
virtual void Maximize( bool WXUNUSED(maximize) = true ) { }
|
||||
virtual bool IsMaximized() const { return true; }
|
||||
virtual void Iconize(bool WXUNUSED(iconize) = true) { }
|
||||
virtual bool IsIconized() const { return false; }
|
||||
virtual void Restore() {}
|
||||
|
||||
virtual bool IsTopLevel() const { return false; }
|
||||
|
||||
virtual bool Destroy();
|
||||
// implementation
|
||||
|
||||
void OnActivate( wxActivateEvent& event );
|
||||
void OnMenuHighlight( wxMenuEvent& event );
|
||||
|
||||
// implementation
|
||||
|
||||
wxMenuBar *m_menuBar;
|
||||
GtkNotebookPage *m_page;
|
||||
bool m_justInserted;
|
||||
|
||||
protected:
|
||||
// override wxFrame methods to not do anything
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
// no size hints
|
||||
virtual void DoSetSizeHints(int WXUNUSED(minW), int WXUNUSED(minH),
|
||||
int WXUNUSED(maxW), int WXUNUSED(maxH),
|
||||
int WXUNUSED(incW), int WXUNUSED(incH)) {}
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
GtkNotebook *GTKGetNotebook() const;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||
};
|
||||
@@ -174,13 +136,13 @@ private:
|
||||
// wxMDIClientWindow
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxWindow
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
|
||||
{
|
||||
public:
|
||||
wxMDIClientWindow();
|
||||
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
|
||||
virtual ~wxMDIClientWindow();
|
||||
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
|
||||
wxMDIClientWindow() { }
|
||||
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent,
|
||||
long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
private:
|
||||
virtual void AddChildGTK(wxWindowGTK* child);
|
||||
|
@@ -1,42 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/mdi.h
|
||||
// Purpose:
|
||||
// Purpose: TDI-based MDI implementation for wxGTK1
|
||||
// Author: Robert Roebling
|
||||
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __MDIH__
|
||||
#define __MDIH__
|
||||
#ifndef _WX_GTK1_MDI_H_
|
||||
#define _WX_GTK1_MDI_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/panel.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/toolbar.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxStatusLineNameStr[];
|
||||
typedef struct _GtkNotebook GtkNotebook;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMDIParentFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
|
||||
{
|
||||
public:
|
||||
wxMDIParentFrame() { Init(); }
|
||||
@@ -53,41 +40,35 @@ public:
|
||||
(void)Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
virtual ~wxMDIParentFrame();
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr );
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
wxMDIChildFrame *GetActiveChild() const;
|
||||
// we don't store the active child in m_currentChild unlike the base class
|
||||
// version so override this method to find it dynamically
|
||||
virtual wxMDIChildFrame *GetActiveChild() const;
|
||||
|
||||
wxMDIClientWindow *GetClientWindow() const;
|
||||
virtual wxMDIClientWindow *OnCreateClient();
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual void Cascade() {}
|
||||
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) {}
|
||||
virtual void ArrangeIcons() {}
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
|
||||
static bool IsTDI() { return true; }
|
||||
|
||||
// implementation
|
||||
|
||||
wxMDIClientWindow *m_clientWindow;
|
||||
bool m_justInserted;
|
||||
|
||||
virtual void GtkOnSize( int x, int y, int width, int height );
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
protected:
|
||||
void Init();
|
||||
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
friend class wxMDIChildFrame;
|
||||
void Init();
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||
};
|
||||
@@ -96,98 +77,54 @@ private:
|
||||
// wxMDIChildFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame
|
||||
{
|
||||
public:
|
||||
wxMDIChildFrame();
|
||||
wxMDIChildFrame( wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr );
|
||||
wxMDIChildFrame() { Init(); }
|
||||
wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxMDIChildFrame();
|
||||
bool Create( wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr );
|
||||
|
||||
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
||||
virtual wxMenuBar *GetMenuBar() const;
|
||||
|
||||
virtual void AddChild( wxWindowBase *child );
|
||||
|
||||
virtual void Activate();
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// no status bars
|
||||
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
|
||||
long WXUNUSED(style) = 1,
|
||||
wxWindowID WXUNUSED(id) = 1,
|
||||
const wxString& WXUNUSED(name) = wxEmptyString)
|
||||
{ return (wxStatusBar*)NULL; }
|
||||
virtual void SetTitle(const wxString& title);
|
||||
|
||||
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
|
||||
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
|
||||
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
|
||||
#endif
|
||||
|
||||
// no size hints
|
||||
virtual void DoSetSizeHints( int WXUNUSED(minW),
|
||||
int WXUNUSED(minH),
|
||||
int WXUNUSED(maxW) = wxDefaultCoord,
|
||||
int WXUNUSED(maxH) = wxDefaultCoord,
|
||||
int WXUNUSED(incW) = wxDefaultCoord,
|
||||
int WXUNUSED(incH) = wxDefaultCoord) {}
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
// no toolbar
|
||||
virtual wxToolBar* CreateToolBar( long WXUNUSED(style),
|
||||
wxWindowID WXUNUSED(id),
|
||||
const wxString& WXUNUSED(name) )
|
||||
{ return (wxToolBar*)NULL; }
|
||||
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
// no icon
|
||||
virtual void SetIcons(const wxIconBundle& icons )
|
||||
{ wxTopLevelWindowBase::SetIcons(icons); }
|
||||
|
||||
// no title
|
||||
virtual void SetTitle( const wxString &title );
|
||||
|
||||
// no maximize etc
|
||||
virtual void Maximize( bool WXUNUSED(maximize) = true ) { }
|
||||
virtual bool IsMaximized() const { return true; }
|
||||
virtual void Iconize(bool WXUNUSED(iconize) = true) { }
|
||||
virtual bool IsIconized() const { return false; }
|
||||
virtual void Restore() {}
|
||||
|
||||
virtual bool IsTopLevel() const { return false; }
|
||||
// implementation
|
||||
|
||||
void OnActivate( wxActivateEvent& event );
|
||||
void OnMenuHighlight( wxMenuEvent& event );
|
||||
|
||||
// implementation
|
||||
|
||||
wxMenuBar *m_menuBar;
|
||||
GtkNotebookPage *m_page;
|
||||
bool m_justInserted;
|
||||
|
||||
protected:
|
||||
// override wxFrame methods to not do anything
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
virtual void DoGetClientSize( int *width, int *height ) const;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
GtkNotebook *GTKGetNotebook() const;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||
};
|
||||
@@ -196,16 +133,16 @@ private:
|
||||
// wxMDIClientWindow
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxWindow
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
|
||||
{
|
||||
public:
|
||||
wxMDIClientWindow();
|
||||
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
|
||||
virtual ~wxMDIClientWindow();
|
||||
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
|
||||
wxMDIClientWindow() { }
|
||||
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent,
|
||||
long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||
};
|
||||
|
||||
#endif // __MDIH__
|
||||
#endif // _WX_GTK1_MDI_H_
|
||||
|
342
include/wx/mdi.h
342
include/wx/mdi.h
@@ -1,10 +1,10 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/mdi.h
|
||||
// Purpose: wxMDI base header
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created:
|
||||
// Copyright: (c) Julian Smart
|
||||
// Author: Julian Smart (original)
|
||||
// Vadim Zeitlin (base MDI classes refactoring)
|
||||
// Copyright: (c) 1998 Julian Smart
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// RCS-ID: $Id$
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -16,12 +16,330 @@
|
||||
|
||||
#if wxUSE_MDI
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/frame.h"
|
||||
|
||||
// forward declarations
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindowBase;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMDIParentFrameBase: base class for parent frame for MDI children
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrameBase : public wxFrame
|
||||
{
|
||||
public:
|
||||
wxMDIParentFrameBase()
|
||||
{
|
||||
m_clientWindow = NULL;
|
||||
m_currentChild = NULL;
|
||||
#if wxUSE_MENUS
|
||||
m_windowMenu = NULL;
|
||||
#endif // wxUSE_MENUS
|
||||
}
|
||||
|
||||
/*
|
||||
Derived classes should provide ctor and Create() with the following
|
||||
declaration:
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
*/
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual ~wxMDIParentFrameBase()
|
||||
{
|
||||
delete m_windowMenu;
|
||||
}
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
// Get or change the active MDI child window
|
||||
virtual wxMDIChildFrame *GetActiveChild() const
|
||||
{ return m_currentChild; }
|
||||
virtual void SetActiveChild(wxMDIChildFrame *child)
|
||||
{ m_currentChild = child; }
|
||||
|
||||
|
||||
// Get the client window
|
||||
wxMDIClientWindowBase *GetClientWindow() const { return m_clientWindow; }
|
||||
|
||||
|
||||
// MDI windows menu functions
|
||||
// --------------------------
|
||||
|
||||
#if wxUSE_MENUS
|
||||
// return the pointer to the current window menu or NULL if we don't have
|
||||
// because of wxFRAME_NO_WINDOW_MENU style
|
||||
wxMenu* GetWindowMenu() const { return m_windowMenu; };
|
||||
|
||||
// use the given menu instead of the default window menu
|
||||
//
|
||||
// menu can be NULL to disable the window menu completely
|
||||
virtual void SetWindowMenu(wxMenu *menu)
|
||||
{
|
||||
delete m_windowMenu;
|
||||
m_windowMenu = menu;
|
||||
}
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
|
||||
// standard MDI window management functions
|
||||
// ----------------------------------------
|
||||
|
||||
virtual void Cascade() { }
|
||||
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) { }
|
||||
virtual void ArrangeIcons() { }
|
||||
virtual void ActivateNext() = 0;
|
||||
virtual void ActivatePrevious() = 0;
|
||||
|
||||
/*
|
||||
Derived classes must provide the following function:
|
||||
|
||||
static bool IsTDI();
|
||||
*/
|
||||
|
||||
// Create the client window class (don't Create() the window here, just
|
||||
// return a new object of a wxMDIClientWindow-derived class)
|
||||
//
|
||||
// Notice that if you override this method you should use the default
|
||||
// constructor and Create() and not the constructor creating the window
|
||||
// when creating the frame or your overridden version is not going to be
|
||||
// called (as the call to a virtual function from ctor will be dispatched
|
||||
// to this class version)
|
||||
virtual wxMDIClientWindow *OnCreateClient();
|
||||
|
||||
protected:
|
||||
// This is wxMDIClientWindow for all the native implementations but not for
|
||||
// the generic MDI version which has its own wxGenericMDIClientWindow and
|
||||
// so we store it as just a base class pointer because we don't need its
|
||||
// exact type anyhow
|
||||
wxMDIClientWindowBase *m_clientWindow;
|
||||
wxMDIChildFrame *m_currentChild;
|
||||
|
||||
#if wxUSE_MENUS
|
||||
// the current window menu or NULL if we are not using it
|
||||
wxMenu *m_windowMenu;
|
||||
#endif // wxUSE_MENUS
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMDIChildFrameBase: child frame managed by wxMDIParentFrame
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrameBase : public wxFrame
|
||||
{
|
||||
public:
|
||||
wxMDIChildFrameBase() { m_mdiParent = NULL; }
|
||||
|
||||
/*
|
||||
Derived classes should provide Create() with the following signature:
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
And setting m_mdiParent to parent parameter.
|
||||
*/
|
||||
|
||||
// MDI children specific methods
|
||||
virtual void Activate() = 0;
|
||||
|
||||
// Return the MDI parent frame: notice that it may not be the same as
|
||||
// GetParent() (our parent may be the client window or even its subwindow
|
||||
// in some implementations)
|
||||
wxMDIParentFrame *GetMDIParent() const { return m_mdiParent; }
|
||||
|
||||
// Synonym for GetMDIParent(), was used in some other ports
|
||||
wxMDIParentFrame *GetMDIParentFrame() const { return GetMDIParent(); }
|
||||
|
||||
|
||||
// in most ports MDI children frames are not really top-level, the only
|
||||
// exception are the Mac ports in which MDI children are just normal top
|
||||
// level windows too
|
||||
virtual bool IsTopLevel() const { return false; }
|
||||
|
||||
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
|
||||
#include "wx/generic/mdig.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/mdi.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/mdi.h"
|
||||
#elif defined(__WXGTK20__)
|
||||
#include "wx/gtk/mdi.h"
|
||||
#elif defined(__WXGTK__)
|
||||
@@ -30,11 +348,13 @@
|
||||
#include "wx/osx/mdi.h"
|
||||
#elif defined(__WXCOCOA__)
|
||||
#include "wx/cocoa/mdi.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/generic/mdig.h"
|
||||
#endif
|
||||
|
||||
inline wxMDIClientWindow *wxMDIParentFrameBase::OnCreateClient()
|
||||
{
|
||||
return new wxMDIClientWindow;
|
||||
}
|
||||
|
||||
#endif // wxUSE_MDI
|
||||
|
||||
#endif
|
||||
// _WX_MDI_H_BASE_
|
||||
#endif // _WX_MDI_H_BASE_
|
||||
|
@@ -2,58 +2,62 @@
|
||||
// Name: wx/motif/mdi.h
|
||||
// Purpose: MDI (Multiple Document Interface) classes.
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
||||
// Created: 17/09/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Copyright: (c) 1998 Julian Smart
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MDI_H_
|
||||
#define _WX_MDI_H_
|
||||
#ifndef _WX_MOTIF_MDI_H_
|
||||
#define _WX_MOTIF_MDI_H_
|
||||
|
||||
/*
|
||||
New MDI scheme using tabs. We can use a wxNotebook to implement the client
|
||||
window. wxMDIChildFrame can be implemented as an XmMainWindow widget
|
||||
as before, and is a child of the notebook _and_ of the parent frame...
|
||||
but wxMDIChildFrame::GetParent should return the parent frame.
|
||||
|
||||
*/
|
||||
|
||||
#include "wx/frame.h"
|
||||
#include "wx/notebook.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||
|
||||
friend class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
public:
|
||||
|
||||
wxMDIParentFrame();
|
||||
inline wxMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, // Scrolling refers to client window
|
||||
const wxString& name = wxFrameNameStr)
|
||||
wxMDIParentFrame() { Init(); }
|
||||
wxMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxMDIParentFrame();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
static bool IsTDI() { return true; }
|
||||
|
||||
virtual void ActivateNext() { /* TODO */ }
|
||||
virtual void ActivatePrevious() { /* TODO */ }
|
||||
|
||||
|
||||
// Implementation
|
||||
|
||||
// Set the child's menubar into the parent frame
|
||||
void SetChildMenuBar(wxMDIChildFrame* frame);
|
||||
|
||||
wxMenuBar* GetActiveMenuBar() const { return m_activeMenuBar; }
|
||||
|
||||
// Redirect events to active child first
|
||||
virtual bool ProcessEvent(wxEvent& event);
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
@@ -62,82 +66,41 @@ public:
|
||||
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
|
||||
// Get the active MDI child window
|
||||
wxMDIChildFrame *GetActiveChild() const ;
|
||||
|
||||
// Get the client window
|
||||
wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; };
|
||||
|
||||
// Create the client window class (don't Create the window,
|
||||
// just return a new class)
|
||||
virtual wxMDIClientWindow *OnCreateClient() ;
|
||||
|
||||
// MDI operations
|
||||
virtual void Cascade();
|
||||
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL);
|
||||
virtual void ArrangeIcons();
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
|
||||
// Implementation
|
||||
|
||||
// Set the active child
|
||||
inline void SetActiveChild(wxMDIChildFrame* child) { m_activeChild = child; }
|
||||
|
||||
// Set the child's menubar into the parent frame
|
||||
void SetChildMenuBar(wxMDIChildFrame* frame);
|
||||
|
||||
inline wxMenuBar* GetActiveMenuBar() const { return m_activeMenuBar; }
|
||||
|
||||
// Redirect events to active child first
|
||||
virtual bool ProcessEvent(wxEvent& event);
|
||||
|
||||
protected:
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
wxMenuBar *m_activeMenuBar;
|
||||
|
||||
// Gets the size available for subwindows after menu size, toolbar size
|
||||
// and status bar size have been subtracted. If you want to manage your own
|
||||
// toolbar(s), don't call SetToolBar.
|
||||
void DoGetClientSize(int *width, int *height) const;
|
||||
|
||||
protected:
|
||||
|
||||
wxMDIClientWindow* m_clientWindow;
|
||||
wxMDIChildFrame* m_activeChild;
|
||||
wxMenuBar* m_activeMenuBar;
|
||||
private:
|
||||
void Init();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||
|
||||
public:
|
||||
wxMDIChildFrame();
|
||||
wxMDIChildFrame() { }
|
||||
wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxMDIChildFrame();
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
// Set menu bar
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
@@ -174,55 +137,18 @@ public:
|
||||
WXWidget GetTopWidget() const { return m_mainWidget; };
|
||||
WXWidget GetClientWidget() const { return m_mainWidget; };
|
||||
|
||||
/*
|
||||
virtual void OnRaise();
|
||||
virtual void OnLower();
|
||||
*/
|
||||
|
||||
void SetMDIParentFrame(wxMDIParentFrame* parentFrame) { m_mdiParentFrame = parentFrame; }
|
||||
wxMDIParentFrame* GetMDIParentFrame() const { return m_mdiParentFrame; }
|
||||
|
||||
protected:
|
||||
wxMDIParentFrame* m_mdiParentFrame;
|
||||
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
|
||||
void DoGetClientSize(int *width, int *height) const;
|
||||
void DoGetSize(int *width, int *height) const;
|
||||
void DoGetPosition(int *x, int *y) const ;
|
||||
void DoSetSizeHints(int minW, int minH,
|
||||
int maxW, int maxH,
|
||||
int incW, int incH);
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||
};
|
||||
|
||||
/* The client window is a child of the parent MDI frame, and itself
|
||||
* contains the child MDI frames.
|
||||
* However, you create the MDI children as children of the MDI parent:
|
||||
* only in the implementation does the client window become the parent
|
||||
* of the children. Phew! So the children are sort of 'adopted'...
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxNotebook
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||
|
||||
public:
|
||||
wxMDIClientWindow() ;
|
||||
wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
|
||||
{
|
||||
CreateClient(parent, style);
|
||||
}
|
||||
|
||||
wxMDIClientWindow() { }
|
||||
virtual ~wxMDIClientWindow();
|
||||
|
||||
// Note: this is virtual, to allow overridden behaviour.
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
// Explicitly call default scroll behaviour
|
||||
void OnScroll(wxScrollEvent& event);
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent,
|
||||
long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
// Implementation
|
||||
void OnPageChanged(wxBookCtrlEvent& event);
|
||||
@@ -231,17 +157,19 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
|
||||
void DoGetClientSize(int *width, int *height) const;
|
||||
void DoGetSize(int *width, int *height) const ;
|
||||
void DoGetPosition(int *x, int *y) const ;
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
virtual void DoGetSize(int *width, int *height) const ;
|
||||
virtual void DoGetPosition(int *x, int *y) const ;
|
||||
|
||||
wxNotebook *m_notebook;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_MDI_H_
|
||||
#endif // _WX_MOTIF_MDI_H_
|
||||
|
@@ -2,28 +2,24 @@
|
||||
// Name: wx/msw/mdi.h
|
||||
// Purpose: MDI (Multiple Document Interface) classes
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Copyright: (c) 1997 Julian Smart
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MDI_H_
|
||||
#define _WX_MDI_H_
|
||||
#ifndef _WX_MSW_MDI_H_
|
||||
#define _WX_MSW_MDI_H_
|
||||
|
||||
#include "wx/frame.h"
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxStatusLineNameStr[];
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxMDIParentFrame
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
|
||||
{
|
||||
public:
|
||||
wxMDIParentFrame();
|
||||
@@ -48,41 +44,26 @@ public:
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
// override/implement base class [pure] virtual methods
|
||||
// ----------------------------------------------------
|
||||
|
||||
// Get the active MDI child window
|
||||
wxMDIChildFrame *GetActiveChild() const;
|
||||
static bool IsTDI() { return false; }
|
||||
|
||||
// Get the client window
|
||||
wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; }
|
||||
// we don't store the active child in m_currentChild so override this
|
||||
// function to find it dynamically
|
||||
virtual wxMDIChildFrame *GetActiveChild() const;
|
||||
|
||||
// Create the client window class (don't Create the window,
|
||||
// just return a new class)
|
||||
virtual wxMDIClientWindow *OnCreateClient();
|
||||
|
||||
// MDI windows menu functions
|
||||
// --------------------------
|
||||
|
||||
// return the pointer to the current window menu or NULL if we don't have
|
||||
// because of wxFRAME_NO_WINDOW_MENU style
|
||||
wxMenu *GetWindowMenu() const { return m_windowMenu; }
|
||||
|
||||
// use the given menu instead of the default window menu
|
||||
//
|
||||
// menu can be NULL to disable the window menu completely
|
||||
void SetWindowMenu(wxMenu* menu) ;
|
||||
|
||||
virtual void DoMenuUpdates(wxMenu* menu = NULL);
|
||||
|
||||
// MDI operations
|
||||
// --------------
|
||||
virtual void Cascade();
|
||||
virtual void Tile(wxOrientation orient = wxHORIZONTAL);
|
||||
virtual void ArrangeIcons();
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual void SetWindowMenu(wxMenu* menu);
|
||||
|
||||
virtual void DoMenuUpdates(wxMenu* menu = NULL);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
// implementation only from now on
|
||||
|
||||
@@ -127,12 +108,6 @@ protected:
|
||||
void UpdateClientSize();
|
||||
|
||||
|
||||
wxMDIClientWindow * m_clientWindow;
|
||||
wxMDIChildFrame * m_currentChild;
|
||||
|
||||
// the current window menu or NULL if we are not using it
|
||||
wxMenu *m_windowMenu;
|
||||
|
||||
// true if MDI Frame is intercepting commands, not child
|
||||
bool m_parentFrameActive;
|
||||
|
||||
@@ -155,7 +130,7 @@ private:
|
||||
// wxMDIChildFrame
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxMDIChildFrameBase
|
||||
{
|
||||
public:
|
||||
wxMDIChildFrame() { Init(); }
|
||||
@@ -172,8 +147,6 @@ public:
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
virtual ~wxMDIChildFrame();
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
@@ -182,21 +155,20 @@ public:
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual bool IsTopLevel() const { return false; }
|
||||
virtual ~wxMDIChildFrame();
|
||||
|
||||
// MDI operations
|
||||
// implement MDI operations
|
||||
virtual void Activate();
|
||||
|
||||
// Override some frame operations too
|
||||
virtual void Maximize(bool maximize = true);
|
||||
virtual void Restore();
|
||||
virtual void Activate();
|
||||
|
||||
virtual bool Show(bool show = true);
|
||||
|
||||
// Implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
wxMDIParentFrame* GetMDIParent() const
|
||||
{
|
||||
return wxStaticCast(wxFrame::GetParent(), wxMDIParentFrame);
|
||||
}
|
||||
|
||||
// Handlers
|
||||
bool HandleMDIActivate(long bActivate, WXHWND, WXHWND);
|
||||
bool HandleWindowPosChanging(void *lpPos);
|
||||
@@ -213,8 +185,6 @@ public:
|
||||
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
|
||||
virtual bool Show(bool show = true);
|
||||
|
||||
protected:
|
||||
virtual void DoGetScreenPosition(int *x, int *y) const;
|
||||
virtual void DoGetPosition(int *x, int *y) const;
|
||||
@@ -240,16 +210,10 @@ private:
|
||||
// wxMDIClientWindow
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxWindow
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
|
||||
{
|
||||
public:
|
||||
wxMDIClientWindow() { Init(); }
|
||||
wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
|
||||
{
|
||||
Init();
|
||||
|
||||
CreateClient(parent, style);
|
||||
}
|
||||
|
||||
// Note: this is virtual, to allow overridden behaviour.
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent,
|
||||
@@ -272,5 +236,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMDIClientWindow)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_MDI_H_
|
||||
#endif // _WX_MSW_MDI_H_
|
||||
|
@@ -1,88 +1,72 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: mdi.h
|
||||
// Name: wx/osx/carbon/mdi.h
|
||||
// Purpose: MDI (Multiple Document Interface) classes.
|
||||
// This doesn't have to be implemented just like Windows,
|
||||
// it could be a tabbed design as in wxGTK.
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
||||
// Created: 1998-01-01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Stefan Csomor
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MDI_H_
|
||||
#define _WX_MDI_H_
|
||||
#ifndef _WX_OSX_CARBON_MDI_H_
|
||||
#define _WX_OSX_CARBON_MDI_H_
|
||||
|
||||
#include "wx/frame.h"
|
||||
|
||||
WXDLLIMPEXP_DATA_CORE(extern const char) wxStatusLineNameStr[];
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||
|
||||
public:
|
||||
wxMDIParentFrame() { Init(); }
|
||||
wxMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
wxMDIParentFrame() { Init(); }
|
||||
wxMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, // Scrolling refers to client window
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxMDIParentFrame();
|
||||
virtual ~wxMDIParentFrame();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
// implement/override base class [pure] virtuals
|
||||
// ---------------------------------------------
|
||||
|
||||
// Mac OS activate event
|
||||
virtual void MacActivate(long timestamp, bool activating);
|
||||
static bool IsTDI() { return false; }
|
||||
|
||||
// wxWidgets activate event
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
virtual void AddChild(wxWindowBase *child);
|
||||
virtual void RemoveChild(wxWindowBase *child);
|
||||
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
virtual void ActivateNext() { /* TODO */ }
|
||||
virtual void ActivatePrevious() { /* TODO */ }
|
||||
|
||||
// Get the active MDI child window (Windows only)
|
||||
wxMDIChildFrame *GetActiveChild() const ;
|
||||
virtual bool Show(bool show = true);
|
||||
|
||||
// Get the client window
|
||||
inline wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; };
|
||||
// Get rect to be used to center top-level children
|
||||
virtual void GetRectForTopLevelChildren(int *x, int *y, int *w, int *h);
|
||||
|
||||
// Create the client window class (don't Create the window,
|
||||
// just return a new class)
|
||||
virtual wxMDIClientWindow *OnCreateClient() ;
|
||||
// Mac-specific implementation from now on
|
||||
// ---------------------------------------
|
||||
|
||||
// MDI operations
|
||||
virtual void Cascade();
|
||||
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL);
|
||||
virtual void ArrangeIcons();
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
// Mac OS activate event
|
||||
virtual void MacActivate(long timestamp, bool activating);
|
||||
|
||||
virtual bool Show( bool show = true );
|
||||
// wxWidgets activate event
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// overridden base clas virtuals
|
||||
virtual void AddChild(wxWindowBase *child);
|
||||
virtual void RemoveChild(wxWindowBase *child);
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
|
||||
// Get rect to be used to center top-level children
|
||||
virtual void GetRectForTopLevelChildren(int *x, int *y, int *w, int *h);
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
@@ -93,9 +77,6 @@ protected:
|
||||
bool ShouldBeVisible() const;
|
||||
|
||||
|
||||
// TODO maybe have this member
|
||||
wxMDIClientWindow *m_clientWindow;
|
||||
wxMDIChildFrame *m_currentChild;
|
||||
wxMenu *m_windowMenu;
|
||||
|
||||
// true if MDI Frame is intercepting commands, not child
|
||||
@@ -107,88 +88,67 @@ protected:
|
||||
|
||||
private:
|
||||
friend class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxFrame
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxMDIChildFrameBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||
public:
|
||||
wxMDIChildFrame() { Init(); }
|
||||
wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init() ;
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
wxMDIChildFrame();
|
||||
inline wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init() ;
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxMDIChildFrame();
|
||||
virtual ~wxMDIChildFrame();
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
// un-override the base class override
|
||||
virtual bool IsTopLevel() const { return true; }
|
||||
|
||||
// Mac OS activate event
|
||||
virtual void MacActivate(long timestamp, bool activating);
|
||||
// implement MDI operations
|
||||
virtual void Activate();
|
||||
|
||||
// Set menu bar
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
|
||||
// MDI operations
|
||||
virtual void Maximize();
|
||||
virtual void Maximize( bool ){ Maximize() ; } // this one is inherited from wxFrame
|
||||
virtual void Restore();
|
||||
virtual void Activate();
|
||||
// Mac OS activate event
|
||||
virtual void MacActivate(long timestamp, bool activating);
|
||||
|
||||
protected:
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||
};
|
||||
|
||||
/* The client window is a child of the parent MDI frame, and itself
|
||||
* contains the child MDI frames.
|
||||
* However, you create the MDI children as children of the MDI parent:
|
||||
* only in the implementation does the client window become the parent
|
||||
* of the children. Phew! So the children are sort of 'adopted'...
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxWindow
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||
public:
|
||||
public:
|
||||
wxMDIClientWindow() { }
|
||||
virtual ~wxMDIClientWindow();
|
||||
|
||||
wxMDIClientWindow() ;
|
||||
inline wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
|
||||
{
|
||||
CreateClient(parent, style);
|
||||
}
|
||||
|
||||
virtual ~wxMDIClientWindow();
|
||||
|
||||
// Note: this is virtual, to allow overridden behaviour.
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
// Explicitly call default scroll behaviour
|
||||
void OnScroll(wxScrollEvent& event);
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent,
|
||||
long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
protected:
|
||||
// Gets the size available for subwindows after menu size, toolbar size
|
||||
// and status bar size have been subtracted. If you want to manage your own
|
||||
// toolbar(s), don't call SetToolBar.
|
||||
void DoGetClientSize(int *width, int *height) const;
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_MDI_H_
|
||||
#endif // _WX_OSX_CARBON_MDI_H_
|
||||
|
Reference in New Issue
Block a user