*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Fri, 15 Oct 2004 16:33:46 +0200
changeset 2762 98eb83162881
parent 2761 611ecd331c14
child 2763 844f86135a02
*** empty log message ***
NoteBookView.st
--- a/NoteBookView.st	Fri Oct 15 15:14:13 2004 +0200
+++ b/NoteBookView.st	Fri Oct 15 16:33:46 2004 +0200
@@ -1164,9 +1164,51 @@
     ].
 !
 
+drawTabFocus:aTab
+    "draw a tabs focus-rectangle"
+
+    |layout extent voffs hoffs|
+
+^ self.
+
+    layout := aTab layout.
+
+    extent := aTab extent.
+
+    self isHorizontal ifTrue:[
+        voffs  := (layout height - extent y) // 2 max:0.
+        hoffs  := (layout width  - extent x) // 2 max:0.
+    ] ifFalse:[
+        voffs  := (layout height - extent x) // 2 max:0.
+        hoffs  := (layout width  - extent y) // 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).
+
+
+
+
+
+""
+!
+
+invalidateSelectedTab
+    |selectedTab|
+
+    selectedTab := self selectedTab.
+    selectedTab notNil ifTrue:[
+        self invalidateTab:selectedTab
+    ].
+!
+
 invalidateTab:aTab
-    "invalidate a tab
-    "
+    "invalidate a tab (i.e. force it to be redrawn)"
+
     |tabBounds|
 
     shown ifTrue:[
@@ -1178,7 +1220,7 @@
 redrawTab:aTab
     "redraw a tab
     "
-    |isSelected layout fgColor extent voffs hoffs|
+    |isSelected layout fgColor|
 
     isSelected := self selectedTab == aTab.
 
@@ -1207,34 +1249,9 @@
     (     isSelected
      and:[self hasFocus
      and:[self supportsFocusOnTab]]
-    ) ifFalse:[
-        ^ self
+    ) ifTrue:[
+        self drawTabFocus:aTab
     ].
-
-    "/ drawing the focus
-
-    extent := aTab extent.
-
-    self isHorizontal ifTrue:[
-        voffs  := (layout height - extent y) // 2 max:0.
-        hoffs  := (layout width  - extent x) // 2 max:0.
-    ] ifFalse:[
-        voffs  := (layout height - extent x) // 2 max:0.
-        hoffs  := (layout width  - extent y) // 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).
-
-
-
-
-
-""
 !
 
 redrawX:x y:y width:w height:h
@@ -1417,31 +1434,20 @@
 !NoteBookView methodsFor:'focus handling'!
 
 showFocus:explicit
-    "got the keyboard focus 
-    "
-    |selectedTab|
+    "got the keyboard focus"
 
     self supportsFocusOnTab ifTrue:[
-        selectedTab := self selectedTab.
-        selectedTab notNil ifTrue:[
-            self invalidateTab:selectedTab
-        ]
+        self invalidateSelectedTab
     ] ifFalse:[
         super showFocus:explicit
     ]
 !
 
 showNoFocus:explicit
-    "lost the keyboard focus 
-    "
-    |selectedTab|
+    "lost the keyboard focus"
 
     self supportsFocusOnTab ifTrue:[
-        selectedTab := self selectedTab.
-
-        selectedTab notNil ifTrue:[
-            self invalidateTab:selectedTab
-        ].
+        self invalidateSelectedTab
     ] ifFalse:[
         super showNoFocus:explicit
     ]
@@ -2872,5 +2878,5 @@
 !NoteBookView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/NoteBookView.st,v 1.101 2004-10-15 10:16:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/NoteBookView.st,v 1.102 2004-10-15 14:33:46 cg Exp $'
 ! !