1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-01-22 21:28:01 -05:00
|
|
|
// Name: wx/gtk1/mdi.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 13:03:18 -05:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __MDIH__
|
|
|
|
#define __MDIH__
|
|
|
|
|
|
|
|
#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
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-11-12 16:37:46 -05:00
|
|
|
extern WXDLLEXPORT_DATA(const char) wxStatusLineNameStr[];
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIParentFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-04-11 18:43:52 -04:00
|
|
|
public:
|
2000-07-15 15:51:35 -04:00
|
|
|
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();
|
|
|
|
|
|
|
|
(void)Create(parent, id, title, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxMDIParentFrame();
|
1999-11-05 10:54:10 -05:00
|
|
|
bool Create( wxWindow *parent,
|
2000-08-10 07:00:06 -04:00
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
|
|
|
const wxString& name = wxFrameNameStr );
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
wxMDIChildFrame *GetActiveChild() const;
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
wxMDIClientWindow *GetClientWindow() const;
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual wxMDIClientWindow *OnCreateClient();
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual void Cascade() {}
|
2005-03-21 07:27:49 -05:00
|
|
|
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) {}
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual void ArrangeIcons() {}
|
|
|
|
virtual void ActivateNext();
|
|
|
|
virtual void ActivatePrevious();
|
1998-07-22 18:13:31 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// implementation
|
1999-04-11 18:43:52 -04:00
|
|
|
|
|
|
|
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();
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init();
|
|
|
|
|
2000-08-10 06:59:02 -04:00
|
|
|
virtual void DoGetClientSize(int *width, int *height) const;
|
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
private:
|
|
|
|
friend class wxMDIChildFrame;
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIChildFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxFrame
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-11-05 10:54:10 -05:00
|
|
|
public:
|
1999-04-11 18:43:52 -04:00
|
|
|
wxMDIChildFrame();
|
1998-05-20 10:01:55 -04:00
|
|
|
wxMDIChildFrame( wxMDIParentFrame *parent,
|
2000-08-10 06:59:02 -04:00
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr );
|
|
|
|
|
|
|
|
virtual ~wxMDIChildFrame();
|
1998-05-20 10:01:55 -04:00
|
|
|
bool Create( wxMDIParentFrame *parent,
|
2000-08-10 06:59:02 -04:00
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr );
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
|
|
|
virtual wxMenuBar *GetMenuBar() const;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual void AddChild( wxWindowBase *child );
|
1998-07-04 11:17:59 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual void Activate();
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-06-14 19:04:05 -04:00
|
|
|
#if wxUSE_STATUSBAR
|
1998-07-29 09:21:22 -04:00
|
|
|
// no status bars
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
|
2000-07-15 15:51:35 -04:00
|
|
|
long WXUNUSED(style) = 1,
|
1999-10-04 16:15:38 -04:00
|
|
|
wxWindowID WXUNUSED(id) = 1,
|
|
|
|
const wxString& WXUNUSED(name) = wxEmptyString)
|
1999-11-05 10:54:10 -05:00
|
|
|
{ return (wxStatusBar*)NULL; }
|
1999-10-04 16:15:38 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
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)[] ) {}
|
1999-06-14 19:04:05 -04:00
|
|
|
#endif
|
1998-07-29 09:21:22 -04:00
|
|
|
|
|
|
|
// no size hints
|
2004-09-30 12:37:58 -04:00
|
|
|
virtual void DoSetSizeHints( int WXUNUSED(minW),
|
2005-11-04 06:11:22 -05:00
|
|
|
int WXUNUSED(minH),
|
|
|
|
int WXUNUSED(maxW) = wxDefaultCoord,
|
|
|
|
int WXUNUSED(maxH) = wxDefaultCoord,
|
|
|
|
int WXUNUSED(incW) = wxDefaultCoord,
|
|
|
|
int WXUNUSED(incH) = wxDefaultCoord) {}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-06-14 19:04:05 -04:00
|
|
|
#if wxUSE_TOOLBAR
|
2005-03-20 10:10:30 -05:00
|
|
|
// no toolbar
|
2000-08-10 06:59:02 -04:00
|
|
|
virtual wxToolBar* CreateToolBar( long WXUNUSED(style),
|
|
|
|
wxWindowID WXUNUSED(id),
|
|
|
|
const wxString& WXUNUSED(name) )
|
|
|
|
{ return (wxToolBar*)NULL; }
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
|
2005-03-20 10:04:27 -05:00
|
|
|
#endif // wxUSE_TOOLBAR
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1998-07-29 09:21:22 -04:00
|
|
|
// no icon
|
2005-03-20 10:10:30 -05:00
|
|
|
virtual void SetIcons(const wxIconBundle& icons )
|
|
|
|
{ wxTopLevelWindowBase::SetIcons(icons); }
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
// no title
|
2005-11-04 06:11:22 -05:00
|
|
|
virtual void SetTitle( const wxString &title );
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1998-07-29 09:21:22 -04:00
|
|
|
// no maximize etc
|
2005-03-20 10:04:27 -05:00
|
|
|
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; }
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual void Restore() {}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2005-03-20 10:04:27 -05:00
|
|
|
virtual bool IsTopLevel() const { return false; }
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
void OnActivate( wxActivateEvent& event );
|
|
|
|
void OnMenuHighlight( wxMenuEvent& event );
|
|
|
|
|
|
|
|
// implementation
|
|
|
|
|
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;
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2000-08-10 06:59:02 -04:00
|
|
|
protected:
|
2002-06-02 10:24:29 -04:00
|
|
|
// 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);
|
2000-08-10 06:59:02 -04:00
|
|
|
virtual void DoGetClientSize( int *width, int *height ) const;
|
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
private:
|
2000-07-15 15:51:35 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-11-05 10:54:10 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIClientWindow
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxWindow
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-04-11 18:43:52 -04:00
|
|
|
public:
|
1999-08-16 08:18:40 -04:00
|
|
|
wxMDIClientWindow();
|
1998-07-04 11:17:59 -04:00
|
|
|
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxMDIClientWindow();
|
1998-07-04 11:17:59 -04:00
|
|
|
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
|
1999-11-05 10:54:10 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __MDIH__
|