Create 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

Creates 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 tab_to_create_before ] TAB_CLAUSE 
	[ GROUP_CLAUSE [ GROUP_CLAUSE... ] ]

window_id is a window identifier.

tab_name is the name of the new tab. It is a mandatory parameter.

tab_to_create_before specifies the position/index of the tab before which the new tab would be created.

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

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

Description

The Create Ribbon Tab statement creates a MapInfo Pro ribbon tab and 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 mandatory and specifies the name of the new 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.

tab_to_create_before is an optional parameter that specifies the position/index of the tab before which the new tab would be created. If this parameter is not specified or its value is more than the number of tabs in the ribbon or its value is less than one, the new tab is created at end position of the ribbon.

TAB_CLAUSE: This is a mandatory clause that sets the properties of the new 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)]
  • caption is the label/name of the tab visible on the ribbon.
  • Enable or Disable the tab upon creation.
  • Active to select the tab by default upon creation.
  • Show or Hide the tab upon creation.
  • TOOLTIP_CLAUSE sets the value of the new 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 creates and sets the initial properties of the group(s) created under the new 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 group_to_Create_Before ] | 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) created under the new tab.
  • group_to_Create_Before specifies the position/index of the group before which the new group would be created under the new 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 upon creation.
  • Enable or Disable the group upon creation.
  • TOOLTIP_CLAUSE sets the value of the new 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 creates and sets the initial properties of the controls(s) created 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.