]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_panel.i
Recent changes in SWIG make this patch no longer necessary
[wxWidgets.git] / wxPython / src / _panel.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _window.i
3 // Purpose: SWIG interface for wxPanel and wxScrolledWindow
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 24-June-1997
8 // RCS-ID: $Id$
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 // Not a %module
14
15
16 //---------------------------------------------------------------------------
17
18 %{
19 %}
20
21
22 //---------------------------------------------------------------------------
23 %newgroup
24
25
26 class wxPanel : public wxWindow
27 {
28 public:
29 %addtofunc wxPanel "self._setOORInfo(self)"
30 %addtofunc wxPanel() ""
31
32 wxPanel(wxWindow* parent,
33 const wxWindowID id,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
37 const wxString& name = wxPyPanelNameStr);
38 %name(PrePanel)wxPanel();
39
40 bool Create(wxWindow* parent,
41 const wxWindowID id,
42 const wxPoint& pos = wxDefaultPosition,
43 const wxSize& size = wxDefaultSize,
44 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
45 const wxString& name = wxPyPanelNameStr);
46
47 void InitDialog();
48
49 };
50
51 //---------------------------------------------------------------------------
52 %newgroup
53
54
55 // TODO: Add wrappers for the wxScrollHelper class, make wxScrolledWindow
56 // derive from it and wxPanel. But what to do about wxGTK where this
57 // is not true?
58
59 class wxScrolledWindow : public wxPanel
60 {
61 public:
62 %addtofunc wxScrolledWindow "self._setOORInfo(self)"
63 %addtofunc wxScrolledWindow() ""
64
65 wxScrolledWindow(wxWindow* parent,
66 const wxWindowID id = -1,
67 const wxPoint& pos = wxDefaultPosition,
68 const wxSize& size = wxDefaultSize,
69 long style = wxHSCROLL | wxVSCROLL,
70 const wxString& name = wxPyPanelNameStr);
71 %name(PreScrolledWindow)wxScrolledWindow();
72
73 bool Create(wxWindow* parent,
74 const wxWindowID id = -1,
75 const wxPoint& pos = wxDefaultPosition,
76 const wxSize& size = wxDefaultSize,
77 long style = wxHSCROLL | wxVSCROLL,
78 const wxString& name = wxPyPanelNameStr);
79
80
81 // configure the scrolling
82 virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
83 int noUnitsX, int noUnitsY,
84 int xPos = 0, int yPos = 0,
85 bool noRefresh = FALSE );
86
87 // scroll to the given (in logical coords) position
88 virtual void Scroll(int x, int y);
89
90 // get/set the page size for this orientation (wxVERTICAL/wxHORIZONTAL)
91 int GetScrollPageSize(int orient) const;
92 void SetScrollPageSize(int orient, int pageSize);
93
94 // Set the x, y scrolling increments.
95 void SetScrollRate( int xstep, int ystep );
96
97 // get the size of one logical unit in physical ones
98 virtual void GetScrollPixelsPerUnit(int *OUTPUT,
99 int *OUTPUT) const;
100
101 // Enable/disable Windows scrolling in either direction. If TRUE, wxWindows
102 // scrolls the canvas and only a bit of the canvas is invalidated; no
103 // Clear() is necessary. If FALSE, the whole canvas is invalidated and a
104 // Clear() is necessary. Disable for when the scroll increment is used to
105 // actually scroll a non-constant distance
106 virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
107
108 // Get the view start
109 virtual void GetViewStart(int *OUTPUT, int *OUTPUT) const;
110
111 // Set the scale factor, used in PrepareDC
112 void SetScale(double xs, double ys);
113 double GetScaleX() const;
114 double GetScaleY() const;
115
116
117 %nokwargs CalcScrolledPosition;
118 %nokwargs CalcUnscrolledPosition;
119
120 // translate between scrolled and unscrolled coordinates
121 void CalcScrolledPosition(int x, int y, int *OUTPUT, int *OUTPUT) const;
122 wxPoint CalcScrolledPosition(const wxPoint& pt) const;
123 void CalcUnscrolledPosition(int x, int y, int *OUTPUT, int *OUTPUT) const;
124 wxPoint CalcUnscrolledPosition(const wxPoint& pt) const;
125
126 // TODO: use directors?
127 // virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
128 // virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
129
130 // Adjust the scrollbars
131 virtual void AdjustScrollbars();
132
133 // Calculate scroll increment
134 virtual int CalcScrollInc(wxScrollWinEvent& event);
135
136 // Normally the wxScrolledWindow will scroll itself, but in some rare
137 // occasions you might want it to scroll [part of] another window (e.g. a
138 // child of it in order to scroll only a portion the area between the
139 // scrollbars (spreadsheet: only cell area will move).
140 virtual void SetTargetWindow(wxWindow *target);
141 virtual wxWindow *GetTargetWindow() const;
142
143 #ifndef __WXGTK__
144 void SetTargetRect(const wxRect& rect);
145 wxRect GetTargetRect() const;
146 #endif
147 };
148
149
150 //---------------------------------------------------------------------------