1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1999-11-16 16:31:40 -05:00
|
|
|
// Name: wx/msw/frame.h
|
2001-10-19 16:35:05 -04:00
|
|
|
// Purpose: wxFrame class
|
1998-05-20 10:12:05 -04:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 05:34:04 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_FRAME_H_
|
|
|
|
#define _WX_FRAME_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-05-18 20:53:27 -04:00
|
|
|
#pragma interface "frame.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
|
|
|
|
2001-10-19 16:35:05 -04:00
|
|
|
class WXDLLEXPORT wxFrame : public wxFrameBase
|
1999-01-31 18:38:10 -05:00
|
|
|
{
|
1998-05-20 10:12:05 -04:00
|
|
|
public:
|
1999-11-16 16:31:40 -05:00
|
|
|
// construction
|
2001-10-19 16:35:05 -04:00
|
|
|
wxFrame() { Init(); }
|
|
|
|
wxFrame(wxWindow *parent,
|
2001-06-26 16:59:19 -04:00
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr)
|
1999-01-31 18:38:10 -05:00
|
|
|
{
|
1999-11-16 16:31:40 -05:00
|
|
|
Init();
|
|
|
|
|
1999-01-31 18:38:10 -05:00
|
|
|
Create(parent, id, title, pos, size, style, name);
|
|
|
|
}
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-01-31 18:38:10 -05:00
|
|
|
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);
|
1999-02-14 16:59:48 -05:00
|
|
|
|
2001-10-19 16:35:05 -04:00
|
|
|
virtual ~wxFrame();
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-11-16 16:31:40 -05:00
|
|
|
// implement base class pure virtuals
|
2000-02-08 14:14:50 -05:00
|
|
|
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
|
2001-09-23 20:34:14 -04:00
|
|
|
virtual void Raise();
|
1999-05-18 20:53:27 -04:00
|
|
|
|
1999-11-16 16:31:40 -05:00
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-11-16 16:31:40 -05:00
|
|
|
// event handlers
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-01-31 18:38:10 -05:00
|
|
|
// Toolbar
|
1999-06-13 18:54:04 -04:00
|
|
|
#if wxUSE_TOOLBAR
|
2003-07-10 06:53:00 -04:00
|
|
|
virtual wxToolBar* CreateToolBar(long style = -1,
|
1999-01-31 18:38:10 -05:00
|
|
|
wxWindowID id = -1,
|
|
|
|
const wxString& name = wxToolBarNameStr);
|
|
|
|
|
|
|
|
virtual void PositionToolBar();
|
1999-06-13 18:54:04 -04:00
|
|
|
#endif // wxUSE_TOOLBAR
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-01-31 18:38:10 -05:00
|
|
|
// Status bar
|
1999-11-16 16:31:40 -05:00
|
|
|
#if wxUSE_STATUSBAR
|
|
|
|
virtual wxStatusBar* OnCreateStatusBar(int number = 1,
|
|
|
|
long style = wxST_SIZEGRIP,
|
|
|
|
wxWindowID id = 0,
|
|
|
|
const wxString& name = wxStatusLineNameStr);
|
1999-01-31 18:38:10 -05:00
|
|
|
|
|
|
|
virtual void PositionStatusBar();
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-11-16 16:31:40 -05:00
|
|
|
// Hint to tell framework which status bar to use: the default is to use
|
|
|
|
// native one for the platforms which support it (Win32), the generic one
|
|
|
|
// otherwise
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-01-31 18:38:10 -05:00
|
|
|
// TODO: should this go into a wxFrameworkSettings class perhaps?
|
1999-11-16 16:31:40 -05:00
|
|
|
static void UseNativeStatusBar(bool useNative)
|
|
|
|
{ m_useNativeStatusBar = useNative; };
|
|
|
|
static bool UsesNativeStatusBar()
|
|
|
|
{ return m_useNativeStatusBar; };
|
1999-06-13 18:54:04 -04:00
|
|
|
#endif // wxUSE_STATUSBAR
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-05-18 20:53:27 -04:00
|
|
|
WXHMENU GetWinMenu() const { return m_hMenu; }
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-11-16 16:31:40 -05:00
|
|
|
// event handlers
|
1999-05-18 20:53:27 -04:00
|
|
|
bool HandlePaint();
|
|
|
|
bool HandleSize(int x, int y, WXUINT flag);
|
|
|
|
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
|
|
|
bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu);
|
2002-02-23 18:16:32 -05:00
|
|
|
bool HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup);
|
1999-05-18 20:53:27 -04:00
|
|
|
|
1999-11-16 16:31:40 -05:00
|
|
|
// tooltip management
|
1999-01-31 18:38:10 -05:00
|
|
|
#if wxUSE_TOOLTIPS
|
1999-05-13 17:21:04 -04:00
|
|
|
WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
|
|
|
|
void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; }
|
1999-01-31 18:38:10 -05:00
|
|
|
#endif // tooltips
|
|
|
|
|
2001-03-31 13:43:54 -05:00
|
|
|
// a MSW only function which sends a size event to the window using its
|
|
|
|
// current size - this has an effect of refreshing the window layout
|
2002-08-22 13:03:38 -04:00
|
|
|
virtual void SendSizeEvent();
|
2001-03-31 13:43:54 -05:00
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
protected:
|
1999-11-16 16:31:40 -05:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
// override base class virtuals
|
|
|
|
virtual void DoGetClientSize(int *width, int *height) const;
|
|
|
|
virtual void DoSetClientSize(int width, int height);
|
1999-05-09 20:42:57 -04:00
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#if wxUSE_MENUS_NATIVE
|
2001-07-10 08:25:46 -04:00
|
|
|
// perform MSW-specific action when menubar is changed
|
|
|
|
virtual void AttachMenuBar(wxMenuBar *menubar);
|
|
|
|
|
1999-05-18 20:53:27 -04:00
|
|
|
// a plug in for MDI frame classes which need to do something special when
|
|
|
|
// the menubar is set
|
|
|
|
virtual void InternalSetMenuBar();
|
2001-06-26 16:59:19 -04:00
|
|
|
#endif // wxUSE_MENUS_NATIVE
|
1999-05-18 20:53:27 -04:00
|
|
|
|
1999-01-31 18:38:10 -05:00
|
|
|
// propagate our state change to all child frames
|
|
|
|
void IconizeChildFrames(bool bIconize);
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-05-18 20:53:27 -04:00
|
|
|
// we add menu bar accel processing
|
|
|
|
bool MSWTranslateMessage(WXMSG* pMsg);
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
// window proc for the frames
|
|
|
|
long MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
2001-05-07 21:09:21 -04:00
|
|
|
|
2003-07-12 19:09:04 -04:00
|
|
|
// handle WM_INITMENUPOPUP message
|
|
|
|
bool HandleInitMenuPopup(WXHMENU hMenu);
|
2003-07-09 06:15:21 -04:00
|
|
|
|
2000-11-25 18:13:29 -05:00
|
|
|
virtual bool IsMDIChild() const { return FALSE; }
|
1999-05-13 17:21:04 -04:00
|
|
|
|
2001-09-23 20:34:14 -04:00
|
|
|
// get default (wxWindows) icon for the frame
|
|
|
|
virtual WXHICON GetDefaultIcon() const;
|
1999-06-13 18:54:04 -04:00
|
|
|
|
|
|
|
#if wxUSE_STATUSBAR
|
1999-01-31 18:38:10 -05:00
|
|
|
static bool m_useNativeStatusBar;
|
1999-06-13 18:54:04 -04:00
|
|
|
#endif // wxUSE_STATUSBAR
|
|
|
|
|
2000-02-08 14:14:50 -05:00
|
|
|
// Data to save/restore when calling ShowFullScreen
|
|
|
|
int m_fsStatusBarFields; // 0 for no status bar
|
|
|
|
int m_fsStatusBarHeight;
|
|
|
|
int m_fsToolBarHeight;
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
private:
|
1999-01-31 18:38:10 -05:00
|
|
|
#if wxUSE_TOOLTIPS
|
|
|
|
WXHWND m_hwndToolTip;
|
|
|
|
#endif // tooltips
|
|
|
|
|
2001-11-13 20:26:14 -05:00
|
|
|
// used by IconizeChildFrames(), see comments there
|
|
|
|
bool m_wasMinimized;
|
|
|
|
|
1999-01-31 18:38:10 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
2001-10-19 16:35:05 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_FRAME_H_
|