Changeset 9371:d8ecc68c6ab3 in orange


Ignore:
Timestamp:
12/16/11 14:02:57 (2 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
e38cfd368b56ec3f9aaeaad14726b2698384bd1c
Message:

Added bold font option.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Unsupervised/OWNxExplorer.py

    r9369 r9371  
    4747        "mdsFromCurrentPos", "labelsOnMarkedOnly", "tabIndex",  
    4848        "networkCanvas.trim_label_words", "opt_from_curr", "networkCanvas.explore_distances", 
    49         "networkCanvas.show_component_distances"]  
     49        "networkCanvas.show_component_distances", "fontWeight"]  
    5050         
    5151        def __init__(self, parent=None, signalManager=None, name = 'Net Explorer',  
     
    109109            self.showMissingValues = 0 
    110110            self.fontSize = 12 
     111            self.fontWeight = 1 
    111112            self.mdsTorgerson = 0 
    112113            self.mdsAvgLinkage = 1 
     
    196197             
    197198            self.attBox = OWGUI.widgetBox(self.verticesTab, "Node labels | tooltips", orientation="vertical", addSpace = False) 
    198             OWGUI.spin(self.attBox, self, "fontSize", 4, 30, 1, label="Set font size:", callback = self.set_font_size) 
    199199            hb = OWGUI.widgetBox(self.attBox, orientation="horizontal", addSpace = False) 
    200200            self.attListBox = OWGUI.listBox(hb, self, "markerAttributes", "attributes", selectionMode=QListWidget.MultiSelection, callback=self.clickedAttLstBox) 
     
    221221            OWGUI.checkBox(ib, self, 'networkCanvas.show_indices', 'Show indices', callback=self.networkCanvas.set_node_labels) 
    222222            OWGUI.checkBox(ib, self, 'labelsOnMarkedOnly', 'Show labels on marked nodes only', callback=(lambda: self.networkCanvas.set_labels_on_marked(self.labelsOnMarkedOnly))) 
     223            OWGUI.spin(ib, self, "fontSize", 4, 30, 1, label="Font size:", callback = self.set_font) 
     224            self.comboFontWeight = OWGUI.comboBox(ib, self, "fontWeight", label='Font weight:', orientation='horizontal', callback=self.set_font) 
     225            self.comboFontWeight.addItem("Normal") 
     226            self.comboFontWeight.addItem("Bold") 
     227            self.comboFontWeight.setCurrentIndex(self.fontWeight) 
    223228             
    224229            ib = OWGUI.widgetBox(self.markTab, "Info", orientation="vertical") 
     
    345350             
    346351            self.graph_layout_method() 
    347             self.set_font_size() 
     352            self.set_font() 
    348353            self.set_graph(None) 
    349354             
     
    15211526            self.networkCanvas.replot() 
    15221527             
    1523         def set_font_size(self): 
     1528        def set_font(self): 
    15241529            if self.networkCanvas is None: 
    15251530                return 
     1531             
     1532            weights = {0: 50, 1: 80} 
    15261533             
    15271534            font = self.networkCanvas.font() 
    15281535            font.setPointSize(self.fontSize) 
     1536            font.setWeight(weights[self.fontWeight]) 
    15291537            self.networkCanvas.setFont(font) 
    15301538            self.networkCanvas.fontSize = font 
Note: See TracChangeset for help on using the changeset viewer.