2004-03-23 12:35:05 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: frame.h
|
|
|
|
// Purpose: wxFrame class
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Stefan Csomor
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2004-03-23 12:35:05 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_FRAME_H_
|
|
|
|
#define _WX_FRAME_H_
|
|
|
|
|
|
|
|
#include "wx/window.h"
|
|
|
|
#include "wx/toolbar.h"
|
|
|
|
#include "wx/accel.h"
|
|
|
|
#include "wx/icon.h"
|
|
|
|
|
2006-01-16 09:59:55 -05:00
|
|
|
WXDLLEXPORT_DATA(extern const wxChar) wxToolBarNameStr[];
|
2004-03-23 12:35:05 -05:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMenuBar;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxStatusBar;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMacToolTip ;
|
2004-03-23 12:35:05 -05:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxFrame: public wxFrameBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// construction
|
|
|
|
wxFrame() { Init(); }
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
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,
|
|
|
|
const wxString& name = wxFrameNameStr);
|
|
|
|
|
|
|
|
virtual ~wxFrame();
|
|
|
|
|
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
2005-07-27 10:53:12 -04:00
|
|
|
// get the origin of the client area (which may be different from (0, 0)
|
|
|
|
// if the frame has a toolbar) in client coordinates
|
|
|
|
virtual wxPoint GetClientAreaOrigin() const;
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
// override some more virtuals
|
|
|
|
virtual bool Enable(bool enable = TRUE) ;
|
|
|
|
|
|
|
|
// event handlers
|
|
|
|
void OnActivate(wxActivateEvent& event);
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
|
|
|
|
|
|
|
// Toolbar
|
|
|
|
#if wxUSE_TOOLBAR
|
|
|
|
virtual wxToolBar* CreateToolBar(long style = -1,
|
|
|
|
wxWindowID id = -1,
|
|
|
|
const wxString& name = wxToolBarNameStr);
|
|
|
|
|
2005-07-27 10:53:12 -04:00
|
|
|
virtual void SetToolBar(wxToolBar *toolbar);
|
2004-03-23 12:35:05 -05:00
|
|
|
#endif // wxUSE_TOOLBAR
|
|
|
|
|
|
|
|
// Status bar
|
|
|
|
#if wxUSE_STATUSBAR
|
|
|
|
virtual wxStatusBar* OnCreateStatusBar(int number = 1,
|
|
|
|
long style = wxST_SIZEGRIP,
|
|
|
|
wxWindowID id = 0,
|
|
|
|
const wxString& name = wxStatusLineNameStr);
|
|
|
|
#endif // wxUSE_STATUSBAR
|
|
|
|
|
|
|
|
// called by wxWindow whenever it gets focus
|
|
|
|
void SetLastFocus(wxWindow *win) { m_winLastFocused = win; }
|
|
|
|
wxWindow *GetLastFocus() const { return m_winLastFocused; }
|
|
|
|
|
2006-02-08 16:47:09 -05:00
|
|
|
void PositionBars();
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2006-02-08 16:47:09 -05:00
|
|
|
#if wxUSE_TOOLBAR
|
|
|
|
virtual void PositionToolBar();
|
|
|
|
#endif
|
|
|
|
#if wxUSE_STATUSBAR
|
|
|
|
virtual void PositionStatusBar();
|
|
|
|
#endif
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
// override base class virtuals
|
|
|
|
virtual void DoGetClientSize(int *width, int *height) const;
|
|
|
|
virtual void DoSetClientSize(int width, int height);
|
|
|
|
|
|
|
|
virtual void DetachMenuBar();
|
|
|
|
virtual void AttachMenuBar(wxMenuBar *menubar);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// the last focused child: we restore focus to it on activation
|
|
|
|
wxWindow *m_winLastFocused;
|
|
|
|
|
2005-04-01 02:05:52 -05:00
|
|
|
virtual bool MacIsChildOfClientArea( const wxWindow* child ) const ;
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_FRAME_H_
|