+ // Windows subclassing
+ void SubclassWin(WXHWND hWnd);
+ void UnsubclassWin();
+
+ WXFARPROC OS2GetOldWndProc() const { return m_oldWndProc; }
+ void OS2SetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
+
+ wxWindow *FindItem(long id) const;
+ wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const;
+
+ // Make a Windows extended style from the given wxWindows window style
+ static WXDWORD MakeExtendedStyle(long style,
+ bool eliminateBorders = TRUE);
+ // Determine whether 3D effects are wanted
+ WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) const;
+
+ // MSW 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 id,
+ wxWindow *parent,
+ const wxChar *wclass,
+ wxWindow *wx_win,
+ const wxChar *title,
+ int x, int y, int width, int height,
+ WXDWORD style,
+ const wxChar *dialog_template = NULL,
+ WXDWORD exendedStyle = 0);
+ virtual bool OS2Command(WXUINT param, WXWORD id);
+
+#if WXWIN_COMPATIBILITY
+ wxObject *GetChild(int number) const;
+ virtual void OS2DeviceToLogical(float *x, float *y) const;
+#endif // WXWIN_COMPATIBILITY
+
+ // Create an appropriate wxWindow from a HWND
+ virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
+
+ // Make sure the window style reflects the HWND style (roughly)
+ virtual void AdoptAttributesFromHWND();
+
+ // Setup background and foreground colours correctly
+ virtual void SetupColours();
+
+ // ------------------------------------------------------------------------
+ // 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 *id, WXHWND *hwnd, WXWORD *cmd);
+ void UnpackActivate(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *state, WXWORD *minimized, WXHWND *hwnd);
+ void UnpackScroll(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *code, WXWORD *pos, WXHWND *hwnd);
+ void UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *nCtlColor, WXHDC *hdc, WXHWND *hwnd);
+ void UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *item, WXWORD *flags, WXHMENU *hmenu);
+
+ // ------------------------------------------------------------------------
+ // internal handlers for MSW 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 Windows
+ // 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 MSWOnXXX() function
+ // and if the derived class wants to process them, it should override
+ // MSWWindowProc() directly.
+
+ // scroll event (both horizontal and vertical)
+ virtual bool OS2OnScroll(int orientation, WXWORD nSBCode,
+ WXWORD pos, WXHWND control);
+
+ virtual bool OS2OnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
+
+ // owner-drawn controls need to process these messages
+ virtual bool OS2OnDrawItem(int id, WXDRAWITEMSTRUCT *item);
+ virtual bool OS2OnMeasureItem(int id, WXMEASUREITEMSTRUCT *item);
+
+ // the rest are not virtual
+ bool HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate);
+ bool HandleInitDialog(WXHWND hWndFocus);
+ bool HandleDestroy();
+
+ bool HandlePaint();
+ bool HandleEraseBkgnd(WXHDC pDC);
+
+ bool HandleMinimize();
+ bool HandleMaximize();
+ bool HandleSize(int x, int y, WXUINT flag);
+ bool HandleGetMinMaxInfo(void *mmInfo);
+
+ bool HandleShow(bool show, int status);
+ bool HandleActivate(int flag, bool minimized, WXHWND activate);
+
+ bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
+ bool HandleSysCommand(WXWPARAM wParam, WXLPARAM lParam);
+
+ bool HandleCtlColor(WXHBRUSH *hBrush,
+ WXHDC hdc,
+ WXHWND hWnd,
+ WXUINT nCtlColor,
+ WXUINT message,
+ WXWPARAM wParam,
+ WXLPARAM lParam);
+
+ bool HandlePaletteChanged(WXHWND hWndPalChange);
+ bool HandleQueryNewPalette();
+ bool HandleSysColorChange();
+
+ bool HandleQueryEndSession(long logOff, bool *mayEnd);
+ bool HandleEndSession(bool endSession, long logOff);
+
+ bool HandleSetFocus(WXHWND wnd);
+ bool HandleKillFocus(WXHWND wnd);
+
+ bool HandleDropFiles(WXWPARAM wParam);
+
+ bool HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags);
+ bool HandleMouseMove(int x, int y, WXUINT flags);
+
+ bool HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
+ bool HandleKeyDown(WXWORD wParam, WXLPARAM lParam);
+ bool HandleKeyUp(WXWORD wParam, WXLPARAM lParam);
+
+ bool HandleQueryDragIcon(WXHICON *hIcon);
+
+ bool HandleSetCursor(WXHWND hWnd, short nHitTest, int mouseMsg);
+
+ // Window procedure
+ virtual MRESULT OS2WindowProc(HWND hwnd, WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+
+ // Calls an appropriate default window procedure
+ virtual MRESULT OS2DefWindowProc(HWND hwnd, WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+ virtual bool OS2ProcessMessage(WXMSG* pMsg);
+ virtual bool OS2TranslateMessage(WXMSG* pMsg);
+ virtual void OS2DestroyWindow();
+
+ // Detach "Window" menu from menu bar so it doesn't get deleted
+ void OS2DetachWindowMenu();
+
+ // 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 nCtlColor,
+ WXUINT message,
+ WXWPARAM wParam,
+ WXLPARAM lParam);
+
+#if WXWIN_COMPATIBILITY
+ void SetShowing(bool show) { (void)Show(show); }
+ bool IsUserEnabled() const { return IsEnabled(); }
+#endif // WXWIN_COMPATIBILITY