Label.st
changeset 50 e2a1b5f187ef
parent 38 4b9b70b2cc87
child 59 450ce95a72a4
equal deleted inserted replaced
49:4c05e94c0c09 50:e2a1b5f187ef
    23 
    23 
    24 Label comment:'
    24 Label comment:'
    25 COPYRIGHT (c) 1989 by Claus Gittinger
    25 COPYRIGHT (c) 1989 by Claus Gittinger
    26               All Rights Reserved
    26               All Rights Reserved
    27 
    27 
    28 $Header: /cvs/stx/stx/libwidg/Label.st,v 1.7 1994-08-07 13:22:44 claus Exp $
    28 $Header: /cvs/stx/stx/libwidg/Label.st,v 1.8 1994-08-23 23:38:00 claus Exp $
    29 '!
    29 '!
    30 
    30 
    31 !Label class methodsFor:'documentation'!
    31 !Label class methodsFor:'documentation'!
    32 
    32 
    33 copyright
    33 copyright
    44 "
    44 "
    45 !
    45 !
    46 
    46 
    47 version
    47 version
    48 "
    48 "
    49 $Header: /cvs/stx/stx/libwidg/Label.st,v 1.7 1994-08-07 13:22:44 claus Exp $
    49 $Header: /cvs/stx/stx/libwidg/Label.st,v 1.8 1994-08-23 23:38:00 claus Exp $
    50 "
    50 "
    51 !
    51 !
    52 
    52 
    53 documentation
    53 documentation
    54 "
    54 "
    94         fgColor             <Color>         foreground color
    94         fgColor             <Color>         foreground color
    95 
    95 
    96         fixSize             <Boolean>       if true, a change of the logo change will not
    96         fixSize             <Boolean>       if true, a change of the logo change will not
    97                                             resize the label; otherwise, its size is adjusted.
    97                                             resize the label; otherwise, its size is adjusted.
    98                                             default:false.
    98                                             default:false.
       
    99 
       
   100     Model-View behavior:
       
   101         label model:aModel.
       
   102         label aspect:aspectSymbol.
       
   103 
       
   104         model sends #changed:aspectSymbol
       
   105         ---> label will redraw its label from value of model>>aspectSymbol
    99 "
   106 "
   100 ! !
   107 ! !
   101 
   108 
   102 !Label class methodsFor:'defaults'!
   109 !Label class methodsFor:'defaults'!
   103 
   110 
   265 
   272 
   266     aForm isNil ifFalse:[
   273     aForm isNil ifFalse:[
   267         aForm ~~ logo ifTrue:[
   274         aForm ~~ logo ifTrue:[
   268             logo notNil ifTrue:[
   275             logo notNil ifTrue:[
   269                 logo extent = aForm extent ifTrue:[
   276                 logo extent = aForm extent ifTrue:[
       
   277                     logo := aForm.
   270                     ^ self
   278                     ^ self
   271                 ]
   279                 ]
   272             ].
   280             ].
   273             logo := aForm.
   281             logo := aForm.
   274             self newLayout
   282             self newLayout
   275         ]
   283         ]
   276     ]
   284     ]
       
   285 ! !
       
   286 
       
   287 !Label methodsFor:'change & update'!
       
   288 
       
   289 update:something
       
   290     "the MVC way of changing the label ..."
       
   291 
       
   292     (something == aspectSymbol) ifTrue:[
       
   293         model notNil ifTrue:[
       
   294             self label:(model perform: aspectSymbol) printString.
       
   295         ].
       
   296         ^ self.
       
   297     ].
       
   298     super update:something
   277 ! !
   299 ! !
   278 
   300 
   279 !Label methodsFor:'queries'!
   301 !Label methodsFor:'queries'!
   280 
   302 
   281 preferredExtent
   303 preferredExtent