1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: frame.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 13:03:18 -05:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
1998-07-23 12:06:23 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKFRAMEH__
|
|
|
|
#define __GTKFRAMEH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/window.h"
|
1999-01-04 08:52:06 -05:00
|
|
|
#include "wx/icon.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-07-22 18:13:31 -04:00
|
|
|
class wxMDIChildFrame;
|
1998-07-29 09:21:22 -04:00
|
|
|
class wxMDIClientWindow;
|
|
|
|
class wxMenu;
|
|
|
|
class wxMenuBar;
|
|
|
|
class wxToolBar;
|
|
|
|
class wxStatusBar;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
class wxFrame;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern const char *wxFrameNameStr;
|
1998-07-29 09:21:22 -04:00
|
|
|
extern const char *wxToolBarNameStr;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxFrame: public wxWindow
|
|
|
|
{
|
1998-07-24 15:05:25 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
1998-07-23 12:06:23 -04:00
|
|
|
public:
|
1998-07-24 15:05:25 -04:00
|
|
|
|
1998-07-23 12:06:23 -04: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 );
|
1998-08-14 18:53:21 -04:00
|
|
|
virtual void Centre( int direction = wxHORIZONTAL );
|
1998-07-23 12:06:23 -04:00
|
|
|
|
|
|
|
virtual void GetClientSize( int *width, int *height ) const;
|
1998-12-26 15:09:03 -05:00
|
|
|
wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); }
|
|
|
|
|
1998-08-08 09:44:36 -04:00
|
|
|
virtual void SetClientSize( int const width, int const height );
|
1998-08-17 14:25:14 -04:00
|
|
|
|
1998-11-11 09:19:46 -05:00
|
|
|
virtual void SetSize( int x, int y, int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO );
|
1998-11-15 12:57:55 -05:00
|
|
|
virtual void SetSize( int width, int height );
|
1998-11-11 09:19:46 -05:00
|
|
|
|
1998-07-27 16:50:48 -04:00
|
|
|
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
|
|
|
|
const wxString& name = "statusBar");
|
1998-08-12 07:44:33 -04:00
|
|
|
virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id,
|
|
|
|
const wxString& name );
|
|
|
|
virtual wxStatusBar *GetStatusBar() const;
|
1998-10-15 12:14:55 -04:00
|
|
|
inline void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; }
|
1998-07-23 12:06:23 -04:00
|
|
|
virtual void SetStatusText( const wxString &text, int number = 0 );
|
1998-08-12 07:44:33 -04:00
|
|
|
virtual void SetStatusWidths( int n, const int widths_field[] );
|
1998-07-23 12:06:23 -04:00
|
|
|
|
1998-08-17 14:25:14 -04:00
|
|
|
virtual wxToolBar* CreateToolBar( long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1,
|
1998-07-27 16:50:48 -04:00
|
|
|
const wxString& name = wxToolBarNameStr);
|
1998-08-12 07:44:33 -04:00
|
|
|
virtual wxToolBar *OnCreateToolBar( long style, wxWindowID id, const wxString& name );
|
|
|
|
virtual wxToolBar *GetToolBar(void) const;
|
1998-10-15 12:14:55 -04:00
|
|
|
inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
|
1998-08-17 14:25:14 -04:00
|
|
|
|
1998-07-24 15:05:25 -04:00
|
|
|
virtual void SetMenuBar( wxMenuBar *menuBar );
|
1998-08-12 07:44:33 -04:00
|
|
|
virtual wxMenuBar *GetMenuBar() const;
|
1998-07-23 12:06:23 -04:00
|
|
|
|
1998-07-29 09:21:22 -04:00
|
|
|
virtual void SetTitle( const wxString &title );
|
|
|
|
virtual wxString GetTitle() const { return m_title; }
|
1998-08-17 14:25:14 -04:00
|
|
|
|
1998-07-29 09:21:22 -04:00
|
|
|
virtual void SetIcon( const wxIcon &icon );
|
1998-08-15 06:52:09 -04:00
|
|
|
virtual void Iconize( bool WXUNUSED(iconize)) { }
|
|
|
|
virtual bool IsIconized(void) const { return FALSE; }
|
|
|
|
bool Iconized(void) const { return IsIconized(); }
|
1998-08-17 14:25:14 -04:00
|
|
|
virtual void Maximize(bool WXUNUSED(maximize)) {}
|
1998-08-15 06:52:09 -04:00
|
|
|
virtual void Restore(void) {}
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-07-24 15:05:25 -04:00
|
|
|
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
1998-07-23 12:06:23 -04:00
|
|
|
void OnSize( wxSizeEvent &event );
|
|
|
|
void OnCloseWindow( wxCloseEvent& event );
|
1998-12-04 02:43:56 -05:00
|
|
|
void OnIdle(wxIdleEvent& event );
|
1998-07-23 12:06:23 -04:00
|
|
|
|
1998-10-29 13:03:18 -05:00
|
|
|
// implementation
|
|
|
|
|
1998-07-23 12:06:23 -04:00
|
|
|
virtual void GtkOnSize( int x, int y, int width, int height );
|
1998-11-03 06:19:58 -05:00
|
|
|
virtual wxPoint GetClientAreaOrigin() const;
|
1998-07-23 12:06:23 -04:00
|
|
|
void DoMenuUpdates();
|
|
|
|
void DoMenuUpdates(wxMenu* menu);
|
|
|
|
|
|
|
|
wxMenuBar *m_frameMenuBar;
|
|
|
|
wxStatusBar *m_frameStatusBar;
|
1998-07-24 15:05:25 -04:00
|
|
|
wxToolBar *m_frameToolBar;
|
1998-07-23 12:06:23 -04:00
|
|
|
wxString m_title;
|
1998-07-27 19:01:43 -04:00
|
|
|
wxIcon m_icon;
|
1998-12-04 02:43:56 -05:00
|
|
|
int m_miniEdge,m_miniTitle;
|
1998-07-23 12:06:23 -04:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKFRAMEH__
|