MenuPanel.st
changeset 4232 8193baee0399
parent 4226 73442f136108
child 4235 c7a96376eac2
equal deleted inserted replaced
4231:6aec2775cc1e 4232:8193baee0399
  7518     oldFont := menuPanel setFont:(self font).
  7518     oldFont := menuPanel setFont:(self font).
  7519     "/ fontAscent := menuPanel font ascent.
  7519     "/ fontAscent := menuPanel font ascent.
  7520     menuPanel paint:fg.
  7520     menuPanel paint:fg.
  7521     labelExtent := self displayLabelExtent.
  7521     labelExtent := self displayLabelExtent.
  7522 
  7522 
  7523     y := layout top + (layout height - labelExtent y // 2) + yOffset.
  7523     y := layout top + ((layout height - labelExtent y) // 2) + yOffset.
  7524 "/  menuPanel centerItems ifTrue:[self halt].
  7524 "/  menuPanel centerItems ifTrue:[self halt].
  7525     aLabel isArray ifFalse:[
  7525     aLabel isArray ifFalse:[
  7526 	|printLabel|
  7526         |printLabel|
  7527 
  7527 
  7528 	aLabel isText ifTrue:[
  7528         aLabel isText ifTrue:[
  7529 	    "/ background of label has already been drawn
  7529             "/ background of label has already been drawn
  7530 	    printLabel := aLabel withoutBackgroundColorEmphasis.
  7530             printLabel := aLabel withoutBackgroundColorEmphasis.
  7531 	] ifFalse:[
  7531         ] ifFalse:[
  7532 	    printLabel := aLabel.
  7532             printLabel := aLabel.
  7533 	].
  7533         ].
  7534 	y := y + (printLabel ascentOn:menuPanel).
  7534         y := y + (printLabel ascentOn:menuPanel).
  7535 	printLabel displayOn:menuPanel x:x y:y.
  7535         printLabel displayOn:menuPanel x:x y:y.
  7536     ] ifTrue:[
  7536     ] ifTrue:[
  7537 	aLabel do:[:el|
  7537         aLabel do:[:el|
  7538 	    el notNil ifTrue:[
  7538             el notNil ifTrue:[
  7539 		y0 := y + (el ascentOn:menuPanel).
  7539                 y0 := y + (el ascentOn:menuPanel).
  7540 "/                el isImageOrForm ifFalse:[
  7540 "/                el isImageOrForm ifFalse:[
  7541 "/                    y0 := y + fontAscent
  7541 "/                    y0 := y + fontAscent
  7542 "/                ] ifTrue:[
  7542 "/                ] ifTrue:[
  7543 "/                    y0 := y
  7543 "/                    y0 := y
  7544 "/                ].
  7544 "/                ].
  7545 		x0 := x + (labelExtent x - (el widthOn:menuPanel) // 2).
  7545                 x0 := x + ((labelExtent x - (el widthOn:menuPanel)) // 2).
  7546 		el displayOn:menuPanel x:x0 y:y0.
  7546                 el displayOn:menuPanel x:x0 y:y0.
  7547 		y := y + 1 + (el heightOn:menuPanel)
  7547                 y := y + 1 + (el heightOn:menuPanel)
  7548 	    ] ifFalse:[
  7548             ] ifFalse:[
  7549 		y := y + (self spaceBetweenEmptyLines)
  7549                 y := y + (self spaceBetweenEmptyLines)
  7550 	    ]
  7550             ]
  7551 	].
  7551         ].
  7552     ].
  7552     ].
  7553     menuPanel setFont:oldFont
  7553     menuPanel setFont:oldFont
  7554 !
  7554 !
  7555 
  7555 
  7556 drawSeparatingLines
  7556 drawSeparatingLines
  8668 ! !
  8668 ! !
  8669 
  8669 
  8670 !MenuPanel class methodsFor:'documentation'!
  8670 !MenuPanel class methodsFor:'documentation'!
  8671 
  8671 
  8672 version
  8672 version
  8673     ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.554 2013-05-28 18:41:16 cg Exp $'
  8673     ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.555 2013-06-04 13:52:09 cg Exp $'
  8674 !
  8674 !
  8675 
  8675 
  8676 version_CVS
  8676 version_CVS
  8677     ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.554 2013-05-28 18:41:16 cg Exp $'
  8677     ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.555 2013-06-04 13:52:09 cg Exp $'
  8678 ! !
  8678 ! !
  8679 
  8679 
  8680 
  8680 
  8681 MenuPanel initialize!
  8681 MenuPanel initialize!