1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: window.h
|
|
|
|
// Purpose: wxWindow class
|
1999-08-02 00:44:01 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-12 18:49:24 -04:00
|
|
|
// Created: 10/12/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-12 18:49:24 -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_WINDOW_H_
|
|
|
|
#define _WX_WINDOW_H_
|
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
#define wxUSE_MOUSEEVENT_HACK 0
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-10-13 16:35:03 -04:00
|
|
|
#define INCL_DOS
|
|
|
|
#define INCL_PM
|
|
|
|
#define INCL_GPI
|
|
|
|
#include <os2.h>
|
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-01-06 19:44:31 -05:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
#ifndef CW_USEDEFAULT
|
|
|
|
# define CW_USEDEFAULT ((int)0x80000000)
|
|
|
|
#endif
|
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxButton;
|
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// constants
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2004-12-15 07:22:51 -05:00
|
|
|
#if WXWIN_COMPATIBILITY_2_4
|
|
|
|
// they're unused by wxWidgets...
|
1999-10-12 18:49:24 -04:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxKEY_SHIFT = 1,
|
|
|
|
wxKEY_CTRL = 2
|
|
|
|
};
|
2004-12-15 07:22:51 -05:00
|
|
|
#endif
|
1999-08-02 00:44:01 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// wxWindow declaration for OS/2 PM
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-08-02 00:44:01 -04:00
|
|
|
|
2001-07-06 17:45:11 -04:00
|
|
|
class WXDLLEXPORT wxWindowOS2 : public wxWindowBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
public:
|
2001-07-06 17:45:11 -04:00
|
|
|
wxWindowOS2()
|
2000-03-07 16:26:54 -05:00
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
1999-10-12 18:49:24 -04:00
|
|
|
|
2001-07-06 17:45:11 -04:00
|
|
|
wxWindowOS2( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
|
|
|
,const wxString& rName = wxPanelNameStr
|
|
|
|
)
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
Init();
|
1999-11-15 18:16:19 -05:00
|
|
|
Create( pParent
|
|
|
|
,vId
|
|
|
|
,rPos
|
|
|
|
,rSize
|
|
|
|
,lStyle
|
|
|
|
,rName
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
}
|
|
|
|
|
2001-07-06 17:45:11 -04:00
|
|
|
virtual ~wxWindowOS2();
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-11-15 18:16:19 -05:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
|
|
|
,const wxString& rName = wxPanelNameStr
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// implement base class pure virtuals
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void SetTitle(const wxString& rTitle);
|
|
|
|
virtual wxString GetTitle(void) const;
|
|
|
|
virtual void Raise(void);
|
|
|
|
virtual void Lower(void);
|
2004-12-15 07:22:51 -05:00
|
|
|
virtual bool Show(bool bShow = true);
|
|
|
|
virtual bool Enable(bool bEnable = true);
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void SetFocus(void);
|
2002-04-26 08:58:11 -04:00
|
|
|
virtual void SetFocusFromKbd(void);
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual bool Reparent(wxWindow* pNewParent);
|
|
|
|
virtual void WarpPointer( int x
|
|
|
|
,int y
|
|
|
|
);
|
2004-12-15 07:22:51 -05:00
|
|
|
virtual void Refresh( bool bEraseBackground = true
|
1999-11-15 18:16:19 -05:00
|
|
|
,const wxRect* pRect = (const wxRect *)NULL
|
|
|
|
);
|
2001-12-28 18:06:51 -05:00
|
|
|
virtual void Freeze(void);
|
|
|
|
virtual void Update(void);
|
|
|
|
virtual void Thaw(void);
|
2002-02-22 18:30:31 -05:00
|
|
|
virtual void SetWindowStyleFlag(long lStyle);
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual bool SetCursor(const wxCursor& rCursor);
|
|
|
|
virtual bool SetFont(const wxFont& rFont);
|
|
|
|
virtual int GetCharHeight(void) const;
|
|
|
|
virtual int GetCharWidth(void) const;
|
|
|
|
virtual void GetTextExtent( const wxString& rString
|
|
|
|
,int* pX
|
|
|
|
,int* pY
|
|
|
|
,int* pDescent = (int *)NULL
|
|
|
|
,int* pExternalLeading = (int *)NULL
|
|
|
|
,const wxFont* pTheFont = (const wxFont *)NULL
|
|
|
|
) const;
|
2001-10-17 18:25:56 -04:00
|
|
|
#if wxUSE_MENUS_NATIVE
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual bool DoPopupMenu( wxMenu* pMenu
|
|
|
|
,int nX
|
|
|
|
,int nY
|
|
|
|
);
|
2001-10-17 18:25:56 -04:00
|
|
|
#endif // wxUSE_MENUS_NATIVE
|
1999-11-15 18:16:19 -05:00
|
|
|
|
|
|
|
virtual void SetScrollbar( int nOrient
|
|
|
|
,int nPos
|
|
|
|
,int nThumbVisible
|
|
|
|
,int nRange
|
2004-12-15 07:22:51 -05:00
|
|
|
,bool bRefresh = true
|
1999-11-15 18:16:19 -05:00
|
|
|
);
|
|
|
|
virtual void SetScrollPos( int nOrient
|
|
|
|
,int nPos
|
2004-12-15 07:22:51 -05:00
|
|
|
,bool bRefresh = true
|
1999-11-15 18:16:19 -05:00
|
|
|
);
|
|
|
|
virtual int GetScrollPos(int nOrient) const;
|
|
|
|
virtual int GetScrollThumb(int nOrient) const;
|
|
|
|
virtual int GetScrollRange(int nOrient) const;
|
|
|
|
virtual void ScrollWindow( int nDx
|
|
|
|
,int nDy
|
|
|
|
,const wxRect* pRect = (wxRect *)NULL
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-02-03 23:19:14 -05:00
|
|
|
inline HWND GetScrollBarHorz(void) const {return m_hWndScrollBarHorz;}
|
|
|
|
inline HWND GetScrollBarVert(void) const {return m_hWndScrollBarVert;};
|
1999-10-12 18:49:24 -04:00
|
|
|
#if wxUSE_DRAG_AND_DROP
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void SetDropTarget(wxDropTarget* pDropTarget);
|
1999-10-12 18:49:24 -04:00
|
|
|
#endif // wxUSE_DRAG_AND_DROP
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
// Accept files for dragging
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void DragAcceptFiles(bool bAccept);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2001-10-17 18:25:56 -04:00
|
|
|
#ifndef __WXUNIVERSAL__
|
1999-11-15 18:16:19 -05:00
|
|
|
// Native resource loading (implemented in src/os2/nativdlg.cpp)
|
1999-10-12 18:49:24 -04:00
|
|
|
// FIXME: should they really be all virtual?
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual bool LoadNativeDialog( wxWindow* pParent
|
|
|
|
,wxWindowID& vId
|
|
|
|
);
|
|
|
|
virtual bool LoadNativeDialog( wxWindow* pParent
|
|
|
|
,const wxString& rName
|
|
|
|
);
|
|
|
|
wxWindow* GetWindowChild1(wxWindowID vId);
|
|
|
|
wxWindow* GetWindowChild(wxWindowID vId);
|
2001-10-17 18:25:56 -04:00
|
|
|
#endif //__WXUNIVERSAL__
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
|
|
|
// simple accessors
|
|
|
|
// ----------------
|
1999-09-20 13:19:25 -04:00
|
|
|
|
1999-11-15 18:16:19 -05:00
|
|
|
WXHWND GetHWND(void) const { return m_hWnd; }
|
|
|
|
void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; }
|
|
|
|
virtual WXWidget GetHandle(void) const { return GetHWND(); }
|
|
|
|
bool GetUseCtl3D(void) const { return m_bUseCtl3D; }
|
|
|
|
bool GetTransparentBackground(void) const { return m_bBackgroundTransparent; }
|
2004-12-15 07:22:51 -05:00
|
|
|
void SetTransparent(bool bT = true) { m_bBackgroundTransparent = bT; }
|
1999-08-02 00:44:01 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// event handlers
|
|
|
|
// --------------
|
2000-02-21 00:12:34 -05:00
|
|
|
void OnSetFocus(wxFocusEvent& rEvent);
|
1999-11-15 18:16:19 -05:00
|
|
|
void OnEraseBackground(wxEraseEvent& rEvent);
|
|
|
|
void OnIdle(wxIdleEvent& rEvent);
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
public:
|
2002-08-30 09:37:52 -04:00
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
// For implementation purposes - sometimes decorations make the client area
|
|
|
|
// smaller
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual wxPoint GetClientAreaOrigin(void) const;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-09-20 13:19:25 -04:00
|
|
|
// Windows subclassing
|
|
|
|
void SubclassWin(WXHWND hWnd);
|
1999-11-15 18:16:19 -05:00
|
|
|
void UnsubclassWin(void);
|
1999-09-20 13:19:25 -04:00
|
|
|
|
1999-11-15 18:16:19 -05:00
|
|
|
WXFARPROC OS2GetOldWndProc(void) const { return m_fnOldWndProc; }
|
|
|
|
void OS2SetOldWndProc(WXFARPROC fnProc) { m_fnOldWndProc = fnProc; }
|
2002-06-17 18:08:57 -04:00
|
|
|
//
|
2004-12-15 07:22:51 -05:00
|
|
|
// Return true if the window is of a standard (i.e. not wxWidgets') class
|
2002-06-17 18:08:57 -04:00
|
|
|
//
|
|
|
|
bool IsOfStandardClass(void) const { return m_fnOldWndProc != NULL; }
|
1999-09-20 13:19:25 -04:00
|
|
|
|
1999-11-15 18:16:19 -05:00
|
|
|
wxWindow* FindItem(long lId) const;
|
|
|
|
wxWindow* FindItemByHWND( WXHWND hWnd
|
2004-12-15 07:22:51 -05:00
|
|
|
,bool bControlOnly = false
|
1999-11-15 18:16:19 -05:00
|
|
|
) const;
|
1999-09-20 13:19:25 -04:00
|
|
|
|
2004-05-23 10:56:36 -04:00
|
|
|
// Make a Windows extended style from the given wxWidgets window style ?? applicable to OS/2??
|
1999-11-15 18:16:19 -05:00
|
|
|
static WXDWORD MakeExtendedStyle( long lStyle
|
2004-12-15 07:22:51 -05:00
|
|
|
,bool bEliminateBorders = true
|
1999-11-15 18:16:19 -05:00
|
|
|
);
|
1999-09-20 13:19:25 -04:00
|
|
|
|
2004-12-15 07:22:51 -05:00
|
|
|
// PM only: true if this control is part of the main control
|
|
|
|
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return false; };
|
1999-09-20 13:19:25 -04:00
|
|
|
|
2004-05-23 10:56:36 -04:00
|
|
|
// translate wxWidgets style flags for this control into the PM style
|
2002-02-22 18:30:31 -05:00
|
|
|
// and optional extended style for the corresponding native control
|
|
|
|
//
|
|
|
|
// this is the function that should be overridden in the derived classes,
|
|
|
|
// but you will mostly use OS2GetCreateWindowFlags() below
|
|
|
|
virtual WXDWORD OS2GetStyle( long lFlags
|
|
|
|
,WXDWORD* pdwExstyle = NULL
|
|
|
|
) const;
|
|
|
|
|
2004-05-23 10:56:36 -04:00
|
|
|
// get the MSW window flags corresponding to wxWidgets ones
|
2002-02-22 18:30:31 -05:00
|
|
|
//
|
|
|
|
// the functions returns the flags (WS_XXX) directly and puts the ext
|
|
|
|
// (WS_EX_XXX) flags into the provided pointer if not NULL
|
|
|
|
WXDWORD OS2GetCreateWindowFlags(WXDWORD* pdwExflags = NULL) const
|
|
|
|
{ return OS2GetStyle(GetWindowStyle(), pdwExflags); }
|
|
|
|
|
|
|
|
|
2002-05-28 17:50:34 -04:00
|
|
|
// get the HWND to be used as parent of this window with CreateWindow()
|
|
|
|
virtual WXHWND OS2GetParent(void) const;
|
|
|
|
|
2004-12-15 07:22:51 -05:00
|
|
|
// returns true if the window has been created
|
2002-01-06 19:44:31 -05:00
|
|
|
bool OS2Create( PSZ zClass
|
|
|
|
,const char* zTitle
|
|
|
|
,WXDWORD dwStyle
|
|
|
|
,const wxPoint& rPos
|
|
|
|
,const wxSize& rSize
|
|
|
|
,void* pCtlData
|
|
|
|
,WXDWORD dwExStyle
|
|
|
|
,bool bIsChild
|
|
|
|
);
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual bool OS2Command( WXUINT uParam
|
|
|
|
,WXWORD nId
|
|
|
|
);
|
1999-10-12 18:49:24 -04:00
|
|
|
|
2001-10-17 18:25:56 -04:00
|
|
|
#ifndef __WXUNIVERSAL__
|
1999-10-12 18:49:24 -04:00
|
|
|
// Create an appropriate wxWindow from a HWND
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual wxWindow* CreateWindowFromHWND( wxWindow* pParent
|
|
|
|
,WXHWND hWnd
|
|
|
|
);
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
// Make sure the window style reflects the HWND style (roughly)
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void AdoptAttributesFromHWND(void);
|
2001-10-17 18:25:56 -04:00
|
|
|
#endif
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
// Setup background and foreground colours correctly
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void SetupColours(void);
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// helpers for message handlers: these perform the same function as the
|
|
|
|
// message crackers from <windowsx.h> - they unpack WPARAM and LPARAM into
|
|
|
|
// the correct parameters
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
1999-11-15 18:16:19 -05:00
|
|
|
void UnpackCommand( WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam,
|
|
|
|
WXWORD* pId
|
|
|
|
,WXHWND* pHwnd
|
|
|
|
,WXWORD* pCmd
|
|
|
|
);
|
|
|
|
void UnpackActivate( WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
,WXWORD* pState
|
|
|
|
,WXHWND* pHwnd
|
|
|
|
);
|
|
|
|
void UnpackScroll( WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
,WXWORD* pCode
|
|
|
|
,WXWORD* pPos
|
|
|
|
,WXHWND* pHwnd
|
|
|
|
);
|
|
|
|
void UnpackMenuSelect( WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
,WXWORD* pTtem
|
|
|
|
,WXWORD* pFlags
|
|
|
|
,WXHMENU* pHmenu
|
|
|
|
);
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------
|
1999-11-15 18:16:19 -05:00
|
|
|
// internal handlers for OS2 messages: all handlers return a boolen value:
|
2004-12-15 07:22:51 -05:00
|
|
|
// true means that the handler processed the event and false that it didn't
|
1999-10-12 18:49:24 -04:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
1999-11-15 18:16:19 -05:00
|
|
|
// there are several cases where we have virtual functions for PM
|
1999-10-12 18:49:24 -04:00
|
|
|
// message processing: this is because these messages often require to be
|
|
|
|
// processed in a different manner in the derived classes. For all other
|
1999-11-15 18:16:19 -05:00
|
|
|
// messages, however, we do *not* have corresponding OS2OnXXX() function
|
1999-10-12 18:49:24 -04:00
|
|
|
// and if the derived class wants to process them, it should override
|
1999-11-15 18:16:19 -05:00
|
|
|
// OS2WindowProc() directly.
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
// scroll event (both horizontal and vertical)
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual bool OS2OnScroll( int nOrientation
|
|
|
|
,WXWORD nSBCode
|
|
|
|
,WXWORD pos
|
|
|
|
,WXHWND control
|
|
|
|
);
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
// owner-drawn controls need to process these messages
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual bool OS2OnDrawItem( int nId
|
|
|
|
,WXDRAWITEMSTRUCT* pItem
|
|
|
|
);
|
2002-09-03 18:26:53 -04:00
|
|
|
virtual long OS2OnMeasureItem( int nId
|
1999-11-15 18:16:19 -05:00
|
|
|
,WXMEASUREITEMSTRUCT* pItem
|
|
|
|
);
|
1999-10-12 18:49:24 -04:00
|
|
|
|
2003-01-21 18:35:16 -05:00
|
|
|
virtual void OnPaint(wxPaintEvent& rEvent);
|
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// the rest are not virtual
|
1999-11-15 18:16:19 -05:00
|
|
|
bool HandleCreate( WXLPCREATESTRUCT vCs
|
|
|
|
,bool* pMayCreate
|
|
|
|
);
|
1999-10-12 18:49:24 -04:00
|
|
|
bool HandleInitDialog(WXHWND hWndFocus);
|
1999-11-15 18:16:19 -05:00
|
|
|
bool HandleDestroy(void);
|
|
|
|
bool HandlePaint(void);
|
|
|
|
bool HandleEraseBkgnd(WXHDC vDC);
|
|
|
|
bool HandleMinimize(void);
|
|
|
|
bool HandleMaximize(void);
|
|
|
|
bool HandleSize( int nX
|
|
|
|
,int nY
|
|
|
|
,WXUINT uFlag
|
|
|
|
);
|
2000-02-27 23:40:52 -05:00
|
|
|
bool HandleGetMinMaxInfo(PSWP pMmInfo);
|
1999-11-15 18:16:19 -05:00
|
|
|
bool HandleShow( bool bShow
|
|
|
|
,int nStatus
|
|
|
|
);
|
|
|
|
bool HandleActivate( int nFlag
|
|
|
|
,WXHWND hActivate
|
|
|
|
);
|
|
|
|
bool HandleCommand( WXWORD nId
|
|
|
|
,WXWORD nCmd
|
|
|
|
,WXHWND hControl
|
|
|
|
);
|
|
|
|
bool HandleSysCommand( WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
2002-04-19 17:40:05 -04:00
|
|
|
bool HandlePaletteChanged(void);
|
|
|
|
bool HandleQueryNewPalette(void);
|
1999-11-15 18:16:19 -05:00
|
|
|
bool HandleSysColorChange(void);
|
2002-04-19 17:40:05 -04:00
|
|
|
bool HandleDisplayChange(void);
|
|
|
|
bool HandleCaptureChanged(WXHWND hBainedCapture);
|
|
|
|
|
2000-02-27 23:40:52 -05:00
|
|
|
bool HandleCtlColor(WXHBRUSH* hBrush);
|
1999-11-15 18:16:19 -05:00
|
|
|
bool HandleSetFocus(WXHWND hWnd);
|
|
|
|
bool HandleKillFocus(WXHWND hWnd);
|
2000-02-27 23:40:52 -05:00
|
|
|
bool HandleEndDrag(WXWPARAM wParam);
|
1999-11-15 18:16:19 -05:00
|
|
|
bool HandleMouseEvent( WXUINT uMsg
|
|
|
|
,int nX
|
|
|
|
,int nY
|
|
|
|
,WXUINT uFlags
|
|
|
|
);
|
|
|
|
bool HandleMouseMove( int nX
|
|
|
|
,int nY
|
|
|
|
,WXUINT uFlags
|
|
|
|
);
|
2002-04-14 23:31:42 -04:00
|
|
|
bool HandleChar( WXWPARAM wParam
|
1999-11-15 18:16:19 -05:00
|
|
|
,WXLPARAM lParam
|
2004-12-15 07:22:51 -05:00
|
|
|
,bool bIsASCII = false
|
1999-11-15 18:16:19 -05:00
|
|
|
);
|
2002-04-10 00:38:11 -04:00
|
|
|
bool HandleKeyDown( WXWPARAM wParam
|
1999-11-15 18:16:19 -05:00
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
2002-04-10 00:38:11 -04:00
|
|
|
bool HandleKeyUp( WXWPARAM wParam
|
1999-11-15 18:16:19 -05:00
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
|
|
|
bool HandleQueryDragIcon(WXHICON* phIcon);
|
2000-02-27 23:40:52 -05:00
|
|
|
bool HandleSetCursor( USHORT vId
|
|
|
|
,WXHWND hWnd
|
1999-11-15 18:16:19 -05:00
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2001-12-28 02:00:16 -05:00
|
|
|
bool IsMouseInWindow(void) const;
|
|
|
|
bool OS2GetCreateWindowCoords( const wxPoint& rPos
|
|
|
|
,const wxSize& rSize
|
|
|
|
,int& rnX
|
|
|
|
,int& rnY
|
|
|
|
,int& rnWidth
|
|
|
|
,int& rnHeight
|
|
|
|
) const;
|
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// Window procedure
|
2000-02-21 00:12:34 -05:00
|
|
|
virtual MRESULT OS2WindowProc( WXUINT uMsg
|
1999-11-15 18:16:19 -05:00
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// Calls an appropriate default window procedure
|
2000-02-21 00:12:34 -05:00
|
|
|
virtual MRESULT OS2DefWindowProc( WXUINT uMsg
|
1999-11-15 18:16:19 -05:00
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
|
|
|
virtual bool OS2ProcessMessage(WXMSG* pMsg);
|
2002-01-22 18:17:55 -05:00
|
|
|
virtual bool OS2ShouldPreProcessMessage(WXMSG* pMsg);
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual bool OS2TranslateMessage(WXMSG* pMsg);
|
|
|
|
virtual void OS2DestroyWindow(void);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// this function should return the brush to paint the window background
|
|
|
|
// with or 0 for the default brush
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual WXHBRUSH OnCtlColor( WXHDC hDC
|
|
|
|
,WXHWND hWnd
|
|
|
|
,WXUINT uCtlColor
|
|
|
|
,WXUINT uMessage
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
1999-10-05 00:22:59 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// Responds to colour changes: passes event on to children.
|
1999-11-15 18:16:19 -05:00
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-11-15 18:16:19 -05:00
|
|
|
// initialize various fields of wxMouseEvent (common part of OS2OnMouseXXX)
|
|
|
|
void InitMouseEvent( wxMouseEvent& rEvent
|
|
|
|
,int nX
|
|
|
|
,int nY
|
|
|
|
,WXUINT uFlags
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2001-12-21 13:09:02 -05:00
|
|
|
void MoveChildren(int nDiff);
|
2002-02-09 23:33:20 -05:00
|
|
|
PSWP GetSwp(void) {return &m_vWinSwp;}
|
2001-12-21 13:09:02 -05:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
protected:
|
2000-02-21 00:12:34 -05:00
|
|
|
// PM can't create some MSW styles natively but can perform these after
|
|
|
|
// creation by sending messages
|
|
|
|
typedef enum extra_flags { kFrameToolWindow = 0x0001
|
|
|
|
,kVertCaption = 0x0002
|
|
|
|
,kHorzCaption = 0x0004
|
|
|
|
} EExtraFlags;
|
|
|
|
// Some internal sizeing id's to make it easy for event handlers
|
|
|
|
typedef enum size_types { kSizeNormal
|
|
|
|
,kSizeMax
|
|
|
|
,kSizeMin
|
|
|
|
} ESizeTypes;
|
1999-10-12 18:49:24 -04:00
|
|
|
// the window handle
|
1999-11-15 18:16:19 -05:00
|
|
|
WXHWND m_hWnd;
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
// the old window proc (we subclass all windows)
|
1999-11-15 18:16:19 -05:00
|
|
|
WXFARPROC m_fnOldWndProc;
|
1999-10-12 18:49:24 -04:00
|
|
|
|
2001-05-25 17:12:00 -04:00
|
|
|
// additional (OS2 specific) flags
|
1999-11-15 18:16:19 -05:00
|
|
|
bool m_bUseCtl3D:1; // Using CTL3D for this control
|
|
|
|
bool m_bBackgroundTransparent:1;
|
|
|
|
bool m_bMouseInWindow:1;
|
2002-04-05 17:09:25 -05:00
|
|
|
bool m_bLastKeydownProcessed:1;
|
1999-11-15 18:16:19 -05:00
|
|
|
bool m_bWinCaptured:1;
|
2001-05-25 17:12:00 -04:00
|
|
|
WXDWORD m_dwExStyle;
|
1999-08-03 00:36:53 -04:00
|
|
|
|
|
|
|
// the size of one page for scrolling
|
1999-11-15 18:16:19 -05:00
|
|
|
int m_nXThumbSize;
|
|
|
|
int m_nYThumbSize;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
#if wxUSE_MOUSEEVENT_HACK
|
|
|
|
// the coordinates of the last mouse event and the type of it
|
1999-11-15 18:16:19 -05:00
|
|
|
long m_lLastMouseX,
|
|
|
|
long m_lLastMouseY;
|
|
|
|
int m_nLastMouseEvent;
|
1999-10-12 18:49:24 -04:00
|
|
|
#endif // wxUSE_MOUSEEVENT_HACK
|
|
|
|
|
1999-11-15 18:16:19 -05:00
|
|
|
WXHMENU m_hMenu; // Menu, if any
|
2000-02-18 18:35:39 -05:00
|
|
|
unsigned long m_ulMenubarId; // it's Id, if any
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
// the return value of WM_GETDLGCODE handler
|
1999-11-15 18:16:19 -05:00
|
|
|
long m_lDlgCode;
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
// implement the base class pure virtuals
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void DoClientToScreen( int* pX
|
|
|
|
,int* pY
|
|
|
|
) const;
|
|
|
|
virtual void DoScreenToClient( int* pX
|
|
|
|
,int* pY
|
|
|
|
) const;
|
|
|
|
virtual void DoGetPosition( int* pX
|
|
|
|
,int* pY
|
|
|
|
) const;
|
|
|
|
virtual void DoGetSize( int* pWidth
|
|
|
|
,int* pHeight
|
|
|
|
) const;
|
|
|
|
virtual void DoGetClientSize( int* pWidth
|
|
|
|
,int* pHeight
|
|
|
|
) const;
|
|
|
|
virtual void DoSetSize( int nX
|
|
|
|
,int nY
|
|
|
|
,int nWidth
|
|
|
|
,int nHeight
|
|
|
|
,int nSizeFlags = wxSIZE_AUTO
|
|
|
|
);
|
|
|
|
virtual void DoSetClientSize( int nWidth
|
|
|
|
,int nHeight
|
|
|
|
);
|
1999-10-12 18:49:24 -04:00
|
|
|
|
2002-01-19 14:38:46 -05:00
|
|
|
virtual void DoCaptureMouse(void);
|
|
|
|
virtual void DoReleaseMouse(void);
|
2002-02-22 18:30:31 -05:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// move the window to the specified location and resize it: this is called
|
|
|
|
// from both DoSetSize() and DoSetClientSize() and would usually just call
|
2000-03-07 16:26:54 -05:00
|
|
|
// ::WinSetWindowPos() except for composite controls which will want to arrange
|
1999-10-12 18:49:24 -04:00
|
|
|
// themselves inside the given rectangle
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void DoMoveWindow( int nX
|
|
|
|
,int nY
|
|
|
|
,int nWidth
|
|
|
|
,int nHeight
|
|
|
|
);
|
1999-10-12 18:49:24 -04:00
|
|
|
|
|
|
|
#if wxUSE_TOOLTIPS
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void DoSetToolTip(wxToolTip* pTip);
|
1999-10-12 18:49:24 -04:00
|
|
|
#endif // wxUSE_TOOLTIPS
|
|
|
|
|
2001-12-21 13:09:02 -05:00
|
|
|
int GetOS2ParentHeight(wxWindowOS2* pParent);
|
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
private:
|
1999-10-12 18:49:24 -04:00
|
|
|
// common part of all ctors
|
1999-11-15 18:16:19 -05:00
|
|
|
void Init(void);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// the (non-virtual) handlers for the events
|
1999-11-15 18:16:19 -05:00
|
|
|
bool HandleMove( int nX
|
|
|
|
,int nY
|
|
|
|
);
|
|
|
|
bool HandleJoystickEvent( WXUINT uMsg
|
|
|
|
,int pX
|
|
|
|
,int pY
|
|
|
|
,WXUINT uFlags
|
|
|
|
);
|
|
|
|
|
|
|
|
bool HandleNotify( int nIdCtrl
|
|
|
|
,WXLPARAM lParam
|
|
|
|
,WXLPARAM* pResult
|
|
|
|
);
|
2000-02-21 00:12:34 -05:00
|
|
|
// the helper functions used by HandleChar/KeyXXX methods
|
2002-04-10 00:38:11 -04:00
|
|
|
wxKeyEvent CreateKeyEvent( wxEventType evType
|
|
|
|
,int nId
|
|
|
|
,WXLPARAM lParam = 0
|
|
|
|
,WXWPARAM wParam = 0
|
|
|
|
) const;
|
2000-02-21 00:12:34 -05:00
|
|
|
|
2002-08-30 17:20:42 -04:00
|
|
|
wxWindowList* m_pChildrenDisabled;
|
2001-05-07 18:17:12 -04:00
|
|
|
HWND m_hWndScrollBarHorz;
|
|
|
|
HWND m_hWndScrollBarVert;
|
2002-02-09 23:33:20 -05:00
|
|
|
SWP m_vWinSwp;
|
2001-05-07 00:17:46 -04:00
|
|
|
|
2002-08-30 17:20:42 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxWindowOS2);
|
|
|
|
DECLARE_NO_COPY_CLASS(wxWindowOS2)
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
|
|
|
//
|
1999-10-13 16:35:03 -04:00
|
|
|
// Virtual function hiding supression
|
2002-08-30 17:20:42 -04:00
|
|
|
//
|
1999-11-15 18:16:19 -05:00
|
|
|
inline virtual bool Reparent(wxWindowBase* pNewParent)
|
2002-08-30 17:20:42 -04:00
|
|
|
{ return(wxWindowBase::Reparent(pNewParent));}
|
2000-02-21 00:12:34 -05:00
|
|
|
}; // end of wxWindow
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2001-12-28 18:06:51 -05:00
|
|
|
class wxWindowCreationHook
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxWindowCreationHook(wxWindow* pWinBeingCreated);
|
|
|
|
~wxWindowCreationHook();
|
|
|
|
}; // end of CLASS wxWindowCreationHook
|
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// global functions
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// kbd code translation
|
1999-11-15 18:16:19 -05:00
|
|
|
WXDLLEXPORT int wxCharCodeOS2ToWX(int nKeySym);
|
|
|
|
WXDLLEXPORT int wxCharCodeWXToOS2( int nId
|
|
|
|
,bool* pbIsVirtual
|
|
|
|
);
|
2004-11-28 13:39:30 -05:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// global objects
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// notice that this hash must be defined after wxWindow declaration as it
|
|
|
|
// needs to "see" its dtor and not just forward declaration
|
|
|
|
#include "wx/hash.h"
|
|
|
|
|
|
|
|
// pseudo-template HWND <-> wxWindow hash table
|
|
|
|
WX_DECLARE_HASH(wxWindowOS2, wxWindowList, wxWinHashTable);
|
|
|
|
|
|
|
|
extern wxWinHashTable *wxWinHandleHash;
|
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
#endif
|
|
|
|
// _WX_WINDOW_H_
|