- // Saves the last message information before calling base version
- virtual bool ProcessEvent(wxEvent& event);
-
- // Handlers
- virtual void MSWOnCreate(WXLPCREATESTRUCT cs);
- virtual bool MSWOnPaint();
- virtual WXHICON MSWOnQueryDragIcon() { return 0; }
- virtual void MSWOnSize(int x, int y, WXUINT flag);
- virtual void MSWOnWindowPosChanging(void *lpPos);
- virtual void MSWOnHScroll(WXWORD nSBCode, WXWORD pos, WXHWND control);
- virtual void MSWOnVScroll(WXWORD nSBCode, WXWORD pos, WXHWND control);
- virtual bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
- virtual long MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam);
- virtual long MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam);
- virtual WXHBRUSH MSWOnCtlColor(WXHDC dc, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
- virtual bool MSWOnColorChange(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
- virtual long MSWOnPaletteChanged(WXHWND hWndPalChange);
- virtual long MSWOnQueryNewPalette();
- virtual bool MSWOnEraseBkgnd(WXHDC pDC);
- virtual void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
- virtual void MSWOnInitMenuPopup(WXHMENU menu, int pos, bool isSystem);
- virtual bool MSWOnClose();
- // Return TRUE to end session, FALSE to veto end session.
- virtual bool MSWOnQueryEndSession(long logOff);
- virtual bool MSWOnEndSession(bool endSession, long logOff);
- virtual bool MSWOnDestroy();
- virtual bool MSWOnSetFocus(WXHWND wnd);
- virtual bool MSWOnKillFocus(WXHWND wnd);
- virtual void MSWOnDropFiles(WXWPARAM wParam);
- virtual bool MSWOnInitDialog(WXHWND hWndFocus);
- virtual void MSWOnShow(bool show, int status);
-
- // TODO: rationalise these functions into 1 or 2 which take the
- // event type as argument.
- virtual void MSWOnLButtonDown(int x, int y, WXUINT flags);
- virtual void MSWOnLButtonUp(int x, int y, WXUINT flags);
- virtual void MSWOnLButtonDClick(int x, int y, WXUINT flags);
-
- virtual void MSWOnMButtonDown(int x, int y, WXUINT flags);
- virtual void MSWOnMButtonUp(int x, int y, WXUINT flags);
- virtual void MSWOnMButtonDClick(int x, int y, WXUINT flags);
-
- virtual void MSWOnRButtonDown(int x, int y, WXUINT flags);
- virtual void MSWOnRButtonUp(int x, int y, WXUINT flags);
- virtual void MSWOnRButtonDClick(int x, int y, WXUINT flags);
-
- virtual void MSWOnMouseMove(int x, int y, WXUINT flags);
- virtual void MSWOnMouseEnter(int x, int y, WXUINT flags);
- virtual void MSWOnMouseLeave(int x, int y, WXUINT flags);
-
- // These return TRUE if an event handler was found, FALSE otherwise (not processed)
- virtual bool MSWOnChar(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
- virtual bool MSWOnKeyDown(WXWORD wParam, WXLPARAM lParam);
- virtual bool MSWOnKeyUp(WXWORD wParam, WXLPARAM lParam);
-
- virtual bool MSWOnActivate(int flag, bool minimized, WXHWND activate);
- virtual long MSWOnMDIActivate(long flag, WXHWND activate, WXHWND deactivate);
-
+ // ------------------------------------------------------------------------
+ // 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,
+ 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 boolean 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 MSWOnScroll(int orientation, WXWORD nSBCode,
+ WXWORD pos, WXHWND control);
+
+ // child control notifications
+ virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
+
+ // owner-drawn controls need to process these messages