Ignore:
Location:
docs/extend-widgets/rst
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • docs/extend-widgets/rst/basics.rst

    r11424 r11439  
    158158            self.resize(100,50) 
    159159 
    160 In initialization, the widget calls the :obj:`init` function 
     160In initialization, the widget calls the :obj:`__init__` function 
    161161of a base class, passing the name 'SampleData' which will, 
    162162essentially, be used for nothing else than a stem of a file for saving 
     
    182182Orange widgets are most often split to control and main area. Control 
    183183area appears on the left and should include any controls for settings 
    184 or options that your widget will use. Main are would most often 
     184or options that your widget will use. Main area would most often 
    185185include a graph, table or some drawing that will be based on the 
    186186inputs to the widget and current options/setting in the control 
     
    225225"Sampled Data". 
    226226 
    227 Notice that the token can be empty (:obj:`dataset==None`), 
     227Notice that the token can be empty (``dataset is None``), 
    228228resulting from either the sending widget to which we have connected 
    229229intentionally emptying the channel, or when the link between the two 
  • docs/extend-widgets/rst/channels.rst

    r11424 r11439  
    22Channels and Tokens 
    33################### 
    4   
     4 
    55Our data sampler widget was, regarding the channels, rather simple 
    66and linear: the widget was designed to receive the token from one 
     
    5555Notice that everything is pretty much the same as it was with 
    5656widgets from previous lessons, the only difference being 
    57 :obj:`Multiple + Default` as the last value in the list that defines 
    58 the :obj:`Learner` channel. This :obj:`Multiple + Default` says 
     57``Multiple + Default`` as the last value in the list that defines 
     58the :obj:`Learner` channel. This ``Multiple + Default`` says 
    5959that this is a multi-input channel and is the default input for its type. 
    6060If it would be unspecified then by default value of 
    61 :obj:`Single + NonDefault` would be used. That would mean that the 
     61``Single + NonDefault`` would be used. That would mean that the 
    6262widget can receive the input only from one widget and is not the default input 
    6363channel for its type (more on default channels later). 
     
    147147scoring functions from stats. I rather like 
    148148the easy by which new scoring functions are added to the widget, since 
    149 all that is needed is the augmenting the list :: 
     149all that is needed is the augmenting the list:: 
    150150 
    151151    self.scoring = [("Classification Accuracy", orngStat.CA), 
     
    234234That is, the :obj:`Train Data` channel is a single-token 
    235235channel which is a default one (third parameter). Note that the flags can 
    236 be added (or OR-d) together so :obj:`Default + Multiple` is a valid flag. 
     236be added (or OR-d) together so ``Default + Multiple`` is a valid flag. 
    237237To test how this works, connect a file widget to a learning curve widget and 
    238238- nothing will really happen: 
  • docs/extend-widgets/rst/graphing.rst

    r11424 r11439  
    5656learner, and use a trick allowed in Orange that we can simply store 
    5757this as a new attribute to the learning object. By default, Orange 
    58 would give a warning of the type :: 
     58would give a warning of the type:: 
    5959 
    6060    c:\Python23\Lib\site-packages\orange\OrangeWidgets\Test\OWLearningCurveC.py:269: 
     
    6262      setattr(learner, "curve", curve) 
    6363 
    64 but we surpress such warnings with a line :: 
     64but we surpress such warnings with a line:: 
    6565 
    6666    warnings.filterwarnings("ignore", ".*builtin attribute.*", orange.AttributeWarning) 
     67 
     68 
     69.. warning:: 
     70 
     71   This is a very bad design. Please do **not** store widget data in the 
     72   input objects. 
     73 
    6774 
    6875in the initialization part of the widget. In this way, each learner 
     
    157164            l.isSelected = i in self.selectedLearners 
    158165 
    159 The complete code of this widget is available :download:`here <OWLearningCurveC.py>`.  
     166The complete code of this widget is available :download:`here <OWLearningCurveC.py>`. 
    160167This is almost like a typical 
    161168widget that is include in a standard Orange distribution, with a 
  • docs/extend-widgets/rst/owgui.rst

    r11424 r11439  
     1.. module:: OWGUI 
     2 
    13##################################### 
    24OWGUI: Library of Common GUI Controls 
  • docs/extend-widgets/rst/settings.rst

    r11424 r11439  
    175175should be a corresponding widget's attribute recording the check box's 
    176176state so that when the user changes a check box, the attribute changes 
    177 and vice-versa. Although you can create such a link manually, you 
    178 should always use the module :doc:`OWGUI <owgui>` instead; 
    179 for instance, for a check box, use :obj:`OWGUI.checkBox` and not 
    180 simply the Qt's :obj:`QCheckBox`. 
     177and vice-versa. You can create such a link manually, or you can use 
     178the :doc:`OWGUI <owgui>` module instead; for instance, for a check 
     179box, use :func:`OWGUI.checkBox`. 
    181180 
    182181The settings fall into two groups. Some of them do not depend on 
    183182the data, while other are context-dependent. For the first to be saved 
    184183properly, you only need to list them in the :obj:`settingsList` 
    185 in the widget definition, as already described :doc:`elsewhere <settings>` 
     184in the widget definition, as already described. 
     185 
     186 
     187.. module:: OWContexts 
    186188 
    187189************************** 
     
    204206Saving, loading and matching contexts is taken care of by context 
    205207handlers. Currently, there are only two classes of context handlers 
    206 implemented. The first one is the abstract :obj:`ContextHandler` 
    207 and the second one is :obj:`DomainContextHandler` in which the 
     208implemented. The first one is the abstract :class:`ContextHandler` 
     209and the second one is :class:`DomainContextHandler` in which the 
    208210context is defined by the data set domain and where the settings 
    209211contain attribute names. The latter should cover most of your needs, 
     
    211213classes from it. There may even be some cases in which the context is 
    212214not defined by the domain, in which case the 
    213 :obj:`ContextHandler` will be used as a base for your new 
     215:class:`ContextHandler` will be used as a base for your new 
    214216handler. 
    215217 
     
    217219closing usually takes place (in the opposite order) in the function 
    218220that handles the data signal. This is how it looks in the scatter plot 
    219 (the code is somewhat simplified for clarity). :: 
     221(the code is somewhat simplified for clarity). 
     222 
     223:: 
    220224 
    221225    def cdata(self, data, clearResults = 1): 
     
    269273 
    270274Except for declaring the context settings, that is. Scatter plot has this just 
    271 below the :obj:`settingsList`:: 
     275below the :obj:`settingsList` :: 
    272276 
    273277    contextHandlers = {"": DomainContextHandler("", 
     
    298302same flags, so they can be grouped into :obj:`(["attrLabel", 
    299303"attrShape", "attrSize"], DomainContextHandler.Optional)`. So 
    300 what scatter plot really says is :: 
     304what scatter plot really says is:: 
    301305 
    302306    contextHandlers = {"": DomainContextHandler("", [ 
Note: See TracChangeset for help on using the changeset viewer.