--- a/NoteBookView.st Thu Mar 01 17:10:11 2007 +0100
+++ b/NoteBookView.st Fri Mar 02 16:05:44 2007 +0100
@@ -74,55 +74,37 @@
examples
"
- tabs at top ( default )
+ tabs at top & bottom
[exBegin]
- |top tab|
-
- top := StandardSystemView extent:250@100.
- tab := NoteBookView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
- tab list:#( 'Foo' 'Bar' 'Baz' ).
- tab action:[:index| Transcript showCR:index].
- top open.
- [exEnd]
-
-
- tabs at bottom
- [exBegin]
- |top tab|
-
- top := StandardSystemView extent:250@100.
- tab := NoteBookView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
- tab direction:#bottom.
- tab list:#( 'Foo' 'Bar' 'Baz' ).
- tab action:[:index| Transcript showCR:index].
+ |top tab1 tab2|
+
+ top := StandardSystemView extent:300@100.
+ tab1 := NoteBookView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:top.
+ tab1 direction:#top.
+ tab1 list:#( 'Foo' 'Bagr' 'Baz' 'Bgar' 'Baqz' ).
+
+ tab2 := NoteBookView origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:top.
+ tab2 direction:#bottom.
+ tab2 list:#( 'Foo' 'Bagr' 'Baz' 'Bgar' 'Baqz' ).
top open.
[exEnd]
- tabs at left
+
+ tabs at left & right
[exBegin]
- |top tab|
-
- top := StandardSystemView extent:100@200.
- tab := NoteBookView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
- tab direction:#left.
- tab list:#( 'Foo' 'Bar' 'Baz' ).
- tab action:[:index| Transcript showCR:index].
+ |top tab1 tab2|
+
+ top := StandardSystemView extent:100@300.
+ tab1 := NoteBookView origin:0.0 @ 0.0 corner:0.5 @ 01.0 in:top.
+ tab1 direction:#left.
+ tab1 list:#( 'Foo' 'Bagr' 'Baz' 'Bgar' 'Baqz' ).
+
+ tab2 := NoteBookView origin:0.5 @ 0.0 corner:1.0 @ 1.0 in:top.
+ tab2 direction:#right.
+ tab2 list:#( 'Foo' 'Bagr' 'Baz' 'Bgar' 'Baqz' ).
top open.
[exEnd]
- tabs at right
- [exBegin]
- |top tab|
-
- top := StandardSystemView extent:100@200.
- tab := NoteBookView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
- tab direction:#right.
- tab list:#( 'Foo' 'Bar' 'Baz' ).
- tab action:[:index| Transcript showCR:index].
- top open.
- [exEnd]
-
-
"
! !
@@ -1442,33 +1424,29 @@
drawTabFocus:aTab
"draw a tabs focus-rectangle"
- |layout extent voffs hoffs|
+ |tabLyt extent voffs hoffs|
self supportsFocusOnTab ifFalse:[ ^ self ].
- self hasFocus ifFalse:[ ^ self ].
-
- self activeTabMarkerColor notNil ifTrue:[
- self drawActiveTabMarker:aTab.
- ^ self
- ].
-
- layout := aTab layout.
+
+ tabLyt := aTab layout.
extent := aTab extent.
self isHorizontal ifTrue:[
- voffs := (layout height - extent y) // 2 max:0.
- hoffs := (layout width - extent x) // 2 max:0.
+ voffs := tabLyt height - extent y.
+ hoffs := tabLyt width - extent x - 4.
] ifFalse:[
- voffs := (layout height - extent x) // 2 max:0.
- hoffs := (layout width - extent y) // 2 max:0.
+ voffs := tabLyt height - extent x - 4.
+ hoffs := tabLyt width - extent y.
].
+ voffs := (voffs // 2) max:0.
+ hoffs := (hoffs // 2) max:0.
self paint:(Color black).
- self displayDottedRectangleX:(layout left + hoffs - 1)
- y:(layout top + voffs - 1)
- width:(layout width - hoffs - hoffs + 2)
- height:(layout height - voffs - voffs + 2).
+ self displayDottedRectangleX:(tabLyt left + hoffs - 1)
+ y:(tabLyt top + voffs - 1)
+ width:(tabLyt width - hoffs - hoffs + 2)
+ height:(tabLyt height - voffs - voffs + 2).
!
invalidateSelectedTab
@@ -1519,7 +1497,12 @@
self drawTabEdgesFor:aTab.
isSelected ifTrue:[
- self drawTabFocus:aTab
+ self activeTabMarkerColor notNil ifTrue:[
+ self drawActiveTabMarker:aTab.
+ ].
+ self hasFocus ifTrue:[
+ self drawTabFocus:aTab
+ ].
].
"Modified: / 01-03-2007 / 16:43:07 / cg"
@@ -1782,16 +1765,12 @@
!NoteBookView methodsFor:'focus handling'!
-focusNext
- "get next focus view to self - returns my canvas focusNext
- "
- |nextView|
-
- (canvas notNil and:[canvas shown]) ifTrue:[
- nextView := canvas focusNext.
- nextView notNil ifTrue:[^ nextView].
- ].
- ^ super focusNext
+canTab
+ "if the list of tabLabels is empty, we do not need the focus
+ by tabing - give the focus to my included subviews."
+
+ list isEmpty ifTrue:[^ false].
+ ^ super canTab
!
showFocus:explicit
@@ -1817,7 +1796,6 @@
supportsFocusOnTab
"returns true if focus is supported
"
-"/ ^ true
^ (styleSheet at:#'focusHighlightStyle') == #win95
! !
@@ -3305,7 +3283,7 @@
x := 0.
].
x := x + lft.
- y := layoutTop + (layout height - inset - extent y // 2).
+ y := layoutTop + ((layout height - inset - extent y - 1)// 2).
aDirection == #top ifTrue:[ y := y + inset ].
@@ -3327,7 +3305,7 @@
y := 0.
].
y := y + top.
- x := layoutLeft + (layout width - inset - extent y // 2).
+ x := layoutLeft + ((layout width - inset - extent y +2) // 2).
aDirection == #left ifTrue:[ x := x + inset ].
@@ -3441,5 +3419,5 @@
!NoteBookView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/NoteBookView.st,v 1.127 2007-03-01 16:10:11 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/NoteBookView.st,v 1.128 2007-03-02 15:05:44 ca Exp $'
! !