Show
Ignore:
Timestamp:
11/29/08 18:08:19 (4 years ago)
Author:
luis
Message:

Integration of RadialNet:
- higwidgets
- Added Mapper to Notebook
- Change version number
Credit for commit: me and Daniel Cassiano
AUTHOR of RadialNet: Joao Medeiros

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/umitGUI/radialnet/ControlWidget.py

    r3726 r3798  
    2323import gobject 
    2424 
    25 import bestwidgets as bw 
     25#import bestwidgets as bw 
    2626import higwidgets.drawing as drawing 
    2727 
     
    2929from umitGUI.radialnet.RadialNet import * 
    3030 
     31from higwidgets.higboxes import HIGBox, HIGHBox, HIGVBox, HIGScrolledWindow 
     32from higwidgets.higexpanders import HIGExpanderRNet 
     33from higwidgets.higtables import HIGTableRNet 
    3134 
    3235OPTIONS = ['address', 
     
    4245 
    4346 
    44 class ControlWidget(bw.BWVBox): 
     47class ControlWidget(HIGVBox): 
    4548    """ 
    4649    """ 
     
    4851        """ 
    4952        """ 
    50         bw.BWVBox.__init__(self) 
     53        HIGVBox.__init__(self) 
    5154        self.set_border_width(6) 
    5255 
     
    6467        self.__view = ControlView(self.radialnet) 
    6568 
    66         self.bw_pack_start_noexpand_nofill(self.__action) 
    67         self.bw_pack_start_noexpand_nofill(self.__interpolation) 
    68         self.bw_pack_start_noexpand_nofill(self.__layout) 
    69         self.bw_pack_start_noexpand_nofill(self.__view) 
    70  
    71  
    72  
    73 class ControlAction(bw.BWExpander): 
     69        self._pack_noexpand_nofill(self.__action) 
     70        self._pack_noexpand_nofill(self.__interpolation) 
     71        self._pack_noexpand_nofill(self.__layout) 
     72        self._pack_noexpand_nofill(self.__view) 
     73 
     74 
     75 
     76class ControlAction(HIGExpanderRNet): 
    7477    """ 
    7578    """ 
     
    7780        """ 
    7881        """ 
    79         bw.BWExpander.__init__(self, 'Action') 
     82        HIGExpanderRNet.__init__(self, 'Action') 
    8083        self.set_expanded(True) 
    8184 
     
    8891        """ 
    8992        """ 
    90         self.__tbox = bw.BWTable(1, 4) 
    91         self.__tbox.bw_set_spacing(0) 
    92         self.__vbox = bw.BWVBox() 
     93        self.__tbox = HIGTableRNet(1, 4) 
     94        self.__tbox._set_spacing(0) 
     95        self.__vbox = HIGVBox() 
    9396 
    9497        self.__tooltips = gtk.Tooltips() 
     
    126129        self.__region_color.set_active(self.radialnet.get_region_color()) 
    127130 
    128         self.__tbox.bw_attach_next(self.__jump_to) 
    129         self.__tbox.bw_attach_next(self.__info) 
    130         self.__tbox.bw_attach_next(self.__group) 
    131         self.__tbox.bw_attach_next(self.__region) 
    132  
    133         self.__vbox.bw_pack_start_noexpand_nofill(self.__tbox) 
    134         self.__vbox.bw_pack_start_noexpand_nofill(self.__region_color) 
    135  
    136         self.bw_add(self.__vbox) 
     131        self.__tbox._attach_next(self.__jump_to) 
     132        self.__tbox._attach_next(self.__info) 
     133        self.__tbox._attach_next(self.__group) 
     134        self.__tbox._attach_next(self.__region) 
     135 
     136        self.__vbox._pack_noexpand_nofill(self.__tbox) 
     137        self.__vbox._pack_noexpand_nofill(self.__region_color) 
     138 
     139        self._add(self.__vbox) 
    137140 
    138141        self.__jump_to.set_active(True) 
     
    354357 
    355358 
    356 class ControlVariable(bw.BWHBox): 
     359class ControlVariable(HIGHBox): 
    357360    """ 
    358361    """ 
     
    360363        """ 
    361364        """ 
    362         bw.BWHBox.__init__(self, spacing=0) 
     365        HIGHBox.__init__(self, spacing=0) 
    363366 
    364367        self.__increment_pass = increment 
     
    399402        self.__right_button.connect('released', self.__released) 
    400403 
    401         self.bw_pack_start_noexpand_nofill(self.__left_button) 
    402         self.bw_pack_start_expand_fill(self.__control) 
    403         self.bw_pack_start_noexpand_nofill(self.__right_button) 
     404        self._pack_noexpand_nofill(self.__left_button) 
     405        self._pack_expand_fill(self.__control) 
     406        self._pack_noexpand_nofill(self.__right_button) 
    404407 
    405408 
     
    432435 
    433436 
    434 class ControlFisheye(bw.BWVBox): 
     437class ControlFisheye(HIGVBox): 
    435438    """ 
    436439    """ 
     
    438441        """ 
    439442        """ 
    440         bw.BWVBox.__init__(self) 
     443        HIGVBox.__init__(self) 
    441444        self.set_border_width(6) 
    442445 
     
    450453        """ 
    451454        """ 
    452         self.__params = bw.BWHBox() 
     455        self.__params = HIGHBox() 
    453456 
    454457        self.__fisheye_label = gtk.Label('<b>Fisheye</b> on ring') 
     
    477480        self.__spread_spin.set_digits(2) 
    478481 
    479         self.__params.bw_pack_start_noexpand_nofill(self.__fisheye_label) 
    480         self.__params.bw_pack_start_noexpand_nofill(self.__ring_spin) 
    481         self.__params.bw_pack_start_expand_fill(self.__ring_scale) 
    482         self.__params.bw_pack_start_noexpand_nofill(self.__interest_label) 
    483         self.__params.bw_pack_start_noexpand_nofill(self.__interest_spin) 
    484         self.__params.bw_pack_start_noexpand_nofill(self.__spread_label) 
    485         self.__params.bw_pack_start_noexpand_nofill(self.__spread_spin) 
    486  
    487         self.bw_pack_start_noexpand_nofill(self.__params) 
     482        self.__params._pack_noexpand_nofill(self.__fisheye_label) 
     483        self.__params._pack_noexpand_nofill(self.__ring_spin) 
     484        self.__params._pack_expand_fill(self.__ring_scale) 
     485        self.__params._pack_noexpand_nofill(self.__interest_label) 
     486        self.__params._pack_noexpand_nofill(self.__interest_spin) 
     487        self.__params._pack_noexpand_nofill(self.__spread_label) 
     488        self.__params._pack_noexpand_nofill(self.__spread_spin) 
     489 
     490        self._pack_noexpand_nofill(self.__params) 
    488491 
    489492        self.__ring.connect('value_changed', self.__change_ring) 
     
    578581 
    579582 
    580 class ControlInterpolation(bw.BWExpander): 
     583class ControlInterpolation(HIGExpanderRNet): 
    581584    """ 
    582585    """ 
     
    584587        """ 
    585588        """ 
    586         bw.BWExpander.__init__(self, 'Interpolation') 
     589        HIGExpanderRNet.__init__(self, 'Interpolation') 
    587590 
    588591        self.radialnet = radialnet 
     
    594597        """ 
    595598        """ 
    596         self.__vbox = bw.BWVBox() 
     599        self.__vbox = HIGVBox() 
    597600 
    598601        self.__cartesian_radio = gtk.RadioButton(None, 'Cartesian') 
     
    605608                                   INTERPOLATION_POLAR) 
    606609 
    607         self.__system_box = bw.BWHBox() 
    608         self.__system_box.bw_pack_start_noexpand_nofill(self.__polar_radio) 
    609         self.__system_box.bw_pack_start_noexpand_nofill(self.__cartesian_radio) 
    610  
    611         self.__frames_box = bw.BWHBox() 
     610        self.__system_box = HIGHBox() 
     611        self.__system_box._pack_noexpand_nofill(self.__polar_radio) 
     612        self.__system_box._pack_noexpand_nofill(self.__cartesian_radio) 
     613 
     614        self.__frames_box = HIGHBox() 
    612615        self.__frames_label = gtk.Label('Frames') 
    613616        self.__frames_label.set_alignment(0.0, 0.5) 
     
    618621        self.__frames.connect('value_changed', self.__change_frames) 
    619622        self.__frames_spin = gtk.SpinButton(self.__frames) 
    620         self.__frames_box.bw_pack_start_expand_fill(self.__frames_label) 
    621         self.__frames_box.bw_pack_start_noexpand_nofill(self.__frames_spin) 
    622  
    623         self.__vbox.bw_pack_start_noexpand_nofill(self.__frames_box) 
    624         self.__vbox.bw_pack_start_noexpand_nofill(self.__system_box) 
    625  
    626         self.bw_add(self.__vbox) 
     623        self.__frames_box._pack_expand_fill(self.__frames_label) 
     624        self.__frames_box._pack_noexpand_nofill(self.__frames_spin) 
     625 
     626        self.__vbox._pack_noexpand_nofill(self.__frames_box) 
     627        self.__vbox._pack_noexpand_nofill(self.__system_box) 
     628 
     629        self._add(self.__vbox) 
    627630 
    628631        gobject.timeout_add(REFRESH_RATE, self.__update_animation) 
     
    665668 
    666669 
    667 class ControlLayout(bw.BWExpander): 
     670class ControlLayout(HIGExpanderRNet): 
    668671    """ 
    669672    """ 
     
    671674        """ 
    672675        """ 
    673         bw.BWExpander.__init__(self, 'Layout') 
     676        HIGExpanderRNet.__init__(self, 'Layout') 
    674677 
    675678        self.radialnet = radialnet 
     
    681684        """ 
    682685        """ 
    683         self.__hbox = bw.BWHBox() 
     686        self.__hbox = HIGHBox() 
    684687 
    685688        self.__layout = gtk.combo_box_new_text() 
     
    691694        self.__force.connect('clicked', self.__force_update) 
    692695 
    693         self.__hbox.bw_pack_start_expand_fill(self.__layout) 
    694         self.__hbox.bw_pack_start_noexpand_nofill(self.__force) 
    695  
    696         self.bw_add(self.__hbox) 
     696        self.__hbox._pack_expand_fill(self.__layout) 
     697        self.__hbox._pack_noexpand_nofill(self.__force) 
     698 
     699        self._add(self.__hbox) 
    697700 
    698701        self.__check_layout() 
     
    729732 
    730733 
    731 class ControlRingGap(bw.BWVBox): 
     734class ControlRingGap(HIGVBox): 
    732735    """ 
    733736    """ 
     
    735738        """ 
    736739        """ 
    737         bw.BWVBox.__init__(self) 
     740        HIGVBox.__init__(self) 
    738741 
    739742        self.radialnet = radialnet 
     
    758761        self.__spin.connect('value_changed', self.__change_lower) 
    759762 
    760         self.__lower_hbox = bw.BWHBox() 
    761         self.__lower_hbox.bw_pack_start_expand_fill(self.__label) 
    762         self.__lower_hbox.bw_pack_start_noexpand_nofill(self.__spin) 
    763  
    764         self.bw_pack_start_noexpand_nofill(self.__radius) 
    765         self.bw_pack_start_noexpand_nofill(self.__lower_hbox) 
     763        self.__lower_hbox = HIGHBox() 
     764        self.__lower_hbox._pack_expand_fill(self.__label) 
     765        self.__lower_hbox._pack_noexpand_nofill(self.__spin) 
     766 
     767        self._pack_noexpand_nofill(self.__radius) 
     768        self._pack_noexpand_nofill(self.__lower_hbox) 
    766769 
    767770 
     
    774777 
    775778 
    776 class ControlOptions(bw.BWScrolledWindow): 
     779class ControlOptions(HIGScrolledWindow): 
    777780    """ 
    778781    """ 
     
    780783        """ 
    781784        """ 
    782         bw.BWScrolledWindow.__init__(self) 
     785        HIGScrolledWindow.__init__(self) 
    783786 
    784787        self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS) 
     
    875878 
    876879 
    877 class ControlView(bw.BWExpander): 
     880class ControlView(HIGExpanderRNet): 
    878881    """ 
    879882    """ 
     
    881884        """ 
    882885        """ 
    883         bw.BWExpander.__init__(self, 'View') 
     886        HIGExpanderRNet.__init__(self, 'View') 
    884887        self.set_expanded(True) 
    885888 
     
    892895        """ 
    893896        """ 
    894         self.__vbox = bw.BWVBox(spacing=0) 
     897        self.__vbox = HIGVBox(spacing=0) 
    895898 
    896899        self.__zoom = ControlVariable('Zoom', 
     
    904907        self.__options.set_border_width(0) 
    905908 
    906         self.__vbox.bw_pack_start_expand_nofill(self.__options) 
    907         self.__vbox.bw_pack_start_noexpand_nofill(self.__navigation) 
    908         self.__vbox.bw_pack_start_noexpand_nofill(self.__zoom) 
    909         self.__vbox.bw_pack_start_noexpand_nofill(self.__ring_gap) 
    910  
    911         self.bw_add(self.__vbox) 
     909        self.__vbox._pack_expand_nofill(self.__options) 
     910        self.__vbox._pack_noexpand_nofill(self.__navigation) 
     911        self.__vbox._pack_noexpand_nofill(self.__zoom) 
     912        self.__vbox._pack_noexpand_nofill(self.__ring_gap) 
     913 
     914        self._add(self.__vbox) 
    912915 
    913916