#------------------------------------------------------------------------ # Compagny : 4Js # Developper : PM # Program : $PROJET/objects/label.obj # Date : 12.10.1995 # Title : Description de la classe Scrollbar #------------------------------------------------------------------------ #====================================================================== Class Scrollbar { inherit Widget global Default #vars : public geo_width 30 public geo_height 200 public geo_orientation "vertical" public geo_bg $Default(Label,Bg) public geo_relief $Default(Label,Relief) public geo_expand 0 #----------------------------------------------------------------------- constructor {config} { # set geo_text $this } method refresh { } { set cmd "" ;# Creation de la commande adaptee a l'objet !!! lappend cmd $geo_widget configure lappend cmd -bg $geo_bg lappend cmd -foreground $geo_fg lappend cmd -activeforeground $geo_active_fg lappend cmd -borderwidth $geo_borderwidth lappend cmd -relief $geo_relief lappend cmd -orient $geo_orientation if { $geo_width != 0} { lappend cmd -width $geo_width } if { $geo_height != 0} { # lappend cmd -height $geo_height } eval $cmd } # ----------------------------------------------------------------------- # Define_Scrollbar : # This function is very important for the class. It is the Tk- # -Implantation for the application, for this object. # The use of an intermediate string instead of calling the widget command # directly, is necessary because of the use of 'width', wich is not # systematique, and then inopportune # Parameters: name of object # Returns: full path of the created widget #........................................................................ method define { } { # puts "Scrollbar::define called" set cmd "" ;# Creation de la commande adaptee a l'objet !!! lappend cmd scrollbar $geo_root$int_name lappend cmd -bg $geo_bg lappend cmd -foreground $geo_fg lappend cmd -activeforeground $geo_active_fg lappend cmd -borderwidth $geo_borderwidth lappend cmd -relief $geo_relief lappend cmd -orient $geo_orientation if {$geo_height != 0} { # lappend cmd -height $geo_height } if {$geo_width != 0} { lappend cmd -width $geo_width } set geo_widget [ eval $cmd ] } } # ======================================================================