Share Tips, Code Samples, etc. with the Visual Prolog community.
Steve Lympany
VIP Member
Posts: 56
Joined: 31 Mar 2001 23:01

simple tooltip

Unread post by Steve Lympany »

Here is a small project that shows a really simple tooltip class. There are no timers as in the pfc's vpiToolbar class.

The attached project has a form that draws two rectangles. When the mouse is over a rectangle, a tooltip is shown with some text. The tooltip moves with the mouse.

The tooltip is a modeless dialog that is created when the form is created. It is visible when the mouse is over a rectangle, and invisible when not.

The weaknesses are:
- if the mouse enters the tooltip dialog, the tooltip will not move. Which is why I have put in the Yoffset.
- there is a delay in repainting the form when the tooltip moves quickly.

Both these problems could probably be overcome with timers or delays.

Built with Vip7103

Steve Lympany
Attachments
dev_tooltip.zip
A simple tooltip class
(28.41 KiB) Downloaded 1299 times
Steve Lympany
VIP Member
Posts: 56
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany »

Hi,
Here is an updated tooltip for VIP7.2 (7201), using the new popupwindow

One tooltip moves with the mouse, the other pops up but remains in place and then disappears

It was a bit tricky to get the popup to appear in the right places!

Steve
Attachments
dev_tooltip.zip
Project with "Tooltip"
(32.82 KiB) Downloaded 1087 times
Steve Lympany
VIP Member
Posts: 56
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany »

Hello again,
Attached is a project using a new tooltip.

adl_tooltip is now a class that doesn't create objects, which make more sense.

Steve
Attachments
dev_tooltip_100409.zip
Project using a tooltip class
(41.35 KiB) Downloaded 1102 times
Post Reply