Documentation | InterfaceKit | ScrollView
SYNOPSIS
Perl
use HaikuR1::Application; use HaikuR1::Window; use HaikuR1::View; use HaikuR1::ScrollView; # define MyApplication, MyWindow, MyView, and MyScrollView subclass here my $app = MyApplication->new($signature); my $window = MyWindow->new( frame => Rect->new($left, $top, $right, $bottom), title => $title, type => B_TITLED_WINDOW, flags => B_QUIT_ON_WINDOW_CLOSE, workspaces => B_CURRENT_WORKSPACE, ); my $view = MyView->new( frame => Rect->new($vleft, $vtop, $vright, $vbottom), name => $name, resizingMode => $resizing_mode, flags = >$vflags, ); my $scrollview = MyScrollView->new( name => $name2, target => $view, resizingMode => $resizing_mode, flags => $view_flags, horizontal => 1, vertical => 1, border => B_FANCY_BORDER, ); $window->AddChild($scrollview); $window->Show(); $app->Run(); # wait for an event to Quit the app or window
Python
from HaikuR1.ApplicationKit import Application from HaikuR1.InterfaceKit import Window from HaikuR1.InterfaceKit import View from HaikuR1.InterfaceKit import ScrollView # define MyApplication, MyWindow, MyView, and MyScrollView subclass here app = MyApplication(signature) window = MyWindow( frame = Rect(left, top, right, bottom), title = title, type = B_TITLED_WINDOW, flags = B_QUIT_ON_WINDOW_CLOSE, workspaces = B_CURRENT_WORKSPACE, ) view = MyView( frame = Rect(vleft, vtop, vright, vbottom), name = name, resizingMode = resizing_mode, flags = >vflags, ) scrollview = MyScrollView( name = name2, target = view, resizingMode = resizing_mode, flags = view_flags, horizontal = 1, vertical = 1, border = B_FANCY_BORDER, ) window.AddChild(scrollview) window.Show() app.Run() # wait for an event to Quit the app or window
DESCRIPTION
Exposes the BScrollView
object.
For more information on ScrollView, see the Be Book class description, the Be Book overview, and the Haiku Book class description.
METHODS
Constructor
Creates a ScrollView.
Perl
HaikuR1::ScrollView->new( name => $name, target => $target, resizingMode => $resizingMode, flags => $flags, horizontal => $horizontal, vertical => $vertical, border => $border, ); HaikuR1::ScrollView->new( name => $name, target => $target, flags => $flags, horizontal => $horizontal, vertical => $vertical, border => $border, ); HaikuR1::ScrollView->new($archive);
Python
ScrollView( name = name, target = target, resizingMode = resizingMode, flags = flags, horizontal = horizontal, vertical = vertical, border = border, ) ScrollView( name = name, target = target, flags = flags, horizontal = horizontal, vertical = vertical, border = border, ) ScrollView(archive)
name
A string, the ScrollView's internal name.
target
A View, the target of the ScrollView; that is, the View that the ScrollView will wrap. The target must not belong to a Window or another View.
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.)
horizontal
,vertical
Booleans indicating whether the ScrollView will have a ScrollBar in the given direction.
border
One of the border style constants.
archive
A Message, contains an archived version of the ScrollView.
Border
SetBorder
Borders
SetBorders
SetBorderHighlighted
IsBorderHighlighted
Gets or sets the ScrollView's border style or highlighted state. The Set
methods can also be called as hooks.
Borders
and SetBorders
are used only with Layout-enabled ScrollViews.
Perl
$scrollview->Border(); $scrollview->SetBorder($border); $scrollview->Borders(); $scrollview->SetBorders($borders); $scrollview->IsBorderHighlighted(); $scrollview->SetBorderHighlighted($state);
Python
scrollview.Border() scrollview.SetBorder(border) scrollview.Borders() scrollview.SetBorders(borders) scrollview.IsBorderHighlighted() scrollview.SetBorderHighlighted(state)
border
One of the border style constants.
borders
One of the TODO constants.
state
A boolean; if true, the border is highlighted. (Highlighting only works for
B_FANCY_BORDER
.
Target
SetTarget
Gets or sets the ScrollView's target. The ScrollView will take ownership of the target, and therefore it must not belong to a Window or another View.
Perl
$scrollview->Target(); $scrollview->SetTarget($target);
Python
scrollview.Target() scrollview.SetTarget(target)
target
The View that the View that the ScrollView will wrap.
ARCHIVABLE INTERFACE
ScrollView
inherits the methods and hooks of Archivable.
HANDLER INTERFACE
ScrollView
inherits the methods and hooks of Handler.
VIEW INTERFACE
ScrollView
inherits the methods and hooks of View.
The following differs from the View
version:
ScrollBar
Instead of returning a ScrollBar that targets this ScrollView, it returns its own ScrollBars, which target this ScrollView's target.
If for some reason you need to get a ScrollBar that targets this ScrollView, then you must call the base class version.
Perl
$scrollview->HaikuR1::View::ScrollBar($posture);
Python
super(ScrollView, self).ScrollBar(posture)
SCRIPTING SUITE
ScrollView inherits the following suites: