#------------------------------------------------------------------------ # Compagny : 4Js # Developper : PM # Program : $PROJET/objects/check.obj # Date : 05.10.1995 # Last. modif. : 26.10.1995 # Title : Description des classes de base #------------------------------------------------------------------------ # Explication : # Displaying is assumed by the methode Display_..., called by # the display event of the object. Define_CheckButton creates the graphical # object, with root window and so on. But only the Pack_... (and # eventually the Place_...- ) -methodes can display it on screen. # So Display_... is tk-independant. # The display event is called with optionnaly root parameter (in this case, # the actually object root is lost and replaced with the new), but the # define, pack_it, place_it are without root parameter, because it is # assumed that the root is already known. # ====================================================================== Class CheckButton { inherit Button global Default #vars : public int_command "" public int_command_bef "" ;# Internal command befor. public int_command_aft "" ;# Internal command after. public int_variable "" ;# public geo_active_bg $Default(Entry,HighlightBg) public geo_disabled_fg $Default(Check,DisabledFg) public geo_x 100 public geo_y 100 public geo_relief $Default(Check,Relief) public geo_bg $Default(Widget,Bg) public geo_value "" constructor { config } { if {$geo_value == ""} { set geo_value $this } if {$int_variable == ""} { set int_variable ${this}_var } } #----------------------------------------------------------------------- # Refresh_CheckButton : # Reconfiguration of the graphical object, ... # Entry : name : Entity name of object # Returns : nothing. #....................................................................... method refresh { } { set cmd "" ;# Creation de la commande adaptee a l'objet !!! lappend cmd $geo_widget configure lappend cmd -command "$int_command_bef; $int_command; $int_command_aft " lappend cmd -bg $geo_bg lappend cmd -fg $geo_fg lappend cmd -activebackground $geo_active_bg # lappend cmd -padx $geo_padx # lappend cmd -pady $geo_pady lappend cmd -borderwidth $geo_borderwidth lappend cmd -relief $geo_relief lappend cmd -anchor w if { $geo_width != 0} { lappend cmd -width $geo_width } if { $geo_height != 0} { lappend cmd -height $geo_height } lappend cmd -text $geo_text lappend cmd -variable $int_variable # lappend cmd -value $geo_value # puts "Refresh_CheckButton: Voici le nouvel object avec cmd >$cmd<" eval $cmd } #----------------------------------------------------------------------- # Define_CheckButton : # Creation of the graphical object, with full path... # Entry : name : Entity name of object # Returns : nothing. #....................................................................... method define { } { set cmd "" ;# Creation de la commande adaptee a l'objet !!! lappend cmd checkbutton ${geo_root}w$int_name lappend cmd -bg $geo_bg lappend cmd -fg $geo_fg # lappend cmd -padx $geo_padx # lappend cmd -pady $geo_pady lappend cmd -borderwidth $geo_borderwidth lappend cmd -activebackground $geo_active_bg lappend cmd -command "$int_command_bef;$int_command;$int_command_aft" lappend cmd -relief $geo_relief lappend cmd -anchor w if {$geo_width != 0} { lappend cmd -width $geo_width } if {$geo_height != 0} { lappend cmd -height $geo_height } lappend cmd -text $geo_text lappend cmd -variable $int_variable # lappend cmd -value $geo_value # puts "Define_CheckButton: Voici le nouvel object avec label >$geo_text<" set geo_widget [ eval $cmd ] } } ;# end of class # ======================================================================