Changeset 8463:81da0ea01a2e in orange


Ignore:
Timestamp:
07/26/11 09:40:06 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
c43280c14329552c66d14c395eb7abdd96ca75dc
Message:

Add an OWPlotGUI class with convenience method for common plot settings widgets

Location:
orange/OrangeWidgets
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Prototypes/OWScatterPlotQt.py

    r8461 r8463  
    119119        OWGUI.checkBox(box4, self, 'graph.showYLaxisTitle', 'Y axis title', callback = self.graph.setShowYLaxisTitle) 
    120120        OWGUI.checkBox(box4, self, 'graph.showAxisScale', 'Show axis scale', callback = self.updateGraph) 
    121         OWGUI.checkBox(box4, self, 'graph.showLegend', 'Show legend', callback = self.updateGraph) 
    122         OWGUI.checkBox(box4, self, 'graph.showFilledSymbols', 'Show filled symbols', callback = self.updateGraph) 
     121        self.graph.gui.show_legend_check_box(box4) 
     122        self.graph.gui.filled_symbols_check_box(box4) 
    123123        OWGUI.checkBox(box4, self, 'showGridlines', 'Show gridlines', callback = self.setShowGridlines) 
    124         OWGUI.checkBox(box4, self, 'graph.useAntialiasing', 'Use antialiasing', callback = self.updateGraph) 
     124        self.graph.gui.antialiasing_check_box(box4) 
    125125 
    126126        box5 = OWGUI.widgetBox(box4, orientation = "horizontal") 
  • orange/OrangeWidgets/plot/owplot.py

    r8462 r8463  
    5555from owlegend import * 
    5656from owpalette import * 
     57from owplotgui import OWPlotGUI 
    5758from owtools import * 
    5859 
     
    127128        self.use_antialiasing = True 
    128129        self.point_width = 5 
    129         self.showFilledSymbols = 1 
     130        self.show_filled_symbols = True 
    130131        self.alpha_value = 1 
    131132         
     
    181182        self.contPalette = ColorPaletteGenerator(numberOfColors = -1) 
    182183        self.discPalette = ColorPaletteGenerator() 
     184         
     185        self.gui = OWPlotGUI(self) 
    183186 
    184187        self.activate_zooming() 
     
    192195    alphaValue = deprecated_attribute("alphaValue", "alpha_value") 
    193196    useAntialiasing = deprecated_attribute("useAntialiasing", "use_antialiasing") 
     197    showFilledSymbols = deprecated_attribute("showFilledSymbols", "show_filled_symbols") 
    194198     
    195199    def __setattr__(self, name, value): 
     
    581585            self.set_clean() 
    582586        self.update_antialiasing() 
     587        self.update_legend() 
    583588        self.update_layout() 
    584589        self.update_zoom() 
    585590        self.update_axes() 
     591        self.update_filled_symbols() 
    586592        self.update() 
    587593        self.setSceneRect(QRectF(self.contentsRect())) 
     594         
     595    def update_legend(self): 
     596        self._legend.setVisible(self.show_legend) 
     597         
     598    def update_filled_symbols(self): 
     599        ## TODO: Implement this in Curve.cpp 
     600        pass 
    588601         
    589602    def legend(self): 
Note: See TracChangeset for help on using the changeset viewer.