fltk.core.enums

FLTK Enumerations and Constants

This module provides D enumerations matching FLTK's Enumerations.H header. All enum member names follow UPPER_SNAKE_CASE convention per project style.

These enumerations cover:

  • Event types (mouse, keyboard, focus, etc.)
  • Key codes (special keys, function keys, modifiers)
  • Colors (basic colors, grayscale ramp, color cube)
  • Fonts (Helvetica, Courier, Times, etc.)
  • Alignment flags
  • Callback trigger flags (when)
  • Box types (visual styles)
  • Cursor types
  • OpenGL mode flags
  • Damage flags

    Authors

    Dejan Lekić

    License

    BSD-3-Clause

Types 12

enumEvent

FLTK event types.

These values are returned by Fl::event() and passed to widget handle() methods. They indicate what kind of event occurred.

NO_EVENT = 0No event
PUSH = 1Mouse button was pushed
RELEASE = 2Mouse button was released
ENTER = 3Mouse pointer entered widget
LEAVE = 4Mouse pointer left widget
DRAG = 5Mouse was dragged with button held
FOCUS = 6Widget gained keyboard focus
UNFOCUS = 7Widget lost keyboard focus
KEYDOWN = 8Key was pressed (same as KEYBOARD)
KEYBOARD = 8Key was pressed
KEYUP = 9Key was released
CLOSE = 10Widget should close
MOVE = 11Mouse was moved without buttons
SHORTCUT = 12Keyboard shortcut
DEACTIVATE = 13Widget was deactivated
ACTIVATE = 14Widget was activated
HIDE = 15Widget is being hidden
SHOW = 16Widget is being shown
PASTE = 17Text was pasted
SELECTIONCLEAR = 18Selection was cleared
MOUSEWHEEL = 19Mouse wheel was scrolled
DND_ENTER = 20Drag and drop enter
DND_DRAG = 21Drag and drop: dragged over widget
DND_LEAVE = 22Drag and drop: left widget
DND_RELEASE = 23Drag and drop: dropped on widget
SCREEN_CONFIGURATION_CHANGED = 24Screen configuration changed
FULLSCREEN = 25Fullscreen state changed
ZOOM_GESTURE = 26Zoom gesture
ZOOM_EVENT = 27Zoom event
enumKey : uint

FLTK key codes.

These values represent keyboard keys and are used with Fl::event_key(). ASCII characters (32-126) use their ASCII values directly.

BUTTON = 0xfee8Button (mouse button placeholder)
BACK_SPACE = 0xff08Backspace key
TAB = 0xff09Tab key
ISO_KEY = 0xff0cISO key
ENTER = 0xff0dEnter/Return key
PAUSE = 0xff13Pause key
SCROLL_LOCK = 0xff14Scroll Lock key
ESCAPE = 0xff1bEscape key
KANA = 0xff2eKana key
EISU = 0xff2fEisu key
YEN = 0xff30Yen key
JIS_UNDERSCORE = 0xff31JIS Underscore key
HOME = 0xff50Home key
LEFT = 0xff51Left arrow key
UP = 0xff52Up arrow key
RIGHT = 0xff53Right arrow key
DOWN = 0xff54Down arrow key
PAGE_UP = 0xff55Page Up key
PAGE_DOWN = 0xff56Page Down key
END = 0xff57End key
PRINT = 0xff61Print Screen key
INSERT = 0xff63Insert key
MENU = 0xff67Menu key
HELP = 0xff68Help key
NUM_LOCK = 0xff7fNum Lock key
KP_ENTER = 0xff8dKeypad Enter
KP_LAST = 0xffbdKeypad Last (for range checking)
F1 = 0xffbd + 1Function key F1
F2 = 0xffbd + 2Function key F2
F3 = 0xffbd + 3Function key F3
F4 = 0xffbd + 4Function key F4
F5 = 0xffbd + 5Function key F5
F6 = 0xffbd + 6Function key F6
F7 = 0xffbd + 7Function key F7
F8 = 0xffbd + 8Function key F8
F9 = 0xffbd + 9Function key F9
F10 = 0xffbd + 10Function key F10
F11 = 0xffbd + 11Function key F11
F12 = 0xffbd + 12Function key F12
F_LAST = 0xffe0Function key last (F12)
SHIFT_L = 0xffe1Left Shift key
SHIFT_R = 0xffe2Right Shift key
CONTROL_L = 0xffe3Left Control key
CONTROL_R = 0xffe4Right Control key
CAPS_LOCK = 0xffe5Caps Lock key
META_L = 0xffe7Left Meta key
META_R = 0xffe8Right Meta key
ALT_L = 0xffe9Left Alt key
ALT_R = 0xffeaRight Alt key
DELETE = 0xffffDelete key
enumModifier : uint

Keyboard modifier flags.

These flags indicate which modifier keys are held during an event. They can be combined with bitwise OR.

NONE = 0No modifiers
SHIFT = 0x00010000Shift key is held
CAPS_LOCK = 0x00020000Caps Lock is active
CTRL = 0x00040000Control key is held
ALT = 0x00080000Alt key is held
NUM_LOCK = 0x00100000Num Lock is active
META = 0x00400000Meta key is held (Command on macOS)
SCROLL_LOCK = 0x00800000Scroll Lock is active
BUTTON1 = 0x01000000Any mouse button is held
BUTTON2 = 0x02000000Mouse button 2 is held
BUTTON3 = 0x04000000Mouse button 3 is held
BUTTONS = 0x7f000000All mouse buttons mask
COMMAND = CTRLCommand key (same as CTRL on non-macOS, META on macOS)
aliasColor = uint

FLTK color type.

Colors are 32-bit unsigned integers. The format depends on the value:

  • 0-255: Index into the FLTK colormap
  • 0x00000000-0xFFFFFF00: RGB color (R in high byte, G, B, 0 in low byte)

Standard FLTK colors.

These are indices into FLTK's built-in colormap.

FOREGROUND = 0Foreground color (usually black)
BACKGROUND2 = 7Background color 2
INACTIVE = 8Inactive color
SELECTION = 15Selection color
GRAY0 = 32Gray 0 (black)
DARK3 = 39Dark gray 3
DARK2 = 45Dark gray 2
DARK1 = 47Dark gray 1
BACKGROUND = 49Background color
LIGHT1 = 50Light gray 1
LIGHT2 = 52Light gray 2
LIGHT3 = 54Light gray 3
BLACK = 56Black
RED = 88Red
GREEN = 63Green
YELLOW = 95Yellow
BLUE = 216Blue
MAGENTA = 248Magenta
CYAN = 223Cyan
DARK_RED = 72Dark red
DARK_GREEN = 60Dark green
DARK_YELLOW = 76Dark yellow
DARK_BLUE = 136Dark blue
DARK_MAGENTA = 152Dark magenta
DARK_CYAN = 140Dark cyan
WHITE = 255White
enumFont

FLTK font indices.

These are indices into FLTK's font table.

HELVETICA = 0Helvetica (normal)
HELVETICA_BOLD = 1Helvetica Bold
HELVETICA_ITALIC = 2Helvetica Italic
HELVETICA_BOLD_ITALIC = 3Helvetica Bold Italic
COURIER = 4Courier (normal)
COURIER_BOLD = 5Courier Bold
COURIER_ITALIC = 6Courier Italic
COURIER_BOLD_ITALIC = 7Courier Bold Italic
TIMES = 8Times (normal)
TIMES_BOLD = 9Times Bold
TIMES_ITALIC = 10Times Italic
TIMES_BOLD_ITALIC = 11Times Bold Italic
SYMBOL = 12Symbol font
SCREEN = 13Screen font (monospace)
SCREEN_BOLD = 14Screen Bold
ZAPF_DINGBATS = 15Zapf Dingbats
FREE_FONT = 16Number of free font slots
enumAlign : uint

FLTK alignment flags.

These flags control how labels and images are aligned within widgets. Multiple flags can be combined with bitwise OR.

CENTER = 0Center alignment (default)
TOP = 1Align to top edge
BOTTOM = 2Align to bottom edge
LEFT = 4Align to left edge
RIGHT = 8Align to right edge
INSIDE = 16Draw label inside widget
TEXT_OVER_IMAGE = 0x0020Align text over image
IMAGE_OVER_TEXT = 0x0000Align image over text
CLIP = 64Clip text to widget bounds
WRAP = 128Wrap text to fit width
IMAGE_NEXT_TO_TEXT = 0x0100Draw image next to text
TEXT_NEXT_TO_IMAGE = 0x0120Draw text next to image
IMAGE_BACKDROP = 0x0200Backdrop for image
TOP_LEFT = TOP | LEFTTop-left corner
TOP_RIGHT = TOP | RIGHTTop-right corner
BOTTOM_LEFT = BOTTOM | LEFTBottom-left corner
BOTTOM_RIGHT = BOTTOM | RIGHTBottom-right corner
LEFT_TOP = TOP_LEFTLeft-top (same as top-left)
RIGHT_TOP = TOP_RIGHTRight-top (same as top-right)
LEFT_BOTTOM = BOTTOM_LEFTLeft-bottom (same as bottom-left)
RIGHT_BOTTOM = BOTTOM_RIGHTRight-bottom (same as bottom-right)
NO_LABEL = TEXT_OVER_IMAGEDo not draw label
enumWhen : uint

FLTK callback trigger flags.

These flags control when a widget's callback is invoked.

NEVER = 0Never call the callback
CHANGED = 1Call when value changes
NOT_CHANGED = 2Call when value has not changed
RELEASE = 4Call when button/key released
RELEASE_ALWAYS = 6Call on release even if value unchanged
ENTER_KEY = 8Call when Enter key pressed
ENTER_KEY_ALWAYS = 10Call on Enter key even if unchanged
ENTER_KEY_CHANGED = 11Call on Enter key or release
enumCursor

FLTK cursor types.

These values specify the mouse cursor appearance.

DEFAULT = 0Default cursor
ARROW = 35Arrow cursor
CROSS = 66Crosshair cursor
WAIT = 76Wait/busy cursor
INSERT = 77Text insertion cursor
HAND = 31Hand/pointer cursor
HELP = 47Help cursor
MOVE = 27Move cursor
NS = 78North-south resize cursor
WE = 79West-east resize cursor
NWSE = 80Northwest-southeast resize cursor
NESW = 81Northeast-southwest resize cursor
N = 70North resize cursor
NE = 69Northeast resize cursor
E = 49East resize cursor
SE = 8Southeast resize cursor
S = 9South resize cursor
SW = 7Southwest resize cursor
W = 36West resize cursor
NW = 68Northwest resize cursor
NONE = 255No cursor (hidden)
enumMode : uint

FLTK mode flags for Fl_Gl_Window and display configuration.

These flags can be combined with bitwise OR.

RGB = 0RGB color mode (default)
INDEX = 1Indexed color mode
SINGLE = 0Single buffered
DOUBLE = 2Double buffered
ACCUM = 4Accumulation buffer
ALPHA = 8Alpha channel
DEPTH = 16Depth buffer
STENCIL = 32Stencil buffer
RGB8 = 64RGB8 color mode
MULTISAMPLE = 128Multisample anti-aliasing
STEREO = 256Stereo rendering
FAKE_SINGLE = 512Fake single buffered mode
OPENGL3 = 1024OpenGL 3.0+ core profile
enumDamage : ubyte

FLTK damage flags.

These flags indicate what parts of a widget need to be redrawn.

NONE = 0No damage
CHILD = 0x01Child widget was damaged
EXPOSE = 0x02Exposure damage (redraw needed)
SCROLL = 0x04Scrolling damage
OVERLAY = 0x08Overlay damage
USER1 = 0x10User-defined damage 1
USER2 = 0x20User-defined damage 2
ALL = 0x80All damage (full redraw)

FLTK label types.

These values control how widget labels are drawn.

NORMAL = 0Normal text label
NO_LABEL = 1No label
SHADOW = 2Shadow text
ENGRAVED = 3Engraved text
EMBOSSED = 4Embossed text
MULTI = 5Multi-label (internal use)
ICON = 6Icon label
IMAGE = 7Image label
FREE = 8Free label type (for custom)

Functions 2

fnColor flRgbColor(ubyte r, ubyte g, ubyte b) pure nothrow @safe @nogcCreates an RGB color value.
fnColor flGrayRamp(ubyte gray) pure nothrow @safe @nogcCreates a grayscale color value.