Share your advanced knowledge/code with the community.
MarkOtt
 
Posts: 8
Joined: Thu Sep 14, 2017 12:59 pm

Formatting the ToolTip of Gadgets and ToolBar

by MarkOtt Fri Sep 22, 2017 2:18 pm

By default the ToolTip arises on the right side of a gadget what might be disturbing if the buttons are located side by side.
Manipulating the "position" parameter of the dijit.Tooltip can help.

For Gadgets, eg. a ButtonImageGadget:
Code: Select all
ButtonImageGadget(#GadgetButtonRefresh, 420, 9, 24, 24, ImageID(10))
GadgetToolTip(#GadgetButtonRefresh, "Show all")

ToolTipId = #GadgetButtonRefresh
! spider.gadget.objects.Get(v_tooltipid).tooltip.set("position",['above','below']);

;use in array one or more of  above, below, before, after (Default)
;https://dojotoolkit.org/reference-guide/1.10/dijit/Tooltip.html

;Modify the label of the ToolTip:
! spider.gadget.objects.Get(v_tooltipid).tooltip.set("label",'qwertz');

;Modify the delay when the ToolTip should arise (miliseconds):
! spider.gadget.objects.Get(v_tooltipid).tooltip.set("showDelay",2000);

Similar for the ToolBar with dependant image buttons:
Code: Select all
CreateToolBar(#Main_Toolbar, WindowID(#Main_Window))
ToolBarImageButton(#Toolbar_1, ImageID(1))
ToolBarImageButton(#Toolbar_2, ImageID(2))
ToolBarToolTip(#Main_Toolbar, #Toolbar_2, "Show all")

ToolTipIdBar = #Main_Toolbar
ToolTipIdButton = #Toolbar_2
! spider.toolbar.objects.Get(v_tooltipidbar).buttons[v_tooltipidbutton].spiderTooltip.set("position",['above','below']);

Best regards. Markus
Return to Tricks 'n' Tips

Who is online

Users browsing this forum: No registered users and 2 guests