X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b9048c56f0aa04b2adbb7813f9698abdda15184..0a5bb138a71dfc1c706fc0858fb2801500e2c2e8:/wxPython/src/_panel.i diff --git a/wxPython/src/_panel.i b/wxPython/src/_panel.i index 76a7fb4d5f..6dc14e0f6f 100644 --- a/wxPython/src/_panel.i +++ b/wxPython/src/_panel.i @@ -22,11 +22,14 @@ %newgroup +MustHaveApp(wxPanel); + class wxPanel : public wxWindow { public: %pythonAppend wxPanel "self._setOORInfo(self)" %pythonAppend wxPanel() "" + %typemap(out) wxPanel*; // turn off this typemap wxPanel(wxWindow* parent, const wxWindowID id=-1, @@ -34,10 +37,13 @@ public: const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxNO_BORDER, const wxString& name = wxPyPanelNameStr); - %name(PrePanel)wxPanel(); + %RenameCtor(PrePanel, wxPanel()); + + // Turn it back on again + %typemap(out) wxPanel* { $result = wxPyMake_wxObject($1, $owner); } 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, @@ -45,6 +51,26 @@ public: void InitDialog(); + + DocDeclStr( + virtual void , SetFocus(), + "Overrides `wx.Window.SetFocus`. This method uses the (undocumented) +mix-in class wxControlContainer which manages the focus and TAB logic +for controls which usually have child controls. In practice, if you +call this method and the panel has at least one child window, then the +focus will be given to the child window.", " +:see: `wx.FocusEvent`, `wx.Window.SetFocus`, `SetFocusIgnoringChildren`"); + + + DocDeclStr( + virtual void , SetFocusIgnoringChildren(), + "In contrast to `SetFocus` (see above) this will set the focus to the +panel even of there are child windows in the panel. This is only +rarely needed.", ""); + + + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); }; //--------------------------------------------------------------------------- @@ -55,11 +81,14 @@ public: // derive from it and wxPanel. But what to do about wxGTK where this // is not True? +MustHaveApp(wxScrolledWindow); + class wxScrolledWindow : public wxPanel { public: %pythonAppend wxScrolledWindow "self._setOORInfo(self)" %pythonAppend wxScrolledWindow() "" + %typemap(out) wxScrolledWindow*; // turn off this typemap wxScrolledWindow(wxWindow* parent, const wxWindowID id = -1, @@ -67,7 +96,10 @@ public: const wxSize& size = wxDefaultSize, long style = wxHSCROLL | wxVSCROLL, const wxString& name = wxPyPanelNameStr); - %name(PreScrolledWindow)wxScrolledWindow(); + %RenameCtor(PreScrolledWindow, wxScrolledWindow()); + + // Turn it back on again + %typemap(out) wxScrolledWindow* { $result = wxPyMake_wxObject($1, $owner); } bool Create(wxWindow* parent, const wxWindowID id = -1, @@ -81,7 +113,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); @@ -90,13 +122,17 @@ public: int GetScrollPageSize(int orient) const; void SetScrollPageSize(int orient, int pageSize); +// // get the number of lines the window can scroll, +// // returns 0 if no scrollbars are there. +// int GetScrollLines( int orient ) const; + // Set the x, y scrolling increments. void SetScrollRate( int xstep, int ystep ); DocDeclAStr( virtual void, GetScrollPixelsPerUnit(int *OUTPUT, int *OUTPUT) const, "GetScrollPixelsPerUnit() -> (xUnit, yUnit)", - "Get the size of one logical unit in physical units."); + "Get the size of one logical unit in physical units.", ""); // Enable/disable Windows scrolling in either direction. If True, wxWindows // scrolls the canvas and only a bit of the canvas is invalidated; no @@ -109,7 +145,7 @@ public: DocDeclAStr( virtual void, GetViewStart(int *OUTPUT, int *OUTPUT) const, "GetViewStart() -> (x,y)", - "Get the view start"); + "Get the view start", ""); // Set the scale factor, used in PrepareDC void SetScale(double xs, double ys); @@ -120,14 +156,14 @@ public: %nokwargs CalcScrolledPosition; %nokwargs CalcUnscrolledPosition; - DocStr(CalcScrolledPosition, "Translate between scrolled and unscrolled coordinates."); + DocStr(CalcScrolledPosition, "Translate between scrolled and unscrolled coordinates.", ""); wxPoint CalcScrolledPosition(const wxPoint& pt) 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."); + 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, @@ -156,6 +192,20 @@ public: void SetTargetRect(const wxRect& rect); wxRect GetTargetRect() const; #endif + + // TODO: directorize this? + DocDeclStr( + virtual void , DoPrepareDC( wxDC & dc ), + "Normally what is called by `PrepareDC`.", ""); + + + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + %property(ScaleX, GetScaleX, doc="See `GetScaleX`"); + %property(ScaleY, GetScaleY, doc="See `GetScaleY`"); + %property(TargetWindow, GetTargetWindow, SetTargetWindow, doc="See `GetTargetWindow` and `SetTargetWindow`"); + %property(ViewStart, GetViewStart, doc="See `GetViewStart`"); };