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

Legend:

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

    r11439 r11424  
    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 area would most often 
     184or options that your widget will use. Main are 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 (``dataset is None``), 
     227Notice that the token can be empty (:obj:`dataset==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

    r11439 r11424  
    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 ``Multiple + Default`` as the last value in the list that defines 
    58 the :obj:`Learner` channel. This ``Multiple + Default`` says 
     57:obj:`Multiple + Default` as the last value in the list that defines 
     58the :obj:`Learner` channel. This :obj:`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 ``Single + NonDefault`` would be used. That would mean that the 
     61:obj:`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 ``Default + Multiple`` is a valid flag. 
     236be added (or OR-d) together so :obj:`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

    r11439 r11424  
    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  
    7467 
    7568in the initialization part of the widget. In this way, each learner 
     
    164157            l.isSelected = i in self.selectedLearners 
    165158 
    166 The complete code of this widget is available :download:`here <OWLearningCurveC.py>`. 
     159The complete code of this widget is available :download:`here <OWLearningCurveC.py>`.  
    167160This is almost like a typical 
    168161widget that is include in a standard Orange distribution, with a 
  • docs/extend-widgets/rst/owgui.rst

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

    r11439 r11424  
    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. You can create such a link manually, or you can use 
    178 the :doc:`OWGUI <owgui>` module instead; for instance, for a check 
    179 box, use :func:`OWGUI.checkBox`. 
     177and vice-versa. Although you can create such a link manually, you 
     178should always use the module :doc:`OWGUI <owgui>` instead; 
     179for instance, for a check box, use :obj:`OWGUI.checkBox` and not 
     180simply the Qt's :obj:`QCheckBox`. 
    180181 
    181182The settings fall into two groups. Some of them do not depend on 
    182183the data, while other are context-dependent. For the first to be saved 
    183184properly, you only need to list them in the :obj:`settingsList` 
    184 in the widget definition, as already described. 
    185  
    186  
    187 .. module:: OWContexts 
     185in the widget definition, as already described :doc:`elsewhere <settings>` 
    188186 
    189187************************** 
     
    206204Saving, loading and matching contexts is taken care of by context 
    207205handlers. Currently, there are only two classes of context handlers 
    208 implemented. The first one is the abstract :class:`ContextHandler` 
    209 and the second one is :class:`DomainContextHandler` in which the 
     206implemented. The first one is the abstract :obj:`ContextHandler` 
     207and the second one is :obj:`DomainContextHandler` in which the 
    210208context is defined by the data set domain and where the settings 
    211209contain attribute names. The latter should cover most of your needs, 
     
    213211classes from it. There may even be some cases in which the context is 
    214212not defined by the domain, in which case the 
    215 :class:`ContextHandler` will be used as a base for your new 
     213:obj:`ContextHandler` will be used as a base for your new 
    216214handler. 
    217215 
     
    219217closing usually takes place (in the opposite order) in the function 
    220218that handles the data signal. This is how it looks in the scatter plot 
    221 (the code is somewhat simplified for clarity). 
    222  
    223 :: 
     219(the code is somewhat simplified for clarity). :: 
    224220 
    225221    def cdata(self, data, clearResults = 1): 
     
    273269 
    274270Except for declaring the context settings, that is. Scatter plot has this just 
    275 below the :obj:`settingsList` :: 
     271below the :obj:`settingsList`:: 
    276272 
    277273    contextHandlers = {"": DomainContextHandler("", 
     
    302298same flags, so they can be grouped into :obj:`(["attrLabel", 
    303299"attrShape", "attrSize"], DomainContextHandler.Optional)`. So 
    304 what scatter plot really says is:: 
     300what scatter plot really says is :: 
    305301 
    306302    contextHandlers = {"": DomainContextHandler("", [ 
Note: See TracChangeset for help on using the changeset viewer.