General Constants¶
alignment Constants¶
Declared in: interface/InterfaceDefs.h
enum alignment {
B_ALIGN_LEFT,
B_ALIGN_RIGHT,
B_ALIGN_CENTER
These constants define the alignment data type. They determine how
lines of text and labels are aligned by BTextView
,
BStringView
, and BMenuField
objects.
See also: BTextView::SetAlignment()
border_style Constants¶
Declared in: interface/InterfaceDefs.h
enum border_style {
B_PLAIN_BORDER,
B_FANCY_BORDER,
B_NO_BORDER
These constants define how BBox
objects and
BScrollView
s are bordered.
Character Constants¶
Declared in: interface/InterfaceDefs.h
Constant |
Character value |
---|---|
|
0x08 (same as ‘b’) |
|
0x0a (same as ‘n’) |
|
0x0a (synonym for |
|
0x20 (same as ‘ ‘) |
|
0x09 (same as ‘t’) |
|
0x1b |
|
0x1c |
|
0x1d |
|
0x1e |
|
0x1f |
|
0x05 |
|
0x7f |
|
0x01 |
|
0x04 |
|
0x0b |
|
0x0c |
|
0x10 |
|
“xE2x80xA6” |
|
“xE2x80x9C” |
|
“xE2x80x9D” |
|
“xC2xA9” |
|
“xC2xAE” |
|
“xE2x84xA2” |
|
“xE2x98xBB” |
|
“xE5xBCx98” |
Constants in the first group stand for the ASCII characters they name. They’re defined only for characters that normally don’t have visible symbols.
Constants in the second group are Unicode UTF-8 encodings of common characters that have multibyte representations. These constants are strings that can be concatenated with other strings—for example, to set a button label that ends in an ellipsis:
myButton->SetLabel("Options"B_UTF_ELLIPSIS);
See also: “Function Key Constants” below
color_space¶
Declared in: interface/GraphicsDefs.h
Constant |
Description |
---|---|
|
Undefined color space |
|
xRGB 8:8:8:8, stored as little endian uint32 |
|
ARGB 8:8:8:8, stored as little endian uint32 |
|
Currently unused |
|
xRGB 5:6:5, stored as little endian uint16 |
|
RGB 1:5:5:5, stored as little endian uint16 |
|
ARGB 1:5:5:5, stored as little endian uint16 |
|
256-color index into the color table. |
|
256-color greyscale value. |
|
Each bit represents a single pixel, where 0 is the view’s low color and 1 is the high color. |
|
xRGB 8:8:8:8, stored as big endian uint32 |
|
ARGB 8:8:8:8, stored as big endian uint32 |
|
Currently unused |
|
RGB 5:6:5, stored as big endian uint16 |
|
xRGB 1:5:5:5, stored as big endian uint16 |
|
ARGB 1:5:5:5, stored as big endian uint16 |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Currently unused. |
|
Hue, saturation, and intensity: x:8:8:8 format |
|
Hue, saturation, and intensity: 8:8:8 format |
|
Hue, saturation, intensity, and alpha: 8:8:8:8 format |
|
Hue, saturation, and value: x:8:8:8 format |
|
Hue, saturation, and value: 8:8:8 format |
|
Hue, saturation, value, and alpha: 8:8:8:8 format |
|
Hue, lightness, and saturation: x:8:8:8 format |
|
Hue, lightness, and saturation: 8:8:8 format |
|
Hue, lightness, saturation, and alpha: 8:8:8:8 format |
|
Cyan, magenta, and yellow: x:8:8:8 format |
|
Cyan, magenta, and yellow: 8:8:8 format |
|
Cyan, magenta, yellow, and alpha: 8:8:8:8 format |
|
Cyan, magenta, yellow, and black: 8:8:8:8 format |
|
For compatibility only: use B_GRAY1 |
|
For compatibility only; use B_GRAY8 |
|
For compatibility only; use B_CMAP8 |
|
For compatibility only; use B_RGB32 |
|
For compatibility only; use B_RGB15 |
|
For compatibility only; use B_RGB32_BIG |
|
For compatibility only; use B_RGB15_BIG |
These constants define the color_space data type. A color space describes three properties of screens and bitmap images:
How many bits of information there are per pixel (the depth of the image)
How those bits are to be interpreted (whether as colors or on a grayscale, what the color components are, and so on).
How are components are arranged
A number of these aren’t actually usable as screen display color spaces, but are intended for use in identifying the color format for video media buffers and other offscreen graphics data.
See the “Color Spaces” section in the “Drawing” section of this chapter for a fuller explanation of these color spaces.
Control Values¶
Declared in: interface/Control.h
Constant |
Value |
---|---|
|
1 |
|
0 |
These constants define the bipolar states of a typical control device.
See also: BControl::SetValue()
Cursor Transit Constants¶
Declared in: interface/View.h
Constant |
Description |
---|---|
|
The cursor has just entered a view. |
|
The cursor has moved within the view. |
|
The cursor has left the view |
These constants describe the cursor’s transit through a view. Each
MouseMoved()
notification includes one of these
constants as an argument, to inform the BView
whether the
cursor has entered the view, moved while inside the view, or exited the
view.
Dead-Key Mapping¶
Declared in: interface/InterfaceDefs.h
Constant |
---|
|
|
|
|
|
|
|
|
|
These constants determine which combinations of modifiers can cause a key to be the “dead” member of a two-key combination.
See also: get_key_map()
drawing_mode Constants¶
Declared in: interface/GraphicsDefs.h
enum drawing_mode {
B_OP_COPY,
B_OP_OVER,
B_OP_ERASE,
B_OP_INVERT,
B_OP_SELECT,
B_OP_ALPHA,
B_OP_ADD,
B_OP_SUBTRACT,
B_OP_BLEND,
B_OP_MIN,
B_OP_MAX
These constants define the drawing_mode data type. The drawing
mode is a BView
graphics parameter that determines how the
image being drawn interacts with the image already in place in the area
where it’s drawn. The various modes are explained under “Drawing Modes” in the “Drawing” section of this chapter.
See also: BView::SetDrawingMode()
Function Key Constants¶
Declared in: interface/InterfaceDefs.h
Constant |
---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These constants stand for the various keys that are mapped to the
B_FUNCTION_KEY
character. When the
B_FUNCTION_KEY
character is reported in a key-down event,
the application can determine which key produced the character by testing
the key code against these constants. ( Control+p also
produces the B_FUNCTION_KEY
character.)
See also: “Character Mapping” in the Keyboard Information appendix
Interface Messages¶
Declared in: app/AppDefs.h
Constant |
---|
|
|
|
These constants identify interface messages—system messages that are
delivered to BWindow
objects. Each constant conveys an
instruction to do something in particular (B_ZOOM
) or
names a type of event (B_KEY_DOWN
).
See also: “Interface Messages” in the “Responding to the User” section of this chapter
list_view_type Constants¶
Declared in: interface/ListView.h
Constant |
---|
|
|
These constants distinguish between lists that permit the user to select only one item at a time and those that allow multiple items to be selected.
See also: The BListView
class
Main Screen¶
Declared in: interface/Screen.h
const screen_id B_MAIN_SCREEN_ID
This constant stands for the main screen, the screen that has the origin of the screen coordinate system at its left top corner. (Currently only one screen can be attached to the computer and it is the main screen.)
See also: screen_id
Modifier States¶
Declared in: interface/InterfaceDef.h
Constant |
---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These constants designate the Shift, Option, Control, Command, and Menu modifier keys and the lock states set by the Caps Lock, Scroll Lock, and Num Lock keys. They’re typically used to form a mask that describes the current, or required, modifier states.
For each variety of modifier key, there are constants that distinguish
between the keys that appear at the left and right of the keyboard, as well
as one that lumps both together. For example, if the user is holding the
left Control key down, both B_CONTROL_KEY
and
B_LEFT_CONTROL_KEY
will be set in the mask.
See also: modifiers()
, BWindow::AddShortcut()
, the
BMenu
constructor
Orientation Constants¶
Declared in: interface/InterfaceDef.h
Constant |
---|
|
|
These constants define the orientation data type that distinguishes between the vertical and horizontal orientation of graphic objects. It’s currently used only to differentiate scroll bars.
See also: The BScrollBar
and BScrollView
classes
Pattern Constants¶
Declared in: interface/GraphicsDef.h
const pattern B_SOLID_HIGH =
{ 0xff, 0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff }
const pattern B_SOLID_LOW =
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
const pattern B_MIXED_COLORS =
{ 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 }
These constants name the three standard patterns defined in the Interface Kit.
B_SOLID_HIGH
is a pattern that consists of the high color
only. It’s the default pattern for all BView drawing functions that stroke
lines and fill shapes.
B_SOLID_LOW
is a pattern with only the low color. It’s
used mainly to erase images (to replace them with the background color).
B_MIXED_COLORS
alternates pixels between the high and low
colors in a checkerboard pattern. The result is a halftone midway between
the two colors. This pattern can produce fine gradations of color,
especially when the high and low colors are set to two colors that are
already quite similar.
See also: “Patterns” in the “Drawing” section of this chapter
Resizing Modes¶
Declared in: interface/View.h
Constant |
---|
|
|
|
|
|
|
|
|
|
|
These constants are used to set the behavior of a view when its parent is
resized. They’re explained under the BView constructor
.
See also: BView::SetResizingMode()
Screen Spaces¶
Declared in: interface/GraphicsDef.h
B_8_BIT_640x400
B_8_BIT_640x480 B_15_BIT_640x480
B_16_BIT_640x480 B_32_BIT_640x480
B_8_BIT_800x600 B_15_BIT_800x600
B_16_BIT_800x600 B_32_BIT_800x600
B_8_BIT_1024x768 B_15_BIT_1024x768
B_16_BIT_1024x768 B_32_BIT_1024x768
B_8_BIT_1152x900 B_15_BIT_1152x900
B_16_BIT_1152x900 B_32_BIT_1152x900
B_8_BIT_1280x1024 B_15_BIT_1280x1024
B_16_BIT_1280x1024 B_32_BIT_1280x1024
B_8_BIT_1600x1200 B_15_BIT_1600x1200
B_16_BIT_1600x1200 B_32_BIT_1600x1200
These constants are currently used to configure the screen—to set its depth and the size of the pixel grid it displays—as well as to report which configurations are possible. However, they may not be supported in the future. 15-bit depths are not currently supported
See also: set_screen_space()
, get_screen_info().
ScrollBar Constants¶
Declared in: interface/ScrollBar.h
Constant |
---|
|
|
These constants record the recommended thickness of scroll bars. They
should be used to help define the frame rectangles passed to the
BScrollBar constructor
.
String Truncation Constants¶
Declared in: interface/Font.h
Constant |
---|
|
|
|
|
These constants instruct a BFont
where it should remove
characters from a set of strings to shorten them.
See also: BFont::GetTruncatedStrings()
tint_color() Constants¶
Declared in: interface/InterfaceDefs.h
These constants are used when calling tint_color()
to alter an
existing color, especially for creating disabled objects or highlighting
backgrounds.
Transparency Constants¶
Declared in: interface/GraphicsDefs.h
const uint8 B_TRANSPARENT_8_BIT
const rgb_color B_TRANSPARENT_32_BIT
These constants set transparent pixel values in a bitmap image.
B_TRANSPARENT_8_BIT
designates a transparent pixel in the
B_CMAP8
color space, and
B_TRANSPARENT_32_BIT
designates a transparent pixel in
the B_RGB32
color space.
Transparency is explained in the “Drawing Modes” part of the “Drawing” section of this chapter. Drawing modes other than B_OP_COPY preserve the destination image where a source bitmap is transparent.
See also: “Drawing Modes” in the “Drawing” section of this
chapter, the BBitmap
class, BView::SetViewColor()
color_which Constants¶
Declared in: interface/InterfaceDefs.h
Constant |
Description |
---|---|
|
The background color used for view panels. |
|
The background color used for menus. |
|
The color used for highlighting menu items when selected. |
|
The color used for drawing menu item labels when not selected. |
|
The color used for drawing menu item labels when selected. |
|
The color used to draw the window’s title tab. |
|
The color used to draw the mark indicating which control is focused for keyboard navigation. |
|
The current desktop color. |
When calling ui_color()
to obtain the color for a user
interface element, these constants are used to select the desired element.
View Flags¶
Declared in: interface/View.h
Constant |
Description |
---|---|
|
Include the entire view in the clipping region. |
|
Allow the BView to draw. |
|
Report pulse events to the BView. |
|
Report view-resized and view-moved events. |
|
Let users navigate to the view with the Tab key. |
|
Mark the view for Control+Tab navigation. |
These constants can be combined to form a mask that sets the behavior of a
BView
object. They’re explained in more detail under the class
constructor. The mask is passed to the constructor
, or to the SetFlags()
function.
Window Flags¶
Declared in: interface/Window.h
Constant |
---|
|
|
|
|
|
|
|
|
These constants set the behavior of a window. They can be combined to form
a mask that’s passed to the BWindow constructor
.
window_type Constants¶
Declared in: interface/Window.h
Constant |
Description |
---|---|
|
The window is a modal window. |
|
The window has a border but no title tab. |
|
The window has a border and a title tab. |
|
The window has a border, tab and resize knob. |
These constants describe the various kinds of windows that can be requested from the Application Server.
See also: The BWindow constructor
Workspace Constants¶
Declared in: interface/Window.h
Constant |
---|
|
|
These constants are used—along with designations of specific workspaces—to
associate a set of one or more workspaces with a BWindow
.
See also: The BWindow constructor
, BWindow::SetWorkspaces()