X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/edccf4281bc8fbb9d8151240ba5b208339c9ac11..6721fc3852ff183e0a59c990cf62ae595c036d05:/include/wx/msw/window.h diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 6ee8daab71..538051007b 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -49,10 +49,9 @@ enum // --------------------------------------------------------------------------- // wxWindow declaration for MSW // --------------------------------------------------------------------------- + class WXDLLEXPORT wxWindow : public wxWindowBase { - DECLARE_DYNAMIC_CLASS(wxWindow); - public: wxWindow() { Init(); } @@ -88,7 +87,7 @@ public: virtual void SetFocus(); - virtual bool Reparent( wxWindow *newParent ); + virtual bool Reparent( wxWindowBase *newParent ); virtual void WarpPointer(int x, int y); virtual void CaptureMouse(); @@ -110,7 +109,7 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; - virtual bool PopupMenu( wxMenu *menu, int x, int y ); + virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = TRUE ); @@ -162,6 +161,13 @@ public: wxWindow* GetWindowChild1(wxWindowID id); wxWindow* GetWindowChild(wxWindowID id); + // a MSW only function which sends a size event to the window using its + // current size - this has an effect of refreshing the window layout +/* +FUNCTION IS NOW A MEMBER OF wxFrame - gt + void SendSizeEvent(); +*/ + // implementation from now on // -------------------------- @@ -178,8 +184,11 @@ public: // event handlers // -------------- + + void OnSetFocus(wxFocusEvent& event); void OnEraseBackground(wxEraseEvent& event); void OnIdle(wxIdleEvent& event); + void OnPaint(wxPaintEvent& event); public: // For implementation purposes - sometimes decorations make the client area @@ -197,13 +206,14 @@ public: WXFARPROC MSWGetOldWndProc() const { return m_oldWndProc; } void MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; } - wxWindow *FindItem(int id) const; + wxWindow *FindItem(long id) const; wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const; // Make a Windows extended style from the given wxWindows window style - virtual WXDWORD MakeExtendedStyle(long style, bool eliminateBorders = TRUE); + static WXDWORD MakeExtendedStyle(long style, + bool eliminateBorders = FALSE); // Determine whether 3D effects are wanted - virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D); + 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; }; @@ -252,7 +262,7 @@ public: WXWORD *item, WXWORD *flags, WXHMENU *hmenu); // ------------------------------------------------------------------------ - // internal handlers for MSW messages: all handlers return a boolen value: + // 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 // ------------------------------------------------------------------------ @@ -296,12 +306,12 @@ public: bool HandleSysCommand(WXWPARAM wParam, WXLPARAM lParam); bool HandleCtlColor(WXHBRUSH *hBrush, - WXHDC hdc, - WXHWND hWnd, - WXUINT nCtlColor, - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam); + WXHDC hdc, + WXHWND hWnd, + WXUINT nCtlColor, + WXUINT message, + WXWPARAM wParam, + WXLPARAM lParam); bool HandlePaletteChanged(WXHWND hWndPalChange); bool HandleQueryNewPalette(); @@ -317,10 +327,11 @@ public: bool HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags); bool HandleMouseMove(int x, int y, WXUINT flags); + bool HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam); - bool HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE); - bool HandleKeyDown(WXWORD wParam, WXLPARAM lParam); - bool HandleKeyUp(WXWORD wParam, WXLPARAM lParam); + bool HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII = FALSE); + bool HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam); + bool HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam); bool HandleQueryDragIcon(WXHICON *hIcon); @@ -385,7 +396,8 @@ protected: WXHMENU m_hMenu; // Menu, if any - wxButton *m_btnDefault; + // the return value of WM_GETDLGCODE handler + long m_lDlgCode; // implement the base class pure virtuals virtual void DoClientToScreen( int *x, int *y ) const; @@ -398,6 +410,12 @@ protected: int sizeFlags = wxSIZE_AUTO); virtual void DoSetClientSize(int width, int height); + // move the window to the specified location and resize it: this is called + // from both DoSetSize() and DoSetClientSize() and would usually just call + // ::MoveWindow() except for composite controls which will want to arrange + // themselves inside the given rectangle + virtual void DoMoveWindow(int x, int y, int width, int height); + #if wxUSE_TOOLTIPS virtual void DoSetToolTip( wxToolTip *tip ); #endif // wxUSE_TOOLTIPS @@ -414,6 +432,10 @@ private: bool HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); #endif // __WIN95__ + // the helper functions used by HandleChar/KeyXXX methods + wxKeyEvent CreateKeyEvent(wxEventType evType, int id, WXLPARAM lp) const; + + DECLARE_DYNAMIC_CLASS(wxWindow); DECLARE_NO_COPY_CLASS(wxWindow); DECLARE_EVENT_TABLE() };