.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.VarHScrollHelper:

==========================================================================================================================================
|phoenix_title|  **wx.VarHScrollHelper**
==========================================================================================================================================

This class provides functions wrapping the :ref:`wx.VarScrollHelperBase`  class, targeted for horizontal-specific scrolling.          

Like :ref:`wx.VarScrollHelperBase`, this class is mostly only useful to those classes built into wxWidgets deriving from here, and this documentation is mostly only provided for referencing the functions provided by this class. You will likely want to derive your window from :ref:`wx.HScrolledWindow`  rather than from here directly. 







         



.. seealso:: :ref:`wx.HScrolledWindow`, :ref:`wx.HVScrolledWindow`, :ref:`wx.VScrolledWindow`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>VarHScrollHelper</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.VarHScrollHelper_inheritance.png" alt="Inheritance diagram of VarHScrollHelper" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.VarHScrollHelper.html" title="wx.VarHScrollHelper" alt="" coords="17,83,171,112"/> <area shape="rect" id="node2" href="wx.VarScrollHelperBase.html" title="wx.VarScrollHelperBase" alt="" coords="5,5,183,35"/> </map> 
   </p>
   </div>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.HScrolledWindow`, :ref:`wx.VarHVScrollHelper`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.VarHScrollHelper.__init__`                                            Constructor taking the target window to be scrolled by this helper class.
