--- a/Label.st Thu Oct 01 11:08:34 2015 +0200
+++ b/Label.st Sun Oct 04 20:58:35 2015 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
@@ -11,6 +13,8 @@
"
"{ Package: 'stx:libwidg' }"
+"{ NameSpace: Smalltalk }"
+
View subclass:#Label
instanceVariableNames:'logo labelWidth labelHeight labelOriginX labelOriginY adjust
hSpace vSpace bgColor fgColor etchedFgColor fixSize labelMsg
@@ -1206,6 +1210,12 @@
"Modified: 13.4.1996 / 11:17:58 / cg"
!
+extraMarginForBorder
+ "some (round) borders may need more space"
+
+ ^ 0
+!
+
font:aFont
"set the font - if I'm not realized and not fixedSize, adjust my size.
CAVEAT: with the addition of Text objects,
@@ -1618,7 +1628,7 @@
x := margin
] ifFalse:[
"/ #right
- x := width - labelWidth - margin
+ x := width - labelWidth - margin - self extraMarginForBorder
]
].
labelOriginX := x
@@ -1683,7 +1693,7 @@
preferredExtent
"return my preferred extent - this is the minimum size I would like to have"
- |ext|
+ |ext m|
"/ If I have an explicit preferredExtent...
explicitExtent notNil ifTrue:[
@@ -1702,8 +1712,8 @@
self label:''
].
ext := self rawLabelSizeOf:logo.
-
- ^ (margin + ext x + margin + hSpace) @ (margin + ext y + margin + vSpace)
+ m := (margin + self extraMarginForBorder) * 2.
+ ^ (m + ext x + hSpace) @ (m + ext y + vSpace)
"Modified: 19.7.1996 / 20:44:41 / cg"
!
@@ -1971,10 +1981,10 @@
!Label class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Label.st,v 1.154 2014-08-03 12:28:17 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libwidg/Label.st,v 1.154 2014-08-03 12:28:17 cg Exp $'
+ ^ '$Header$'
! !