1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: frame.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Created: 01/02/97
|
|
|
|
// Id:
|
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
1998-07-23 16:06:23 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKFRAMEH__
|
|
|
|
#define __GTKFRAMEH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/window.h"
|
|
|
|
#include "wx/menu.h"
|
|
|
|
#include "wx/statusbr.h"
|
1998-07-24 19:05:25 +00:00
|
|
|
#include "wx/toolbar.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-07-22 22:13:31 +00:00
|
|
|
class wxMDIChildFrame;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
class wxFrame;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern const char *wxFrameNameStr;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxFrame: public wxWindow
|
|
|
|
{
|
1998-07-24 19:05:25 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
1998-07-23 16:06:23 +00:00
|
|
|
public:
|
1998-07-24 19:05:25 +00:00
|
|
|
|
1998-07-23 16:06:23 +00:00
|
|
|
wxFrame();
|
|
|
|
wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
|
|
|
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE, 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, const wxString &name = wxFrameNameStr );
|
|
|
|
~wxFrame();
|
|
|
|
bool Destroy();
|
|
|
|
|
|
|
|
virtual bool Show( bool show );
|
|
|
|
virtual void Enable( bool enable );
|
|
|
|
|
|
|
|
virtual void GetClientSize( int *width, int *height ) const;
|
1998-07-24 19:05:25 +00:00
|
|
|
|
|
|
|
// set minimal/maxmimal size for the frame
|
|
|
|
virtual void SetSizeHints( int minW, int minH, int maxW, int maxH, int incW = -1 );
|
1998-07-23 16:06:23 +00:00
|
|
|
|
1998-07-27 20:50:48 +00:00
|
|
|
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
|
|
|
|
const wxString& name = "statusBar");
|
1998-07-24 19:05:25 +00:00
|
|
|
virtual wxStatusBar *GetStatusBar();
|
1998-07-23 16:06:23 +00:00
|
|
|
virtual void SetStatusText( const wxString &text, int number = 0 );
|
|
|
|
virtual void SetStatusWidths( int n, int *width );
|
|
|
|
|
1998-07-27 20:50:48 +00:00
|
|
|
virtual wxToolBar* CreateToolBar( long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1,
|
|
|
|
const wxString& name = wxToolBarNameStr);
|
1998-07-24 19:05:25 +00:00
|
|
|
virtual wxToolBar *GetToolBar();
|
|
|
|
|
|
|
|
virtual void SetMenuBar( wxMenuBar *menuBar );
|
|
|
|
virtual wxMenuBar *GetMenuBar();
|
1998-07-23 16:06:23 +00:00
|
|
|
|
|
|
|
void SetTitle( const wxString &title );
|
|
|
|
wxString GetTitle() const { return m_title; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-07-24 19:05:25 +00:00
|
|
|
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
1998-07-23 16:06:23 +00:00
|
|
|
void OnSize( wxSizeEvent &event );
|
|
|
|
void OnCloseWindow( wxCloseEvent& event );
|
|
|
|
void OnIdle(wxIdleEvent& event);
|
|
|
|
|
1998-07-24 19:05:25 +00:00
|
|
|
virtual void AddChild( wxWindow *child );
|
1998-07-23 16:06:23 +00:00
|
|
|
virtual void GtkOnSize( int x, int y, int width, int height );
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend wxWindow;
|
|
|
|
friend wxMDIChildFrame;
|
|
|
|
|
|
|
|
// update frame's menus (called from OnIdle)
|
|
|
|
void DoMenuUpdates();
|
|
|
|
void DoMenuUpdates(wxMenu* menu);
|
|
|
|
|
|
|
|
GtkWidget *m_mainWindow;
|
|
|
|
wxMenuBar *m_frameMenuBar;
|
|
|
|
wxStatusBar *m_frameStatusBar;
|
1998-07-24 19:05:25 +00:00
|
|
|
wxToolBar *m_frameToolBar;
|
|
|
|
int m_toolBarHeight;
|
1998-07-23 16:06:23 +00:00
|
|
|
bool m_doingOnSize;
|
1998-07-24 19:05:25 +00:00
|
|
|
bool m_addPrivateChild; // for toolbar (and maybe menubar)
|
1998-07-23 16:06:23 +00:00
|
|
|
wxString m_title;
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKFRAMEH__
|