- ////////////////////////////////////////////////////////////////////////
- //// IMPLEMENTATION
-
- // For implementation purposes - sometimes decorations make the client area
- // smaller
- virtual wxPoint GetClientAreaOrigin() const;
-
- // Makes an adjustment to the window position (for example, a frame that has
- // a toolbar that it manages itself).
- virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
-
- // Windows subclassing
- void SubclassWin(WXHWND hWnd);
- void UnsubclassWin();
- virtual long Default();
- virtual bool MSWCommand(WXUINT param, WXWORD id);
-
- // returns TRUE if the event was processed
- virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
-
- virtual wxWindow *FindItem(int id) const;
- virtual wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const ;
- virtual void PreDelete(WXHDC dc); // Allows system cleanup
- // TO DO: how many of these need to be virtual?
- virtual WXHWND GetHWND() 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(); // Removes and destroys all children
-
- inline bool IsBeingDeleted();
-
- // 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() 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();
-
- virtual void ResetConstraints();
- virtual void SetConstraintSizes(bool recurse = TRUE);
- virtual bool LayoutPhase1(int *noChanges);
- virtual bool LayoutPhase2(int *noChanges);
- virtual bool DoPhase(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(int x, int y, int w, int h);
- virtual void SizerMove(int x, int y);
-
- // Only set/get the size/position of the constraint (if any)
- virtual void SetSizeConstraint(int x, int y, int w, int h);
- virtual void MoveConstraint(int x, 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 ;
-
- // Dialog units translations. Implemented in wincmn.cpp.
- wxPoint ConvertPixelsToDialog(const wxPoint& pt) ;
- wxPoint ConvertDialogToPixels(const wxPoint& pt) ;
- inline wxSize ConvertPixelsToDialog(const wxSize& sz)
- { wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
- inline wxSize ConvertDialogToPixels(const wxSize& sz)
- { wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
-
- wxObject *GetChild(int number) const ;
-
- void MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow *wx_win, const char *title,
- int x, int y, int width, int height,
- WXDWORD style, const char *dialog_template = NULL,
- 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();
-
- // Setup background and foreground colours correctly
- virtual void SetupColours();
-
- // 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, bool isASCII = FALSE);
- virtual bool MSWOnKeyUp(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
-
- virtual bool MSWOnActivate(int flag, bool minimized, WXHWND activate);
- virtual long MSWOnMDIActivate(long flag, WXHWND activate, WXHWND deactivate);
-
- virtual bool MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *item);
- virtual bool MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *item);
-
- virtual void MSWOnJoyDown(int joystick, int x, int y, WXUINT flags);
- virtual void MSWOnJoyUp(int joystick, int x, int y, WXUINT flags);
- virtual void MSWOnJoyMove(int joystick, int x, int y, WXUINT flags);
- virtual void MSWOnJoyZMove(int joystick, int z, WXUINT flags);
-
- virtual long MSWGetDlgCode();
-
- // 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 bool MSWTranslateMessage(WXMSG* pMsg);
- virtual void MSWDestroyWindow();
-
- // Detach "Window" menu from menu bar so it doesn't get deleted
- void MSWDetachWindowMenu();
-
- inline WXFARPROC MSWGetOldWndProc() const;
- inline void MSWSetOldWndProc(WXFARPROC proc);
-
- // Define for each class of dialog and control
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
-
- inline void SetShowing(bool show);
- inline bool IsUserEnabled() const;
- inline bool GetUseCtl3D() const ;
- inline bool GetTransparentBackground() 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();
-
- ////////////////////////////////////////////////////////////////////////
- //// PROTECTED DATA
-protected:
- wxAcceleratorTable m_acceleratorTable;
- int m_windowId;
- long m_windowStyle; // Store the window's style
- wxEvtHandler * m_windowEventHandler; // Usually is 'this'
- wxLayoutConstraints * m_constraints; // Constraints for this window
- wxList * m_constraintsInvolvedIn; // List of constraints we're involved in
- wxSizer * m_windowSizer; // Window's top-level sizer (if any)
- wxWindow * m_sizerParent; // Window's parent sizer (if any)
- bool m_autoLayout; // Whether to call Layout() in OnSize
- wxWindow * m_windowParent; // Each window always knows its parent
- wxValidator * m_windowValidator;
- // Old window proc, for subclassed controls
- WXFARPROC m_oldWndProc;
- bool m_useCtl3D; // Using CTL3D for this control
-
- bool m_inOnSize; // Protection against OnSize reentry
-#ifndef _WX_WIN32__
- // Pointer to global memory, for EDIT controls that need
- // special treatment to reduce USER area consumption.
- WXHGLOBAL m_globalHandle;
-#endif
-
- bool m_winEnabled;
- int m_minSizeX;
- int m_minSizeY;
- int m_maxSizeX;
- int m_maxSizeY;
-
- // Caret data
- int m_caretWidth;
- int m_caretHeight;
- bool m_caretEnabled;
- bool m_caretShown;
- wxFont m_windowFont; // Window's font
- bool m_isShown;
- bool m_doubleClickAllowed ;
- wxCursor m_windowCursor; // Window's cursor
- bool m_winCaptured;
- wxString m_windowName; // Window name
-
-#if wxUSE_EXTENDED_STATICS
- wxList m_staticItems;
-#endif