X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd3f686c274a264e89ea97505350a82c1134f307..add28c55a04eb30080fc2ef9d3c5ddf66eab236a:/include/wx/msw/window.h?ds=sidebyside diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 66e3dfc9ce..b02d8e4298 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -96,6 +96,7 @@ public: long style = 0, const wxString& name = wxPanelNameStr) { + Init(); Create(parent, id, pos, size, style, name); } @@ -161,26 +162,40 @@ public: // Get overall window size virtual void GetSize(int *width, int *height) const; + virtual wxSize GetSize() const { int w, h; GetSize(& w, & h); return wxSize(w, h); } + virtual wxRect GetRect() const { int w, h; int x, y; GetPosition(& x, & y); GetSize(& w, & h); return wxRect(x, y, w, h); } // Get window position, relative to parent (or screen if no parent) virtual void GetPosition(int *x, int *y) const; + virtual wxPoint GetPosition() const { int x, y; GetPosition(&x, &y); return wxPoint(x, y); } // Get client (application-useable) size virtual void GetClientSize(int *width, int *height) const; + virtual wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); } // Set overall size and position virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - inline virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } - inline virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { SetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); } + virtual void SetSize(const wxSize& size) { SetSize(-1, -1, size.x, size.y, wxSIZE_USE_EXISTING); } + + virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); } + virtual void Move(const wxPoint& pt) { SetSize(pt.x, pt.y, -1, -1, wxSIZE_USE_EXISTING); } // Set client size - virtual void SetClientSize(int width, int size); + virtual void SetClientSize(int width, int height); + virtual void SetClientSize(const wxSize& sz) { SetClientSize(sz.x, sz.y); } // Convert client to screen coordinates virtual void ClientToScreen(int *x, int *y) const; + virtual wxPoint ClientToScreen(const wxPoint& pt) const + { int x = pt.x; int y = pt.y; ClientToScreen(& x, & y); return wxPoint(x, y); } // Convert screen to client coordinates virtual void ScreenToClient(int *x, int *y) const; + virtual wxPoint ScreenToClient(const wxPoint& pt) const + { int x = pt.x; int y = pt.y; ScreenToClient(& x, & y); return wxPoint(x, y); } // Set the focus to this window virtual void SetFocus(); @@ -274,6 +289,10 @@ public: inline void SetParent(wxWindow *p) ; inline wxWindow *GetGrandParent() const; inline wxList *GetChildren() const; + // Set this window to be the child of 'parent'. + // Returns FALSE it's not possible (some systems + // won't allow it) + virtual bool Reparent(wxWindow *parent); // Set/get the window's font virtual void SetFont(const wxFont& f);