Page 1 of 1

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

Posted: 19 Oct 2014 4:27
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?

Posted: 20 Oct 2014 11:56
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)

Thanx

Posted: 21 Oct 2014 11:02
by Ferenc Nagy
Thankx,
I understand.

Posted: 25 Oct 2014 15:31
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).

Posted: 25 Oct 2014 22:34
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.

Posted: 26 Oct 2014 5:10
by Ferenc Nagy

Posted: 26 Oct 2014 20:54
by Thomas Linder Puls
Why did you reduce the number of colors?

Color reduction

Posted: 27 Oct 2014 9:53
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.

Posted: 27 Oct 2014 23:06
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.