X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..ad3fca675f77c2903cafd096bbda8baa2e7689ff:/wxPython/src/_panel.i diff --git a/wxPython/src/_panel.i b/wxPython/src/_panel.i index 828c81e908..180bd8c8ed 100644 --- a/wxPython/src/_panel.i +++ b/wxPython/src/_panel.i @@ -18,19 +18,20 @@ %{ %} - //--------------------------------------------------------------------------- %newgroup +MustHaveApp(wxPanel); + class wxPanel : public wxWindow { public: - %addtofunc wxPanel "self._setOORInfo(self)" - %addtofunc wxPanel() "" + %pythonAppend wxPanel "self._setOORInfo(self)" + %pythonAppend wxPanel() "" wxPanel(wxWindow* parent, - const wxWindowID id, + const wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxNO_BORDER, @@ -38,7 +39,7 @@ public: %name(PrePanel)wxPanel(); bool Create(wxWindow* parent, - const wxWindowID id, + const wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxNO_BORDER, @@ -46,6 +47,8 @@ public: void InitDialog(); + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); }; //--------------------------------------------------------------------------- @@ -54,13 +57,15 @@ public: // TODO: Add wrappers for the wxScrollHelper class, make wxScrolledWindow // derive from it and wxPanel. But what to do about wxGTK where this -// is not true? +// is not True? + +MustHaveApp(wxScrolledWindow); class wxScrolledWindow : public wxPanel { public: - %addtofunc wxScrolledWindow "self._setOORInfo(self)" - %addtofunc wxScrolledWindow() "" + %pythonAppend wxScrolledWindow "self._setOORInfo(self)" + %pythonAppend wxScrolledWindow() "" wxScrolledWindow(wxWindow* parent, const wxWindowID id = -1, @@ -82,7 +87,7 @@ public: virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, int noUnitsX, int noUnitsY, int xPos = 0, int yPos = 0, - bool noRefresh = FALSE ); + bool noRefresh = False ); // scroll to the given (in logical coords) position virtual void Scroll(int x, int y); @@ -94,20 +99,24 @@ public: // Set the x, y scrolling increments. void SetScrollRate( int xstep, int ystep ); - // get the size of one logical unit in physical ones - virtual void GetScrollPixelsPerUnit(int *OUTPUT, - int *OUTPUT) const; + DocDeclAStr( + virtual void, GetScrollPixelsPerUnit(int *OUTPUT, int *OUTPUT) const, + "GetScrollPixelsPerUnit() -> (xUnit, yUnit)", + "Get the size of one logical unit in physical units.", ""); - // Enable/disable Windows scrolling in either direction. If TRUE, wxWindows + // Enable/disable Windows scrolling in either direction. If True, wxWindows // scrolls the canvas and only a bit of the canvas is invalidated; no - // Clear() is necessary. If FALSE, the whole canvas is invalidated and a + // Clear() is necessary. If False, the whole canvas is invalidated and a // Clear() is necessary. Disable for when the scroll increment is used to // actually scroll a non-constant distance virtual void EnableScrolling(bool x_scrolling, bool y_scrolling); - // Get the view start - virtual void GetViewStart(int *OUTPUT, int *OUTPUT) const; + DocDeclAStr( + virtual void, GetViewStart(int *OUTPUT, int *OUTPUT) const, + "GetViewStart() -> (x,y)", + "Get the view start", ""); + // Set the scale factor, used in PrepareDC void SetScale(double xs, double ys); double GetScaleX() const; @@ -117,12 +126,21 @@ public: %nokwargs CalcScrolledPosition; %nokwargs CalcUnscrolledPosition; - // translate between scrolled and unscrolled coordinates - void CalcScrolledPosition(int x, int y, int *OUTPUT, int *OUTPUT) const; + DocStr(CalcScrolledPosition, "Translate between scrolled and unscrolled coordinates.", ""); wxPoint CalcScrolledPosition(const wxPoint& pt) const; - void CalcUnscrolledPosition(int x, int y, int *OUTPUT, int *OUTPUT) const; + DocDeclA( + void, CalcScrolledPosition(int x, int y, int *OUTPUT, int *OUTPUT) const, + "CalcScrolledPosition(int x, int y) -> (sx, sy)"); + + + DocStr(CalcUnscrolledPosition, "Translate between scrolled and unscrolled coordinates.", ""); wxPoint CalcUnscrolledPosition(const wxPoint& pt) const; + DocDeclA( + void, CalcUnscrolledPosition(int x, int y, int *OUTPUT, int *OUTPUT) const, + "CalcUnscrolledPosition(int x, int y) -> (ux, uy)"); + + // TODO: use directors? // virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const; // virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const; @@ -144,6 +162,9 @@ public: void SetTargetRect(const wxRect& rect); wxRect GetTargetRect() const; #endif + + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); };