#UI_ENHANCEMENT by cg
class: FramedBox
new style option: frameLineOnly
class definition
changed:
#drawFrame
#initStyle
#redraw
--- a/FramedBox.st Wed Jun 20 03:31:45 2018 +0000
+++ b/FramedBox.st Thu Jun 21 13:41:28 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1991 by Claus Gittinger
All Rights Reserved
@@ -16,7 +18,7 @@
SimpleView subclass:#FramedBox
instanceVariableNames:'label labelChannel labelPosition fgColor showFrame frame3D
frameMacRounded horizontalSpace verticalSpace
- innerHorizontalSpace innerVerticalSpace frameColor'
+ innerHorizontalSpace innerVerticalSpace frameColor frameLineOnly'
classVariableNames:''
poolDictionaries:''
category:'Views-Layout'
@@ -569,20 +571,31 @@
frameColor ~= fgColor ifTrue:[
gc paint:frameColor
].
- gc displayRectangleX:halfSepX y:halfSepY width:w height:h.
+ frameLineOnly ifTrue:[
+ gc displayLineFromX:halfSepX y:halfSepY toX:w y:halfSepY.
+ ] ifFalse:[
+ gc displayRectangleX:halfSepX y:halfSepY width:w height:h.
+ ].
^ self
].
w := w + 1.
h := h + 1.
- gc paint:lightColor.
- gc displayRectangleX:halfSepX y:halfSepY width:w height:h.
+ frameLineOnly ifTrue:[
+ gc paint:lightColor.
+ gc displayLineFromX:halfSepX y:halfSepY toX:w y:halfSepY.
+ gc paint:shadowColor.
+ gc displayLineFromX:halfSepX y:halfSepY-1 toX:w y:halfSepY-1.
+ ] ifFalse:[
+ gc paint:lightColor.
+ gc displayRectangleX:halfSepX y:halfSepY width:w height:h.
+ gc paint:shadowColor.
+ gc displayRectangleX:halfSepX-1 y:halfSepY-1 width:w height:h.
+ ].
- gc paint:shadowColor.
- gc displayRectangleX:halfSepX-1 y:halfSepY-1 width:w height:h.
-
- "Modified: 17.2.1997 / 11:04:34 / cg"
+ "Modified: / 17-02-1997 / 11:04:34 / cg"
+ "Modified: / 21-06-2018 / 13:38:44 / Claus Gittinger"
!
redraw
@@ -644,14 +657,15 @@
].
self paint:fgColor on:viewBackground.
label isString ifTrue:[
- self displayOpaqueString:l x:x y:y
+ self displayOpaqueString:(l,' ') x:x y:y
] ifFalse:[
l displayOpaqueOn:self x:x y:y - gc font ascent
]
]
]
- "Modified: 28.2.1997 / 21:28:09 / cg"
+ "Modified: / 28-02-1997 / 21:28:09 / cg"
+ "Modified: / 21-06-2018 / 13:40:29 / Claus Gittinger"
! !
!FramedBox methodsFor:'event handling'!
@@ -686,6 +700,7 @@
#'framedBox.frameColor'
#'framedBox.font'
#'framedBox.MacRoundFrame'
+ #'framedBox.frameLineOnly'
#'framedBox.3DFrame')>
super initStyle.
@@ -695,10 +710,12 @@
labelPosition := StyleSheet at:'framedBox.labelPosition' default:#topCenter.
frame3D := StyleSheet at:'framedBox.3DFrame' default:true.
frameMacRounded := StyleSheet at:'framedBox.MacRoundFrame' default:false.
+ frameLineOnly := StyleSheet at:'framedBox.frameLineOnly' default:false.
self basicFont:(StyleSheet at:'framedBox.font' default:(StyleSheet at:'label.font' default:self font)).
self borderWidth:0.
- "Modified: / 26.10.1997 / 17:00:57 / cg"
+ "Modified: / 26-10-1997 / 17:00:57 / cg"
+ "Modified: / 21-06-2018 / 13:41:10 / Claus Gittinger"
!
initialize