|
Travis,
What worked for me (with my long, 5 second closeDelay) was to use announceHelpInterrupted instead of announceFrameExited.
I've attached my framework extensions for 7.6, complete with an example application showing indexed tooltips in a list, dataSet, tree and table, in case a version of this can be incorporated. I didn't get around to hierarchical list. And I don't know if there are any others I missed. Maybe tab controls? But any additional extension should involve no more than inserting a line in #mouseMovedEvent: for any controller subclass that implements #findElementFor:, like so: mouseMovedEvent: event self setTooltipIndexFor: event. ... Enjoy, Dave Stevenson [hidden email]
From: Dave Stevenson <[hidden email]>
To: Claus Kick <[hidden email]>; [hidden email]
Sent: Tue, August 30, 2011 2:59:07 PM
Subject: Re: [vwnc] List element tooltips
I don't want to burden my application code any more than I have to. To "remember" the tooltip state, my app would have to track changes in the state machines of each sequence view.. I think
all I need is the secret incantation to tickle the existing state machine, which Terry provided in his response to my email below. I have yet to incorporate his suggestions, however (diversions abound).
I've been told that the tooltip state machine was rewritten after VW 7.6, so even if I get it working now, I may have to revisit it when we upgrade.
Dave Stevenson
[hidden email]
From: Claus Kick <[hidden email]>
To: [hidden email]
Sent: Tue, August 30, 2011 2:36:31 PM
Subject: Re: [vwnc] List element tooltips
Cant you just remember the tooltop state (i.e. open or not) and if you get a mousemoved event, close it when its open and open the new one?
--
Claus Kick
"Wenn Sie mich suchen: Ich halte mich in der Nähe des Wahnsinns auf.
Genauer gesagt auf der schmalen Linie zwischen Wahnsinn und Panik.
Gleich um die Ecke von Todesangst, nicht weit weg von Irrwitz und Idiotie."
"If you are looking for me: I am somewhere near to lunacy.
More clearly, on the narrow path between lunacy and panic.
Right around the corner of fear of death,
not far away from idiocy and insanity."
Von: "Dave Stevenson" <[hidden email]>
Gesendet: 29.08.2011 20:19:47
An: "Terry Raymond" <[hidden email]>, [hidden email]
Betreff: Re: [vwnc] List element tooltips
Terry,
My problem is not computing the new text, but figuring out how to interrupt the current tooltip to get it to show the new text without waiting for the 5 second closeDelay. What did your sequence view do with its newly computed help text?
Dave Stevenson
[hidden email]
From: Terry Raymond <[hidden email]>
To: Dave Stevenson <[hidden email]>; [hidden email]
Sent: Mon, August 29, 2011 12:46:15 PM
Subject: RE: [vwnc] List element tooltips
We added a
mouseMovedEvent: to the SequenceController which
directed the view, a
SequenceView, to compute the help text.
Terry
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI 02878
(401) 624-4517 [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================
I'm using VW 7.6, with HoverHelp, and trying to implement tooltips for individual elements of a SelectionView, starting with a data set. First, I provide a way for the view to cache
the index of the item under the mouse:
SelectionView>>setTooltipIndex: anInteger
self propertyAt: #tooltipIndex put: anInteger
SelectionView>>tooltipIndex
^self propertyAt: #tooltipIndex
Next I add a method to the controller (again, starting with data sets - similar behavior would need to be added to controllers for lists or other types of sequence views) to set that index in its view:
DataSetController>>setTooltipIndexFor: event
self view setTooltipIndex: (self findElementFor: self sensor cursorPoint)
And add an override to ensure the index gets set when the mouse moves:
DataSetController>>mouseMovedEvent: event
| point |
self setTooltipIndexFor: event.
...
Now my application can set the tooltip on the dataset in postBuildWith:
...
(self widgetAt: #myDataSet) tooltip: [self dataSetTooltip]
And the tooltip code itself can find the element under the mouse:
dataSetTooltip
| index |
index := (self widgetAt: #myDataSet) tooltipIndex.
^index = 0
ifTrue: ['']
ifFalse: [(self listHolder value at: index) tooltipText]
Now, if the mouse enters the dataSet widget from the side, the tooltip shows for the element under the mouse. But when I move the mouse up/down the dataSet, the tooltip window doesn't change. So I figure I need to tickle the TooltipAssistant state machine.
My first thought was to extend #setTooltipIndex: a bit more:
SelectionView>>setTooltipIndex: anInteger
anInteger = self tooltipIndex ifTrue: [^self].
self propertyAt: #tooltipIndex put: anInteger.
self announceFrameExited.
self announceFrameEntered
But this didn't quite do the trick. Any ideas?
Dave Stevenson
[hidden email]
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
|