Documentation | InterfaceKit | TabView
SYNOPSIS
Perl
use HaikuR1::TabView; my $tabview = HaikuR1::TabView->new( frame => $frame, name => $name, width => $width, resizingMode => $resizingMode, flags => $flags, ); $window->AddChild($tabview);
Python
from HaikuR1.InterfaceKit import TabView tabview = TabView( frame = frame, name = name, width = width, resizingMode = resizingMode, flags = flags, ) window.AddChild(tabview)
DESCRIPTION
Exposes the BTabView
object.
For more information on TabView, see the Be Book class description, the Be Book overview, and the Haiku Book class description.
METHODS
Constructor
Creates a TabView.
Perl
HaikuR1::TabView->new( frame => $frame, name => $name, width => $width, resizingMode => $resizingMode, flags => $flags, ); HaikuR1::TabView->new($archive);
Python
TabView( frame = frame, name = name, width = width, resizingMode = resizingMode, flags = flags, ) TabView(archive)
frame
A Rect that indicates where on the parent Window the View should be. You should not specify a frame on a View that will be added to a parent which uses a Layout.
name
A string, the TabView's internal name.
width
An integer, one of the button width constants.
resizingMode
An integer, the resizing mode. (See the resizing mode constants.) Should only be specified when there is a frame. Defaults to
B_FOLLOW_NONE
.flags
An integer, view flags. (See the view flag constants.)
archive
A Message, contains an archived version of the TabView.
Border
SetBorder
Gets or sets the border style. SetBorder
can also be called as a hook.
Perl
$tabview->Border(); $tabview->SetBorder($style);
Python
tabview.Border() tabview.SetBorder(style)
style
An integer, one of the border style constants.
FocusTab
SetFocusTab
Gets or sets the focus tab. SetFocusTab
can also be called as a hook.
Perl
$tabview->FocusTab(); $tabview->SetFocusTab($tab);
Python
tabview.FocusTab() tabview.SetFocusTab(tab)
tab
An integer, the index of the tab to select, or the empty value to defocus all tabs.
Select
Selection
Gets or sets the selected tab. Select
can also be called as a hook.
Perl
$tabview->Select($tab); $tabview->Selection();
Python
tabview.Select(tab) tabview.Selection()
tab
An integer, the index of the tab to select.
Tab maintenance
AddTab
RemoveTab
TabAt
CountTabs
TabFrame
These methods do what you expect. AddTab
, RemoveTab
, TabAt
, and
TabFrame
can also be called as hooks.
Perl
$tabview->AddTab($target, $tab); $tabview->RemoveTab($index); $tabview->TabAt($index); $tabview->CountTabs(); $tabview->TabFrame($index);
Python
tabview.AddTab(target, tab) tabview.RemoveTab(index) tabview.TabAt(index) tabview.CountTabs() tabview.TabFrame(index)
target
A View that will contain the Tab's contents.
tab
A Tab, the new tab; if not supplied, a Tab will be created.
index
An integer, the index of the Tab to find or remove.
TabSide
SetTabSide
Gets or sets the tab side. SetTabSide
can also be called as a hook.
Perl
$tabview->TabSide(); $tabview->SetTabSide($tabSide);
Python
tabview.TabSide() tabview.SetTabSide(tabSide)
tabSide
An integer, one of the Tab side constants.
Tab size
TabWidth
SetTabWidth
TabHeight
SetTabHeight
Gets or sets the size of the tabs. SetTabWidth
and SetTabHeight
can also
be called as hooks.
Perl
$tabview->TabWidth(); $tabview->SetTabWidth($width); $tabview->TabHeight(); $tabview->SetTabHeight($height);
Python
tabview.TabWidth() tabview.SetTabWidth(width) tabview.SetTabHeight(height) tabview.TabHeight()
width
An integer, one of the button width constants.
height
A floating point number, the height in pixels.
Views
ContainerView
ViewForTab
Each Tab controls a View; these Views are not owned directly by the TabView, but by a container View instead.
Perl
$tabview->ContainerView(); $tabview->ViewForTab($tabIndex);
Python
tabview.ContainerView() tabview.ViewForTab(tabIndex)
tabIndex
An integer, the index of the Tab to get a View for.
HOOKS
DrawBox
Called to draw a box around the container View.
Perl
$tabview->DrawBox($selectedTabRect);
Python
tabview.DrawBox(selectedTabRect)
selectedTabRect
A Rect, the frame of the selected tab; use this to attach the box to the View.
DrawTabs
Called when the TabView needs to draw its Tabs. It should return the frame rectangle of the currently selected Tab, which is then passed to DrawBox.
Perl
$tabview->DrawTabs();
Python
tabview.DrawTabs()
ARCHIVABLE INTERFACE
TabView
inherits the methods and hooks of Archivable.
HANDLER INTERFACE
TabView
inherits the methods and hooks of Handler.
VIEW INTERFACE
TabView
inherits the methods and hooks of View.
CONSTANTS
Tab side
Perl
use HaikuR1::TabView qw(:tab_side)
Python
Python does not support export tags.
- kLeftSide
- kRightSide
- kTopSide
- kBottomSide
SCRIPTING SUITE
The name of TabView's scripting suite is suite/vnd.Be-tab-view
.
Properties
Selection
B_GET_PROPERTY
,B_SET_PROPERTY
Gets or sets the index of the selected tab.
TabView also inherits the following suites: