GraffitiRibbon

Images #

About #

GraffitiRibbon emulates the visual style of recent Microsoft applications (as well as the many other applications applying the principle since its introduction). It can also be used without the tab bar to create a powerful and beautiful toolbar.

Features:

  • Tabs
  • Groups
  • Columns
  • Static Button
  • Multiple Button Styles
  • RectControl and ContainerControl embedding
  • Custom Colors
  • Responsive Resizing of Elements

Enumerations #

Name Values
Styles Light
Dark

Constants #

Name Type Value

This class exposes no constants.

Events #

Definition Description
ButtonClick( button as GraffitiRibbonButton ) Fires when a button is clicked. This can be any of the button types, so you should use IsA to check the value.
ButtonMenu( button as GraffitiRibbonButton, menuSelection as MenuItem ) Fires when a MenuItem child of a Button is selected.
ItemHover( item as GraffitiRibbonItem ) Can be any item type, use IsA along with one of the Shared Methods to check value.
TabChange() Fires when the user selects a different tab.

Methods #

Definition Description
AddTab( tab as GraffitiRibbonTab ) Adds the specified tab to the UI.
Child(tabIndex as Integer) as GraffitiRibbonTab Returns the tab specified by tabIndex
Count() as Integer Returns the total number of children, this is the LastRowIndex + 1
FindByCaption(searchFor as String) as GraffitiRibbonItem Iterates over all children regardless of depth to find an exact match for the supplied parameter.
FindByTag(searchFor as Variant) as GraffitiRibbonItem Iterates over all children regardless of depth in an attempt to match the supplied Tag.
Remove( index as Integer ) Removes the tab at the specified index.
Remove( tab as GraffitiRibbonTab ) Removes the specified tab.
RemoveAll() Removes all tabs.

Properties #

Name Type Default Value Description
BackgroundColor Color &c000000 Background color of the control when CustomColors = True.
ButtonBackgroundColor Color &c000000 Default button background color.
ButtonBackgroundColorDown Color &c000000 Button background color while mouse is down.
ButtonBackgroundColorHover Color &c000000 Button background color while mouse is hovering.
ButtonBorderColor Color &c000000 Default button border color.
ButtonBorderColorDown Color &c000000 Button border color while mouse is down.
ButtonBorderColorHover Color &c000000 Button border color while mouse is hovering.
ButtonTextColor Color &c000000 Default button text color.
ButtonTextColorDown Color &c000000 Button text color while mouse is down.
ButtonTextColorHover Color &c000000 Button text color while mouse is hovering.
CustomColor Boolean False If True, the ribbon will use the custom color properties to draw elements.
GroupBackgroundColor Color &c000000 Background color for groups.
GroupBorderColor Color &c000000 Border color for groups.
GroupTextColor Color &c000000 Default text color for groups.
GroupTextColorDown Color &c000000 Text color for groups while mouse is down.
GroupTextColorHover Color &c000000 Text color for groups while mouse is hovering.
HasBorder Boolean True When False, the control will not automatically draw the appropriate border based on placement.
LockUpdate Boolean False When True, redrawing is delayed until LockUpdate is again set to False.
SelectedTab GraffitiRibbonTab Nil The currently selected tab item.
ShiftIconsByStyle Boolean True When True, GraffitiRibbon will attempt to recolor icons appropriately for the selected Style.
StaticButton GraffitiRibbonButton Nil Button to display to the far-right of the tab bar.
Style Styles Light The currently used color scheme. If CustomColors is True, then all colors for the style are overridden by the Color properties.
TabBarVisible Boolean True When False, the tab bar and StaticButton are hidden.
TabCaretColor Color &c000000 Default color for the tab’s disclosure arrow.
TabCaretColorDown Color &c000000 Tab disclosure arrow’s color when mouse is down.
TabCaretColorHover Color &c000000 Tab disclosure arrow’s color when mouse is hovering.
TickColor Color &c000000 Disclosure tick color for groups/columns/buttons with menus or too many items for display.
TickColorDown Color &c000000 Disclosure tick color for groups/columns/buttons with menus or too many items for display when mouse is down.
TickColorHover Color &c000000 Disclosure tick color for groups/columns/buttons with menus or too many items for display when mouse is hovering.

Shared Methods #

Definition Description
IsContainer( item as GraffitiRibbonItem ) If the item is an instance of a subclass of GraffitiRibbonItem, this method with return True.
IsControl( item as GraffitiButtonItem ) If the item is an instance of a subclass of GraffitiRibbonItem and classified as a Control (Buttons, Containers, RectControls), this method will return True.
IsDecorator( item as GraffitiRibbonButtonItem ) If the item is classified as a decorator (Separator), this method will return True.

Examples #

Create the StaticButton #

dim buttonMenu as new MenuItem()
dim mOne as new MenuItem( "One" )
buttonMenu.Append( mOne )
 
me.StaticButton = new GraffitiRibbonButton( "File" )
me.StaticButton.Menu = buttonMenu

Add and select a Tab #

dim mainTab as new GraffitiRibbonTab( "Main" )
me.AddTab( mainTab )
me.SelectedTab = mainTab

Add a Group to a Tab #

dim groupMainPercent as new GraffitiRibbonGroup( "Percentage" )
groupMainPercent.Width = "25%"
groupMainPercent.MinWidth = 110
groupMainPercent.MaxWidth = 180
mainTab.AddGroup( groupMainPercent )

Add a Button to a Group #

dim newButton as new GraffitiRibbonButtonLarge( "New", imgNew2018 )
newButton.Menu = buttonMenu
groupMainPercent.AddItem( newButton )

Notes #

RectControls and ContainerControls #

Before instantiating and adding these elements to the ribbon, they must be present on the window. For ContainerControls you can use EmbedWithin during runtime to make instances of your containers available to GraffitiRibbon.