Documentation | InterfaceKit | TextControl
SYNOPSIS
Perl
use HaikuR1::TextControl;
my $textcontrol = HaikuR1::TextControl->new(
frame => $frame,
name => $name,
label => $label,
text => $text,
message => $message,
resizingMode => $resizingMode,
flags => $flags,
);
$window->AddChild($textcontrol);
Python
import HaikuR1.TextControl []
textcontrol = TextControl(
frame = frame,
name = name,
label = label,
text = text,
message = message,
resizingMode = resizingMode,
flags = flags,
)
window.AddChild(textcontrol)
DESCRIPTION
Exposes the BTextControl object.
For more information on TextControl, see the Be Book class description, the Be Book overview, and the Haiku Book class description.
METHODS
Constructor
Creates a TextControl.
Perl
HaikuR1::TextControl->new(
frame => $frame,
name => $name,
label => $label,
text => $text,
message => $message,
resizingMode => $resizingMode,
flags => $flags,
);
HaikuR1::TextControl->newFromArchive($archive);
Python
TextControl(
frame = frame,
name = name,
label = label,
text = text,
message = message,
resizingMode = resizingMode,
flags = flags,
)
TextControl.FromArchive(archive)
frameA 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.
nameA string, the TextControl's internal name.
labelA string, the label that will be displayed to the left of the TextControl's input field.
textA string, the initial text in the TextControl's input field; if you pass the empty value, there will be no label.
messageA Message that will be sent when the TextControl is Invoked.
resizingModeAn integer, the resizing mode. (See the resizing mode constants.) Should only be specified when there is a frame. Defaults to
B_FOLLOW_NONE.flagsAn integer, view flags. (See the view flag constants.)
archiveA Message, contains an archived version of the TextControl.
Text
SetText
TextLength
Gets or sets the text in the input field. SetText can also be called as a
hook.
Perl
$textcontrol->Text(); $textcontrol->SetText($text); $textcontrol->TextLength();
Python
textcontrol.Text() textcontrol.SetText(text) textcontrol.TextLength()
textA string, the new value for the input field.
MarkAsInvalid
Marks the control as invalid; this changes its appearance.
Perl
$textcontrol->MarkAsInvalid($invalid);
Python
textcontrol.MarkAsInvalid(invalid)
invalidA boolean; if true, the control will be marked invalid.
TextView
Returns the TextView input field.
Perl
$textcontrol->TextView();
Python
textcontrol.TextView()
ModificationMessage
SetModificationMessage
Gets or sets the message sent when the content changes.
SetModificationMessage can also be called as a hook.
Perl
$textcontrol->ModificationMessage(); $textcontrol->SetModificationMessage($message);
Python
textcontrol.ModificationMessage() textcontrol.SetModificationMessage(message)
messageThe new modification Message.
Alignment
GetAlignment
SetAlignment
Gets or sets the alignment for the TextControl's input field and label.
SetAlignment can also be called as a hook. GetAlignment returns two
values.
Perl
$textcontrol->GetAlignment(); $textcontrol->SetAlignment($forLabel, $forText);
Python
textcontrol.GetAlignment() textcontrol.SetAlignment(forLabel, forText)
forLabelforTextIntegers, one of the alignment constants.
Divider
SetDivider
Gets or sets the divider point between the label and the TextView; this is the x-coordinate where the label stops and the input field begins.
Perl
$textcontrol->Divider(); $textcontrol->SetDivider($xCoordinate);
Python
textcontrol.Divider() textcontrol.SetDivider(xCoordinate)
xCoordinateA floating point number, the new divider point.
Layout items
CreateLabelLayoutItem
CreateTextViewLayoutItem
Creates LayoutItems for the internal Views.
Perl
$textcontrol->CreateLabelLayoutItem(); $textcontrol->CreateTextViewLayoutItem();
Python
textcontrol.CreateLabelLayoutItem() textcontrol.CreateTextViewLayoutItem()
ARCHIVABLE INTERFACE
TextControl inherits the methods and hooks of Archivable.
HANDLER INTERFACE
TextControl inherits the methods and hooks of Handler.
VIEW INTERFACE
TextControl inherits the methods and hooks of View.
CONTROL INTERFACE
TextControl inherits the methods and hooks of Control.
SCRIPTING SUITE
TextControl inherits the following suites:
However, TextControl overrides the Control suite so that the Value
property is a string instead of an integer.