-// virtual void OnChangeFocus(wxControl *from, wxControl *to);
-// virtual bool OnFunctionKey(wxKeyEvent &event);
-
-#if WXWIN_COMPATIBILITY
- virtual void OldOnMenuSelect(int WXUNUSED(cmd));
- virtual void OldOnInitMenuPopup(int WXUNUSED(pos));
- virtual void OldOnScroll(wxCommandEvent& WXUNUSED(event));
- virtual void OldOnPaint(void); // Called when needs painting
- virtual void OldOnSize(int width, int height); // Called on resize
- virtual void OldOnMouseEvent(wxMouseEvent& event); // Called on mouse event
- virtual void OldOnChar(wxKeyEvent& event); // Called on character event
- virtual void OldOnMenuCommand(int cmd); // Dealt with properly in wxFrame
- inline virtual void OldOnMove(int WXUNUSED(x), int WXUNUSED(y)); // Called on move
- inline virtual void OldOnActivate(bool WXUNUSED(active)); // Called on window activation (MSW)
- virtual void OldOnSetFocus(void); // Called on setting focus
- virtual void OldOnKillFocus(void); // Called on killing focus
-#endif
-
-/* THIS IS NOW OBSOLETE - all positions are in device units
- // Calculates the position of a point on the window
- // taking into account the position of scrollbars.
- // Windows doesn't automatically reflect the position of the
- // scrollbars - (0, 0) is always the top left of the visible window,
- // whereas in XView, (0, 0) moves according to scrollbar positions.
- virtual void CalcScrolledPosition(const int x, const int y, int *xx, int *yy) const ;
-
- // Calculate logical (scroll-bar/scaling aware) position from
- // device (pixel) position
- virtual void CalcUnscrolledPosition(const int x, const int y, float *xx, float *yy) const ;
-*/
-
-public:
- ////////////////////////////////////////////////////////////////////////
- //// IMPLEMENTATION
-
- // Windows subclassing
- void SubclassWin(WXHWND hWnd);
- void UnsubclassWin(void);
- virtual long Default(void);
- virtual bool MSWCommand(const WXUINT param, const WXWORD id);
- virtual bool MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam);
- virtual wxWindow *FindItem(const int id) const;
- virtual wxWindow *FindItemByHWND(const WXHWND hWnd, bool controlOnly = FALSE) const ;
- virtual void PreDelete(const WXHDC dc); // Allows system cleanup
- // TO DO: how many of these need to be virtual?
- virtual WXHWND GetHWND(void) const ;
- virtual void SetHWND(WXHWND hWnd);
-
- // Make a Windows extended style from the given wxWindows window style
- virtual WXDWORD MakeExtendedStyle(long style, bool eliminateBorders = TRUE);
- // Determine whether 3D effects are wanted
- virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D);
-
- virtual void AddChild(wxWindow *child); // Adds reference to the child object
- virtual void RemoveChild(wxWindow *child); // Removes reference to child
- // (but doesn't delete the child object)
- virtual void DestroyChildren(void); // Removes and destroys all children
-
- inline bool IsBeingDeleted(void);
-
- // MSW only: TRUE if this control is part of the main control
- virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
-
- // Constraint implementation
- void UnsetConstraints(wxLayoutConstraints *c);
- inline wxList *GetConstraintsInvolvedIn(void) const ;
- // Back-pointer to other windows we're involved with, so if we delete
- // this window, we must delete any constraints we're involved with.
- void AddConstraintReference(wxWindow *otherWin);
- void RemoveConstraintReference(wxWindow *otherWin);
- void DeleteRelatedConstraints(void);
-
- virtual void ResetConstraints(void);
- virtual void SetConstraintSizes(const bool recurse = TRUE);
- virtual bool LayoutPhase1(int *noChanges);
- virtual bool LayoutPhase2(int *noChanges);
- virtual bool DoPhase(const int);
- // Transforms from sizer coordinate space to actual
- // parent coordinate space
- virtual void TransformSizerToActual(int *x, int *y) const ;
-
- // Set size with transformation to actual coordinates if nec.
- virtual void SizerSetSize(const int x, const int y, const int w, const int h);
- virtual void SizerMove(const int x, const int y);
-
- // Only set/get the size/position of the constraint (if any)
- virtual void SetSizeConstraint(const int x, const int y, const int w, const int h);
- virtual void MoveConstraint(const int x, const int y);
- virtual void GetSizeConstraint(int *w, int *h) const ;
- virtual void GetClientSizeConstraint(int *w, int *h) const ;
- virtual void GetPositionConstraint(int *x, int *y) const ;
-
- wxObject *GetChild(const int number) const ;
-
- void MSWCreate(const int id, wxWindow *parent, const char *wclass, wxWindow *wx_win, const char *title,
- const int x, const int y, const int width, const int height,
- const WXDWORD style, const char *dialog_template = NULL,
- const WXDWORD exendedStyle = 0);
-
- // Actually defined in wx_canvs.cc since requires wxCanvas declaration
- virtual void MSWDeviceToLogical(float *x, float *y) const ;
-
- // 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(void);
-
- // Setup background and foreground colours correctly
- virtual void SetupColours(void);
-
- // Handlers
- virtual void MSWOnCreate(WXLPCREATESTRUCT cs);
- virtual bool MSWOnPaint(void);
- virtual WXHICON MSWOnQueryDragIcon(void) { return 0; }
- virtual void MSWOnSize(const int x, const int y, const WXUINT flag);
- virtual void MSWOnWindowPosChanging(void *lpPos);
- virtual void MSWOnHScroll(const WXWORD nSBCode, const WXWORD pos, const WXHWND control);
- virtual void MSWOnVScroll(const WXWORD nSBCode, const WXWORD pos, const WXHWND control);
- virtual bool MSWOnCommand(const WXWORD id, const WXWORD cmd, const WXHWND control);
- virtual long MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam);
- virtual bool MSWOnNotify(const WXWPARAM wParam, const WXLPARAM lParam);
- virtual WXHBRUSH MSWOnCtlColor(const WXHDC dc, const WXHWND pWnd, const WXUINT nCtlColor,
- const WXUINT message, const WXWPARAM wParam, const WXLPARAM lParam);
- virtual bool MSWOnColorChange(const WXHWND hWnd, const WXUINT message, const WXWPARAM wParam, const WXLPARAM lParam);
- virtual bool MSWOnEraseBkgnd(const WXHDC pDC);
- virtual void MSWOnMenuHighlight(const WXWORD item, const WXWORD flags, const WXHMENU sysmenu);
- virtual void MSWOnInitMenuPopup(const WXHMENU menu, const int pos, const bool isSystem);
- virtual bool MSWOnClose(void);
- virtual bool MSWOnDestroy(void);
- virtual bool MSWOnSetFocus(const WXHWND wnd);
- virtual bool MSWOnKillFocus(const WXHWND wnd);
- virtual void MSWOnDropFiles(const 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(const int x, const int y, const WXUINT flags);
- virtual void MSWOnLButtonUp(const int x, const int y, const WXUINT flags);
- virtual void MSWOnLButtonDClick(const int x, const int y, const WXUINT flags);
-
- virtual void MSWOnMButtonDown(const int x, const int y, const WXUINT flags);
- virtual void MSWOnMButtonUp(const int x, const int y, const WXUINT flags);
- virtual void MSWOnMButtonDClick(const int x, const int y, const WXUINT flags);
-
- virtual void MSWOnRButtonDown(const int x, const int y, const WXUINT flags);
- virtual void MSWOnRButtonUp(const int x, const int y, const WXUINT flags);
- virtual void MSWOnRButtonDClick(const int x, const int y, const WXUINT flags);
-
- virtual void MSWOnMouseMove(const int x, const int y, const WXUINT flags);
- virtual void MSWOnMouseEnter(const int x, const int y, const WXUINT flags);
- virtual void MSWOnMouseLeave(const int x, const int y, const WXUINT flags);
-
- virtual void MSWOnChar(const WXWORD wParam, const WXLPARAM lParam, const bool isASCII = FALSE);
-
- virtual bool MSWOnActivate(const int flag, const bool minimized, const WXHWND activate);
- virtual long MSWOnMDIActivate(const long flag, const WXHWND activate, const WXHWND deactivate);
-
- virtual bool MSWOnDrawItem(const int id, WXDRAWITEMSTRUCT *item);
- virtual bool MSWOnMeasureItem(const int id, WXMEASUREITEMSTRUCT *item);
-
- virtual void MSWOnJoyDown(const int joystick, const int x, const int y, const WXUINT flags);
- virtual void MSWOnJoyUp(const int joystick, const int x, const int y, const WXUINT flags);
- virtual void MSWOnJoyMove(const int joystick, const int x, const int y, const WXUINT flags);
- virtual void MSWOnJoyZMove(const int joystick, const int z, const WXUINT flags);
-
- // Window procedure
- virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
-
- // Calls an appropriate default window procedure
- virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
- virtual bool MSWProcessMessage(WXMSG* pMsg);
- virtual void MSWDestroyWindow(void);
-
- // Detach "Window" menu from menu bar so it doesn't get deleted
- void MSWDetachWindowMenu(void);
-
- inline WXFARPROC MSWGetOldWndProc() const;
- inline void MSWSetOldWndProc(const WXFARPROC proc);
-
- // Define for each class of dialog and control
- virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
-
- inline void SetShowing(const bool show);
- inline bool IsUserEnabled(void) const;
- inline bool GetUseCtl3D(void) const ;
- inline bool GetTransparentBackground(void) const ;
-
- // Responds to colour changes: passes event on to children.
- void OnSysColourChanged(wxSysColourChangedEvent& event);
-
- // Transfers data to any child controls
- void OnInitDialog(wxInitDialogEvent& event);
-
- // Sends an OnInitDialog event, which in turns transfers data to
- // to the window via validators.
- virtual void InitDialog(void);
-
- ////////////////////////////////////////////////////////////////////////
- //// PROTECTED DATA