Documentation | InterfaceKit | ColorControl
SYNOPSIS
Perl
use HaikuR1::ColorControl []; my $color_control = HaikuR1::ColorControl->new( start => $start, layout => $layout, cellSize => $cellSize, name => $name, message => $message, useOffscreen => $useOffscreen, ); $window->AddChild($color_control);
Python
import HaikuR1.ColorControl [] color_control = ColorControl( start = start, layout = layout, cellSize = cellSize, name = name, message = message, useOffscreen = useOffscreen, ) window.AddChild(button)
DESCRIPTION
Exposes the BColorControl
object.
For more information on ColorControl, see the Be Book class description, the Be Book overview, and the Haiku Book class description.
METHODS
Constructor
Creates a ColorControl.
Perl
HaikuR1::ColorControl->new( start => $start, layout => $layout, cellSize => $cellSize, name => $name, message => $message, useOffscreen => $useOffscreen, ); HaikuR1::ColorControl->new($archive);
Python
ColorControl( start = start, layout = layout, cellSize = cellSize, name = name, message = message, useOffscreen = useOffscreen, ) ColorControl(archive)
start
A Point that indicates where on the parent Window the View should be. This is not a Rect like most Views, because a ColorControl determines its own width and height.
layout
One of the layout constants
cellSize
A floating point number, the size of the squares used in 256-bit color mode.
name
A string, the Button's internal name.
message
A Message that will be sent when the ColorControl is Invoked.
useOffscreen
A boolean; if true, then the drawing will be done offscreen and then copied to the screen.
If drawing directly to screen, then the color regions will be recalculated and redrawn every time the View is redrawn. If drawing offscreen, these calculations are only done when necessary, the image is drawn to a bitmap, and when the View is redrawn, that bitmap is copied into the View. This reduces choppy drawing at the expense of more memory.
archive
A Message, contains an archived version of the ColorControl.
CellSize
SetCellSize
Gets or sets the cell size.
Perl
$colorcontrol->CellSize(); $colorcontrol->SetCellSize($size);
Python
colorcontrol.CellSize() colorcontrol.SetCellSize(size)
size
A floating point number, the size of the squares used in 256-bit color mode.
Layout
Gets the current layout, as an integer layout constant.
Perl
$colorcontrol->Layout();
Python
colorcontrol.Layout()
ValueAsColor
Gets the value as an rgb_color.
Perl
$colorcontrol->ValueAsColor();
Python
colorcontrol.ValueAsColor()
ARCHIVABLE INTERFACE
ColorControl
inherits the methods and hooks of Archivable.
HANDLER INTERFACE
ColorControl
inherits the methods and hooks of Handler.
VIEW INTERFACE
ColorControl
inherits the methods and hooks of View.
The following differs from the View
version:
SetLayout
Takes either a Layout object (like the View version) or a layout constant. Both versions can be called as hooks.
Perl
$colorcontrol->SetLayout($layout);
Python
colorcontrol.SetLayout(layout)
CONTROL INTERFACE
ColorControl
inherits the methods and hooks of Control.
The following differs from the Control
version:
SetValue
Takes either an integer value (like the Control version) or an rgb_color. Only the integer version can be called as a hook.
Perl
$colorcontrol->SetValue($value);
Python
colorcontrol.SetValue(value)
CONSTANTS
Cell layout
Perl
use HaikuR1::ColorControl qw(:layout)
Python
Python does not support export tags.
- B_CELLS_4x64
- B_CELLS_8x32
- B_CELLS_16x16
- B_CELLS_32x8
- B_CELLS_64x4
SCRIPTING SUITE
Button inherits the following suites: