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

How can I pass a resource icon as a tooltip icon?

Unread post by Ferenc Nagy »

The custom icon of a balloon is defined so:

Code: Select all

customIcon(gui_native::hIcon IconHandle).
How can I make the hIcon handle from the resource identifier of an icon?
TIA, Regards,
Frank Nagy
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

You can use:

Code: Select all

IconHandle = gui_api::loadImage_resId(resourceIdentifiers::idc_myIcon, gui_native::image_icon, 0, 0, gui_native::lr_shared)
Regards Thomas Linder Puls
PDC
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Thanx

Unread post by Ferenc Nagy »

Thankx,
I understand.
TIA, Regards,
Frank Nagy
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy »

The program lines:

Code: Select all

 IconHandle = gui_api::loadImage_resId(resourceIdentifiers::idi_exit_2, gui_native::image_icon, 0, 0, gui_native::lr_shared),         provideFancyTooltip(cancel_ctl,toolTip::customIcon(IconHandle),             "Exit button",             "Click on this button in order to destroy this form.\nYou can reopen the form using the Go menu item."),             succeed().
------------ The called procedure -----------------

Code: Select all

predicates     % 2014.10.18. Provide fancy tooltip for a control.     provideFancyTooltip:(control, tooltip::icon, string Title, string TipText) procedure. clauses     provideFancyTooltip(Control,Icon,Title,TipText) :-         FancyTip=controlTooltip::new(),         FancyTip:multiline:=true,         FancyTip:maxWidth:=some(200),         FancyTip:popTime:=10000,         FancyTip:style:=toolTip::balloon(Icon,Title),         Control:toolTip:=some(FancyTip),         Control:toolTipText:=tooltip::tip(TipText).
Attachments
The icon in the balloon.
The icon in the balloon.
exit button with tooltip.png (8.17 KiB) Viewed 8217 times
TIA, Regards,
Frank Nagy
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Nice. Did you notice all the icons that are included in Vip7.5 (in $(ProDir)\icons)?

They all contain two sizes (16 x 16 and 32 x 32; this small fits this usage) and they all have transparent background with alpha-blended edges.
Attachments
Tooltop
Tooltop
tooltip.png (4.68 KiB) Viewed 8204 times
Regards Thomas Linder Puls
PDC
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy »

TIA, Regards,
Frank Nagy
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Why did you reduce the number of colors?
Regards Thomas Linder Puls
PDC
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Color reduction

Unread post by Ferenc Nagy »

Good question. I might have used them as-is. The system can display icons made often thousands of colors.
Answer:
The bitmap editor built in the VIP 7.5 PE screamed that it could not handle too many colors.
When I reduced the number of colors I got on the top and in the editing area e.g. many shades of green and no red.
TIA, Regards,
Frank Nagy
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

It is correct that the built-in bitmap editor cannot handle such icons. We have decided it is better if you use some other bitmap editor (there are plenty of free editors) and we focus our attention on other things. You can set external editors in the IDE settings.
Regards Thomas Linder Puls
PDC
Post Reply