+activeHelpText
authorClaus Gittinger <cg@exept.de>
Mon, 26 Mar 2007 13:44:39 +0200
changeset 3212 cb80f339ddfa
parent 3211 69cc92eb7a77
child 3213 2b0edaa554f1
+activeHelpText
DSVLabelView.st
--- a/DSVLabelView.st	Mon Mar 26 13:44:23 2007 +0200
+++ b/DSVLabelView.st	Mon Mar 26 13:44:39 2007 +0200
@@ -113,6 +113,22 @@
 
 !DSVLabelView methodsFor:'drawing'!
 
+flyByHelpTextAt:aPoint
+    "return the helpText for aPoint (i.e. when mouse-pointer is moved over an item)."
+
+    |colNr col|
+
+    columns isEmpty ifTrue:[^ nil].
+    colNr := self xVisibleToColNr:aPoint x.
+    colNr ~~ 0 ifTrue:[
+        col := columns at:colNr.
+        ^ col activeHelpText.
+    ].
+    ^ nil
+
+    "Created: / 26-03-2007 / 13:43:20 / cg"
+!
+
 invalidate
     (shown) ifTrue:[
         super invalidate
@@ -319,11 +335,14 @@
         (x between:(x1-tabSpacing) and:(x1+tabSpacing))
         "/ x + tabSpacing > x1 
         ifTrue:[
-            ^ self cursor:handleCursor
+            self cursor:handleCursor.
+            ^ self
         ].
     ].
 
     self cursor:(Cursor normal)
+
+    "Modified: / 26-03-2007 / 13:36:01 / cg"
 !
 
 buttonPress:button x:x y:y
@@ -338,14 +357,11 @@
 
     "/ in the resize area ?
     idx := self xVisibleToColNr:(x-tabSpacing).
-
     idx ~~ 0 ifTrue:[
-        col := columns at:idx ifAbsent:nil.
-
+        col := columns at:idx.
         col isResizeable ifTrue:[
             x1 := self xVisibleOfColNr:(idx + 1).
-            (x between:(x1-tabSpacing) and:(x1+tabSpacing))
-            ifTrue:[
+            (x between:(x1-tabSpacing) and:(x1+tabSpacing)) ifTrue:[
                 col := columns at:idx ifAbsent:nil.
                 self cursor:handleCursor.
 
@@ -359,20 +375,21 @@
                 (opaqueColumnResize ? (UserPreferences current opaqueTableColumnResizing == true)) ifFalse:[
                     lineDrag invertLine.
                 ].
-              ^ self
+                ^ self
             ]
         ]
     ].
 
     idx := self xVisibleToColNr:x.
-    col := columns at:idx ifAbsent:nil.
-
-    col notNil ifTrue:[
+    idx ~~ 0 ifTrue:[
+        col := columns at:idx.
         col label isSelectable ifTrue:[
             self invalidateItemAt:(selection := idx)
-        ]
+        ].
     ].
     self cursor:(Cursor normal).
+
+    "Modified: / 26-03-2007 / 13:35:07 / cg"
 !
 
 buttonRelease:button x:x y:y
@@ -422,8 +439,9 @@
 !
 
 xVisibleToColNr:x
-    "returns the column number assigned to a physical x or nil
-    "
+    "returns the column number for a physical x position.
+     Returns nil if x is behond the last column."
+
     |x0 x1|
 
     x1 := self xVisibleOfColNr:1.
@@ -437,6 +455,8 @@
         ]
     ].
     ^ 0
+
+    "Modified: / 26-03-2007 / 13:32:00 / cg"
 ! !
 
 !DSVLabelView methodsFor:'focus handling'!
@@ -622,5 +642,5 @@
 !DSVLabelView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DSVLabelView.st,v 1.51 2007-03-02 15:45:40 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DSVLabelView.st,v 1.52 2007-03-26 11:44:39 cg Exp $'
 ! !