Set Ribbon Tab statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Updates a MapInfo Pro ribbon tab. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Create Ribbon 
	[ Window window_id ] Tab { tab_name | Index nIndex } 
	{ Remove | { [ TAB_CLAUSE ] [ GROUP_CLAUSE [ GROUP_CLAUSE... ] ] } }

window_id is a window identifier.

tab_name is the name of the tab.

nIndex specifies the position/index of the tab.

TAB_CLAUSE, sets the caption, tool tip and other properties of the tab.

GROUP_CLAUSE, sets the caption, tool tip and other properties of the groups(s) under the tab.

Description

The Set Ribbon Tab statement updates MapInfo Pro ribbon tab, groups and other controls if specified.

If the window_id is specified, the window must be a map, browser, layout, or redistricter, and the window must have a ribbon.

The tab_name parameter is optional and specifies the updated name of the tab. This is the variable name used in MapBasic scripts. It is a string expression and is case-sensitive. It must start with a letter or underscore and can contain numbers, letters, and underscores.

nIndex is an optional parameter that specifies the position/index of the tab.

TAB_CLAUSE: This is a optional clause that updates the properties of a tab.
Create Ribbon 
	[ Window window_id ] Tab { tab_name | Index nIndex } 
	{ Remove | {  
	
	'TAB_CLAUSE
	[Caption caption] [Enable | Disable] [Active] [Show | Hide] 
	[Tooltip TOOTIP_CLAUSE] [Properties(PROPERTIES_CLAUSE)]

	[ GROUP_CLAUSE [ GROUP_CLAUSE... ] ] } }
  • caption is the label/name of the tab visible on the ribbon.
  • Enable or Disable the tab.
  • Active to select the tab by default.
  • Show or Hide the tab.
  • TOOLTIP_CLAUSE sets the value of the tab's tool tip.
  • PROPERTIES_CLAUSE sets the properties of the tab. See Ribbon Control Definitions for more details.
GROUP_CLAUSE: This is an optional clause that sets the properties of the group(s) under the tab.
Create Ribbon 
	[ Window window_id ] Tab tab_name
	[ Index tab_to_create_before ]
	
	'TAB_CLAUSE
	[Caption caption] [Enable | Disable] [Active] [Show | Hide] 
	[Tooltip TOOTIP_CLAUSE] [Properties(PROPERTIES_CLAUSE)]
	
	'GROUP_CLAUSE
	Group { name [ Index nIndex } 
	{ Remove | { [ Caption caption ] [ Show | Hide ]  [ Enable | Disable ] 
	[ Tooltip TOOLTIP_CLAUSE ] [ Icon ICON_CLAUSE ] 
	[ Launcher LAUNCHER_CLAUSE ] [ Properties ( PROPERTIES_CLAUSE ) ] 
	[ Controls ( CONTROL_CLAUSE [ CONTROL_CLAUSE... ] ) ] } }
  • name of the group(s) under the tab.
  • nIndex specifies the position/index of the group under the new tab.
  • Remove the group from the tab.
  • caption is the label/name of the group visible under the tab.
  • Show or Hide the group.
  • Enable or Disable the group.
  • TOOLTIP_CLAUSE sets the value of the group's tool tip.
  • ICON_CLAUSE specifies the icon for the group.
  • LAUNCHER_CLAUSE creates a launcher on the ribbon.
  • PROPERTIES_CLAUSE sets the properties of the group. See Ribbon Control Definitions for more details.
  • CONTROL_CLAUSE sets the properties of the controls(s) under the group.
Note: Refer Ribbon Token and Property Mappings to see which ribbon token sets the corresponding ribbon property. You can access these properties using the RibbonInfo() and the RibbonItemInfo() functions.

Example

Please see the Create Ribbon Sample Code.