#UI_ENHANCEMENT by cg
class: FlyByHelp
comment/format in: #toolTipFollowsMouse
changed:
#helpTextFromView:at:
#initiateHelpFor:at:now:
debugging missing tooltips
--- a/FlyByHelp.st Wed Jun 06 17:35:43 2018 +0200
+++ b/FlyByHelp.st Wed Jun 06 17:37:31 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 2001 by eXept Software AG
All Rights Reserved
@@ -136,7 +138,7 @@
|prevView|
currentHelpView notNil ifTrue:[
- key == $§ ifTrue:[
+ key == $§ ifTrue:[
"/ generate a line suitable for the resources file (a null translation)
"/ into the clipboard; makes it easy to add missing translations to a .rs file,
"/ by pressing paragraph whenever you see an untranslated helptext
@@ -213,6 +215,7 @@
|text key app|
(aPointOrNil notNil and:[aView respondsTo:#helpTextAt:]) ifTrue:[
+(aView isKindOf:MenuPanel) ifTrue:[self halt].
text := aView helpTextAt:aPointOrNil.
text notNil ifTrue:[^ text].
].
@@ -241,14 +244,19 @@
app := Error handle:[:ex | nil] do:[ aView windowGroup mainGroup application ].
].
app notNil ifTrue:[
- ^ app helpTextForKey:key
+ ^ "text :=" app helpTextForKey:key.
+ text notNil ifTrue:[^ text].
].
- ^ aView resources string:key
+ ^ "text :=" aView resources string:key.
+ (text notNil and:[text ~= key]) ifTrue:[
+ ^ text
+ ]
].
].
^ nil.
"Modified: / 09-01-2018 / 17:38:42 / stefan"
+ "Modified: / 06-06-2018 / 17:00:05 / Claus Gittinger"
! !
!FlyByHelp methodsFor:'private'!
@@ -278,14 +286,12 @@
re-negotiation of the displayed helpText
(for example in a menu, when the selection changes)"
- |text delayTime now|
+ |text delayTime|
(self interestedIn:aView) ifFalse:[
^ self
].
- now := Timestamp now.
-
"/ do not allow for more than 200 ms to be spent in the
"/ helpText gatherer (the codeView parses the code for the variable under the cursor)
[
@@ -302,13 +308,23 @@
^ self
] afterMilliseconds:(self flyByHelpTimeoutMillis).
+ false ifTrue:[
+ (text notNil and:[text isEmpty]) ifTrue:[
+ Logger warning:('empty help from: ',aView class printString)
+ ] ifFalse:[
+ text isEmptyOrNil ifTrue:[
+ Logger warning:('no help from: ',aView class printString)
+ ].
+ ].
+ ].
+
(lastHelpText = text and:[lastHelpWidget == aView]) ifTrue:[
self toolTipFollowsMouse ifFalse:[
^ self
]
].
- ((text size > 0) or:[text isString not]) ifTrue:[
+ ((text size > 0) or:[text notNil and:[text isString not]]) ifTrue:[
(showItNow not and:[(delayTime := self delayTime) > 0]) ifTrue:[
self stopHelpDisplayProcess.
showProcess :=
@@ -334,6 +350,7 @@
"Modified: / 22-03-2011 / 19:10:28 / cg"
"Modified: / 16-04-2018 / 12:20:33 / stefan"
+ "Modified: / 06-06-2018 / 17:19:26 / Claus Gittinger"
! !
!FlyByHelp methodsFor:'queries'!
@@ -347,6 +364,8 @@
so that it stays away from (does not cover) the mouse pointer"
^ false
+
+ "Modified: / 06-06-2018 / 17:37:19 / Claus Gittinger"
! !
!FlyByHelp methodsFor:'show & hide help'!