Comment out wxHVScrolledWindow

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-03-05 04:00:08 +00:00
parent df5f8f4e3d
commit 971e47976f

View File

@@ -219,254 +219,254 @@ public:
//---------------------------------------------------------------------------- // //----------------------------------------------------------------------------
%newgroup; // %newgroup;
// wxHVScrolledWindow // // wxHVScrolledWindow
// First, the C++ version // // First, the C++ version
%{ // %{
class wxPyHVScrolledWindow : public wxHVScrolledWindow // class wxPyHVScrolledWindow : public wxHVScrolledWindow
{ // {
DECLARE_ABSTRACT_CLASS(wxPyHVScrolledWindow) // DECLARE_ABSTRACT_CLASS(wxPyHVScrolledWindow)
public: // public:
wxPyHVScrolledWindow() : wxHVScrolledWindow() {} // wxPyHVScrolledWindow() : wxHVScrolledWindow() {}
wxPyHVScrolledWindow(wxWindow *parent, // wxPyHVScrolledWindow(wxWindow *parent,
wxWindowID id = wxID_ANY, // wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, // const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, // const wxSize& size = wxDefaultSize,
long style = 0, // long style = 0,
const wxString& name = wxPyPanelNameStr) // const wxString& name = wxPyPanelNameStr)
: wxHVScrolledWindow(parent, id, pos, size, style, name) {} // : wxHVScrolledWindow(parent, id, pos, size, style, name) {}
// Overridable virtuals // // Overridable virtuals
// these functions must be overridden in the derived class and they should // // these functions must be overridden in the derived class and they should
// return the width or height of the given line in pixels // // return the width or height of the given line in pixels
DEC_PYCALLBACK_COORD_SIZET_constpure(OnGetRowHeight); // DEC_PYCALLBACK_COORD_SIZET_constpure(OnGetRowHeight);
DEC_PYCALLBACK_COORD_SIZET_constpure(OnGetColumnWidth); // DEC_PYCALLBACK_COORD_SIZET_constpure(OnGetColumnWidth);
// the following functions don't need to be overridden but it may be useful // // the following functions don't need to be overridden but it may be useful
// to do if calculating the lines widths or heights is a relatively // // to do if calculating the lines widths or heights is a relatively
// expensive operation as it gives the user code a possibility to calculate // // expensive operation as it gives the user code a possibility to calculate
// several of them at once // // several of them at once
// // //
// OnGetRowsHeightHint() and OnGetColumnsWidthHint() are normally called // // OnGetRowsHeightHint() and OnGetColumnsWidthHint() are normally called
// just before OnGetRowHeight() and OnGetColumnWidth(), respectively, but // // just before OnGetRowHeight() and OnGetColumnWidth(), respectively, but
// you shouldn't rely on the latter methods being called for all lines in // // you shouldn't rely on the latter methods being called for all lines in
// the interval specified here. It is also possible that OnGetRowHeight() // // the interval specified here. It is also possible that OnGetRowHeight()
// or OnGetColumnWidth() will be called for the lines outside of this // // or OnGetColumnWidth() will be called for the lines outside of this
// interval, so this is really just a hint, not a promise. // // interval, so this is really just a hint, not a promise.
// // //
// finally note that min is inclusive, while max is exclusive, as usual // // finally note that min is inclusive, while max is exclusive, as usual
DEC_PYCALLBACK_VOID_SIZETSIZET_const(OnGetRowsHeightHint); // DEC_PYCALLBACK_VOID_SIZETSIZET_const(OnGetRowsHeightHint);
DEC_PYCALLBACK_VOID_SIZETSIZET_const(OnGetColumnsWidthHint); // DEC_PYCALLBACK_VOID_SIZETSIZET_const(OnGetColumnsWidthHint);
// when the number of lines changes, we try to estimate the total width or // // when the number of lines changes, we try to estimate the total width or
// height of all lines which is a rather expensive operation in terms of // // height of all lines which is a rather expensive operation in terms of
// lines access, so if the user code may estimate the average height // // lines access, so if the user code may estimate the average height
// better/faster than we do, it should override this function to implement // // better/faster than we do, it should override this function to implement
// its own logic // // its own logic
// // //
// this function should return the best guess for the total height it may // // this function should return the best guess for the total height it may
// make // // make
DEC_PYCALLBACK_COORD_const(EstimateTotalHeight); // DEC_PYCALLBACK_COORD_const(EstimateTotalHeight);
DEC_PYCALLBACK_COORD_const(EstimateTotalWidth); // DEC_PYCALLBACK_COORD_const(EstimateTotalWidth);
// Also expose some other interesting protected methods // // Also expose some other interesting protected methods
// find the index of the horizontal line we need to show at the top of the // // find the index of the horizontal line we need to show at the top of the
// window such that the last (fully or partially) visible line is the given // // window such that the last (fully or partially) visible line is the given
// one // // one
size_t FindFirstFromRight(size_t columnLast, bool fullyVisible = false) // size_t FindFirstFromRight(size_t columnLast, bool fullyVisible = false)
{ return wxHVScrolledWindow::FindFirstFromRight(columnLast, fullyVisible); } // { return wxHVScrolledWindow::FindFirstFromRight(columnLast, fullyVisible); }
// find the index of the vertical line we need to show at the top of the // // find the index of the vertical line we need to show at the top of the
// window such that the last (fully or partially) visible line is the given // // window such that the last (fully or partially) visible line is the given
// one // // one
size_t FindFirstFromBottom(size_t lineLast, bool fullyVisible = false) // size_t FindFirstFromBottom(size_t lineLast, bool fullyVisible = false)
{ return wxHVScrolledWindow::FindFirstFromBottom(lineLast, fullyVisible); } // { return wxHVScrolledWindow::FindFirstFromBottom(lineLast, fullyVisible); }
// get the total width or height of the lines between lineMin (inclusive) // // get the total width or height of the lines between lineMin (inclusive)
// and lineMax (exclusive) // // and lineMax (exclusive)
wxCoord GetRowsHeight(size_t lineMin, size_t lineMax) const // wxCoord GetRowsHeight(size_t lineMin, size_t lineMax) const
{ return wxHVScrolledWindow::GetRowsHeight(lineMin, lineMax); } // { return wxHVScrolledWindow::GetRowsHeight(lineMin, lineMax); }
wxCoord GetColumnsWidth(size_t columnMin, size_t columnMax) const // wxCoord GetColumnsWidth(size_t columnMin, size_t columnMax) const
{ return wxHVScrolledWindow::GetColumnsWidth(columnMin, columnMax); } // { return wxHVScrolledWindow::GetColumnsWidth(columnMin, columnMax); }
PYPRIVATE; // PYPRIVATE;
}; // };
IMPLEMENT_ABSTRACT_CLASS(wxPyHVScrolledWindow, wxHVScrolledWindow); // IMPLEMENT_ABSTRACT_CLASS(wxPyHVScrolledWindow, wxHVScrolledWindow);
IMP_PYCALLBACK_COORD_SIZET_constpure(wxPyHVScrolledWindow, wxHVScrolledWindow, OnGetRowHeight); // IMP_PYCALLBACK_COORD_SIZET_constpure(wxPyHVScrolledWindow, wxHVScrolledWindow, OnGetRowHeight);
IMP_PYCALLBACK_COORD_SIZET_constpure(wxPyHVScrolledWindow, wxHVScrolledWindow, OnGetColumnWidth); // IMP_PYCALLBACK_COORD_SIZET_constpure(wxPyHVScrolledWindow, wxHVScrolledWindow, OnGetColumnWidth);
IMP_PYCALLBACK_VOID_SIZETSIZET_const(wxPyHVScrolledWindow, wxHVScrolledWindow, OnGetRowsHeightHint); // IMP_PYCALLBACK_VOID_SIZETSIZET_const(wxPyHVScrolledWindow, wxHVScrolledWindow, OnGetRowsHeightHint);
IMP_PYCALLBACK_VOID_SIZETSIZET_const(wxPyHVScrolledWindow, wxHVScrolledWindow, OnGetColumnsWidthHint); // IMP_PYCALLBACK_VOID_SIZETSIZET_const(wxPyHVScrolledWindow, wxHVScrolledWindow, OnGetColumnsWidthHint);
IMP_PYCALLBACK_COORD_const (wxPyHVScrolledWindow, wxHVScrolledWindow, EstimateTotalHeight); // IMP_PYCALLBACK_COORD_const (wxPyHVScrolledWindow, wxHVScrolledWindow, EstimateTotalHeight);
IMP_PYCALLBACK_COORD_const (wxPyHVScrolledWindow, wxHVScrolledWindow, EstimateTotalWidth); // IMP_PYCALLBACK_COORD_const (wxPyHVScrolledWindow, wxHVScrolledWindow, EstimateTotalWidth);
%} // %}
// Now define this class for SWIG // // Now define this class for SWIG
/* // /*
This class is strongly influenced by wxVScrolledWindow. In fact, much of // This class is strongly influenced by wxVScrolledWindow. In fact, much of
code is line for line the same except it EXPLICITLY states which axis is // code is line for line the same except it EXPLICITLY states which axis is
being worked on. Like wxVScrolledWindow, this class is here to provide // being worked on. Like wxVScrolledWindow, this class is here to provide
an easy way to implement variable line sizes. The difference is that // an easy way to implement variable line sizes. The difference is that
wxVScrolledWindow only works with vertical scrolling. This class extends // wxVScrolledWindow only works with vertical scrolling. This class extends
the behavior of wxVScrolledWindow to the horizontal axis in addition to the // the behavior of wxVScrolledWindow to the horizontal axis in addition to the
vertical axis. // vertical axis.
The scrolling is also "virtual" in the sense that line widths and heights // The scrolling is also "virtual" in the sense that line widths and heights
only need to be known for lines that are currently visible. // only need to be known for lines that are currently visible.
Like wxVScrolledWindow, this is a generalization of the wxScrolledWindow // Like wxVScrolledWindow, this is a generalization of the wxScrolledWindow
class which can be only used when all horizontal lines have the same width // class which can be only used when all horizontal lines have the same width
and all of the vertical lines have the same height. Like wxVScrolledWinow // and all of the vertical lines have the same height. Like wxVScrolledWinow
it lacks some of wxScrolledWindow features such as scrolling another window // it lacks some of wxScrolledWindow features such as scrolling another window
or only scrolling a rectangle of the window and not its entire client area. // or only scrolling a rectangle of the window and not its entire client area.
If only vertical scrolling is needed, wxVScrolledWindow is recommended // If only vertical scrolling is needed, wxVScrolledWindow is recommended
because it is simpler to use (and you get to type less). // because it is simpler to use (and you get to type less).
There is no wxHScrolledWindow but horizontal only scrolling is implemented // There is no wxHScrolledWindow but horizontal only scrolling is implemented
easily enough with this class. If someone feels the need for such a class, // easily enough with this class. If someone feels the need for such a class,
implementing it is trivial. // implementing it is trivial.
*/ // */
MustHaveApp(wxPyHVScrolledWindow); // MustHaveApp(wxPyHVScrolledWindow);
%rename(HVScrolledWindow) wxPyHVScrolledWindow; // %rename(HVScrolledWindow) wxPyHVScrolledWindow;
class wxPyHVScrolledWindow : public wxPanel // class wxPyHVScrolledWindow : public wxPanel
{ // {
public: // public:
%pythonAppend wxPyHVScrolledWindow "self._setOORInfo(self); self._setCallbackInfo(self, VScrolledWindow)" // %pythonAppend wxPyHVScrolledWindow "self._setOORInfo(self); self._setCallbackInfo(self, VScrolledWindow)"
%pythonAppend wxPyHVScrolledWindow() "" // %pythonAppend wxPyHVScrolledWindow() ""
// normal ctor, no need to call Create() after this one // // normal ctor, no need to call Create() after this one
// // //
// note that wxVSCROLL and wxHSCROLL are always automatically added to our // // note that wxVSCROLL and wxHSCROLL are always automatically added to our
// style, there is no need to specify them explicitly // // style, there is no need to specify them explicitly
wxPyHVScrolledWindow(wxWindow *parent, // wxPyHVScrolledWindow(wxWindow *parent,
wxWindowID id = wxID_ANY, // wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, // const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, // const wxSize& size = wxDefaultSize,
long style = 0, // long style = 0,
const wxString& name = wxPyPanelNameStr); // const wxString& name = wxPyPanelNameStr);
%RenameCtor(PreHVScrolledWindow, wxPyHVScrolledWindow()); // %RenameCtor(PreHVScrolledWindow, wxPyHVScrolledWindow());
void _setCallbackInfo(PyObject* self, PyObject* _class); // void _setCallbackInfo(PyObject* self, PyObject* _class);
bool Create(wxWindow *parent, // bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY, // wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, // const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, // const wxSize& size = wxDefaultSize,
long style = 0, // long style = 0,
const wxString& name = wxPyPanelNameStr); // const wxString& name = wxPyPanelNameStr);
// operations // // operations
// ---------- // // ----------
// set the number of lines the window contains for each axis: the derived // // set the number of lines the window contains for each axis: the derived
// class must provide the widths and heights for all lines with indices up // // class must provide the widths and heights for all lines with indices up
// to each of the one given here in its OnGetColumnWidth() and // // to each of the one given here in its OnGetColumnWidth() and
// OnGetRowHeight() // // OnGetRowHeight()
void SetRowColumnCounts(size_t rowCount, size_t columnCount); // void SetRowColumnCounts(size_t rowCount, size_t columnCount);
// with physical scrolling on, the device origin is changed properly when // // with physical scrolling on, the device origin is changed properly when
// a wxPaintDC is prepared, children are actually moved and layed out // // a wxPaintDC is prepared, children are actually moved and layed out
// properly, and the contents of the window (pixels) are actually moved // // properly, and the contents of the window (pixels) are actually moved
void EnablePhysicalScrolling(bool scrolling = true); // void EnablePhysicalScrolling(bool scrolling = true);
// scroll to the specified line: it will become the first visible line in // // scroll to the specified line: it will become the first visible line in
// the window // // the window
// // //
// return true if we scrolled the window, false if nothing was done // // return true if we scrolled the window, false if nothing was done
bool ScrollToRow(size_t row); // bool ScrollToRow(size_t row);
bool ScrollToColumn(size_t column); // bool ScrollToColumn(size_t column);
bool ScrollToRowColumn(size_t row, size_t column); // bool ScrollToRowColumn(size_t row, size_t column);
// scroll by the specified number of lines/pages // // scroll by the specified number of lines/pages
virtual bool ScrollRows(int rows); // virtual bool ScrollRows(int rows);
virtual bool ScrollColumns(int columns); // virtual bool ScrollColumns(int columns);
virtual bool ScrollRowsColumns(int rows, int columns); // virtual bool ScrollRowsColumns(int rows, int columns);
virtual bool ScrollRowPages(int pages); // virtual bool ScrollRowPages(int pages);
virtual bool ScrollColumnPages(int pages); // virtual bool ScrollColumnPages(int pages);
virtual bool ScrollPages(int rowPages, int columnPages); // virtual bool ScrollPages(int rowPages, int columnPages);
// redraw the specified line // // redraw the specified line
virtual void RefreshRow(size_t line); // virtual void RefreshRow(size_t line);
virtual void RefreshColumn(size_t line); // virtual void RefreshColumn(size_t line);
virtual void RefreshRowColumn(size_t row, size_t column); // virtual void RefreshRowColumn(size_t row, size_t column);
// redraw all lines in the specified range (inclusive) // // redraw all lines in the specified range (inclusive)
virtual void RefreshRows(size_t from, size_t to); // virtual void RefreshRows(size_t from, size_t to);
virtual void RefreshColumns(size_t from, size_t to); // virtual void RefreshColumns(size_t from, size_t to);
virtual void RefreshRowsColumns(size_t fromRow, size_t toRow, // virtual void RefreshRowsColumns(size_t fromRow, size_t toRow,
size_t fromColumn, size_t toColumn); // size_t fromColumn, size_t toColumn);
// return the horizontal and vertical line within a wxPoint at the // // return the horizontal and vertical line within a wxPoint at the
// specified (in physical coordinates) position or. // // specified (in physical coordinates) position or.
// wxNOT_FOUND in either or both axes if no line is present at the // // wxNOT_FOUND in either or both axes if no line is present at the
// requested coordinates, i.e. if it is past the last lines // // requested coordinates, i.e. if it is past the last lines
%Rename(HitTestXY, wxPoint, HitTest(wxCoord x, wxCoord y) const); // %Rename(HitTestXY, wxPoint, HitTest(wxCoord x, wxCoord y) const);
wxPoint HitTest(const wxPoint& pt) const; // wxPoint HitTest(const wxPoint& pt) const;
// recalculate all our parameters and redisplay all lines // // recalculate all our parameters and redisplay all lines
virtual void RefreshAll(); // virtual void RefreshAll();
// accessors // // accessors
// --------- // // ---------
// get the number of lines this window contains (previously set by // // get the number of lines this window contains (previously set by
// SetLineCount()) // // SetLineCount())
size_t GetRowCount() const; // size_t GetRowCount() const;
size_t GetColumnCount() const; // size_t GetColumnCount() const;
wxSize GetRowColumnCounts() const; // wxSize GetRowColumnCounts() const;
// get the first currently visible line/lines // // get the first currently visible line/lines
size_t GetVisibleRowsBegin() const; // size_t GetVisibleRowsBegin() const;
size_t GetVisibleColumnsBegin() const; // size_t GetVisibleColumnsBegin() const;
wxPoint GetVisibleBegin() const; // wxPoint GetVisibleBegin() const;
// get the last currently visible line/lines // // get the last currently visible line/lines
size_t GetVisibleRowsEnd() const; // size_t GetVisibleRowsEnd() const;
size_t GetVisibleColumnsEnd() const; // size_t GetVisibleColumnsEnd() const;
wxPoint GetVisibleEnd() const; // wxPoint GetVisibleEnd() const;
// is this line currently visible? // // is this line currently visible?
bool IsRowVisible(size_t row) const; // bool IsRowVisible(size_t row) const;
bool IsColumnVisible(size_t column) const; // bool IsColumnVisible(size_t column) const;
bool IsVisible(size_t row, size_t column) const; // bool IsVisible(size_t row, size_t column) const;
// find the index of the horizontal line we need to show at the top of the // // find the index of the horizontal line we need to show at the top of the
// window such that the last (fully or partially) visible line is the given // // window such that the last (fully or partially) visible line is the given
// one // // one
size_t FindFirstFromRight(size_t columnLast, bool fullyVisible = false); // size_t FindFirstFromRight(size_t columnLast, bool fullyVisible = false);
// find the index of the vertical line we need to show at the top of the // // find the index of the vertical line we need to show at the top of the
// window such that the last (fully or partially) visible line is the given // // window such that the last (fully or partially) visible line is the given
// one // // one
size_t FindFirstFromBottom(size_t lineLast, bool fullyVisible = false); // size_t FindFirstFromBottom(size_t lineLast, bool fullyVisible = false);
// get the total width or height of the lines between lineMin (inclusive) // // get the total width or height of the lines between lineMin (inclusive)
// and lineMax (exclusive) // // and lineMax (exclusive)
wxCoord GetRowsHeight(size_t lineMin, size_t lineMax) const; // wxCoord GetRowsHeight(size_t lineMin, size_t lineMax) const;
wxCoord GetColumnsWidth(size_t columnMin, size_t columnMax) const; // wxCoord GetColumnsWidth(size_t columnMin, size_t columnMax) const;
}; // };