1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: mdi.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 13:03:18 -05:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1998-05-20 10:01:55 -04:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __MDIH__
|
|
|
|
#define __MDIH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
#include "wx/panel.h"
|
|
|
|
#include "wx/frame.h"
|
1998-07-22 18:13:31 -04:00
|
|
|
#include "wx/toolbar.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMDIParentFrame;
|
|
|
|
class wxMDIClientWindow;
|
|
|
|
class wxMDIChildFrame;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1999-04-14 07:56:15 -04:00
|
|
|
extern const wxChar* wxFrameNameStr;
|
|
|
|
extern const wxChar* wxStatusLineNameStr;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIParentFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMDIParentFrame: public wxFrame
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
|
|
|
|
|
|
|
friend class wxMDIChildFrame;
|
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
public:
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
wxMDIParentFrame(void);
|
|
|
|
wxMDIParentFrame( wxWindow *parent,
|
1998-07-04 11:17:59 -04:00
|
|
|
wxWindowID id, const wxString& title,
|
1998-05-20 10:01:55 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
1998-05-20 10:01:55 -04:00
|
|
|
const wxString& name = wxFrameNameStr );
|
|
|
|
~wxMDIParentFrame(void);
|
|
|
|
bool Create( wxWindow *parent,
|
1998-07-04 11:17:59 -04:00
|
|
|
wxWindowID id, const wxString& title,
|
1998-05-20 10:01:55 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
1998-05-20 10:01:55 -04:00
|
|
|
const wxString& name = wxFrameNameStr );
|
|
|
|
|
|
|
|
|
1998-07-22 18:13:31 -04:00
|
|
|
void GetClientSize(int *width, int *height) const;
|
1999-04-11 18:43:52 -04:00
|
|
|
wxMDIChildFrame *GetActiveChild() const;
|
1998-07-22 18:13:31 -04:00
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
wxMDIClientWindow *GetClientWindow() const;
|
|
|
|
virtual wxMDIClientWindow *OnCreateClient();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual void Cascade() {}
|
|
|
|
virtual void Tile() {}
|
|
|
|
virtual void ArrangeIcons() {}
|
|
|
|
virtual void ActivateNext();
|
|
|
|
virtual void ActivatePrevious();
|
1998-07-22 18:13:31 -04:00
|
|
|
|
|
|
|
void OnActivate( wxActivateEvent& event );
|
|
|
|
void OnSysColourChanged( wxSysColourChangedEvent& event );
|
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
// implementation
|
|
|
|
|
|
|
|
wxMDIClientWindow *m_clientWindow;
|
|
|
|
bool m_justInserted;
|
|
|
|
|
1998-07-22 18:13:31 -04:00
|
|
|
virtual void GtkOnSize( int x, int y, int width, int height );
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual void OnInternalIdle();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-07-22 18:13:31 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIChildFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-07-29 09:21:22 -04:00
|
|
|
class wxMDIChildFrame: public wxFrame
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
wxMDIChildFrame();
|
1998-05-20 10:01:55 -04:00
|
|
|
wxMDIChildFrame( wxMDIParentFrame *parent,
|
1998-07-04 11:17:59 -04:00
|
|
|
wxWindowID id, const wxString& title,
|
1998-05-20 10:01:55 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
|
1998-05-20 10:01:55 -04:00
|
|
|
~wxMDIChildFrame(void);
|
|
|
|
bool Create( wxMDIParentFrame *parent,
|
1998-07-04 11:17:59 -04:00
|
|
|
wxWindowID id, const wxString& title,
|
1998-05-20 10:01:55 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
|
1998-07-29 09:21:22 -04:00
|
|
|
|
|
|
|
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
1999-02-18 09:55:34 -05:00
|
|
|
virtual wxMenuBar *GetMenuBar() const;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-07-29 09:21:22 -04:00
|
|
|
virtual void GetClientSize( int *width, int *height ) const;
|
|
|
|
virtual void AddChild( wxWindow *child );
|
1998-07-04 11:17:59 -04:00
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual void Activate();
|
1998-07-29 09:21:22 -04:00
|
|
|
|
|
|
|
// no status bars
|
1998-08-22 23:22:56 -04:00
|
|
|
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1,
|
|
|
|
wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; }
|
1998-07-29 09:21:22 -04:00
|
|
|
virtual wxStatusBar *GetStatusBar() { return (wxStatusBar*)NULL; }
|
|
|
|
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {}
|
|
|
|
virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {}
|
|
|
|
|
|
|
|
// no size hints
|
1999-02-22 06:01:13 -05:00
|
|
|
virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH),
|
|
|
|
int WXUNUSED(maxW), int WXUNUSED(maxH),
|
|
|
|
int WXUNUSED(incW) )
|
|
|
|
{
|
|
|
|
}
|
1998-07-29 09:21:22 -04:00
|
|
|
|
|
|
|
// no toolbar bars
|
|
|
|
virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
|
|
|
|
const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; }
|
1999-02-17 14:26:42 -05:00
|
|
|
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
|
1998-07-29 09:21:22 -04:00
|
|
|
|
|
|
|
// no icon
|
|
|
|
void SetIcon( const wxIcon &icon ) { m_icon = icon; }
|
|
|
|
|
|
|
|
// no title
|
|
|
|
void SetTitle( const wxString &title ) { m_title = title; }
|
|
|
|
wxString GetTitle() const { return m_title; }
|
|
|
|
|
|
|
|
// no maximize etc
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual void Maximize( bool WXUNUSED(maximize) ) {}
|
|
|
|
virtual void Restore() {}
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-08-15 06:52:09 -04:00
|
|
|
void OnActivate( wxActivateEvent &event );
|
1998-07-22 18:13:31 -04:00
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
// implementation
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-07-22 18:13:31 -04:00
|
|
|
wxMenuBar *m_menuBar;
|
|
|
|
GtkNotebookPage *m_page;
|
1999-04-11 18:43:52 -04:00
|
|
|
bool m_justInserted;
|
1998-07-22 18:13:31 -04:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIClientWindow
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMDIClientWindow: public wxWindow
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
public:
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
wxMDIClientWindow(void);
|
1998-07-04 11:17:59 -04:00
|
|
|
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
|
1998-05-20 10:01:55 -04:00
|
|
|
~wxMDIClientWindow(void);
|
1998-07-04 11:17:59 -04:00
|
|
|
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __MDIH__
|
|
|
|
|