Changeset 9391:80bf0bae6618 in orange


Ignore:
Timestamp:
12/20/11 20:39:16 (2 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
b0894bf37e66a17f717dd01605de85d920a91b33
Message:

Added select state and selection_behavour to toolbar.

File:
1 edited

Legend:

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

    r9381 r9391  
    9595        self.layout().addStretch() 
    9696 
    97  
     97    def select_state(self, state): 
     98        #NOTHING = 0 
     99        #ZOOMING = 1 
     100        #SELECT = 2 
     101        #SELECT_POLYGON = 3 
     102        #PANNING = 4 
     103        #SELECT_RECTANGLE = SELECT 
     104        #SELECT_RIGHTCLICK = SELECT 
     105        state_buttons = {0: 11, 1: 11, 2: 13, 3: 13, 4: 12} 
     106        self.buttons[state_buttons[state]].click() 
     107     
     108    def select_selection_behaviour(self, selection_behaviour): 
     109        #SelectionAdd = 21 
     110        #SelectionRemove = 22 
     111        #SelectionToggle = 23 
     112        #SelectionOne = 24 
     113        self.buttons[13]._actions[21 + selection_behaviour].trigger() 
     114     
    98115class StateButtonContainer(OrientedWidget): 
    99116    ''' 
     
    442459        m = QMenu(b) 
    443460        b.setMenu(m) 
     461        b._actions = {} 
     462         
    444463        QObject.connect(m, SIGNAL("triggered(QAction*)"), b, SLOT("setDefaultAction(QAction*)")) 
    445464 
     
    450469        for id in ids: 
    451470            id, name, attr_name, attr_value, callback, icon_name = self._expand_id(id) 
    452             m.addAction(OWAction(self._plot, icon_name, attr_name, attr_value, callback, parent=m)) 
     471            a = OWAction(self._plot, icon_name, attr_name, attr_value, callback, parent=m) 
     472            m.addAction(a) 
     473            b._actions[id] = a 
    453474             
    454475        if m.actions(): 
Note: See TracChangeset for help on using the changeset viewer.