1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: window.h
|
|
|
|
// Purpose: wxWindow class
|
1999-08-02 04:44:01 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-12 22:49:24 +00:00
|
|
|
// Created: 10/12/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-12 22:49:24 +00:00
|
|
|
// Copyright: (c) David Webster
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_WINDOW_H_
|
|
|
|
#define _WX_WINDOW_H_
|
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
#define wxUSE_MOUSEEVENT_HACK 0
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-10-13 20:35:03 +00:00
|
|
|
#define INCL_DOS
|
|
|
|
#define INCL_PM
|
|
|
|
#define INCL_GPI
|
|
|
|
#include <os2.h>
|
|
|
|
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2002-01-07 00:44:31 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
#ifndef CW_USEDEFAULT
|
|
|
|
# define CW_USEDEFAULT ((int)0x80000000)
|
|
|
|
#endif
|
|
|
|
|
1999-07-29 05:11:30 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxButton;
|
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// constants
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// FIXME does anybody use those? they're unused by wxWindows...
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxKEY_SHIFT = 1,
|
|
|
|
wxKEY_CTRL = 2
|
|
|
|
};
|
1999-08-02 04:44:01 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// wxWindow declaration for OS/2 PM
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-08-02 04:44:01 +00:00
|
|
|
|
2001-07-06 21:45:11 +00:00
|
|
|
class WXDLLEXPORT wxWindowOS2 : public wxWindowBase
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
|
|
|
public:
|
2001-07-06 21:45:11 +00:00
|
|
|
wxWindowOS2()
|
2000-03-07 21:26:54 +00:00
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
1999-10-12 22:49:24 +00:00
|
|
|
|
2001-07-06 21:45:11 +00:00
|
|
|
wxWindowOS2( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
|
|
|
,const wxString& rName = wxPanelNameStr
|
|
|
|
)
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
|
|
|
Init();
|
1999-11-15 23:16:19 +00:00
|
|
|
Create( pParent
|
|
|
|
,vId
|
|
|
|
,rPos
|
|
|
|
,rSize
|
|
|
|
,lStyle
|
|
|
|
,rName
|
|
|
|
);
|
1999-07-29 05:11:30 +00:00
|
|
|
}
|
|
|
|
|
2001-07-06 21:45:11 +00:00
|
|
|
virtual ~wxWindowOS2();
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-11-15 23:16:19 +00: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 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// implement base class pure virtuals
|
1999-11-15 23:16:19 +00: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 CaptureMouse(void);
|
|
|
|
virtual void ReleaseMouse(void);
|
|
|
|
virtual void Refresh( bool bEraseBackground = TRUE
|
|
|
|
,const wxRect* pRect = (const wxRect *)NULL
|
|
|
|
);
|
|
|
|
virtual void Clear(void);
|
2001-12-28 23:06:51 +00:00
|
|
|
virtual void Freeze(void);
|
|
|
|
virtual void Update(void);
|
|
|
|
virtual void Thaw(void);
|
1999-11-15 23:16:19 +00: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 22:25:56 +00:00
|
|
|
#if wxUSE_MENUS_NATIVE
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual bool DoPopupMenu( wxMenu* pMenu
|
|
|
|
,int nX
|
|
|
|
,int nY
|
|
|
|
);
|
2001-10-17 22:25:56 +00:00
|
|
|
#endif // wxUSE_MENUS_NATIVE
|
1999-11-15 23:16:19 +00: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 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
#if wxUSE_DRAG_AND_DROP
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual void SetDropTarget(wxDropTarget* pDropTarget);
|
1999-10-12 22:49:24 +00:00
|
|
|
#endif // wxUSE_DRAG_AND_DROP
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
// Accept files for dragging
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual void DragAcceptFiles(bool bAccept);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
#if WXWIN_COMPATIBILITY
|
|
|
|
// Set/get scroll attributes
|
1999-11-15 23:16:19 +00: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 22:49:24 +00:00
|
|
|
// event handlers
|
1999-11-15 23:16:19 +00:00
|
|
|
//
|
1999-10-12 22:49:24 +00:00
|
|
|
// Handle a control command
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual void OnCommand( wxWindow& rWin
|
|
|
|
,wxCommandEvent& rEvent
|
|
|
|
);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// Override to define new behaviour for default action (e.g. double
|
|
|
|
// clicking on a listbox)
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual void OnDefaultAction(wxControl* WXUNUSED(pInitiatingItem)) { }
|
1999-10-12 22:49:24 +00:00
|
|
|
#endif // WXWIN_COMPATIBILITY
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
#if wxUSE_CARET && WXWIN_COMPATIBILITY
|
1999-11-15 23:16:19 +00: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 22:49:24 +00:00
|
|
|
#endif // wxUSE_CARET
|
|
|
|
|
2001-10-17 22:25:56 +00:00
|
|
|
#ifndef __WXUNIVERSAL__
|
1999-11-15 23:16:19 +00:00
|
|
|
// Native resource loading (implemented in src/os2/nativdlg.cpp)
|
1999-10-12 22:49:24 +00:00
|
|
|
// FIXME: should they really be all virtual?
|
1999-11-15 23:16:19 +00: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 22:25:56 +00:00
|
|
|
#endif //__WXUNIVERSAL__
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
|
|
|
// simple accessors
|
|
|
|
// ----------------
|
1999-09-20 17:19:25 +00:00
|
|
|
|
1999-11-15 23:16:19 +00: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 04:44:01 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// event handlers
|
|
|
|
// --------------
|
2000-02-21 05:12:34 +00:00
|
|
|
void OnSetFocus(wxFocusEvent& rEvent);
|
1999-11-15 23:16:19 +00:00
|
|
|
void OnEraseBackground(wxEraseEvent& rEvent);
|
|
|
|
void OnIdle(wxIdleEvent& rEvent);
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
public:
|
1999-07-29 05:11:30 +00:00
|
|
|
// For implementation purposes - sometimes decorations make the client area
|
|
|
|
// smaller
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual wxPoint GetClientAreaOrigin(void) const;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-09-20 17:19:25 +00:00
|
|
|
// Windows subclassing
|
|
|
|
void SubclassWin(WXHWND hWnd);
|
1999-11-15 23:16:19 +00:00
|
|
|
void UnsubclassWin(void);
|
1999-09-20 17:19:25 +00:00
|
|
|
|
1999-11-15 23:16:19 +00:00
|
|
|
WXFARPROC OS2GetOldWndProc(void) const { return m_fnOldWndProc; }
|
|
|
|
void OS2SetOldWndProc(WXFARPROC fnProc) { m_fnOldWndProc = fnProc; }
|
1999-09-20 17:19:25 +00:00
|
|
|
|
1999-11-15 23:16:19 +00:00
|
|
|
wxWindow* FindItem(long lId) const;
|
|
|
|
wxWindow* FindItemByHWND( WXHWND hWnd
|
|
|
|
,bool bControlOnly = FALSE
|
|
|
|
) const;
|
1999-09-20 17:19:25 +00:00
|
|
|
|
1999-11-15 23:16:19 +00: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 17:19:25 +00:00
|
|
|
// Determine whether 3D effects are wanted
|
1999-11-15 23:16:19 +00:00
|
|
|
WXDWORD Determine3DEffects( WXDWORD dwDefaultBorderStyle
|
|
|
|
,bool* pbWant3D
|
|
|
|
) const;
|
1999-09-20 17:19:25 +00:00
|
|
|
|
1999-11-15 23:16:19 +00:00
|
|
|
// PM only: TRUE if this control is part of the main control
|
1999-09-20 17:19:25 +00:00
|
|
|
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// returns TRUE if the window has been created
|
2002-01-07 00:44:31 +00: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 23:16:19 +00:00
|
|
|
virtual bool OS2Command( WXUINT uParam
|
|
|
|
,WXWORD nId
|
|
|
|
);
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
#if WXWIN_COMPATIBILITY
|
1999-11-15 23:16:19 +00:00
|
|
|
wxObject* GetChild(int nNumber) const;
|
|
|
|
virtual void OS2DeviceToLogical( float* pfX
|
|
|
|
,float* pfY
|
|
|
|
) const;
|
1999-10-12 22:49:24 +00:00
|
|
|
#endif // WXWIN_COMPATIBILITY
|
|
|
|
|
2001-10-17 22:25:56 +00:00
|
|
|
#ifndef __WXUNIVERSAL__
|
1999-10-12 22:49:24 +00:00
|
|
|
// Create an appropriate wxWindow from a HWND
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual wxWindow* CreateWindowFromHWND( wxWindow* pParent
|
|
|
|
,WXHWND hWnd
|
|
|
|
);
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
// Make sure the window style reflects the HWND style (roughly)
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual void AdoptAttributesFromHWND(void);
|
2001-10-17 22:25:56 +00:00
|
|
|
#endif
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
// Setup background and foreground colours correctly
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual void SetupColours(void);
|
1999-10-12 22:49:24 +00: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 23:16:19 +00: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 22:49:24 +00:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------
|
1999-11-15 23:16:19 +00:00
|
|
|
// internal handlers for OS2 messages: all handlers return a boolen value:
|
1999-10-12 22:49:24 +00:00
|
|
|
// TRUE means that the handler processed the event and FALSE that it didn't
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
1999-11-15 23:16:19 +00:00
|
|
|
// there are several cases where we have virtual functions for PM
|
1999-10-12 22:49:24 +00: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 23:16:19 +00:00
|
|
|
// messages, however, we do *not* have corresponding OS2OnXXX() function
|
1999-10-12 22:49:24 +00:00
|
|
|
// and if the derived class wants to process them, it should override
|
1999-11-15 23:16:19 +00:00
|
|
|
// OS2WindowProc() directly.
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
// scroll event (both horizontal and vertical)
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual bool OS2OnScroll( int nOrientation
|
|
|
|
,WXWORD nSBCode
|
|
|
|
,WXWORD pos
|
|
|
|
,WXHWND control
|
|
|
|
);
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
// owner-drawn controls need to process these messages
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual bool OS2OnDrawItem( int nId
|
|
|
|
,WXDRAWITEMSTRUCT* pItem
|
|
|
|
);
|
|
|
|
virtual bool OS2OnMeasureItem( int nId
|
|
|
|
,WXMEASUREITEMSTRUCT* pItem
|
|
|
|
);
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
// the rest are not virtual
|
1999-11-15 23:16:19 +00:00
|
|
|
bool HandleCreate( WXLPCREATESTRUCT vCs
|
|
|
|
,bool* pMayCreate
|
|
|
|
);
|
1999-10-12 22:49:24 +00:00
|
|
|
bool HandleInitDialog(WXHWND hWndFocus);
|
1999-11-15 23:16:19 +00: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-28 04:40:52 +00:00
|
|
|
bool HandleGetMinMaxInfo(PSWP pMmInfo);
|
1999-11-15 23:16:19 +00: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-28 04:40:52 +00:00
|
|
|
bool HandlePaletteChanged();
|
1999-11-15 23:16:19 +00:00
|
|
|
bool HandleSysColorChange(void);
|
2000-02-28 04:40:52 +00:00
|
|
|
bool HandleCtlColor(WXHBRUSH* hBrush);
|
1999-11-15 23:16:19 +00:00
|
|
|
bool HandleSetFocus(WXHWND hWnd);
|
|
|
|
bool HandleKillFocus(WXHWND hWnd);
|
2000-02-28 04:40:52 +00:00
|
|
|
bool HandleEndDrag(WXWPARAM wParam);
|
1999-11-15 23:16:19 +00:00
|
|
|
bool HandleMouseEvent( WXUINT uMsg
|
|
|
|
,int nX
|
|
|
|
,int nY
|
|
|
|
,WXUINT uFlags
|
|
|
|
);
|
|
|
|
bool HandleMouseMove( int nX
|
|
|
|
,int nY
|
|
|
|
,WXUINT uFlags
|
|
|
|
);
|
2001-10-22 05:11:09 +00:00
|
|
|
bool HandleChar( WXDWORD wParam
|
1999-11-15 23:16:19 +00:00
|
|
|
,WXLPARAM lParam
|
|
|
|
,bool bIsASCII = FALSE
|
|
|
|
);
|
|
|
|
bool HandleKeyDown( WXWORD wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
2001-10-22 05:11:09 +00:00
|
|
|
bool HandleKeyUp( WXDWORD wParam
|
1999-11-15 23:16:19 +00:00
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
|
|
|
bool HandleQueryDragIcon(WXHICON* phIcon);
|
2000-02-28 04:40:52 +00:00
|
|
|
bool HandleSetCursor( USHORT vId
|
|
|
|
,WXHWND hWnd
|
1999-11-15 23:16:19 +00:00
|
|
|
);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2001-12-28 07:00:16 +00: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 22:49:24 +00:00
|
|
|
// Window procedure
|
2000-02-21 05:12:34 +00:00
|
|
|
virtual MRESULT OS2WindowProc( WXUINT uMsg
|
1999-11-15 23:16:19 +00:00
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// Calls an appropriate default window procedure
|
2000-02-21 05:12:34 +00:00
|
|
|
virtual MRESULT OS2DefWindowProc( WXUINT uMsg
|
1999-11-15 23:16:19 +00:00
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
|
|
|
virtual bool OS2ProcessMessage(WXMSG* pMsg);
|
|
|
|
virtual bool OS2TranslateMessage(WXMSG* pMsg);
|
|
|
|
virtual void OS2DestroyWindow(void);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// Detach "Window" menu from menu bar so it doesn't get deleted
|
1999-11-15 23:16:19 +00:00
|
|
|
void OS2DetachWindowMenu(void);
|
1999-10-05 04:22:59 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// this function should return the brush to paint the window background
|
|
|
|
// with or 0 for the default brush
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual WXHBRUSH OnCtlColor( WXHDC hDC
|
|
|
|
,WXHWND hWnd
|
|
|
|
,WXUINT uCtlColor
|
|
|
|
,WXUINT uMessage
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
1999-10-05 04:22:59 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
#if WXWIN_COMPATIBILITY
|
1999-11-15 23:16:19 +00:00
|
|
|
void SetShowing(bool bShow) { (void)Show(show); }
|
|
|
|
bool IsUserEnabled(void) const { return IsEnabled(); }
|
1999-10-12 22:49:24 +00:00
|
|
|
#endif // WXWIN_COMPATIBILITY
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// Responds to colour changes: passes event on to children.
|
1999-11-15 23:16:19 +00:00
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-11-15 23:16:19 +00:00
|
|
|
// initialize various fields of wxMouseEvent (common part of OS2OnMouseXXX)
|
|
|
|
void InitMouseEvent( wxMouseEvent& rEvent
|
|
|
|
,int nX
|
|
|
|
,int nY
|
|
|
|
,WXUINT uFlags
|
|
|
|
);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2001-12-21 18:09:02 +00:00
|
|
|
void MoveChildren(int nDiff);
|
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
protected:
|
2000-02-21 05:12:34 +00: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 22:49:24 +00:00
|
|
|
// the window handle
|
1999-11-15 23:16:19 +00:00
|
|
|
WXHWND m_hWnd;
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
// the old window proc (we subclass all windows)
|
1999-11-15 23:16:19 +00:00
|
|
|
WXFARPROC m_fnOldWndProc;
|
1999-10-12 22:49:24 +00:00
|
|
|
|
2001-05-25 21:12:00 +00:00
|
|
|
// additional (OS2 specific) flags
|
1999-11-15 23:16:19 +00: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 21:12:00 +00:00
|
|
|
WXDWORD m_dwExStyle;
|
1999-08-03 04:36:53 +00:00
|
|
|
|
|
|
|
// the size of one page for scrolling
|
1999-11-15 23:16:19 +00:00
|
|
|
int m_nXThumbSize;
|
|
|
|
int m_nYThumbSize;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
#if wxUSE_MOUSEEVENT_HACK
|
|
|
|
// the coordinates of the last mouse event and the type of it
|
1999-11-15 23:16:19 +00:00
|
|
|
long m_lLastMouseX,
|
|
|
|
long m_lLastMouseY;
|
|
|
|
int m_nLastMouseEvent;
|
1999-10-12 22:49:24 +00:00
|
|
|
#endif // wxUSE_MOUSEEVENT_HACK
|
|
|
|
|
1999-11-15 23:16:19 +00:00
|
|
|
WXHMENU m_hMenu; // Menu, if any
|
2000-02-18 23:35:39 +00:00
|
|
|
unsigned long m_ulMenubarId; // it's Id, if any
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
// the return value of WM_GETDLGCODE handler
|
1999-11-15 23:16:19 +00:00
|
|
|
long m_lDlgCode;
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
// implement the base class pure virtuals
|
1999-11-15 23:16:19 +00: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 22:49:24 +00: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 21:26:54 +00:00
|
|
|
// ::WinSetWindowPos() except for composite controls which will want to arrange
|
1999-10-12 22:49:24 +00:00
|
|
|
// themselves inside the given rectangle
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual void DoMoveWindow( int nX
|
|
|
|
,int nY
|
|
|
|
,int nWidth
|
|
|
|
,int nHeight
|
|
|
|
);
|
1999-10-12 22:49:24 +00:00
|
|
|
|
|
|
|
#if wxUSE_TOOLTIPS
|
1999-11-15 23:16:19 +00:00
|
|
|
virtual void DoSetToolTip(wxToolTip* pTip);
|
1999-10-12 22:49:24 +00:00
|
|
|
#endif // wxUSE_TOOLTIPS
|
|
|
|
|
2001-12-21 18:09:02 +00:00
|
|
|
int GetOS2ParentHeight(wxWindowOS2* pParent);
|
|
|
|
|
1999-07-29 05:11:30 +00:00
|
|
|
private:
|
1999-10-12 22:49:24 +00:00
|
|
|
// common part of all ctors
|
1999-11-15 23:16:19 +00:00
|
|
|
void Init(void);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// the (non-virtual) handlers for the events
|
1999-11-15 23:16:19 +00: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 05:12:34 +00:00
|
|
|
// the helper functions used by HandleChar/KeyXXX methods
|
|
|
|
wxKeyEvent CreateKeyEvent(wxEventType evType, int id, WXLPARAM lp) const;
|
|
|
|
|
2001-07-06 21:45:11 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxWindowOS2);
|
|
|
|
DECLARE_NO_COPY_CLASS(wxWindowOS2)
|
1999-10-12 22:49:24 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-10-13 20:35:03 +00:00
|
|
|
private:
|
2001-05-07 22:17:12 +00:00
|
|
|
HWND m_hWndScrollBarHorz;
|
|
|
|
HWND m_hWndScrollBarVert;
|
2001-05-07 04:17:46 +00:00
|
|
|
|
1999-10-13 20:35:03 +00:00
|
|
|
// Virtual function hiding supression
|
1999-11-15 23:16:19 +00:00
|
|
|
inline virtual bool Reparent(wxWindowBase* pNewParent)
|
|
|
|
{ return(wxWindowBase::Reparent(pNewParent));};
|
2000-02-21 05:12:34 +00:00
|
|
|
}; // end of wxWindow
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2001-12-28 23:06:51 +00:00
|
|
|
class wxWindowCreationHook
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxWindowCreationHook(wxWindow* pWinBeingCreated);
|
|
|
|
~wxWindowCreationHook();
|
|
|
|
}; // end of CLASS wxWindowCreationHook
|
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// global functions
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
// kbd code translation
|
1999-11-15 23:16:19 +00:00
|
|
|
WXDLLEXPORT int wxCharCodeOS2ToWX(int nKeySym);
|
|
|
|
WXDLLEXPORT int wxCharCodeWXToOS2( int nId
|
|
|
|
,bool* pbIsVirtual
|
|
|
|
);
|
1999-07-29 05:11:30 +00:00
|
|
|
#endif
|
|
|
|
// _WX_WINDOW_H_
|