Set Ribbon Context 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 contextual tab. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Create Ribbon 
	[ Window window_id ] Context Tab { tab_name | Index nIndex }
	Group { group_name | Index group_Index } 
	{ Remove | {[ TAB_CLAUSE ] 
		[ [ Add ] GROUP_CLAUSE [ [ Add ] GROUP_CLAUSE... ] ] } }

window_id is a window identifier.

tab_name is the name of the tab.

nIndex specifies the position/index of the tab.

group_name specifies the name of the contextual tab group under which the contextual tab is.

group_Index specifies the position/index of the contextual tab group.

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

Add: Use the Add clause to check if the group already exists.

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

Description

The Create Ribbon Context Tab statement updates MapInfo Pro ribbon contextual tabs, 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.

group_name specifies the name of the contextual tab group under which the contextual tab is.

group_Index specifies the position/index of the contextual tab group.

TAB_CLAUSE: This is a mandatory clause that sets the properties of the new tab.
Create Ribbon 
	[ Window window_id ] Context Tab { tab_name | Index nIndex }
	Group { group_name | Index group_Index } 
	{ Remove | { 

	'TAB_CLAUSE
	[Caption caption] [Enable | Disable] [Active] [Show | Hide] 
	[Tooltip TOOTIP_CLAUSE] [Properties(PROPERTIES_CLAUSE)]

	[ [ Add ] GROUP_CLAUSE [ [ Add ] 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 ] Context Tab { tab_name | Index nIndex }
	Group { group_name | Index group_Index } 
	{ Remove | {
	
	'TAB_CLAUSE
	[Caption caption] [Enable | Disable] [Active] [Show | Hide] 
	[Tooltip TOOTIP_CLAUSE] [Properties(PROPERTIES_CLAUSE)]
	
	'GROUP_CLAUSE
	Group { name [ Index 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 new tab.
  • nIndex specifies the position/index of the group under the 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 new 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.