TabBarScrollArrow

Package: Libraries.Interface.Controls · Inherits from: Libraries.Interface.Item, Libraries.Interface.Controls.Control, Libraries.Interface.Item2D, Libraries.Interface.Events.MouseListener, Libraries.Language.Object

The TabBarScrollArrow class is one of the two small arrows at the ends of a horizontal TabBar. The arrows show only when the tabs are wider than the bar. Clicking one scrolls the bar to show the next hidden Tab in its direction. The arrow toward an end the bar has already reached is drawn faded. The arrows are mouse helpers. They never take the focus, and screen readers skip them. Keyboard and screen reader users move between tabs with the usual keys, and the selected or focused Tab scrolls into view. Each TabBar makes its own two arrows, so most users won't need this class.

Example Code

use Libraries.Game.Game
use Libraries.Interface.Controls.TabPane
use Libraries.Interface.Controls.Tab

class Main is Game
action Main
    StartGame()
end

action CreateGame
    // With more tabs than fit across the window, the TabBar shows its
    // scroll arrows at both ends.
    TabPane pane
    Add(pane)
    integer counter = 1
    repeat while counter <= 30
        Tab tab
        tab:SetName("Document " + counter)
        pane:Add(tab)
        counter = counter + 1
    end
    pane:Select(0)
end
end

Actions

ClickedMouse(Libraries.Interface.Events.MouseEvent event)

This action scrolls the TabBar when the arrow is clicked with the left mouse button. The start arrow shows the previous hidden Tab, and the end arrow shows the next one.

Parameters

Focus()

The arrows never take the focus. Clicking one leaves the focus where it was, for example in the code editor.

IsScrollAvailable()

This action returns whether the bar can scroll further in this arrow's direction.

Returns

boolean: True if the bar can scroll further this way, or false if it is at that end.

IsTowardEnd()

This action returns whether this is the arrow at the end of the bar.

Returns

boolean: True for the arrow at the end of the bar, or false for the arrow at the start.

LoadGraphics(Libraries.Interface.Layouts.LayoutProperties properties)

This action is used to load the graphical components of the Control. This is handled automatically by the Game engine as needed, and most users shouldn't need to use this action directly.

Parameters

PlaceArrow(number x, number y, number width, number height)

This action places the arrow in its TabBar and centers the triangle in it. The TabBar's layout calls it, so most users won't need it.

Parameters

  • x number: The x position of the arrow inside the TabBar.
  • y number: The y position of the arrow inside the TabBar.
  • width number: The width of the arrow.
  • height number: The height of the arrow.

SetScrollAvailable(boolean available)

This action sets whether the bar can scroll further in this arrow's direction. If it can't, the triangle is drawn faded. The TabBar's layout calls it, so most users won't need it.

Parameters

  • available boolean: True if the bar can scroll further this way, or false if it is at that end.

Setup(Libraries.Interface.Controls.TabBar tabBar, boolean atEnd)

This action connects the arrow to its TabBar and says which end of the bar it is at. The TabBar calls it when it is made, so most users won't need it.

Parameters

  • tabBar Libraries.Interface.Controls.TabBar: The TabBar this arrow scrolls.
  • atEnd boolean: True for the arrow at the end of the bar, which shows later tabs, or false for the arrow at the start, which shows earlier tabs.

Inherited Actions

263 actions from Libraries.Interface.Controls.Control
1 action from Libraries.Interface.Events.MouseListener
60 actions from Libraries.Interface.Item
202 actions from Libraries.Interface.Item2D
3 actions from Libraries.Language.Object