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
|
|
|
|
// 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
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// FIXME does anybody use those? they're unused by wxWindows...
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxKEY_SHIFT = 1,
|
|
|
|
wxKEY_CTRL = 2
|
|
|
|
};
|
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);
|
|
|
|
virtual bool Show(bool bShow = TRUE);
|
|
|
|
virtual bool Enable(bool bEnable = TRUE);
|
|
|
|
virtual void SetFocus(void);
|
|
|
|
virtual bool Reparent(wxWindow* pNewParent);
|
|
|
|
virtual void WarpPointer( int x
|
|
|
|
,int y
|
|
|
|
);
|
|
|
|
virtual void Refresh( bool bEraseBackground = TRUE
|
|
|
|
,const wxRect* pRect = (const wxRect *)NULL
|
|
|
|
);
|
|
|
|
virtual void Clear(void);
|
2001-12-28 18:06:51 -05:00
|
|
|
virtual void Freeze(void);
|
|
|
|
virtual void Update(void);
|
|
|
|
virtual void Thaw(void);
|
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
|
|
|
|
,bool bRefresh = TRUE
|
|
|
|
);
|
|
|
|
virtual void SetScrollPos( int nOrient
|
|
|
|
,int nPos
|
|
|
|
,bool bRefresh = TRUE
|
|
|
|
);
|
|
|
|
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
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
#if WXWIN_COMPATIBILITY
|
|
|
|
// Set/get scroll attributes
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void SetScrollRange( int nOrient
|
|
|
|
,int nRange
|
|
|
|
,bool bRefresh = TRUE
|
|
|
|
);
|
|
|
|
virtual void SetScrollPage( int nOrient
|
|
|
|
,int nPage
|
|
|
|
,bool bRefresh = TRUE
|
|
|
|
);
|
|
|
|
virtual int OldGetScrollRange(int nOrient) const;
|
|
|
|
virtual int GetScrollPage(int nOrient) const;
|
|
|
|
|
|
|
|
//
|
1999-10-12 18:49:24 -04:00
|
|
|
// event handlers
|
1999-11-15 18:16:19 -05:00
|
|
|
//
|
1999-10-12 18:49:24 -04:00
|
|
|
// Handle a control command
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void OnCommand( wxWindow& rWin
|
|
|
|
,wxCommandEvent& rEvent
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
// Override to define new behaviour for default action (e.g. double
|
|
|
|
// clicking on a listbox)
|
1999-11-15 18:16:19 -05:00
|
|
|
virtual void OnDefaultAction(wxControl* WXUNUSED(pInitiatingItem)) { }
|
1999-10-12 18:49:24 -04:00
|
|
|
#endif // WXWIN_COMPATIBILITY
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
#if wxUSE_CARET && WXWIN_COMPATIBILITY
|
1999-11-15 18:16:19 -05:00
|
|
|
void CreateCaret( int nWidth
|
|
|
|
,int nHeight
|
|
|
|
);
|
|
|
|
void CreateCaret(const wxBitmap* pBitmap);
|
|
|
|
void DestroyCaret(void);
|
|
|
|
void ShowCaret(bool bShow);
|
|
|
|
void SetCaretPos( int nX
|
|
|
|
,int nY
|
|
|
|
);
|
|
|
|
void GetCaretPos( int* pX
|
|
|
|
,int* pY
|
|
|
|
) const;
|
1999-10-12 18:49:24 -04:00
|
|
|
#endif // wxUSE_CARET
|
|
|
|
|
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; }
|
|
|
|
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:
|
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; }
|
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
|
|
|
|
,bool bControlOnly = FALSE
|
|
|
|
) const;
|
1999-09-20 13:19:25 -04:00
|
|
|
|
1999-11-15 18:16:19 -05:00
|
|
|
// Make a Windows extended style from the given wxWindows window style ?? applicable to OS/2??
|
|
|
|
static WXDWORD MakeExtendedStyle( long lStyle
|
|
|
|
,bool bEliminateBorders = TRUE
|
|
|
|
);
|
1999-09-20 13:19:25 -04:00
|
|
|
// Determine whether 3D effects are wanted
|
1999-11-15 18:16:19 -05:00
|
|
|
WXDWORD Determine3DEffects( WXDWORD dwDefaultBorderStyle
|
|
|
|
,bool* pbWant3D
|
|
|
|
) const;
|
1999-09-20 13:19:25 -04:00
|
|
|
|
1999-11-15 18:16:19 -05:00
|
|
|
// PM only: TRUE if this control is part of the main control
|
1999-09-20 13:19:25 -04:00
|
|
|
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
|
|
|
|
1999-10-12 18:49:24 -04: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
|
|
|
|
|
|
|
#if WXWIN_COMPATIBILITY
|
1999-11-15 18:16:19 -05:00
|
|
|
wxObject* GetChild(int nNumber) const;
|
|
|
|
virtual void OS2DeviceToLogical( float* pfX
|
|
|
|
,float* pfY
|
|
|
|
) const;
|
1999-10-12 18:49:24 -04:00
|
|
|
#endif // WXWIN_COMPATIBILITY
|
|
|
|
|
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:
|
1999-10-12 18:49:24 -04:00
|
|
|
// TRUE means that the handler processed the event and FALSE that it didn't
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
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
|
|
|
|
);
|
|
|
|
virtual bool OS2OnMeasureItem( int nId
|
|
|
|
,WXMEASUREITEMSTRUCT* pItem
|
|
|
|
);
|
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
|
|
|
|
);
|
2000-02-27 23:40:52 -05:00
|
|
|
bool HandlePaletteChanged();
|
1999-11-15 18:16:19 -05:00
|
|
|
bool HandleSysColorChange(void);
|
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
|
|
|
|
);
|
2001-10-22 01:11:09 -04:00
|
|
|
bool HandleChar( WXDWORD wParam
|
1999-11-15 18:16:19 -05:00
|
|
|
,WXLPARAM lParam
|
|
|
|
,bool bIsASCII = FALSE
|
|
|
|
);
|
|
|
|
bool HandleKeyDown( WXWORD wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
2001-10-22 01:11:09 -04:00
|
|
|
bool HandleKeyUp( WXDWORD 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
|
|
|
#if WXWIN_COMPATIBILITY
|
1999-11-15 18:16:19 -05:00
|
|
|
void SetShowing(bool bShow) { (void)Show(show); }
|
|
|
|
bool IsUserEnabled(void) const { return IsEnabled(); }
|
1999-10-12 18:49:24 -04:00
|
|
|
#endif // WXWIN_COMPATIBILITY
|
1999-07-29 01:11:30 -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;
|
|
|
|
bool m_bDoubleClickAllowed:1;
|
|
|
|
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-12 13:15:20 -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
|
|
|
|
wxKeyEvent CreateKeyEvent(wxEventType evType, int id, WXLPARAM lp) const;
|
|
|
|
|
2002-02-03 23:19:14 -05:00
|
|
|
|
2001-07-06 17:45:11 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxWindowOS2);
|
|
|
|
DECLARE_NO_COPY_CLASS(wxWindowOS2)
|
1999-10-12 18:49:24 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
2002-02-03 23:19:14 -05:00
|
|
|
|
1999-10-13 16:35:03 -04:00
|
|
|
private:
|
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
|
|
|
|
1999-10-13 16:35:03 -04:00
|
|
|
// Virtual function hiding supression
|
1999-11-15 18:16:19 -05:00
|
|
|
inline virtual bool Reparent(wxWindowBase* pNewParent)
|
|
|
|
{ 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
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
#endif
|
|
|
|
// _WX_WINDOW_H_
|