Changeset 8550:bfcd7d94f13a in orange


Ignore:
Timestamp:
08/01/11 10:13:12 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
032f40e6da72e9b1492eaffc871695278a2eef19
Message:

Add the owplotgui module to the documentation index

Location:
orange
Files:
2 edited

Legend:

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

    r8549 r8550  
    4848    ''' 
    4949        A toolbar is a container that can contain any number of buttons.   
     50         
     51        :param gui: Used to create containers and buttons 
     52        :type gui: :obj:`.OWPlotGUI` 
     53         
     54        :param text: The name of this toolbar 
     55        :type text: str 
     56         
     57        :param orientation: The orientation of this toolbar, either Qt.Vertical or Qt.Horizontal 
     58        :type tex: int 
     59         
     60        :param buttons: A list of button identifiers to be added to this toolbar 
     61        :type buttons: list of (int or tuple) 
     62         
     63        :param parent: The toolbar's parent widget 
     64        :type parent: :obj:`.QWidget` 
    5065    ''' 
    5166    def __init__(self, gui, text, orientation, buttons, parent): 
     
    6176                    if buttons[j] == gui.StateButtonsEnd: 
    6277                        qDebug('Adding state buttons ' + repr(state_buttons) + ' to layout ' + repr(self.layout())) 
    63                         s = gui.state_buttons(state_buttons, orientation, self) 
     78                        s = gui.state_buttons(orientation, state_buttons, self) 
    6479                        self.buttons.update(s.buttons) 
    6580                        self.groups[buttons[i+1]] = s 
     
    8398    ''' 
    8499        This class can contain any number of checkable buttons, of which only one can be selected at any time.  
    85     ''' 
    86     def __init__(self, gui, ids, orientation, parent): 
     100     
     101        :param gui: Used to create containers and buttons 
     102        :type gui: :obj:`.OWPlotGUI` 
     103         
     104        :param buttons: A list of button identifiers to be added to this toolbar 
     105        :type buttons: list of (int or tuple) 
     106        
     107        :param orientation: The orientation of this toolbar, either Qt.Vertical or Qt.Horizontal 
     108        :type tex: int 
     109         
     110        :param parent: The toolbar's parent widget 
     111        :type parent: :obj:`.QWidget` 
     112    ''' 
     113    def __init__(self, gui, orientation, buttons, parent): 
    87114        OrientedWidget.__init__(self, orientation, parent) 
    88115        self.buttons = {} 
    89116        self.layout().setContentsMargins(0, 0, 0, 0) 
    90117        self._clicked_button = None 
    91         for i in ids: 
     118        for i in buttons: 
    92119            b = gui.tool_button(i, self) 
    93120            b.clicked.connect(self.button_clicked) 
     
    154181        This class contains functions to create common user interface elements (QWidgets) 
    155182        for configuration and interaction with the ``plot``.  
     183         
     184        It provides shorter version of some methods in :obj:`.OWGUI` that are directly related to an :obj:`.OWPlot` object.  
    156185    ''' 
    157186    def __init__(self, plot): 
     
    204233    ] 
    205234     
    206     ''' 
    207         A map of  
    208         id : (name, attr_name, attr_value, callback, icon_name) 
    209     ''' 
    210235    _buttons = { 
    211236        Zoom : ('Zoom', 'state', ZOOMING, None, 'Dlg_zoom'), 
     
    219244        ClearSelection : ('Clear selection', None, None, 'clear_selection', 'Dlg_clear') 
    220245    } 
     246    ''' 
     247        The list of built-in buttons. It is a map of  
     248        id : (name, attr_name, attr_value, callback, icon_name) 
     249         
     250        .. seealso:: :meth:`.tool_button` 
     251    ''' 
    221252 
    222253    def _get_callback(self, name): 
    223         return getattr(self._plot, name, self._plot.replot) 
     254        if type(name) == str: 
     255            return getattr(self._plot, name, self._plot.replot) 
     256        else: 
     257            return name 
    224258         
    225259    def _check_box(self, widget, value, label, cb_name): 
     260        ''' 
     261            Adds a :obj:`.QCheckBox` to ``widget``.  
     262            When the checkbox is toggled, the attribute ``value`` of the plot object is set to the checkbox' check state, 
     263            and the callback ``cb_name`` is called.  
     264        ''' 
    226265        OWGUI.checkBox(widget, self._plot, value, label, callback=self._get_callback(cb_name))     
    227266         
    228267    def antialiasing_check_box(self, widget): 
     268        ''' 
     269            Creates a check box that toggles the Antialiasing of the plot  
     270        ''' 
    229271        self._check_box(widget, 'use_antialiasing', 'Use antialiasing', 'update_antialiasing') 
    230272         
    231273    def show_legend_check_box(self, widget): 
     274        ''' 
     275            Creates a check box that shows and hides the plot legend 
     276        ''' 
    232277        self._check_box(widget, 'show_legend', 'Show legend', 'update_legend') 
    233278     
     
    239284     
    240285    def animations_check_box(self, widget): 
     286        ''' 
     287            Creates a check box that enabled or disables animations 
     288        ''' 
    241289        self._check_box(widget, 'use_animations', 'Use animations', 'update_animations') 
    242290     
     
    245293         
    246294    def point_size_slider(self, widget): 
     295        ''' 
     296            Creates a slider that controls point size 
     297        ''' 
    247298        self._slider(widget, 'point_width', "Symbol size:   ", 1, 20, 1, 'update_point_size') 
    248299         
    249300    def alpha_value_slider(self, widget): 
     301        ''' 
     302            Creates a slider that controls point transparency 
     303        ''' 
    250304        self._slider(widget, 'alpha_value', "Transparency: ", 0, 255, 10, 'update_alpha_value') 
    251305         
    252306    def point_properties_box(self, widget): 
     307        ''' 
     308            Creates a box with controls for common point properties.  
     309            Currently, these properties are point size and transparency.  
     310        ''' 
    253311        return self.create_box([ 
    254312            self.PointSize,  
     
    257315         
    258316    def plot_settings_box(self, widget): 
     317        ''' 
     318            Creates a box with controls for common plot settings 
     319        ''' 
    259320        return self.create_box([ 
    260321            self.ShowLegend, 
     
    284345             
    285346    def create_box(self, ids, widget, name): 
     347        ''' 
     348            Creates a :obj:`.QGroupBox` with text ``name`` and adds it to ``widget``.  
     349            The ``ids`` argument is a list of widget ID's that will be added to this box 
     350        ''' 
    286351        box = OWGUI.widgetBox(widget, name) 
    287352        self.add_widgets(ids, widget) 
     
    315380        return b 
    316381         
    317     def state_buttons(self, ids, orientation, widget): 
     382    def state_buttons(self, orientation, buttons, widget): 
    318383        ''' 
    319384            This function creates a set of checkable buttons and connects them so that only one 
    320385            may be checked at a time.  
    321386        ''' 
    322         c = StateButtonContainer(self, ids, orientation, widget) 
     387        c = StateButtonContainer(self, orientation, buttons, widget) 
    323388        if widget.layout() is not None: 
    324389            widget.layout().addWidget(c) 
     
    326391         
    327392    def toolbar(self, widget, text, orientation, buttons): 
     393        ''' 
     394            Creates an :obj:`.OWToolbar` with the specified ``text``, ``orientation`` and ``buttons`` and adds it to ``widget``.  
     395             
     396            .. seealso:: :obj:`.OWToolbar` 
     397        ''' 
    328398        t = OWToolbar(self, text, orientation, buttons, widget) 
    329399        if widget.layout() is not None: 
  • orange/doc/Orange/rst/OrangeWidgets.plot.rst

    r8548 r8550  
    99 
    1010   OrangeWidgets.plot.owplot 
     11   OrangeWidgets.plot.owplotgui 
    1112   OrangeWidgets.plot.owtools 
    1213   OrangeWidgets.plot.owcurve 
Note: See TracChangeset for help on using the changeset viewer.