--- a/FlyByHelp.st Fri Nov 18 21:05:32 2016 +0000
+++ b/FlyByHelp.st Fri Nov 18 21:09:18 2016 +0000
@@ -205,6 +205,13 @@
key notNil ifTrue:[
app := aView application.
app isNil ifTrue:[
+ "/ special case for oldStyle Dialog subclasses.
+ aView topView flyByHelpSpec notNil ifTrue:[
+ text := aView topView flyByHelpSpec at:key ifAbsent:nil.
+ text notNil ifTrue:[
+ ^ aView topView resources stringWithCRs:text.
+ ].
+ ].
app := Error handle:[:ex | nil] do:[ aView windowGroup mainGroup application ].
].
app notNil ifTrue:[
@@ -274,17 +281,19 @@
]
].
- text size > 0 ifTrue:[
+ ((text size > 0) or:[text isString not]) ifTrue:[
(showItNow not and:[(delayTime := self delayTime) > 0]) ifTrue:[
self stopHelpDisplayProcess.
showProcess :=
[
Delay waitForSeconds:delayTime.
[
- aView device anyButtonPressed ifFalse:[
- showProcess := nil.
- self showHelp:text for:aView
- ]
+ aView device notNil ifTrue:[
+ aView device anyButtonPressed ifFalse:[
+ showProcess := nil.
+ self showHelp:text for:aView
+ ]
+ ].
] ensure:[
showProcess := nil.
]
@@ -390,13 +399,18 @@
"/ no longer done here (otherwise, we could not generate tooltips with windows filenames in it)
textLines := helpTextShown isStringCollection
ifTrue:[helpTextShown]
- ifFalse:[ helpTextShown "withCRs" asCollectionOfLines asStringCollection].
- textLines size > (self class maxNumberOfLines) ifTrue:[
- textLines := (textLines copyTo:(self class maxNumberOfLines)) copyWith:'...'
+ ifFalse:[
+ helpTextShown isString
+ ifTrue:[helpTextShown "withCRs" asCollectionOfLines asStringCollection]
+ ifFalse:[nil]].
+ textLines notNil ifTrue:[
+ textLines size > (self class maxNumberOfLines) ifTrue:[
+ textLines := (textLines copyTo:(self class maxNumberOfLines)) copyWith:'...'
+ ].
+ textLines := textLines collect:[:l | l contractAtEndTo:(self class maxNumberOfColumns)].
+ helpTextShown := textLines asString.
].
- textLines := textLines collect:[:l | l contractAtEndTo:(self class maxNumberOfColumns)].
- helpTextShown := textLines asString.
-
+
(p := closeProcess) notNil ifTrue:[
closeProcess := nil.
p terminate.
@@ -405,6 +419,9 @@
self hideHelp
].
+ "/ Transcript showCR:helpTextShown storeString.
+ helpTextShown isEmptyOrNil ifTrue:[^ self].
+
org := view originRelativeTo:nil.
currentFrame := org extent:view extent.
org := org + (view extent // 2).