+ // 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
+ ,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
+ );
+
+ // ------------------------------------------------------------------------
+ // 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
+ );
+
+ // 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(PSWP pMmInfo);
+ 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
+ );
+ bool HandlePaletteChanged(void);
+ bool HandleQueryNewPalette(void);
+ bool HandleSysColorChange(void);
+ bool HandleDisplayChange(void);
+ bool HandleCaptureChanged(WXHWND hBainedCapture);
+
+ bool HandleCtlColor(WXHBRUSH* hBrush);
+ bool HandleSetFocus(WXHWND hWnd);
+ bool HandleKillFocus(WXHWND hWnd);
+ bool HandleEndDrag(WXWPARAM wParam);
+ bool HandleMouseEvent( WXUINT uMsg
+ ,int nX
+ ,int nY
+ ,WXUINT uFlags
+ );
+ bool HandleMouseMove( int nX
+ ,int nY
+ ,WXUINT uFlags
+ );
+ bool HandleChar( WXWPARAM wParam
+ ,WXLPARAM lParam
+ ,bool bIsASCII = FALSE
+ );
+ bool HandleKeyDown( WXWPARAM wParam
+ ,WXLPARAM lParam
+ );
+ bool HandleKeyUp( WXWPARAM wParam
+ ,WXLPARAM lParam
+ );
+ bool HandleQueryDragIcon(WXHICON* phIcon);
+ bool HandleSetCursor( USHORT vId
+ ,WXHWND hWnd
+ );
+
+ bool IsMouseInWindow(void) const;
+ bool OS2GetCreateWindowCoords( const wxPoint& rPos
+ ,const wxSize& rSize
+ ,int& rnX
+ ,int& rnY
+ ,int& rnWidth
+ ,int& rnHeight
+ ) const;
+
+ // Window procedure
+ virtual MRESULT OS2WindowProc( WXUINT uMsg
+ ,WXWPARAM wParam
+ ,WXLPARAM lParam
+ );
+
+ // Calls an appropriate default window procedure
+ virtual MRESULT OS2DefWindowProc( WXUINT uMsg
+ ,WXWPARAM wParam
+ ,WXLPARAM lParam
+ );
+ virtual bool OS2ProcessMessage(WXMSG* pMsg);
+ virtual bool OS2ShouldPreProcessMessage(WXMSG* pMsg);
+ virtual bool OS2TranslateMessage(WXMSG* pMsg);
+ virtual void OS2DestroyWindow(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
+ );
+
+ void MoveChildren(int nDiff);
+ PSWP GetSwp(void) {return &m_vWinSwp;}