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? [hidden email] _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
We added a mouseMovedEvent: to the SequenceController which directed the view, a SequenceView, to compute the help text. Terry From: [hidden email] [mailto:[hidden email]] On Behalf Of Dave Stevenson 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: Dave Stevenson _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
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 From: [hidden email] [mailto:[hidden email]] On Behalf Of Dave Stevenson
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:
Dave Stevenson
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Dave Stevenson-3
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."
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
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. [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."
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |