Documentation | InterfaceKit | MenuField
SYNOPSIS
Perl
use HaikuR1::MenuField; my $menufield = HaikuR1::MenuField->new( frame => $frame, name => $name, flags => $flags, menu => $menu, label => $label, ); $window->AddChild($menufield);
Python
import HaikuR1.MenuField menufield = MenuField( frame = frame, name = name, flags = flags, menu = menu, label = label, ) window.AddChild(menufield)
DESCRIPTION
Exposes the BMenuField
object.
For more information on MenuField, see the Be Book class description, the Be Book overview, and the Haiku Book class description.
METHODS
Constructor
Creates a MenuField.
Perl
HaikuR1::MenuField->new( frame => $frame, name => $name, label => $label, menu => $menu, resizingMode => $resizingMode, flags => $flags, );
Python
MenuField( frame = frame, name = name, label = label, menu = menu, resizingMode = resizingMode, flags = flags, )
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 MenuField's internal name.
label
A string, the text that will be displayed on the MenuField.
menu
The MenuField's Menu.
fixedSize
A boolean, if true the MenuField will not resize to fit the text of the selected item. Defaults to false.
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 MenuField.
Alignment
SetAlignment
Gets or sets the MenuField's alignment.
Perl
$menufield->Alignment(); $menufield->SetAlignment($flag);
Python
menufield.Alignment() menufield.SetAlignment(flag)
flag
An integer, one of the alignment constants.
Divider
SetDivider
Gets or sets the position of the divider between the label and the menu.
Perl
$menufield->Divider(); $menufield->SetDivider($xCoordinate);
Python
menufield.Divider() menufield.SetDivider(xCoordinate)
xCoordinate
A floating point number, the new position.
Enabled state
IsEnabled
SetEnabled
Returns true if the MenuField is enabled.
Gets or sets the MenuField's enabled state. SetEnabled
can also be called
as a hook.
Perl
$menufield->IsEnabled(); $menufield->SetEnabled($enabled);
Python
menufield.IsEnabled() menufield.SetEnabled(enabled)
enabled
A boolean, the new state.
Label
SetLabel
Gets or sets the label. SetLabel
can also be called as a hook.
Perl
$menufield->Label(); $menufield->SetLabel($string);
Python
menufield.Label() menufield.SetLabel(string)
string
A string, the new label.
Menu
Returns the Menu associated with the MenuField.
Perl
$menufield->Menu();
Python
menufield.Menu()
MenuBar
Returns the MenuBar created during construction to hold the Menu.
Perl
$menufield->MenuBar();
Python
menufield.MenuBar()
MenuItem
Returns the first MenuItem from the Menu.
Perl
$menufield->MenuItem();
Python
menufield.MenuItem()
Popup marker
ShowPopUpMarker
HidePopUpMarker
Shows or hides the popup marker at the edge of the MenuField.
Perl
$menufield->ShowPopUpMarker(); $menufield->HidePopUpMarker();
Python
menufield.ShowPopUpMarker() menufield.HidePopUpMarker()
ARCHIVABLE INTERFACE
Button
inherits the methods and hooks of Archivable.
HANDLER INTERFACE
Button
inherits the methods and hooks of Handler.
VIEW INTERFACE
Button
inherits the methods and hooks of View.
SCRIPTING SUITE
Button inherits the following suites: