XUITabBarRendererSafari
Implements XUITabBarRenderer
Description
A tab bar renderer that renders a XUITabBar
similar to that seen in macOS Safari.
Properties
Name | Type | Read-Only |
---|---|---|
mBuffer | Picture |
|
mOwner | WeakRef |
Methods
Name | Parameters | Returns |
---|---|---|
BufferWidth | Integer |
|
Constructor | owner As XUITabBar |
|
DrawTabCloseIcon | tab As XUITabBarItem , x As Integer , g As Graphics , style As XUITabBarStyle |
|
LeftMenuButtonWidth | Double |
|
Name | String |
|
Owner | XUITabBar |
|
Render | ownerGraphics As Graphics , scrollPosX As Integer , needsFullRedraw As Boolean |
|
RenderTab | 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 |
Constants
Name | Type |
---|---|
CLOSE_ICON_HEIGHT | Double |
CLOSE_ICON_RIGHT_PADDING | Double |
CLOSE_ICON_WIDTH | Double |
CONTENTS_HORIZONTAL_PADDING | Double |
ICON_RIGHT_PADDING | Double |
MIN_TAB_WIDTH | Double |
TAB_HORIZONTAL_PADDING | Double |
CLOSE_ICON_HEIGHT As Double The height of the close icon.
CLOSE_ICON_RIGHT_PADDING As Double How much to pad the right of the close icon (if the tab is closable).
CLOSE_ICON_WIDTH As Double The width of the close icon.
CONTENTS_HORIZONTAL_PADDING As Double How much to pad left and right of the contents of the tab (close icon, icon and caption).
ICON_RIGHT_PADDING As Double how much to pad the right side of the icon from the tab's caption.
MIN_TAB_WIDTH As Double The minimum width a tab should be.
TAB_HORIZONTAL_PADDING As Double The number of pixels to pad the content from the tab edges.
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.
DrawTabCloseIcon(tab As XUITabBarItem, x As Integer, g As Graphics, style As XUITabBarStyle)
Draws the close icon for tab
at x
. Also sets the tab's CloseIconBounds
.
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.
RenderTab(tab As XUITabBarItem, g As Graphics, x As Double, style As XUITabBarStyle, width As Double)
Renders 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
.