#------------------------------------------------------------------------ # Compagny : 4Js # Developper : PM # Program : $PROJET/objects/array.obj # Date : 26.05.1995 # Last modif. : 13.10.1995 # Title : Description of class Array #------------------------------------------------------------------------ #====================================================================== # A Array is a complex set of objects. It is a container in witch # are put a list of fields, and for each of this fields, the number of # entries is the dimension of the array. # An attribut soons gives a list of fields whitch represents slaves # objects, in other words, member of this array. It is used for # example by the event display, so that the function knows witch objects # have to be displayed on this one. # For the moment, only an horizontal array is considered. #........................................................................ Class Array { inherit Frame global Default #vars : public geo_bg $Default(Array,Bg) public geo_active_bg $Default(Button,ActiveBg) public geo_relief $Default(Array,Relief) public geo_orientation "vertical" public geo_height 30 public geo_width 100 public geo_padx $Default(Container,PadX) public geo_pady $Default(Container,PadX) #Application specifics: public int_parent "" ;# object were it is member public int_geoman "place_it" ;# object were it is member public int_nb_lines 1 ;# like field, it's the minimum public int_label_relief $Default(Label,Relief) ;# not supported yet public int_entry_relief $Default(Entry,Relief) ;# not supported yet #soons: # please see definition in class "Widget", used soon is "members" #methodes : # set name(meth,incr_lines) "$name(meth,incr_lines);call $_name display" # set name(meth,decr_lines) "$name(meth,decr_lines);call $_name display" constructor { config } { } destructor { } #----------------------------------------------------------------------- # Define_Array: # This function is used to define the object in his integrality. But # because it isn't a low level object, tk-instructions cannot be used there # This is why, in the event "define", the Define_Array function is coupled # with the allready existing function Define... # Please see explainations in $DOC/define.txt #........................................................................ method define { } { # puts "Array::define" Frame::define # The following is to be able to change the number of lines in the array # init_ch_lines #ICI foreach entity $int_members { # puts "Define_Array <$this>: Update of $entity" $entity config -geo_orientation $geo_orientation \ -geo_fill "both" \ -geo_relief "flat" \ -int_geoman "pack_it" \ -int_nb_lines $int_nb_lines \ -int_parent $int_name \ -int_show_attr "H" # puts "Define_Field: fill now is >$geo_fill <" } } #----------------------------------------------------------------------- # Refresh_Array: #....................................................................... method refresh { } { Frame::refresh # puts "Refresh_Array: geoman for $name(int,name), is $name(int,geoman)" foreach entity $int_members { $entity config -int_nb_lines $int_nb_lines \ -geo_orientation $geo_orientation \ -int_geoman "pack_it" \ -geo_relief "flat" # puts ">$entity(int,name)< has >$entity(int,geoman)< for geoman!" # oldies: global $entity(int,name) ;# je ne me m'explique pas la raison !!! $entity reset_geo ;# ICI } } } ;# end of class Array #=======================================================================