+ // PM only: TRUE if this control is part of the main control
+ virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
+
+ // returns TRUE if the window has been created
+ bool OS2Create( int nId
+ ,wxWindow* pParent
+ ,const wxChar* zWclass
+ ,wxWindow* pWxWin
+ ,const wxChar* zTitle
+ ,int nX
+ ,int nY
+ ,int nWidth
+ ,int nHeight
+ ,WXDWORD dwStyle
+ ,const wxChar* zDialogTemplate = NULL
+ ,WXDWORD dwExendedStyle = 0
+ );
+ virtual bool OS2Command( WXUINT uParam
+ ,WXWORD nId
+ );
+
+#if WXWIN_COMPATIBILITY
+ wxObject* GetChild(int nNumber) const;
+ virtual void OS2DeviceToLogical( float* pfX
+ ,float* pfY
+ ) const;
+#endif // WXWIN_COMPATIBILITY
+
+ // Create an appropriate wxWindow from a HWND
+ virtual wxWindow* CreateWindowFromHWND( wxWindow* pParent
+ ,WXHWND hWnd
+ );
+
+ // Make sure the window style reflects the HWND style (roughly)
+ virtual void AdoptAttributesFromHWND(void);
+
+ // Setup background and foreground colours correctly
+ virtual void SetupColours(void);
+
+ // ------------------------------------------------------------------------
+ // 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
+ // ------------------------------------------------------------------------
+
+ void UnpackCommand( WXWPARAM wParam
+ ,WXLPARAM lParam,
+ WXWORD* pId
+ ,WXHWND* pHwnd
+ ,WXWORD* pCmd
+ );
+ void UnpackActivate( WXWPARAM wParam
+ ,WXLPARAM lParam
+ ,WXWORD* pState
+ ,WXWORD* pMinimized
+ ,WXHWND* pHwnd
+ );
+ void UnpackScroll( WXWPARAM wParam
+ ,WXLPARAM lParam
+ ,WXWORD* pCode
+ ,WXWORD* pPos
+ ,WXHWND* pHwnd
+ );
+ void UnpackCtlColor( WXWPARAM wParam
+ ,WXLPARAM lParam
+ ,WXWORD* pCtlColor
+ ,WXHDC* pHdc
+ ,WXHWND* pHwnd
+ );
+ void UnpackMenuSelect( WXWPARAM wParam
+ ,WXLPARAM lParam
+ ,WXWORD* pTtem
+ ,WXWORD* pFlags
+ ,WXHMENU* pHmenu
+ );
+
+ // ------------------------------------------------------------------------
+ // internal handlers for OS2 messages: all handlers return a boolen value:
+ // TRUE means that the handler processed the event and FALSE that it didn't
+ // ------------------------------------------------------------------------
+
+ // there are several cases where we have virtual functions for PM
+ // message processing: this is because these messages often require to be
+ // processed in a different manner in the derived classes. For all other
+ // messages, however, we do *not* have corresponding OS2OnXXX() function
+ // and if the derived class wants to process them, it should override
+ // OS2WindowProc() directly.
+
+ // scroll event (both horizontal and vertical)
+ virtual bool OS2OnScroll( int nOrientation
+ ,WXWORD nSBCode
+ ,WXWORD pos
+ ,WXHWND control
+ );
+
+ virtual bool OS2OnNotify( int nIdCtrl
+ ,WXLPARAM lParam
+ ,WXLPARAM* pResult
+ );
+
+ // owner-drawn controls need to process these messages
+ virtual bool OS2OnDrawItem( int nId
+ ,WXDRAWITEMSTRUCT* pItem
+ );
+ virtual bool OS2OnMeasureItem( int nId
+ ,WXMEASUREITEMSTRUCT* pItem
+ );
+
+ // the rest are not virtual
+ bool HandleCreate( WXLPCREATESTRUCT vCs
+ ,bool* pMayCreate
+ );
+ bool HandleInitDialog(WXHWND hWndFocus);
+ bool HandleDestroy(void);
+ bool HandlePaint(void);
+ bool HandleEraseBkgnd(WXHDC vDC);
+ bool HandleMinimize(void);
+ bool HandleMaximize(void);
+ bool HandleSize( int nX
+ ,int nY
+ ,WXUINT uFlag
+ );
+ bool HandleGetMinMaxInfo(void* pMmInfo);
+ bool HandleShow( bool bShow
+ ,int nStatus
+ );
+ bool HandleActivate( int nFlag
+ ,bool bMinimized
+ ,WXHWND hActivate
+ );
+ bool HandleCommand( WXWORD nId
+ ,WXWORD nCmd
+ ,WXHWND hControl
+ );
+ bool HandleSysCommand( WXWPARAM wParam
+ ,WXLPARAM lParam
+ );
+ bool HandleCtlColor( WXHBRUSH* phBrush
+ ,WXHDC hDc
+ ,WXHWND hWnd
+ ,WXUINT uCtlColor
+ ,WXUINT uMessage
+ ,WXWPARAM wParam
+ ,WXLPARAM lParam
+ );
+ bool HandlePaletteChanged(WXHWND hWndPalChange);
+ bool HandleQueryNewPalette(void);
+ bool HandleSysColorChange(void);
+ bool HandleQueryEndSession( long lLogOff
+ ,bool* pbMayEnd
+ );
+ bool HandleEndSession( bool bEndSession
+ ,long lLogOff
+ );
+ bool HandleSetFocus(WXHWND hWnd);
+ bool HandleKillFocus(WXHWND hWnd);
+ bool HandleDropFiles(WXWPARAM wParam);
+ bool HandleMouseEvent( WXUINT uMsg
+ ,int nX
+ ,int nY
+ ,WXUINT uFlags
+ );
+ bool HandleMouseMove( int nX
+ ,int nY
+ ,WXUINT uFlags
+ );
+ bool HandleChar( WXWORD wParam
+ ,WXLPARAM lParam
+ ,bool bIsASCII = FALSE
+ );
+ bool HandleKeyDown( WXWORD wParam
+ ,WXLPARAM lParam
+ );
+ bool HandleKeyUp( WXWORD wParam
+ ,WXLPARAM lParam
+ );
+ bool HandleQueryDragIcon(WXHICON* phIcon);
+ bool HandleSetCursor( WXHWND hWnd
+ ,short nHitTest
+ ,int nMouseMsg
+ );
+
+ // Window procedure
+ virtual MRESULT OS2WindowProc( HWND hwnd
+ ,WXUINT uMsg
+ ,WXWPARAM wParam
+ ,WXLPARAM lParam
+ );
+
+ // Calls an appropriate default window procedure
+ virtual MRESULT OS2DefWindowProc( HWND hwnd
+ ,WXUINT uMsg
+ ,WXWPARAM wParam
+ ,WXLPARAM lParam
+ );
+ virtual bool OS2ProcessMessage(WXMSG* pMsg);
+ virtual bool OS2TranslateMessage(WXMSG* pMsg);
+ virtual void OS2DestroyWindow(void);
+
+ // Detach "Window" menu from menu bar so it doesn't get deleted
+ void OS2DetachWindowMenu(void);
+
+ // this function should return the brush to paint the window background
+ // with or 0 for the default brush
+ virtual WXHBRUSH OnCtlColor( WXHDC hDC
+ ,WXHWND hWnd
+ ,WXUINT uCtlColor
+ ,WXUINT uMessage
+ ,WXWPARAM wParam
+ ,WXLPARAM lParam
+ );
+
+#if WXWIN_COMPATIBILITY
+ void SetShowing(bool bShow) { (void)Show(show); }
+ bool IsUserEnabled(void) const { return IsEnabled(); }
+#endif // WXWIN_COMPATIBILITY
+
+ // Responds to colour changes: passes event on to children.
+ void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
+
+ // initialize various fields of wxMouseEvent (common part of OS2OnMouseXXX)
+ void InitMouseEvent( wxMouseEvent& rEvent
+ ,int nX
+ ,int nY
+ ,WXUINT uFlags
+ );