1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: frame.h
|
|
|
|
// Purpose: wxFrame class
|
1999-10-07 04:44:22 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-27 22:47:04 +00:00
|
|
|
// Created: 10/27/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-07 04:44:22 +00:00
|
|
|
// Copyright: (c) David Webster
|
2003-03-17 10:34:04 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_FRAME_H_
|
|
|
|
#define _WX_FRAME_H_
|
|
|
|
|
2000-02-28 04:40:52 +00:00
|
|
|
//
|
|
|
|
// Get the default resource ID's for frames
|
|
|
|
//
|
2002-01-21 19:57:54 +00:00
|
|
|
#include "wx/os2/wxrsc.h"
|
2000-02-28 04:40:52 +00:00
|
|
|
|
2001-10-19 20:35:05 +00:00
|
|
|
class WXDLLEXPORT wxFrame : public wxFrameBase
|
1999-10-25 02:41:20 +00:00
|
|
|
{
|
1999-08-02 04:44:01 +00:00
|
|
|
public:
|
1999-11-19 22:36:55 +00:00
|
|
|
// construction
|
2001-10-19 20:35:05 +00:00
|
|
|
wxFrame() { Init(); }
|
|
|
|
wxFrame( wxWindow* pParent
|
2001-07-06 21:45:11 +00:00
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsTitle
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = wxDEFAULT_FRAME_STYLE
|
|
|
|
,const wxString& rsName = wxFrameNameStr
|
|
|
|
)
|
1999-10-07 04:44:22 +00:00
|
|
|
{
|
1999-11-19 22:36:55 +00:00
|
|
|
Init();
|
|
|
|
|
2000-02-16 21:51:58 +00:00
|
|
|
Create(pParent, vId, rsTitle, rPos, rSize, lStyle, rsName);
|
1999-10-07 04:44:22 +00:00
|
|
|
}
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2000-02-16 21:51:58 +00:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsTitle
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = wxDEFAULT_FRAME_STYLE
|
|
|
|
,const wxString& rsName = wxFrameNameStr
|
|
|
|
);
|
1999-10-07 04:44:22 +00:00
|
|
|
|
2001-10-19 20:35:05 +00:00
|
|
|
virtual ~wxFrame();
|
1999-10-07 04:44:22 +00:00
|
|
|
|
1999-11-19 22:36:55 +00:00
|
|
|
// implement base class pure virtuals
|
2001-10-17 22:25:56 +00:00
|
|
|
#if wxUSE_MENUS_NATIVE
|
2000-02-16 21:51:58 +00:00
|
|
|
virtual void SetMenuBar(wxMenuBar* pMenubar);
|
2001-10-17 22:25:56 +00:00
|
|
|
#endif
|
2000-02-16 21:51:58 +00:00
|
|
|
virtual bool ShowFullScreen( bool bShow
|
|
|
|
,long lStyle = wxFULLSCREEN_ALL
|
|
|
|
);
|
|
|
|
|
1999-10-07 04:44:22 +00:00
|
|
|
|
1999-11-19 22:36:55 +00:00
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
1999-10-07 04:44:22 +00:00
|
|
|
|
2002-01-07 00:44:31 +00:00
|
|
|
virtual void Raise(void);
|
1999-10-07 04:44:22 +00:00
|
|
|
|
1999-11-19 22:36:55 +00:00
|
|
|
// event handlers
|
2000-02-16 21:51:58 +00:00
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
|
1999-10-07 04:44:22 +00:00
|
|
|
|
|
|
|
// Toolbar
|
|
|
|
#if wxUSE_TOOLBAR
|
2003-07-10 10:53:00 +00:00
|
|
|
virtual wxToolBar* CreateToolBar( long lStyle = -1
|
2000-02-16 21:51:58 +00:00
|
|
|
,wxWindowID vId = -1
|
|
|
|
,const wxString& rsName = wxToolBarNameStr
|
|
|
|
);
|
1999-10-07 04:44:22 +00:00
|
|
|
|
2002-07-01 22:22:13 +00:00
|
|
|
virtual wxToolBar* OnCreateToolBar( long lStyle
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsName
|
|
|
|
);
|
2000-02-16 21:51:58 +00:00
|
|
|
virtual void PositionToolBar(void);
|
1999-10-07 04:44:22 +00:00
|
|
|
#endif // wxUSE_TOOLBAR
|
|
|
|
|
|
|
|
// Status bar
|
1999-11-19 22:36:55 +00:00
|
|
|
#if wxUSE_STATUSBAR
|
2000-02-16 21:51:58 +00:00
|
|
|
virtual wxStatusBar* OnCreateStatusBar( int nNumber = 1
|
|
|
|
,long lStyle = wxST_SIZEGRIP
|
|
|
|
,wxWindowID vId = 0
|
|
|
|
,const wxString& rsName = wxStatusLineNameStr
|
|
|
|
);
|
|
|
|
virtual void PositionStatusBar(void);
|
1999-10-07 04:44:22 +00:00
|
|
|
|
1999-11-19 22:36:55 +00: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-10-07 04:44:22 +00:00
|
|
|
|
|
|
|
// TODO: should this go into a wxFrameworkSettings class perhaps?
|
2000-02-16 21:51:58 +00:00
|
|
|
static void UseNativeStatusBar(bool bUseNative)
|
2000-02-17 23:31:03 +00:00
|
|
|
{ m_bUseNativeStatusBar = bUseNative; };
|
1999-11-19 22:36:55 +00:00
|
|
|
static bool UsesNativeStatusBar()
|
2000-02-17 23:31:03 +00:00
|
|
|
{ return m_bUseNativeStatusBar; };
|
1999-10-07 04:44:22 +00:00
|
|
|
#endif // wxUSE_STATUSBAR
|
|
|
|
|
|
|
|
WXHMENU GetWinMenu() const { return m_hMenu; }
|
|
|
|
|
|
|
|
// Returns the origin of client area (may be different from (0,0) if the
|
|
|
|
// frame has a toolbar)
|
|
|
|
virtual wxPoint GetClientAreaOrigin() const;
|
|
|
|
|
1999-11-19 22:36:55 +00:00
|
|
|
// event handlers
|
2000-02-16 21:51:58 +00:00
|
|
|
bool HandlePaint(void);
|
|
|
|
bool HandleSize( int nX
|
|
|
|
,int nY
|
|
|
|
,WXUINT uFlag
|
|
|
|
);
|
|
|
|
bool HandleCommand( WXWORD wId
|
|
|
|
,WXWORD wCmd
|
|
|
|
,WXHWND wControl
|
|
|
|
);
|
|
|
|
bool HandleMenuSelect( WXWORD wItem
|
|
|
|
,WXWORD wFlags
|
|
|
|
,WXHMENU hMenu
|
|
|
|
);
|
|
|
|
|
1999-11-19 22:36:55 +00:00
|
|
|
// tooltip management
|
1999-10-07 04:44:22 +00:00
|
|
|
#if wxUSE_TOOLTIPS
|
2000-02-21 05:12:34 +00:00
|
|
|
WXHWND GetToolTipCtrl(void) const { return m_hWndToolTip; }
|
|
|
|
void SetToolTipCtrl(WXHWND hHwndTT) { m_hWndToolTip = hHwndTT; }
|
1999-10-07 04:44:22 +00:00
|
|
|
#endif // tooltips
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2002-08-30 21:20:42 +00:00
|
|
|
virtual void SendSizeEvent(void);
|
|
|
|
|
2000-10-02 02:45:47 +00:00
|
|
|
void SetClient(WXHWND c_Hwnd);
|
|
|
|
void SetClient(wxWindow* c_Window);
|
|
|
|
wxWindow *GetClient();
|
|
|
|
|
2000-11-17 06:01:48 +00:00
|
|
|
friend MRESULT EXPENTRY wxFrameWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
|
|
|
|
friend MRESULT EXPENTRY wxFrameMainWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
|
|
|
|
|
1999-07-29 05:11:30 +00:00
|
|
|
protected:
|
1999-11-19 22:36:55 +00:00
|
|
|
// common part of all ctors
|
2000-02-16 21:51:58 +00:00
|
|
|
void Init(void);
|
1999-11-19 22:36:55 +00:00
|
|
|
|
2002-01-07 00:44:31 +00:00
|
|
|
virtual WXHICON GetDefaultIcon(void) const;
|
1999-10-07 04:44:22 +00:00
|
|
|
// override base class virtuals
|
2000-02-16 21:51:58 +00:00
|
|
|
virtual void DoGetClientSize( int* pWidth
|
|
|
|
,int* pHeight
|
|
|
|
) const;
|
|
|
|
virtual void DoSetClientSize( int nWidth
|
|
|
|
,int nWeight
|
|
|
|
);
|
2002-01-07 00:44:31 +00:00
|
|
|
inline virtual bool IsMDIChild(void) const { return FALSE; }
|
1999-10-24 15:57:35 +00:00
|
|
|
|
2001-10-17 22:25:56 +00:00
|
|
|
#if wxUSE_MENUS_NATIVE
|
1999-11-19 22:36:55 +00:00
|
|
|
// helper
|
2000-02-16 21:51:58 +00:00
|
|
|
void DetachMenuBar(void);
|
2001-07-13 17:41:54 +00:00
|
|
|
// perform MSW-specific action when menubar is changed
|
|
|
|
virtual void AttachMenuBar(wxMenuBar* pMenubar);
|
1999-10-07 04:44:22 +00:00
|
|
|
// a plug in for MDI frame classes which need to do something special when
|
|
|
|
// the menubar is set
|
2000-02-16 21:51:58 +00:00
|
|
|
virtual void InternalSetMenuBar(void);
|
2001-07-13 17:41:54 +00:00
|
|
|
#endif
|
1999-10-07 04:44:22 +00:00
|
|
|
// propagate our state change to all child frames
|
|
|
|
void IconizeChildFrames(bool bIconize);
|
|
|
|
|
|
|
|
// we add menu bar accel processing
|
|
|
|
bool OS2TranslateMessage(WXMSG* pMsg);
|
|
|
|
|
|
|
|
// window proc for the frames
|
2000-02-16 21:51:58 +00:00
|
|
|
MRESULT OS2WindowProc( WXUINT uMessage
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
1999-10-07 04:44:22 +00:00
|
|
|
|
2000-02-16 21:51:58 +00:00
|
|
|
bool m_bIconized;
|
|
|
|
WXHICON m_hDefaultIcon;
|
1999-10-07 04:44:22 +00:00
|
|
|
|
|
|
|
#if wxUSE_STATUSBAR
|
2000-02-16 21:51:58 +00:00
|
|
|
static bool m_bUseNativeStatusBar;
|
1999-10-07 04:44:22 +00:00
|
|
|
#endif // wxUSE_STATUSBAR
|
|
|
|
|
2000-02-16 21:51:58 +00:00
|
|
|
// Data to save/restore when calling ShowFullScreen
|
|
|
|
long m_lFsStyle; // Passed to ShowFullScreen
|
|
|
|
wxRect m_vFsOldSize;
|
|
|
|
long m_lFsOldWindowStyle;
|
|
|
|
int m_nFsStatusBarFields; // 0 for no status bar
|
|
|
|
int m_nFsStatusBarHeight;
|
|
|
|
int m_nFsToolBarHeight;
|
|
|
|
bool m_bFsIsMaximized;
|
|
|
|
bool m_bFsIsShowing;
|
2001-11-16 18:40:45 +00:00
|
|
|
bool m_bWasMinimized;
|
2000-08-21 11:08:33 +00:00
|
|
|
bool m_bIsShown;
|
2000-02-16 21:51:58 +00:00
|
|
|
|
1999-10-07 04:44:22 +00:00
|
|
|
private:
|
|
|
|
#if wxUSE_TOOLTIPS
|
2000-02-17 23:31:03 +00:00
|
|
|
WXHWND m_hWndToolTip;
|
1999-10-07 04:44:22 +00:00
|
|
|
#endif // tooltips
|
|
|
|
|
2000-03-22 23:22:48 +00:00
|
|
|
//
|
2000-11-17 06:01:48 +00:00
|
|
|
// Handles to child windows of the Frame, and the frame itself,
|
|
|
|
// that we don't have child objects for (m_hWnd in wxWindow is the
|
|
|
|
// handle of the Frame's client window!
|
2000-03-22 23:22:48 +00:00
|
|
|
//
|
|
|
|
WXHWND m_hTitleBar;
|
|
|
|
WXHWND m_hHScroll;
|
|
|
|
WXHWND m_hVScroll;
|
|
|
|
|
|
|
|
//
|
2000-07-15 19:51:35 +00:00
|
|
|
// Swp structures for various client data
|
2000-03-22 23:22:48 +00:00
|
|
|
// DW: Better off in attached RefData?
|
|
|
|
//
|
|
|
|
SWP m_vSwpTitleBar;
|
|
|
|
SWP m_vSwpMenuBar;
|
|
|
|
SWP m_vSwpHScroll;
|
|
|
|
SWP m_vSwpVScroll;
|
|
|
|
SWP m_vSwpStatusBar;
|
|
|
|
SWP m_vSwpToolBar;
|
|
|
|
|
1999-10-07 04:44:22 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2001-10-19 20:35:05 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
1999-07-29 05:11:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_FRAME_H_
|
1999-10-07 04:44:22 +00:00
|
|
|
|