:meth:`~wx.VarHScrollHelper.EstimateTotalWidth`                                  This class forwards calls from :meth:`~VarHScrollHelper.EstimateTotalSize`   to this function so derived classes can override either just the height or the width estimation, or just estimate both differently if desired in any :ref:`wx.HVScrolledWindow`  derived class.
:meth:`~wx.VarHScrollHelper.GetColumnCount`                                      Returns the number of columns the target window contains.
:meth:`~wx.VarHScrollHelper.GetVisibleColumnsBegin`                              Returns the index of the first visible column based on the scroll position.
:meth:`~wx.VarHScrollHelper.GetVisibleColumnsEnd`                                Returns the index of the last visible column based on the scroll position.
:meth:`~wx.VarHScrollHelper.IsColumnVisible`                                     Returns ``True`` if the given column is currently visible (even if only partially visible) or ``False`` otherwise.
:meth:`~wx.VarHScrollHelper.OnGetColumnWidth`                                    This function must be overridden in the derived class, and should return the width of the given column in pixels.
:meth:`~wx.VarHScrollHelper.OnGetColumnsWidthHint`                               This function doesn't have to be overridden but it may be useful to do so if calculating the columns' sizes is a relatively expensive operation as it gives your code a chance to calculate several of them at once and cache the result if necessary.
:meth:`~wx.VarHScrollHelper.RefreshColumn`                                       Triggers a refresh for just the given column's area of the window if it's visible.
:meth:`~wx.VarHScrollHelper.RefreshColumns`                                      Triggers a refresh for the area between the specified range of columns given (inclusively).
:meth:`~wx.VarHScrollHelper.ScrollColumnPages`                                   Scroll by the specified number of pages which may be positive (to scroll right) or negative (to scroll left).
:meth:`~wx.VarHScrollHelper.ScrollColumns`                                       Scroll by the specified number of columns which may be positive (to scroll right) or negative (to scroll left).
:meth:`~wx.VarHScrollHelper.ScrollToColumn`                                      Scroll to the specified column.
:meth:`~wx.VarHScrollHelper.SetColumnCount`                                      Set the number of columns the window contains.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.VarHScrollHelper.ColumnCount`                                         See :meth:`~wx.VarHScrollHelper.GetColumnCount` and :meth:`~wx.VarHScrollHelper.SetColumnCount`
:attr:`~wx.VarHScrollHelper.VisibleColumnsBegin`                                 See :meth:`~wx.VarHScrollHelper.GetVisibleColumnsBegin`
:attr:`~wx.VarHScrollHelper.VisibleColumnsEnd`                                   See :meth:`~wx.VarHScrollHelper.GetVisibleColumnsEnd`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.VarHScrollHelper(VarScrollHelperBase)

   **Possible constructors**::

       VarHScrollHelper(winToScroll)
       
   
   This class provides functions wrapping the VarScrollHelperBase
   class, targeted for horizontal-specific scrolling.



   .. method:: __init__(self, winToScroll)

      Constructor taking the target window to be scrolled by this helper class.                  

      This will attach scroll event handlers to the target window to catch and handle scroll events appropriately.                  


      :param `winToScroll`: 
      :type `winToScroll`: wx.Window







   .. method:: EstimateTotalWidth(self)

      This class forwards calls from :meth:`EstimateTotalSize`   to this function so derived classes can override either just the height or the width estimation, or just estimate both differently if desired in any :ref:`wx.HVScrolledWindow`  derived class.                  

                

      :rtype: :ref:`wx.Coord`







      .. note:: 

         This function will not be called if :meth:`EstimateTotalSize`   is overridden in your derived class.   








   .. method:: GetColumnCount(self)

      Returns the number of columns the target window contains.                  

                

      :rtype: `int`







      .. seealso:: :meth:`SetColumnCount`     








   .. method:: GetVisibleColumnsBegin(self)

      Returns the index of the first visible column based on the scroll position.                  

      :rtype: `int`








   .. method:: GetVisibleColumnsEnd(self)

      Returns the index of the last visible column based on the scroll position.                  

      This includes the last column even if it is only partially visible.                  

      :rtype: `int`








   .. method:: IsColumnVisible(self, column)

      Returns ``True`` if the given column is currently visible (even if only partially visible) or ``False`` otherwise.                  


      :param `column`: 
      :type `column`: int




      :rtype: `bool`








   .. method:: OnGetColumnWidth(self, column)

      This function must be overridden in the derived class, and should return the width of the given column in pixels.                  


      :param `column`: 
      :type `column`: int




      :rtype: :ref:`wx.Coord`








   .. method:: OnGetColumnsWidthHint(self, columnMin, columnMax)

      This function doesn't have to be overridden but it may be useful to do so if calculating the columns' sizes is a relatively expensive operation as it gives your code a chance to calculate several of them at once and cache the result if necessary.                  

      :meth:`OnGetColumnsWidthHint`   is normally called just before :meth:`OnGetColumnWidth`   but you shouldn't rely on the latter being called for all columns in the interval specified here. It is also possible that :meth:`OnGetColumnWidth`   will be called for units outside of this interval, so this is really just a hint, not a promise. 

      Finally, note that `columnMin`  is inclusive, while `columnMax`  is exclusive.                  


      :param `columnMin`: 
      :type `columnMin`: int
      :param `columnMax`: 
      :type `columnMax`: int







   .. method:: RefreshColumn(self, column)

      Triggers a refresh for just the given column's area of the window if it's visible.                  


      :param `column`: 
      :type `column`: int







   .. method:: RefreshColumns(self, from_, to_)

      Triggers a refresh for the area between the specified range of columns given (inclusively).                  


      :param `from_`: 
      :type `from_`: int
      :param `to_`: 
      :type `to_`: int







   .. method:: ScrollColumnPages(self, pages)

      Scroll by the specified number of pages which may be positive (to scroll right) or negative (to scroll left).                  


      :param `pages`: 
      :type `pages`: int




      :rtype: `bool`








   .. method:: ScrollColumns(self, columns)

      Scroll by the specified number of columns which may be positive (to scroll right) or negative (to scroll left).                  

                


      :param `columns`: 
      :type `columns`: int




      :rtype: `bool`







      :returns: 

         ``True`` if the window was scrolled, ``False`` otherwise (for example, if we're trying to scroll right but we are already showing the last column).   








   .. method:: ScrollToColumn(self, column)

      Scroll to the specified column.                  

      It will become the first visible column in the window. 

                


      :param `column`: 
      :type `column`: int




      :rtype: `bool`







      :returns: 

         ``True`` if we scrolled the window, ``False`` if nothing was done.   








   .. method:: SetColumnCount(self, columnCount)

      Set the number of columns the window contains.                  

      The derived class must provide the widths for all columns with indices up to the one given here in it's :meth:`OnGetColumnWidth`   implementation. 

                


      :param `columnCount`: 
      :type `columnCount`: int






      .. seealso:: :meth:`GetColumnCount`     








   .. attribute:: ColumnCount

      See :meth:`~wx.VarHScrollHelper.GetColumnCount` and :meth:`~wx.VarHScrollHelper.SetColumnCount`


   .. attribute:: VisibleColumnsBegin

      See :meth:`~wx.VarHScrollHelper.GetVisibleColumnsBegin`


   .. attribute:: VisibleColumnsEnd

      See :meth:`~wx.VarHScrollHelper.GetVisibleColumnsEnd`

