Hi Stefan,
The tooltip syntax description is correct.
TOOLTIP_CLAUSE
{ Remove | { tooltiptext | ( PROPERTIES_CLAUSE ) } }
- Remove the tool tip.
- tooltiptext sets the value of the tool tip.
- PROPERTIES_CLAUSE sets the properties of the tab as defined in the RibbonControls.def file.
The simple syntax just creates a simple tooltip with a string, which works fine.
The more advanced syntax lets you create a tooltip object with the same properties as the built in controls:
eg: ToolTip(PROPERTY_TOOLTIPTEXT : "text", PROPERTY_TOOLTIPDISABLEDTEXT: "disabled text")
Unfortunately a bug crept into our parsing that our automation missed for the advanced syntax -- I will try to get a fix into a localized release if I can. ISSUE: MIPRO-122900
Usually when you try to set a property that does not exist you get an error saying so. In this example you tried:
Create Ribbon Tab "ControlsTab" Caption "MapTab"Active Index 2Properties(PROPERTY_ISTRACKED : "True", PROPERTY_TOOLTIP : "This is a Tab ToolTip", PROPERTY_KEYTIP : "Z")The property "ToolTip" does exist but we do not support setting it from a string.
I think your point is valid that since we can do this with the syntax token ToolTip "text" that we should also support it this way. I will look into it.--- tooltip properties---
'IRibbonToolTip see the ExtensibilityReference for the list of properties you can set, including these: (pasted below)
Define PROPERTY_SHOWHELPTEXT "ShowHelpText" 'logical
Define PROPERTY_SHOWSIMPLETOOLTIP "ShowSimpleToolTip" 'logical
Define PROPERTY_SHOWONDISABLED "ShowOnDisabled" 'logical
Define PROPERTY_TOOLTIPDESCRIPTION "ToolTipDescription" 'string
Define PROPERTY_TOOLTIPDISABLEDTEXT "ToolTipDisabledText" 'string
Define PROPERTY_TOOLTIPTEXT "ToolTipText" 'string
The IRibbonToolTip type exposes the following members.
Properties
Another thing that is not clear is how to get these tooltip advanced properties.
Getting "ToolTip" just returns the text as a convenience. To get specific properties use the object.property syntax:
Create Ribbon Tab "ControlsTab" Caption "MapTab" Active Index 1 ToolTip "This is a ToolTip"
Print RibbonInfo("ControlsTab", "ToolTip")
Print RibbonInfo("ControlsTab", "ToolTip.ToolTipText")
Print RibbonInfo("ControlsTab", "ToolTip.ShowOnDisabled")
results:
This is a ToolTip
This is a ToolTip
T
------------------------------
Bob Fortin
Software Architect and Distinguished Engineer
MapInfo Pro Development Team
------------------------------
Original Message:
Sent: 12-01-2021 06:24
From: Stefan Hausmann
Subject: MapBasic Help-File Sample-Code for creating Ribbons not up-to-date
Hi there,
just started to play around with your new possibilities to create ribbons without diving into .NET-stuff,
and found, that the sample code, provided with the mapbasic help file seems to be outdated, - or i just dont get this...
The first Statement:
Create Ribbon Tab "ControlsTab" Caption "MapTab"
Active Index 2
Properties(PROPERTY_ISTRACKED : "True", PROPERTY_TOOLTIP : "This is a Tab ToolTip", PROPERTY_KEYTIP : "Z") ...
doesn't produce a tool-tip. If you change it to
Create Ribbon Tab "ControlsTab" Caption "MapTab"
Active Index 2
Tooltip "This is a Tab ToolTip"
Properties(PROPERTY_ISTRACKED : "True", PROPERTY_KEYTIP : "Z") ....
it works.
What does this common-property PROPERTY_TOOLTIP do?
And why is there a PROPERTY_TOOLTIPTEXT ?
regards
Stefan