1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/os2/frame.h
|
1999-07-29 01:11:30 -04:00
|
|
|
// Purpose: wxFrame class
|
1999-10-07 00:44:22 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-27 18:47:04 -04:00
|
|
|
// Created: 10/27/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-07 00:44:22 -04:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_FRAME_H_
|
|
|
|
#define _WX_FRAME_H_
|
|
|
|
|
2000-02-27 23:40:52 -05:00
|
|
|
//
|
|
|
|
// Get the default resource ID's for frames
|
|
|
|
//
|
2002-01-21 14:57:54 -05:00
|
|
|
#include "wx/os2/wxrsc.h"
|
2000-02-27 23:40:52 -05:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
|
1999-10-24 22:41:20 -04:00
|
|
|
{
|
1999-08-02 00:44:01 -04:00
|
|
|
public:
|
1999-11-19 17:36:55 -05:00
|
|
|
// construction
|
2001-10-19 16:35:05 -04:00
|
|
|
wxFrame() { Init(); }
|
|
|
|
wxFrame( wxWindow* pParent
|
2001-07-06 17:45:11 -04: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 00:44:22 -04:00
|
|
|
{
|
1999-11-19 17:36:55 -05:00
|
|
|
Init();
|
|
|
|
|
2000-02-16 16:51:58 -05:00
|
|
|
Create(pParent, vId, rsTitle, rPos, rSize, lStyle, rsName);
|
1999-10-07 00:44:22 -04:00
|
|
|
}
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-02-16 16:51:58 -05: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 00:44:22 -04:00
|
|
|
|
2001-10-19 16:35:05 -04:00
|
|
|
virtual ~wxFrame();
|
1999-10-07 00:44:22 -04:00
|
|
|
|
1999-11-19 17:36:55 -05:00
|
|
|
// implement base class pure virtuals
|
2001-10-17 18:25:56 -04:00
|
|
|
#if wxUSE_MENUS_NATIVE
|
2000-02-16 16:51:58 -05:00
|
|
|
virtual void SetMenuBar(wxMenuBar* pMenubar);
|
2001-10-17 18:25:56 -04:00
|
|
|
#endif
|
2000-02-16 16:51:58 -05:00
|
|
|
virtual bool ShowFullScreen( bool bShow
|
|
|
|
,long lStyle = wxFULLSCREEN_ALL
|
|
|
|
);
|
|
|
|
|
1999-10-07 00:44:22 -04:00
|
|
|
|
1999-11-19 17:36:55 -05:00
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
1999-10-07 00:44:22 -04:00
|
|
|
|
2002-01-06 19:44:31 -05:00
|
|
|
virtual void Raise(void);
|
1999-10-07 00:44:22 -04:00
|
|
|
|
1999-11-19 17:36:55 -05:00
|
|
|
// event handlers
|
2000-02-16 16:51:58 -05:00
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
|
1999-10-07 00:44:22 -04:00
|
|
|
|
|
|
|
// Toolbar
|
|
|
|
#if wxUSE_TOOLBAR
|
2003-07-10 06:53:00 -04:00
|
|
|
virtual wxToolBar* CreateToolBar( long lStyle = -1
|
2000-02-16 16:51:58 -05:00
|
|
|
,wxWindowID vId = -1
|
|
|
|
,const wxString& rsName = wxToolBarNameStr
|
|
|
|
);
|
1999-10-07 00:44:22 -04:00
|
|
|
|
2002-07-01 18:22:13 -04:00
|
|
|
virtual wxToolBar* OnCreateToolBar( long lStyle
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsName
|
|
|
|
);
|
2000-02-16 16:51:58 -05:00
|
|
|
virtual void PositionToolBar(void);
|
1999-10-07 00:44:22 -04:00
|
|
|
#endif // wxUSE_TOOLBAR
|
|
|
|
|
|
|
|
// Status bar
|
1999-11-19 17:36:55 -05:00
|
|
|
#if wxUSE_STATUSBAR
|
2000-02-16 16:51:58 -05:00
|
|
|
virtual wxStatusBar* OnCreateStatusBar( int nNumber = 1
|
2009-04-25 08:59:09 -04:00
|
|
|
,long lStyle = wxSTB_DEFAULT_STYLE
|
2000-02-16 16:51:58 -05:00
|
|
|
,wxWindowID vId = 0
|
|
|
|
,const wxString& rsName = wxStatusLineNameStr
|
|
|
|
);
|
|
|
|
virtual void PositionStatusBar(void);
|
1999-10-07 00:44:22 -04:00
|
|
|
|
1999-11-19 17:36:55 -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-10-07 00:44:22 -04:00
|
|
|
|
|
|
|
// TODO: should this go into a wxFrameworkSettings class perhaps?
|
2000-02-16 16:51:58 -05:00
|
|
|
static void UseNativeStatusBar(bool bUseNative)
|
2000-02-17 18:31:03 -05:00
|
|
|
{ m_bUseNativeStatusBar = bUseNative; };
|
1999-11-19 17:36:55 -05:00
|
|
|
static bool UsesNativeStatusBar()
|
2000-02-17 18:31:03 -05:00
|
|
|
{ return m_bUseNativeStatusBar; };
|
1999-10-07 00:44:22 -04: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 17:36:55 -05:00
|
|
|
// event handlers
|
2000-02-16 16:51:58 -05: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 17:36:55 -05:00
|
|
|
// tooltip management
|
1999-10-07 00:44:22 -04:00
|
|
|
#if wxUSE_TOOLTIPS
|
2000-02-21 00:12:34 -05:00
|
|
|
WXHWND GetToolTipCtrl(void) const { return m_hWndToolTip; }
|
|
|
|
void SetToolTipCtrl(WXHWND hHwndTT) { m_hWndToolTip = hHwndTT; }
|
1999-10-07 00:44:22 -04:00
|
|
|
#endif // tooltips
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-10-01 22:45:47 -04:00
|
|
|
void SetClient(WXHWND c_Hwnd);
|
|
|
|
void SetClient(wxWindow* c_Window);
|
|
|
|
wxWindow *GetClient();
|
|
|
|
|
2000-11-17 01:01:48 -05: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 01:11:30 -04:00
|
|
|
protected:
|
1999-11-19 17:36:55 -05:00
|
|
|
// common part of all ctors
|
2000-02-16 16:51:58 -05:00
|
|
|
void Init(void);
|
1999-11-19 17:36:55 -05:00
|
|
|
|
2002-01-06 19:44:31 -05:00
|
|
|
virtual WXHICON GetDefaultIcon(void) const;
|
1999-10-07 00:44:22 -04:00
|
|
|
// override base class virtuals
|
2000-02-16 16:51:58 -05:00
|
|
|
virtual void DoGetClientSize( int* pWidth
|
|
|
|
,int* pHeight
|
|
|
|
) const;
|
|
|
|
virtual void DoSetClientSize( int nWidth
|
|
|
|
,int nWeight
|
|
|
|
);
|
2002-01-06 19:44:31 -05:00
|
|
|
inline virtual bool IsMDIChild(void) const { return FALSE; }
|
1999-10-24 11:57:35 -04:00
|
|
|
|
2001-10-17 18:25:56 -04:00
|
|
|
#if wxUSE_MENUS_NATIVE
|
1999-11-19 17:36:55 -05:00
|
|
|
// helper
|
2000-02-16 16:51:58 -05:00
|
|
|
void DetachMenuBar(void);
|
2001-07-13 13:41:54 -04:00
|
|
|
// perform MSW-specific action when menubar is changed
|
|
|
|
virtual void AttachMenuBar(wxMenuBar* pMenubar);
|
1999-10-07 00:44:22 -04:00
|
|
|
// a plug in for MDI frame classes which need to do something special when
|
|
|
|
// the menubar is set
|
2000-02-16 16:51:58 -05:00
|
|
|
virtual void InternalSetMenuBar(void);
|
2001-07-13 13:41:54 -04:00
|
|
|
#endif
|
1999-10-07 00:44:22 -04: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 16:51:58 -05:00
|
|
|
MRESULT OS2WindowProc( WXUINT uMessage
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
1999-10-07 00:44:22 -04:00
|
|
|
|
2000-02-16 16:51:58 -05:00
|
|
|
bool m_bIconized;
|
|
|
|
WXHICON m_hDefaultIcon;
|
1999-10-07 00:44:22 -04:00
|
|
|
|
|
|
|
#if wxUSE_STATUSBAR
|
2000-02-16 16:51:58 -05:00
|
|
|
static bool m_bUseNativeStatusBar;
|
1999-10-07 00:44:22 -04:00
|
|
|
#endif // wxUSE_STATUSBAR
|
|
|
|
|
2000-02-16 16:51:58 -05: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 13:40:45 -05:00
|
|
|
bool m_bWasMinimized;
|
2000-08-21 07:08:33 -04:00
|
|
|
bool m_bIsShown;
|
2000-02-16 16:51:58 -05:00
|
|
|
|
1999-10-07 00:44:22 -04:00
|
|
|
private:
|
|
|
|
#if wxUSE_TOOLTIPS
|
2000-02-17 18:31:03 -05:00
|
|
|
WXHWND m_hWndToolTip;
|
1999-10-07 00:44:22 -04:00
|
|
|
#endif // tooltips
|
|
|
|
|
2000-03-22 18:22:48 -05:00
|
|
|
//
|
2000-11-17 01:01:48 -05: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 18:22:48 -05:00
|
|
|
//
|
|
|
|
WXHWND m_hTitleBar;
|
|
|
|
WXHWND m_hHScroll;
|
|
|
|
WXHWND m_hVScroll;
|
|
|
|
|
|
|
|
//
|
2000-07-15 15:51:35 -04:00
|
|
|
// Swp structures for various client data
|
2000-03-22 18:22:48 -05: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 00:44:22 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
2001-10-19 16:35:05 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
1999-07-29 01:11:30 -04:00
|
|
|
};
|
|
|
|
|
2008-10-20 02:55:10 -04:00
|
|
|
MRESULT EXPENTRY wxFrameWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
|
|
|
|
MRESULT EXPENTRY wxFrameMainWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
|
1999-07-29 01:11:30 -04:00
|
|
|
#endif
|
|
|
|
// _WX_FRAME_H_
|
1999-10-07 00:44:22 -04:00
|
|
|
|