Skip to content

XUITabBarRendererEdge

Implements XUITabBarRenderer

Description

A tab bar renderer that renders a XUITabBar similar to that seen in Microsoft Edge.

Properties

Name Type Read-Only
mBuffer Picture
mOwner WeakRef

Methods

Name Parameters Returns
BufferWidth Integer
Constructor owner As XUITabBar
DrawTabBorders g As Graphics, style As XUITabBarStyle
DrawTabCloseIcon tab As XUITabBarItem, g As Graphics, x As Double, style As XUITabBarStyle
LeftMenuButtonWidth Double
Name String
Owner XUITabBar
Render ownerGraphics As Graphics, scrollPosX As Integer, needsFullRedraw As Boolean
RenderLeftMenuButton g As Graphics, style As XUITabBarStyle
RenderRightMenuButton g As Graphics, style As XUITabBarStyle, x As Double
RenderSelectedTab g As Graphics, x As Double, style As XUITabBarStyle, width As Double
RenderUnselectedTab tab As XUITabBarItem, g As Graphics, x As Double, style As XUITabBarStyle, width As Double
RightMenuButtonWidth Double
SetGraphicsBackgroundColor tab As XUITabBarItem, g As Graphics, isSelected As Boolean, hoveredOver As Boolean, style As XUITabBarStyle
SetGraphicsFontProperties tab As XUITabBarItem, g As Graphics, isSelected As Boolean, hoveredOver As Boolean
SupportsLeftMenuButton Boolean
SupportsRightMenuButton Boolean
TabBarHeight Integer
TabWidth tab As XUITabBarItem, g As Graphics, style As XUITabBarStyle Double
TabWidthExcludingCaption tab As XUITabBarItem Double

Constants

Name Type
BORDER_VERT_PADDING Double
CLOSE_ICON_CROSS_HEIGHT Double
CLOSE_ICON_CROSS_WIDTH Double
CLOSE_ICON_HEIGHT Double
CLOSE_ICON_LEFT_PADDING Double
CLOSE_ICON_WIDTH Double
CONTENTS_HORIZONTAL_PADDING Double
ICON_PADDING Double
LEFT_MENU_BUTTON_HEIGHT Double
LEFT_MENU_BUTTON_HOVER_VERT_PADDING Double
LEFT_MENU_BUTTON_HOVER_WIDTH Double
LEFT_MENU_BUTTON_PADDING Double
LEFT_MENU_BUTTON_WIDTH Double
MAX_TAB_WIDTH Double
MIN_TAB_WIDTH Double
RIGHT_MENU_BUTTON_HEIGHT Double
RIGHT_MENU_BUTTON_HOVER_VERT_PADDING Double
RIGHT_MENU_BUTTON_HOVER_WIDTH Double
RIGHT_MENU_BUTTON_PADDING Double
RIGHT_MENU_BUTTON_WIDTH Double

BORDER_VERT_PADDING As Double The number of pixels to pad above and below the left and right tab borders.


CLOSE_ICON_CROSS_HEIGHT As Double The height of the close icon cross.


CLOSE_ICON_CROSS_WIDTH As Double The width of the close icon cross.


CLOSE_ICON_HEIGHT As Double The height of the close icon rounded rect.


CLOSE_ICON_LEFT_PADDING As Double How much to pad the left of the close icon (if the tab is closable).


CLOSE_ICON_WIDTH As Double The width of the close icon rounded rect.


CONTENTS_HORIZONTAL_PADDING As Double How much to pad left and right of the contents of the tab (close icon, icon and caption).


ICON_PADDING As Double how much to pad the left and right sides of the icon from the tab's caption.


LEFT_MENU_BUTTON_HEIGHT As Double The height of the left menu button.


LEFT_MENU_BUTTON_HOVER_VERT_PADDING As Double How much to pad above and below the rounded rectangle drawn when hovering over the left menu button if there is no left menu button icon.


LEFT_MENU_BUTTON_HOVER_WIDTH As Double The width of the left menu button when hovered over if no icon specified.


LEFT_MENU_BUTTON_PADDING As Double How much to pad the left and right of the left menu button if present.


LEFT_MENU_BUTTON_WIDTH As Double The width of the left menu button.


MAX_TAB_WIDTH As Double The maximum width a tab can be.


