Lazy tracking tooltip

Discussions related to Visual Prolog
User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

Lazy tracking tooltip

Unread post by Ferenc Nagy » 18 Jan 2016 15:11

Hi,
I would like to see the relative coordinates of the cursor within a group box.
The tracking tooltip is lazy: It shows the info after a delay then I have to leave the group box or wait until the coordinates reappear.

Code in the form:

Code: Select all

constants     tooltip_offset_x=5.     tooltip_offset_y=5.   predicates     territoryRender: areaTooltip::areaTipRender. clauses     territoryRender(Pnt) = tuple(rct(0,0,W,H),TipStr,TipPnt)  :-         territory_gb:getClientSize(W,H),         PNT=pnt(X,Y),         TipStr=toString(PNT),         TipPnt=some(pnt(X+tooltip_offset_x,Y+tooltip_offset_y)).     predicates     defineTooltips:() procedure. clauses     defineTooltips() :-         provideAreaTooltip(territory_gb,territoryRender),
The provideAreaTooltip predicate uses the following parameters:

Code: Select all

% Provide a tooltip showing transformed cursor position within an area.    provideAreaToolTip(Control,AreaTipRender) :-         AreaTip = areatooltip::new(Control,AreaTipRender),         AreaTip:initialTime := -1,         AreaTip:popTime := 1500,         AreaTip:reshowTime:=-1,         AreaTip:multiLine := true,         AreaTip:maxWidth := some(250).
Have you any idea to display the cursor position coordinates relative to the upper left corner of the group box without delay?
TIA, Regards,
Frank Nagy

Post Reply