2002-01-07 11:40:17 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2005-11-04 16:13:03 -05:00
|
|
|
// Name: wx/os2/toplevel.h
|
|
|
|
// Purpose: wxTopLevelWindowOS2 is the OS2 implementation of wxTLW
|
2002-01-07 11:40:17 -05:00
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 20.09.01
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2002-01-07 11:40:17 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_MSW_TOPLEVEL_H_
|
|
|
|
#define _WX_MSW_TOPLEVEL_H_
|
|
|
|
|
2005-11-04 16:13:03 -05:00
|
|
|
enum ETemplateID
|
|
|
|
{
|
|
|
|
kResizeableDialog = 130,
|
|
|
|
kCaptionDialog,
|
|
|
|
kNoCaptionDialog
|
|
|
|
};
|
2002-01-07 11:40:17 -05:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxTopLevelWindowOS2
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxTopLevelWindowOS2 : public wxTopLevelWindowBase
|
2002-01-07 11:40:17 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// constructors and such
|
|
|
|
wxTopLevelWindowOS2() { Init(); }
|
|
|
|
|
|
|
|
wxTopLevelWindowOS2( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsTitle
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = wxDEFAULT_FRAME_STYLE
|
|
|
|
,const wxString& rsName = wxFrameNameStr
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
(void)Create(pParent, vId, rsTitle, rPos, rSize, lStyle, rsName);
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
);
|
|
|
|
|
|
|
|
virtual ~wxTopLevelWindowOS2();
|
|
|
|
|
|
|
|
//
|
|
|
|
// Implement base class pure virtuals
|
|
|
|
//
|
2005-11-04 16:13:03 -05:00
|
|
|
virtual void SetTitle( const wxString& title);
|
|
|
|
virtual wxString GetTitle() const;
|
|
|
|
|
|
|
|
virtual void Iconize(bool bIconize = true);
|
|
|
|
virtual bool IsFullScreen(void) const { return m_bFsIsShowing; }
|
|
|
|
virtual bool IsIconized(void) const;
|
|
|
|
virtual bool IsMaximized(void) const;
|
|
|
|
virtual void Maximize(bool bMaximize = true);
|
|
|
|
virtual void Restore(void);
|
2008-07-29 19:07:24 -04:00
|
|
|
virtual void SendSizeEvent(int flags = 0);
|
2005-11-04 16:13:03 -05:00
|
|
|
virtual void SetIcons(const wxIconBundle& rIcons);
|
2002-03-26 16:54:23 -05:00
|
|
|
|
2005-11-04 16:13:03 -05:00
|
|
|
virtual bool Show(bool bShow = true);
|
|
|
|
virtual bool ShowFullScreen( bool bShow,
|
|
|
|
long lStyle = wxFULLSCREEN_ALL );
|
2002-01-07 11:40:17 -05:00
|
|
|
|
|
|
|
//
|
2005-11-04 16:13:03 -05:00
|
|
|
// EnableCloseButton(false) may be used to remove the "Close"
|
2002-01-07 11:40:17 -05:00
|
|
|
// button from the title bar
|
|
|
|
//
|
2005-11-04 16:13:03 -05:00
|
|
|
bool EnableCloseButton(bool bEnable = true);
|
|
|
|
HWND GetFrame(void) const { return m_hFrame; }
|
2002-01-07 11:40:17 -05:00
|
|
|
|
|
|
|
//
|
|
|
|
// Implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
//
|
2005-11-04 16:13:03 -05:00
|
|
|
PSWP GetSwpClient(void) { return &m_vSwpClient; }
|
|
|
|
|
|
|
|
void OnActivate(wxActivateEvent& rEvent);
|
2002-06-17 18:08:57 -04:00
|
|
|
|
2005-11-04 16:13:03 -05:00
|
|
|
void SetLastFocus(wxWindow *pWin) { m_pWinLastFocused = pWin; }
|
|
|
|
wxWindow* GetLastFocus(void) const { return m_pWinLastFocused; }
|
2002-06-17 18:08:57 -04:00
|
|
|
|
2002-01-07 11:40:17 -05:00
|
|
|
protected:
|
2005-11-04 16:13:03 -05:00
|
|
|
|
2002-01-07 11:40:17 -05:00
|
|
|
//
|
|
|
|
// Common part of all ctors
|
|
|
|
//
|
|
|
|
void Init(void);
|
|
|
|
|
|
|
|
//
|
2005-11-04 16:13:03 -05:00
|
|
|
// Create a new frame, return false if it couldn't be created
|
2002-01-07 11:40:17 -05:00
|
|
|
//
|
|
|
|
bool CreateFrame( const wxString& rsTitle
|
|
|
|
,const wxPoint& rPos
|
|
|
|
,const wxSize& rSize
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Create a new dialog using the given dialog template from resources,
|
2005-11-04 16:13:03 -05:00
|
|
|
// return false if it couldn't be created
|
2002-01-07 11:40:17 -05:00
|
|
|
//
|
|
|
|
bool CreateDialog( ULONG ulDlgTemplate
|
|
|
|
,const wxString& rsTitle
|
|
|
|
,const wxPoint& rPos
|
|
|
|
,const wxSize& rSize
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Common part of Iconize(), Maximize() and Restore()
|
|
|
|
//
|
|
|
|
void DoShowWindow(int nShowCmd);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Implement the geometry-related methods for a top level window
|
|
|
|
//
|
|
|
|
virtual void DoSetClientSize( int nWidth
|
|
|
|
,int nHeight
|
|
|
|
);
|
|
|
|
virtual void DoGetClientSize( int* pnWidth
|
|
|
|
,int* pnHeight
|
|
|
|
) const;
|
|
|
|
|
|
|
|
//
|
2004-05-23 10:56:36 -04:00
|
|
|
// Translate wxWidgets flags into OS flags
|
2002-01-07 11:40:17 -05:00
|
|
|
//
|
2002-02-22 18:30:31 -05:00
|
|
|
virtual WXDWORD OS2GetStyle( long lFlag
|
|
|
|
,WXDWORD* pdwExstyle
|
|
|
|
) const;
|
2002-05-28 17:50:34 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// Choose the right parent to use with CreateWindow()
|
|
|
|
//
|
|
|
|
virtual WXHWND OS2GetParent(void) const;
|
|
|
|
|
2002-01-07 11:40:17 -05:00
|
|
|
//
|
|
|
|
// Is the frame currently iconized?
|
|
|
|
//
|
2005-11-04 16:13:03 -05:00
|
|
|
bool m_bIconized;
|
2002-01-07 11:40:17 -05:00
|
|
|
|
|
|
|
//
|
|
|
|
// Should the frame be maximized when it will be shown? set by Maximize()
|
|
|
|
// when it is called while the frame is hidden
|
|
|
|
//
|
2005-11-04 16:13:03 -05:00
|
|
|
bool m_bMaximizeOnShow;
|
2002-01-07 11:40:17 -05:00
|
|
|
|
|
|
|
//
|
|
|
|
// Data to save/restore when calling ShowFullScreen
|
|
|
|
//
|
2005-11-04 16:13:03 -05:00
|
|
|
long m_lFsStyle; // Passed to ShowFullScreen
|
|
|
|
wxRect m_vFsOldSize;
|
|
|
|
long m_lFsOldWindowStyle;
|
|
|
|
bool m_bFsIsMaximized;
|
|
|
|
bool m_bFsIsShowing;
|
2002-01-07 11:40:17 -05:00
|
|
|
|
2005-11-04 16:13:03 -05:00
|
|
|
wxWindow* m_pWinLastFocused;
|
2002-06-17 18:08:57 -04:00
|
|
|
|
2005-11-04 16:13:03 -05:00
|
|
|
WXHWND m_hFrame;
|
|
|
|
SWP m_vSwp;
|
|
|
|
SWP m_vSwpClient;
|
|
|
|
static bool m_sbInitialized;
|
|
|
|
static wxWindow* m_spHiddenParent;
|
2002-06-17 18:08:57 -04:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2002-01-07 11:40:17 -05:00
|
|
|
}; // end of CLASS wxTopLevelWindowOS2
|
|
|
|
|
|
|
|
#endif // _WX_MSW_TOPLEVEL_H_
|