MIN_TAB_WIDTH As Double The minimum width a tab can be.


RIGHT_MENU_BUTTON_HEIGHT As Double The height of the right menu button.


RIGHT_MENU_BUTTON_HOVER_VERT_PADDING As Double How much to pad above and below the rounded rectangle drawn when hovering over the right menu button if there is no right menu button icon.


RIGHT_MENU_BUTTON_HOVER_WIDTH As Double The width of the right menu button when hovered over if no icon specified.


RIGHT_MENU_BUTTON_PADDING As Double How much to pad the left and right of the right menu button if present.


RIGHT_MENU_BUTTON_WIDTH As Double The width of the right menu button.


Property Descriptions

mBuffer As Picture

Cache of the Picture returned from the last call to XUITabBarRender.Buffer(). May be Nil.


mOwner As WeakRef

A weak reference to the tab bar that this renderer operates on.


Method Descriptions

BufferWidth() As Integer

The current width of the buffer in points.

Part of the XUITabBarRenderer interface.


Constructor(owner As XUITabBar)

owner is the XUITabBar that owns this renderer. A WeakRef will be created.

Part of the XUITabBarRenderer interface.


DrawTabBorders(g As Graphics, style As XUITabBarStyle)

Draws the tab borders to g using style.

This is the last step in rendering the tab bar's buffer. We do it separate from rendering the tabs because there are several edge cases to deal with that we can more gracefully handle after all tabs have been rendered.


DrawTabCloseIcon(tab As XUITabBarItem, g As Graphics, x As Double, style As XUITabBarStyle)

Draws this tab's close icon to g at x. Also sets the tab's CloseIconBounds.

Assumes this tab has a close icon.


LeftMenuButtonWidth() As Double

The width of the left menu button (if supported by this renderer).

Part of the XUITabBarRenderer interface.


Name() As String

The name of this renderer.


Owner() As XUITabBar

The tab bar this renderer operates on.

Part of the XUITabBarRenderer interface.


Render(ownerGraphics As Graphics, scrollPosX As Integer, needsFullRedraw As Boolean)

Renders the tab bar to the passed graphics context at scrollPosX.

Assumes that ownerGraphics is the graphics context from the tab bar's Paint event. scrollPosX is the number of pixels (>= 0) the tab bar has been scrolled to the right. 0 is no scrolling. ownerGraphics will be used as a temporary drawing scratch pad but will ultimately be overwritten when we draw the background and buffer to it.

Part of the XUITabBarRenderer interface.


RenderLeftMenuButton(g As Graphics, style As XUITabBarStyle)

Renders the left menu button to g at x.


RenderRightMenuButton(g As Graphics, style As XUITabBarStyle, x As Double)

Renders the right menu button to g at x.


RenderSelectedTab(g As Graphics, x As Double, style As XUITabBarStyle, width As Double)

Renders the selected to g, placing its left edge at x and sets its bounds.


RenderUnselectedTab(tab As XUITabBarItem, g As Graphics, x As Double, style As XUITabBarStyle, width As Double)

Renders the unselected tab with width to g, placing its left edge at x and sets its bounds.


RightMenuButtonWidth() As Double

The width of the right menu button (if supported by this renderer).

Part of the XUITabBarRenderer interface.


SetGraphicsBackgroundColor(tab As XUITabBarItem, g As Graphics, isSelected As Boolean, hoveredOver As Boolean, style As XUITabBarStyle)

Sets the background drawing colour of g to those required for tab.


SetGraphicsFontProperties(tab As XUITabBarItem, g As Graphics, isSelected As Boolean, hoveredOver As Boolean)

Sets the font properties of g to those required for tab.


SupportsLeftMenuButton() As Boolean

True if this renderer supports the concept of a left menu button.

Part of the XUITabBarRenderer interface.


SupportsRightMenuButton() As Boolean

True if this renderer supports the concept of a right menu button.

Part of the XUITabBarRenderer interface.


TabBarHeight() As Integer

Returns the height the tab bar will be rendered at.

Part of the XUITabBarRenderer interface.


TabWidth(tab As XUITabBarItem, g As Graphics, style As XUITabBarStyle) As Double

Returns the width of tab if it were drawn to g.


TabWidthExcludingCaption(tab As XUITabBarItem) As Double

Returns the width of tab excluding its caption.