1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for wxPanel and wxScrolledWindow
7 // Created: 24-June-1997
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
21 //---------------------------------------------------------------------------
27 class wxPanel : public wxWindow
30 %pythonAppend wxPanel "self._setOORInfo(self)"
31 %pythonAppend wxPanel() ""
33 wxPanel(wxWindow* parent,
34 const wxWindowID id=-1,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
37 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
38 const wxString& name = wxPyPanelNameStr);
39 %name(PrePanel)wxPanel();
41 bool Create(wxWindow* parent,
42 const wxWindowID id=-1,
43 const wxPoint& pos = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize,
45 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
46 const wxString& name = wxPyPanelNameStr);
50 static wxVisualAttributes
51 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
54 //---------------------------------------------------------------------------
58 // TODO: Add wrappers for the wxScrollHelper class, make wxScrolledWindow
59 // derive from it and wxPanel. But what to do about wxGTK where this
62 MustHaveApp(wxScrolledWindow);
64 class wxScrolledWindow : public wxPanel
67 %pythonAppend wxScrolledWindow "self._setOORInfo(self)"
68 %pythonAppend wxScrolledWindow() ""
70 wxScrolledWindow(wxWindow* parent,
71 const wxWindowID id = -1,
72 const wxPoint& pos = wxDefaultPosition,
73 const wxSize& size = wxDefaultSize,
74 long style = wxHSCROLL | wxVSCROLL,
75 const wxString& name = wxPyPanelNameStr);
76 %name(PreScrolledWindow)wxScrolledWindow();
78 bool Create(wxWindow* parent,
79 const wxWindowID id = -1,
80 const wxPoint& pos = wxDefaultPosition,
81 const wxSize& size = wxDefaultSize,
82 long style = wxHSCROLL | wxVSCROLL,
83 const wxString& name = wxPyPanelNameStr);
86 // configure the scrolling
87 virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
88 int noUnitsX, int noUnitsY,
89 int xPos = 0, int yPos = 0,
90 bool noRefresh = False );
92 // scroll to the given (in logical coords) position
93 virtual void Scroll(int x, int y);
95 // get/set the page size for this orientation (wxVERTICAL/wxHORIZONTAL)
96 int GetScrollPageSize(int orient) const;
97 void SetScrollPageSize(int orient, int pageSize);
99 // Set the x, y scrolling increments.
100 void SetScrollRate( int xstep, int ystep );
103 virtual void, GetScrollPixelsPerUnit(int *OUTPUT, int *OUTPUT) const,
104 "GetScrollPixelsPerUnit() -> (xUnit, yUnit)",
105 "Get the size of one logical unit in physical units.", "");
107 // Enable/disable Windows scrolling in either direction. If True, wxWindows
108 // scrolls the canvas and only a bit of the canvas is invalidated; no
109 // Clear() is necessary. If False, the whole canvas is invalidated and a
110 // Clear() is necessary. Disable for when the scroll increment is used to
111 // actually scroll a non-constant distance
112 virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
116 virtual void, GetViewStart(int *OUTPUT, int *OUTPUT) const,
117 "GetViewStart() -> (x,y)",
118 "Get the view start", "");
120 // Set the scale factor, used in PrepareDC
121 void SetScale(double xs, double ys);
122 double GetScaleX() const;
123 double GetScaleY() const;
126 %nokwargs CalcScrolledPosition;
127 %nokwargs CalcUnscrolledPosition;
129 DocStr(CalcScrolledPosition, "Translate between scrolled and unscrolled coordinates.", "");
130 wxPoint CalcScrolledPosition(const wxPoint& pt) const;
132 void, CalcScrolledPosition(int x, int y, int *OUTPUT, int *OUTPUT) const,
133 "CalcScrolledPosition(int x, int y) -> (sx, sy)");
136 DocStr(CalcUnscrolledPosition, "Translate between scrolled and unscrolled coordinates.", "");
137 wxPoint CalcUnscrolledPosition(const wxPoint& pt) const;
139 void, CalcUnscrolledPosition(int x, int y, int *OUTPUT, int *OUTPUT) const,
140 "CalcUnscrolledPosition(int x, int y) -> (ux, uy)");
144 // TODO: use directors?
145 // virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
146 // virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
148 // Adjust the scrollbars
149 virtual void AdjustScrollbars();
151 // Calculate scroll increment
152 virtual int CalcScrollInc(wxScrollWinEvent& event);
154 // Normally the wxScrolledWindow will scroll itself, but in some rare
155 // occasions you might want it to scroll [part of] another window (e.g. a
156 // child of it in order to scroll only a portion the area between the
157 // scrollbars (spreadsheet: only cell area will move).
158 virtual void SetTargetWindow(wxWindow *target);
159 virtual wxWindow *GetTargetWindow() const;
162 void SetTargetRect(const wxRect& rect);
163 wxRect GetTargetRect() const;
166 static wxVisualAttributes
167 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
171 //---------------------------------------------------------------------------