.. wxPython Phoenix documentation

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

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

.. include:: headings.inc



.. _wx.FileHistory:

==========================================================================================================================================
|phoenix_title|  **wx.FileHistory**
==========================================================================================================================================

The :ref:`wx.FileHistory`  encapsulates a user interface convenience, the list of most recently visited files as shown on a menu (usually the File menu).          

:ref:`wx.FileHistory`  can manage one or more file menus. More than one menu may be required in an MDI application, where the file history should appear on each MDI child menu as well as the MDI parent frame. 







         



.. seealso:: :ref:`Document/View Framework <document/view framework>`, :ref:`DocManager`    







|

|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>FileHistory</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.FileHistory_inheritance.png" alt="Inheritance diagram of FileHistory" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Object.html" title="wx.Object" alt="" coords="17,5,99,35"/> <area shape="rect" id="node2" href="wx.FileHistory.html" title="wx.FileHistory" alt="" coords="5,83,112,112"/> </map> 
   </p>

|


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

================================================================================ ================================================================================
:meth:`~wx.FileHistory.__init__`                                                 Constructor.
:meth:`~wx.FileHistory.AddFileToHistory`                                         Adds a file to the file history list, if the object has a pointer to an appropriate file menu.
:meth:`~wx.FileHistory.AddFilesToMenu`                                           Appends the files in the history list, to all menus managed by the file history object.
:meth:`~wx.FileHistory.GetBaseId`                                                Returns the base identifier for the range used for appending items.
:meth:`~wx.FileHistory.GetCount`                                                 Returns the number of files currently stored in the file history.
:meth:`~wx.FileHistory.GetHistoryFile`                                           Returns the file at this index (zero-based).
:meth:`~wx.FileHistory.GetMaxFiles`                                              Returns the maximum number of files that can be stored.
:meth:`~wx.FileHistory.GetMenus`                                                 Returns the list of menus that are managed by this file history object.
:meth:`~wx.FileHistory.Load`                                                     Loads the file history from the given config object.
:meth:`~wx.FileHistory.RemoveFileFromHistory`                                    Removes the specified file from the history.
:meth:`~wx.FileHistory.RemoveMenu`                                               Removes this menu from the list of those managed by this object.
:meth:`~wx.FileHistory.Save`                                                     Saves the file history into the given config object.
:meth:`~wx.FileHistory.SetBaseId`                                                Sets the base identifier for the range used for appending items.
:meth:`~wx.FileHistory.UseMenu`                                                  Adds this menu to the list of those menus that are managed by this file history object.
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.FileHistory.BaseId`                                                   See :meth:`~wx.FileHistory.GetBaseId` and :meth:`~wx.FileHistory.SetBaseId`
:attr:`~wx.FileHistory.Count`                                                    See :meth:`~wx.FileHistory.GetCount`
:attr:`~wx.FileHistory.MaxFiles`                                                 See :meth:`~wx.FileHistory.GetMaxFiles`
:attr:`~wx.FileHistory.Menus`                                                    See :meth:`~wx.FileHistory.GetMenus`
================================================================================ ================================================================================


|


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


.. class:: wx.FileHistory(Object)

   **Possible constructors**::

       FileHistory(maxFiles=9, idBase=ID_FILE1)
       
   
   The FileHistory encapsulates a user interface convenience, the list
   of most recently visited files as shown on a menu (usually the File
   menu).



   .. method:: __init__(self, maxFiles=9, idBase=ID_FILE1)

      Constructor.                  

      Pass the maximum number of files that should be stored and displayed. 

      `idBase`  defaults to ``wx.ID_FILE1`` and represents the id given to the first history menu item. Since menu items can't share the same ``ID`` you should change `idBase`  (to one of your own defined IDs) when using more than one :ref:`wx.FileHistory`  in your application.                  


      :param `maxFiles`: 
      :type `maxFiles`: int
      :param `idBase`: 
      :type `idBase`: wx.WindowID







   .. method:: AddFileToHistory(self, filename)

      Adds a file to the file history list, if the object has a pointer to an appropriate file menu.                  


      :param `filename`: 
      :type `filename`: string







   .. method:: AddFilesToMenu(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **AddFilesToMenu** `(self)`
      
      Appends the files in the history list, to all menus managed by the file history object.                   
      
      
      
      
      **~~~**

      
      **AddFilesToMenu** `(self, menu)`
      
      Appends the files in the history list, to the given menu only.                  
      
      
      :param `menu`: 
      :type `menu`: wx.Menu
      
      
      
      
      
      
      **~~~**






   .. method:: GetBaseId(self)

      Returns the base identifier for the range used for appending items.                  

      :rtype: :ref:`wx.WindowID`








   .. method:: GetCount(self)

      Returns the number of files currently stored in the file history.                  

      :rtype: `int`








   .. method:: GetHistoryFile(self, index)

      Returns the file at this index (zero-based).                  


      :param `index`: 
      :type `index`: int




      :rtype: `string`








   .. method:: GetMaxFiles(self)

      Returns the maximum number of files that can be stored.                  

      :rtype: `int`








   .. method:: GetMenus(self)

      Returns the list of menus that are managed by this file history object.                  

                

      :rtype: :ref:`FileHistoryMenuList`







      .. seealso:: :meth:`UseMenu`     








   .. method:: Load(self, config)

      Loads the file history from the given config object.                  

      This function should be called explicitly by the application. 

                


      :param `config`: 
      :type `config`: wx.ConfigBase






      .. seealso:: :ref:`wx.ConfigBase`    








   .. method:: RemoveFileFromHistory(self, i)

      Removes the specified file from the history.                  


      :param `i`: 
      :type `i`: int







   .. method:: RemoveMenu(self, menu)

      Removes this menu from the list of those managed by this object.                  


      :param `menu`: 
      :type `menu`: wx.Menu







   .. method:: Save(self, config)

      Saves the file history into the given config object.                  

      This must be called explicitly by the application. 

                


      :param `config`: 
      :type `config`: wx.ConfigBase






      .. seealso:: :ref:`wx.ConfigBase`    








   .. method:: SetBaseId(self, baseId)

      Sets the base identifier for the range used for appending items.                  


      :param `baseId`: 
      :type `baseId`: wx.WindowID







   .. method:: UseMenu(self, menu)

      Adds this menu to the list of those menus that are managed by this file history object.                  

      Also see :meth:`AddFilesToMenu`   for initializing the menu with filenames that are already in the history when this function is called, as this is not done automatically.                  


      :param `menu`: 
      :type `menu`: wx.Menu







   .. attribute:: BaseId

      See :meth:`~wx.FileHistory.GetBaseId` and :meth:`~wx.FileHistory.SetBaseId`


   .. attribute:: Count

      See :meth:`~wx.FileHistory.GetCount`


   .. attribute:: MaxFiles

      See :meth:`~wx.FileHistory.GetMaxFiles`


   .. attribute:: Menus

      See :meth:`~wx.FileHistory.GetMenus`

