X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/debe6624c1e9d4bf3243381153d1e173c849bcd8..da468d387db3b7e22b008bf08be2ff6b202508fb:/include/wx/msw/window.h diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 47ef66082e..82c7516980 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -25,6 +25,7 @@ #include "wx/event.h" #include "wx/string.h" #include "wx/list.h" +#include "wx/region.h" #define wxKEY_SHIFT 1 #define wxKEY_CTRL 2 @@ -202,6 +203,12 @@ public: // Accept files for dragging virtual void DragAcceptFiles(bool accept); + // Update region access + virtual wxRegion GetUpdateRegion() const; + virtual bool IsExposed(int x, int y, int w, int h) const; + virtual bool IsExposed(const wxPoint& pt) const; + virtual bool IsExposed(const wxRect& rect) const; + // Set/get the window title virtual inline void SetTitle(const wxString& WXUNUSED(title)) {}; inline virtual wxString GetTitle(void) const { return wxString(""); }; @@ -386,36 +393,26 @@ public: // Do Update UI processing for controls void UpdateWindowUI(void); - void OnSize(wxSizeEvent& event); void OnEraseBackground(wxEraseEvent& event); void OnChar(wxKeyEvent& event); void OnPaint(wxPaintEvent& event); void OnIdle(wxIdleEvent& event); -// 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 -*/ + // Does this window want to accept keyboard focus? + virtual bool AcceptsFocus() const; public: //////////////////////////////////////////////////////////////////////// //// 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(void); @@ -506,6 +503,8 @@ public: 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); @@ -548,6 +547,8 @@ public: 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); @@ -616,11 +617,6 @@ protected: int m_caretHeight; bool m_caretEnabled; bool m_caretShown; - - // Device context being stored whilst drawing is done -// WXHDC m_tempHDC; - // Temporary device context stored during an OnPaint -// WXHDC m_paintHDC; wxFont m_windowFont; // Window's font bool m_isShown; bool m_doubleClickAllowed ; @@ -642,8 +638,6 @@ protected: bool m_backgroundTransparent; -// wxDC * m_windowDC; // The canvas's device context - int m_xThumbSize; int m_yThumbSize; @@ -662,10 +656,15 @@ public: WXUINT m_lastMsg; WXWPARAM m_lastWParam; WXLPARAM m_lastLParam; + + wxRegion m_updateRegion; +/* wxRectangle m_updateRect; // Bounding box for screen damage area #ifdef __WIN32__ WXHRGN m_updateRgn; // NT allows access to the rectangle list #endif +*/ + WXHANDLE m_acceleratorTable; WXHMENU m_hMenu; // Menu, if any wxList * m_children; // Window's children @@ -709,20 +708,8 @@ inline wxColour wxWindow::GetDefaultBackgroundColour(void) const { return m_defa inline wxButton *wxWindow::GetDefaultItem(void) const { return m_defaultItem; } inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; } -// inline wxDC *wxWindow::GetDC(void) const { return m_windowDC; } inline bool wxWindow::IsRetained(void) const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); } -/* -#if WXWIN_COMPATIBILITY -inline void wxWindow::OldOnMenuSelect(int WXUNUSED(cmd)) { Default(); }; -inline void wxWindow::OldOnInitMenuPopup(int WXUNUSED(pos)) { Default(); }; -inline void wxWindow::OldOnScroll(wxCommandEvent& WXUNUSED(event)) { Default(); }; -inline void wxWindow::OldOnMenuCommand(int WXUNUSED(cmd)) { Default(); } // Dealt with properly in wxFrame -inline void wxWindow::OldOnMove(int WXUNUSED(x), int WXUNUSED(y)) { Default(); }; // Called on move -inline void wxWindow::OldOnActivate(bool WXUNUSED(active)) { Default(); }; // Called on window activation (MSW) -#endif -*/ - inline void wxWindow::SetShowing(bool show) { m_isShown = show; } inline wxList *wxWindow::GetConstraintsInvolvedIn(void) const { return m_constraintsInvolvedIn; } inline wxSizer *wxWindow::GetSizer(void) const { return m_windowSizer; } @@ -741,6 +728,8 @@ inline bool wxWindow::IsBeingDeleted(void) { return m_isBeingDeleted; } // Window specific (so far) wxWindow* WXDLLEXPORT wxGetActiveWindow(void); +// OBSOLETE +#if 0 // Allows iteration through damaged rectangles in OnPaint class WXDLLEXPORT wxUpdateIterator { @@ -763,6 +752,7 @@ class WXDLLEXPORT wxUpdateIterator int GetW(); int GetH(); }; +#endif WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows;