This appendix lists the enumerations provided in the
<FL/Enumerations.H> header file, organized by section.
Constants whose value is zero are marked with "(0)", this is often
useful to know when programming.
Version Numbers
The FLTK version number is stored in a number of compile-time
constants:
- FL_MAJOR_VERSION - The major release number, currently 1.
- FL_MINOR_VERSION - The minor release number, currently 0.
- FL_PATCH_VERSION - The patch release number, currently 0.
- FL_VERSION - A combined floating-point version number for
the major and minor release numbers, currently 1.0.
Events
Events are identified by an Fl_Event enumeration value. The
following events are currently defined:
- FL_NO_EVENT - No event (or an event fltk does not
understand) occurred (0).
- FL_PUSH - A mouse button was pushed.
- FL_RELEASE - A mouse button was released.
- FL_ENTER - The mouse pointer entered a widget.
- FL_LEAVE - The mouse pointer left a widget.
- FL_DRAG - The mouse pointer was moved with a button
pressed.
- FL_FOCUS - A widget should receive keyboard focus.
- FL_UNFOCUS - A widget loses keyboard focus.
- FL_KEYBOARD - A key was pressed.
- FL_CLOSE - A window was closed.
- FL_MOVE - The mouse pointer was moved with no buttons
pressed.
- FL_SHORTCUT - The user pressed a shortcut key.
- FL_DEACTIVATE - The widget has been deactivated.
- FL_ACTIVATE - The widget has been activated.
- FL_HIDE - The widget has been hidden.
- FL_SHOW - The widget has been shown.
- FL_PASTE - The widget should paste the contents of the
clipboard.
- FL_SELECTIONCLEAR - The widget should clear any selections
made for the clipboard.
The following constants determine when a callback is performed:
- FL_WHEN_NEVER - Never call the callback (0).
- FL_WHEN_CHANGED - Do the callback only when the widget
value changes.
- FL_WHEN_NOT_CHANGED - Do the callback whenever the user
interacts with the widget.
- FL_WHEN_RELEASE - Do the callback when the button or key
is released and the value changes.
- FL_WHEN_ENTER_KEY - Do the callback when the user presses
the ENTER key and the value changes.
- FL_WHEN_RELEASE_ALWAYS - Do the callback when the button
or key is released, even if the value doesn't change.
- FL_WHEN_ENTER_KEY_ALWAYS - Do the callback when the user
presses the ENTER key, even if the value doesn't change.
The following constants define the button numbers for FL_PUSH and
FL_RELEASE events:
- FL_LEFT_MOUSE - the left mouse button
- FL_MIDDLE_MOUSE - the middle mouse button
- FL_RIGHT_MOUSE - the right mouse button
The following constants define the non-ASCII keys on the keyboard for
FL_KEYBOARD and FL_SHORTCUT events:
- FL_Button - A mouse button; use Fl_Button + n
for mouse button n.
- FL_BackSpace - The backspace key.
- FL_Tab - The tab key.
- FL_Enter - The enter key.
- FL_Pause - The pause key.
- FL_Scroll_Lock - The scroll lock key.
- FL_Escape - The escape key.
- FL_Home - The home key.
- FL_Left - The left arrow key.
- FL_Up - The up arrow key.
- FL_Right - The right arrow key.
- FL_Down - The down arrow key.
- FL_Page_Up - The page-up key.
- FL_Page_Down - The page-down key.
- FL_End - The end key.
- FL_Print - The print (or print-screen) key.
- FL_Insert - The insert key.
- FL_Menu - The menu key.
- FL_Num_Lock - The num lock key.
- FL_KP - One of the keypad numbers; use FL_KP + n
for number n.
- FL_KP_Enter - The enter key on the keypad.
- FL_F - One of the function keys; use FL_F + n
for function key n.
- FL_Shift_L - The lefthand shift key.
- FL_Shift_R - The righthand shift key.
- FL_Control_L - The lefthand control key.
- FL_Control_R - The righthand control key.
- FL_Caps_Lock - The caps lock key.
- FL_Meta_L - The left meta/Windows key.
- FL_Meta_R - The right meta/Windows key.
- FL_Alt_L - The left alt key.
- FL_Alt_R - The right alt key.
- FL_Delete - The delete key.
Fl::event_state() Values
The following constants define bits in the Fl::event_state()
value:
- FL_SHIFT - One of the shift keys is down.
- FL_CAPS_LOCK - The caps lock is on.
- FL_CTRL - One of the ctrl keys is down.
- FL_ALT - One of the alt keys is down.
- FL_NUM_LOCK - The num lock is on.
- FL_META - One of the meta/Windows keys is down.
- FL_SCROLL_LOCK - The scroll lock is on.
- FL_BUTTON1 - Mouse button 1 is pushed.
- FL_BUTTON2 - Mouse button 2 is pushed.
- FL_BUTTON3 - Mouse button 3 is pushed.
The following constants define bits that can be used with
Fl_Widget::align() to control the positioning of the
label:
- FL_ALIGN_CENTER - The label is centered (0).
- FL_ALIGN_TOP - The label is top-aligned.
- FL_ALIGN_BOTTOM - The label is bottom-aligned.
- FL_ALIGN_LEFT - The label is left-aligned.
- FL_ALIGN_RIGHT - The label is right-aligned.
- FL_ALIGN_CLIP - The label is clipped to the widget.
- FL_ALIGN_WRAP - The label text is wrapped as needed.
- FL_ALIGN_TOP_LEFT
- FL_ALIGN_TOP_RIGHT
- FL_ALIGN_BOTTOM_LEFT
- FL_ALIGN_BOTTOM_RIGHT
- FL_ALIGN_LEFT_TOP
- FL_ALIGN_RIGHT_TOP
- FL_ALIGN_LEFT_BOTTOM
- FL_ALIGN_RIGHT_BOTTOM
- FL_ALIGN_INSIDE - 'or' this with other values to put
label inside the widget.
The following constants define the standard FLTK fonts:
- FL_HELVETICA - Helvetica (or Arial) normal (0).
- FL_HELVETICA_BOLD - Helvetica (or Arial) bold.
- FL_HELVETICA_ITALIC - Helvetica (or Arial) oblique.
- FL_HELVETICA_BOLD_ITALIC - Helvetica (or Arial)
bold-oblique.
- FL_COURIER - Courier normal.
- FL_COURIER_BOLD - Courier bold.
- FL_COURIER_ITALIC - Courier italic.
- FL_COURIER_BOLD_ITALIC - Courier bold-italic.
- FL_TIMES - Times roman.
- FL_TIMES_BOLD - Times bold.
- FL_TIMES_ITALIC - Times italic.
- FL_TIMES_BOLD_ITALIC - Times bold-italic.
- FL_SYMBOL - Standard symbol font.
- FL_SCREEN - Default monospaced screen font.
- FL_SCREEN_BOLD - Default monospaced bold screen font.
- FL_ZAPF_DINGBATS - Zapf-dingbats font.
The following color constants can be used to access the colors in the
FLTK standard color palette:
- FL_BLACK - the default label color (0)
- FL_RED
- FL_GREEN
- FL_YELLOW
- FL_BLUE
- FL_MAGENTA
- FL_CYAN
- FL_WHITE - the default background for text
- FL_SELECTION_COLOR - change to dark blue for Windows style
- FL_GRAY - the default color.
In addition there are two inline functions to allow you to select
grays or colors from the FLTK colormap:
Fl_Color fl_gray_ramp(int i)
Returns a gray color. Returns black for zero, returns white for
FL_NUM_GRAY (which is 24) minus 1. To get the closest to an
8-bit gray value 'I' use
fl_gray_ramp(I*FL_NUM_GRAY/256)
Fl_Color fl_color_cube(int r, int g, int b)
Returns a color out of the color cube.
r must be in the range 0 to FL_NUM_RED (5) minus 1.
g must be in the range 0 to FL_NUM_GREEN (8) minus 1.
b must be in the range 0 to FL_NUM_BLUE (5) minus 1.
To get the closest color to a 8-bit set of R,G,B values use
fl_color_cube(R*FL_NUM_RED/256, G*FL_NUM_GREEN/256,
B*FL_NUM_BLUE/256);
The following constants define the mouse cursors that are available in
FLTK. The double-headed arrows are bitmaps
provided by FLTK on X, the others are provided by system-defined
cursors.
- FL_CURSOR_DEFAULT - the default cursor, usually an arrow (0)
- FL_CURSOR_ARROW - an arrow pointer
- FL_CURSOR_CROSS - crosshair
- FL_CURSOR_WAIT - watch or hourglass
- FL_CURSOR_INSERT - I-beam
- FL_CURSOR_HAND - hand (uparrow on MSWindows)
- FL_CURSOR_HELP - question mark
- FL_CURSOR_MOVE - 4-pointed arrow
- FL_CURSOR_NS - up/down arrow
- FL_CURSOR_WE - left/right arrow
- FL_CURSOR_NWSE - diagonal arrow
- FL_CURSOR_NESW - diagonal arrow
- FL_CURSOR_NONE - invisible
FD "When" Conditions
- FL_READ - Call the callback when there is data to be
read.
- FL_WRITE - Call the callback when data can be written
without blocking.
- FL_EXCEPT - Call the callback if an exception occurs on
the file.
The following damage mask bits are used by the standard FLTK widgets:
- FL_DAMAGE_CHILD - A child needs to be redrawn.
- FL_DAMAGE_EXPOSE - The window was exposed.
- FL_DAMAGE_SCROLL - The Fl_Scroll widget was
scrolled.
- FL_DAMAGE_OVERLAY - The overlay planes need to be redrawn.
- FL_DAMAGE_ALL - Everything needs to be redrawn.