Changeset 8548:a5f3835913c2 in orange


Ignore:
Timestamp:
07/31/11 12:11:09 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
82a9d40e7cf1670ee78db61745f918de9bf17a51
Message:

Add the documentation files for the plot module.

Location:
orange
Files:
5 added
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/plot/owplotgui.py

    r8546 r8548  
     1''' 
     2     
     3.. index:: plot 
     4 
     5###################################### 
     6GUI elements for plots (``owplotgui``) 
     7###################################### 
     8 
     9.. autoclass:: OrientedWidget 
     10    :show-inheritance: 
     11     
     12.. autoclass:: StateButtonContainer 
     13    :show-inheritance: 
     14     
     15.. autoclass:: OWToolbar 
     16    :show-inheritance: 
     17     
     18.. autoclass:: OWButton 
     19    :show-inheritance: 
     20 
     21.. autoclass:: OrangeWidgets.plot.OWPlotGUI 
     22    :members: 
     23 
     24''' 
     25 
    126import os 
    227import OWGUI 
     
    934 
    1035class OrientedWidget(QWidget): 
     36    ''' 
     37        A simple QWidget with a box layout that matches its ``orientation``.  
     38    ''' 
    1139    def __init__(self, orientation, parent): 
    1240        QWidget.__init__(self, parent) 
     
    1846 
    1947class OWToolbar(OrientedWidget): 
     48    ''' 
     49        A toolbar is a container that can contain any number of buttons.   
     50    ''' 
    2051    def __init__(self, gui, text, orientation, buttons, parent): 
    2152        OrientedWidget.__init__(self, orientation, parent) 
     
    5081 
    5182class StateButtonContainer(OrientedWidget): 
     83    ''' 
     84        This class can contain any number of checkable buttons, of which only one can be selected at any time.  
     85    ''' 
    5286    def __init__(self, gui, ids, orientation, parent): 
    5387        OrientedWidget.__init__(self, orientation, parent) 
     
    76110                     
    77111class OWButton(QToolButton): 
     112    ''' 
     113        A custom tool button that can set and attribute or call a function when clicked.  
     114         
     115        :param plot: The object whose attributes will be modified 
     116        :type plot: :obj:`.OWPlot` 
     117         
     118        :param attr_name: Name of attribute which will be set when the button is clicked.  
     119                          If this parameter is empty or None, no attribute will be set.  
     120        :type attr_name: str 
     121         
     122        :param attr_value: The value that will be assigned to the ``attr_name`` when the button is clicked.  
     123        :type attr: any 
     124         
     125        :param callback: Function to be called when the button is clicked.  
     126                         If a string is passed as ``callback``, a method by that name of ``plot`` will be called.  
     127                         If this parameter is empty or None, no function will be called 
     128        :type callback: str or function 
     129    ''' 
    78130    def __init__(self, plot, attr_name, attr_value, callback, parent): 
    79131        QToolButton.__init__(self, parent) 
     
    237289         
    238290    def tool_button(self, id, widget): 
     291        ''' 
     292            Creates an :obj:`.OWButton` and adds it to the parent ``widget``.  
     293             
     294            :param id: If ``id`` is an ``int``, a button is constructed from the default table.  
     295                       Otherwise, ``id`` must be tuple of size 4 or 5 with members. The first is optional and  
     296                       is a unique identifier for the button, the second is its name, and 
     297                       the last three are the ``attr_name``, ``attr_value`` and ``callback`` arguments to :obj:`.OWButton` 
     298            :type if: int or tuple 
     299             
     300            :param widget: The button's parent widget 
     301            :type widget: QWidget 
     302        ''' 
    239303        if type(id) == int: 
    240304            name, attr_name, attr_value, callback, icon_name = self._buttons[id] 
Note: See TracChangeset for help on using the changeset viewer.