LabelAndTwoIcons.st
changeset 5210 be1d9fbaa48d
parent 3871 185109a66d51
equal deleted inserted replaced
5209:173846bc5b93 5210:be1d9fbaa48d
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 "{ Package: 'stx:libwidg2' }"
    12 "{ Package: 'stx:libwidg2' }"
       
    13 
       
    14 "{ NameSpace: Smalltalk }"
    13 
    15 
    14 LabelAndIcon subclass:#LabelAndTwoIcons
    16 LabelAndIcon subclass:#LabelAndTwoIcons
    15 	instanceVariableNames:'image2'
    17 	instanceVariableNames:'image2'
    16 	classVariableNames:''
    18 	classVariableNames:''
    17 	poolDictionaries:''
    19 	poolDictionaries:''
   101 
   103 
   102     super displayOn:aGC x:x y:y opaque:opaque.
   104     super displayOn:aGC x:x y:y opaque:opaque.
   103 
   105 
   104     image2Value := image2 value.
   106     image2Value := image2 value.
   105     image2Value notNil ifTrue:[
   107     image2Value notNil ifTrue:[
   106         asc  := (aGC font onDevice:aGC device) ascent.
   108         asc  := aGC deviceFont ascent.
   107         image2Height  := image2Value notNil ifTrue:[image2Value height]  ifFalse:[0].
   109         image2Height  := image2Value notNil ifTrue:[image2Value height]  ifFalse:[0].
   108         maxHeight := self heightOn:aGC.
   110         maxHeight := self heightOn:aGC.
   109         x1 := x  + gap + (super widthOn:aGC).
   111         x1 := x  + gap + (super widthOn:aGC).
   110 
   112 
   111         image2Value notNil ifTrue:[
   113         image2Value notNil ifTrue:[
   124 heightOn:aGC
   126 heightOn:aGC
   125     "return the height of the receiver, if it is to be displayed on aGC"
   127     "return the height of the receiver, if it is to be displayed on aGC"
   126 
   128 
   127     |image2Height oneMillimeter|
   129     |image2Height oneMillimeter|
   128 
   130 
   129     oneMillimeter := aGC device pixelPerMillimeter x rounded.
       
   130 
       
   131     image2 notNil ifTrue:[
   131     image2 notNil ifTrue:[
       
   132         oneMillimeter := aGC device isNil ifTrue:[2] ifFalse:[aGC verticalIntegerPixelPerMillimeter].
   132         image2Height := image2 value height + oneMillimeter
   133         image2Height := image2 value height + oneMillimeter
   133     ] ifFalse:[
   134     ] ifFalse:[
   134         image2Height := 0   
   135         image2Height := 0   
   135     ].
   136     ].
   136     ^ (super heightOn:aGC) max: image2Height
   137     ^ (super heightOn:aGC) max: image2Height
   149 ! !
   150 ! !
   150 
   151 
   151 !LabelAndTwoIcons class methodsFor:'documentation'!
   152 !LabelAndTwoIcons class methodsFor:'documentation'!
   152 
   153 
   153 version_CVS
   154 version_CVS
   154     ^ '$Header: /cvs/stx/stx/libwidg2/LabelAndTwoIcons.st,v 1.4 2010-02-01 11:29:25 cg Exp $'
   155     ^ '$Header$'
   155 ! !
   156 ! !
       
   157