CRM64Pro GDK v0.18.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches

Description

GUI Manager for panels, consoles and debug windows [v26.05.0].

Overview

The GUI module provides the engine-managed runtime GUI layer through the GUI Manager. It handles three object families: Panels (widget containers), Consoles (interactive command-line overlays) and Debug Windows (runtime variable monitors). Panels can optionally arrange their child widgets using horizontal or vertical flow layout while preserving their behavioral type (modeless, modal or ephemeral). GUI objects are attached to screens, support multi-screen configurations, and can be saved and loaded through the CDC GUI format. Widget lifecycle is split into visibility (show() / hide()) and interactivity (enable() / disable()), so controls can remain visible while disabled.
See Widget module for skin properties, feature flags, callbacks, state machine and update protocol.

Key features

  • Panel system: Widget containers with modeless, modal and ephemeral (TTL) behavior
  • Panel flow layouts: Optional horizontal and vertical flow layout with configurable spacing, padding, justify and alignment
  • Console: In-game command-line interface with history, built-in commands and TAB auto-complete
  • Debug window: Runtime watch windows for Sint32 and float variables with configurable refresh interval
  • Widget set: Label, Image, Frame, Button, CheckBox, Progress, Slider, TextEdit, NumberEdit, List, ComboBox
  • Theming: Built-in Default, Dark and Flat themes; custom themes created at runtime via createTheme()
  • Tooltips: Delayed hover tooltips with fade-in, per-widget TTL, cursor-follow and themed visuals
  • Multi-screen routing: GUI objects attach to specific screens; events are filtered by windowID
  • Separated widget lifecycle: Visibility and enabled state are managed independently
  • Inspection and persistence: Enumerate widgets, inspect metadata, save and load GUI state through CDC

GUI object types

PanelContainer for widgets. Supports modeless, modal and time-to-live (TTL) ephemeral behavior. Panels are ref-counted: loading a panel whose name already exists returns the existing panel and increments its reference count. Optional flow layout for automatic child arrangement.
ConsoleCommand-line interface with prompt, UTF-8 cursor navigation, command history, TAB auto-complete and custom command registration. Captures SDL text input focus while allowing other GUI interactions. Read-only mode available.
DebugWindowVariable watch window for monitoring Sint32* and float* pointers in real-time. Configurable refresh interval. add/removeWatch fail gracefully when the window is disabled.

Render order

Render pass order, from bottom to top:

1. PanelsRendered back-to-front by focus vector (vPanelID). Open ComboBox popups are rendered in a second panel pass above normal panel widgets.
2. TooltipManager-owned overlay drawn above panels but below DebugWindows and Consoles. Uses the active theme shared tooltip style, optionally overridden per widget.
3. DebugWindowsRendered on top of panels and tooltips. Drag-drop capable.
4. ConsolesAlways on top of panels, tooltips and debug windows.

Update priority

Input/update priority is processed from topmost interactive overlays down to panels:

1. DebugWindowsChecked first so overlay activity can block drag/drop and lower GUI layers.
2. ConsolesChecked before panels so text input focus and overlay activity can prevent panel interaction underneath.
3. PanelsFront panel receives events first. Modal panels can block lower panels.
4. Tooltip StateResolved after object updates so tooltip ownership uses the final hover/focus state for the frame.

Panel flow layout

Panels can automatically arrange their child widgets using a one-dimensional flow layout. The layout is selected via setLayout() and configured with setLayoutSpacing(), setLayoutPadding(), setLayoutJustify() and setLayoutAlign(). The layout re-runs (reflow()) whenever the internal dirty flag is raised: on widget creation, widget removal, widget resize, widget show/hide, panel show, and explicit invalidateLayout() calls. Widget positions under a flow layout are set by calling Widget::setPosition() with absolute pixel coordinates computed by the reflow pass.

PL_NONENo layout. Widgets are positioned manually. Default.
PL_HFLOWHorizontal flow. Widgets are placed left-to-right. Main axis is X, cross axis is Y.
PL_VFLOWVertical flow. Widgets are placed top-to-bottom. Main axis is Y, cross axis is X.


Layout justify options (eLayoutJustify) - main axis distribution

LJ_STARTWidgets packed to the start of the main axis (after padding). Default.
LJ_CENTERWidgets centered along the main axis. If total widget size exceeds the inner dimension the cursor may go negative; widgets are silently clamped by WF_ENCLOSE.
LJ_ENDWidgets packed to the end of the main axis. Same overflow clamp caveat as LJ_CENTER.
LJ_SPACESpacing is distributed evenly between widgets. With a single visible widget, spacing is the configured iLayoutSpacing value.


Layout align options (eLayoutAlign) - cross axis positioning

LA_STARTWidgets aligned to the start of the cross axis (after cross padding).
LA_CENTERWidgets centered along the cross axis. Default.
LA_ENDWidgets aligned to the end of the cross axis.
LA_STRETCHWidget cross-axis size is expanded to fill the available inner cross dimension. setSize() is called on each widget during reflow.
Note
Showing or hiding a widget automatically invalidates the parent panel layout. Use Panel::invalidateLayout() only for caller-controlled edge cases where no widget creation, removal, resize or visibility change occurs.

Console features

Command registrationaddCmdHandler() registers user commands with a name, help text and callback. The command name must be unique and cannot be "help".
Built-in commands'help', 'con', 'dw' and 'cur' are always available. Parameters for auto-complete are registered internally via setCmdParams().
Command historyUp/Down arrow keys recall and cycle previously executed commands.
TAB auto-completeSingle match: completes immediately. Multiple matches: prints list and expands to the common prefix. Repeated TAB cycles through matches.
Input focusCaptures SDL_EVENT_TEXT_INPUT, blocking it from reaching panels below. Read-only mode disables text input and command execution while keeping the console visible.
ClipboardCtrl+C copies the current prompt line. Ctrl+V pastes at the current cursor position.

DebugWindow features

Variable watchaddWatch() accepts a display name, an optional Sint32* and an optional float*. At least one pointer must be non-null. Watch names must be unique.
Refresh intervalsetRefreshInterval() configures the update period in milliseconds. Default is 500 ms. The timer is driven by an explicit init flag (bRefreshTimerInit) rather than a zero-sentinel to avoid edge cases at startup.
Named watchesEach watch has a display name shown before its values. Format: "name integer float" or "name integer" or "name float" depending on which pointers are set.
Disabled guardaddWatch() and removeWatch() return -1 immediately when the DebugWindow base widget is in GS_DISABLED state.

Manager types

PanelShared-name management: loading a CDC block whose panel name already exists returns the existing panel and increments its reference count. close() decrements the count and destroys the panel only when it reaches zero.
ConsoleStandard manager: names must be unique. The first console created (GUICONSOLE_SIGNATURE) is the default console and cannot be closed or disabled.
DebugWindowStandard manager: names must be unique.

Tooltip behavior

Tooltips are driven by widget text assigned through Widget::setTooltip(). The GUI manager shows them after GUI_TOOLTIP_DELAY_MS (1000 ms) of stable hover, with a fade-in over GUI_TOOLTIP_FADEIN_MS (500 ms). Tooltip visuals use the active theme's shared tooltip style, unless the hovered widget overrides tooltip background, border or font locally. The tooltip is positioned near the cursor with GUI_TOOLTIP_OFFSET_X / GUI_TOOLTIP_OFFSET_Y and clamped to the screen bounds. Per-widget TTL is read from Widget::getTooltipTTL(); the widget default is WIDGET_TOOLTIP_DEFAULT_TTL_MS = 0, meaning the tooltip stays visible while the hover is valid. GUI_TOOLTIP_TTL_MS is only the manager's bootstrap/fallback value used before a concrete widget owner is latched. After a tooltip expires, it will not show again for the same widget until the pointer leaves and re-hovers. Tooltip display is dismissed early by keyboard input, text input events, mouse button press or mouse wheel while a tooltip is visible. Mouse button release is intentionally ignored because the press already represents the user intent to dismiss.

Themes

GUI themes define procedural widget styling per widget type and widget state. Built-in themes are available immediately through GUIMgr::getThemeDefault(), GUIMgr::getThemeDark() and GUIMgr::getThemeFlat(). Theme resolution order for any skin property: widget override, then panel theme override, then global theme, then built-in Default theme. A typical workflow is:

GUIMgr& gui = Main::instance().guiMgr();
gui.setGlobalTheme(gui.getThemeDark());
Sint32 setGlobalTheme(Sint32 idTheme)
Set the active global theme.
Definition GUI.cpp:1685
GUIMgr & guiMgr()
Get reference to GUI Manager.
Definition CoreMain.cpp:1010
static Main & instance()
Access the Main singleton.
Definition CoreMain.cpp:453

To customize a theme:

Sint32 idTheme = gui.createTheme("MyTheme");
GUITheme* pTheme = gui.getTheme(idTheme);
if(pTheme)
{
pTheme->setSkinBackgroundColor(WT_BUTTON, WS_NORMAL, 32, 96, 160);
pTheme->setSkinFontName(WT_BUTTON, WS_NORMAL, "@c64/font/Arial12White");
}
@ WT_BUTTON
Standard button widget.
Definition CRM64Pro.h:5955
@ WS_NORMAL
Normal widget state.
Definition CRM64Pro.h:5941

Custom themes created via createTheme() are pre-filled from the Default theme. Theme entries are inspected through GUITheme::getSkin() and modified through the explicit GUITheme::setSkin...() methods. Built-in fonts should use the full "@c64/font/..." name in GUIThemeSkin::sFontName to avoid name collisions with user-loaded fonts. Theme font resolution first checks FontMgr::getBuiltin(), then FontMgr::get() by name.

Best practices

  • Use GUI objects from the main thread only; there is no internal synchronization
  • Set a global theme through GUIMgr::setGlobalTheme(), then override individual panels or widgets only when needed. This minimizes per-widget skin data in CDC files
  • Widget show()/hide(), creation, removal and resize automatically invalidate parent flow layouts; use Panel::invalidateLayout() only for caller-controlled edge cases
  • Use widget tooltips for hover help text and panel TTL (ephemeral panels) for temporary HUD notifications
  • Register custom console commands during initialization for in-game debugging; use addCmdHandler() with setCmdParams() to enable TAB auto-complete for your command parameters
  • Use DebugWindow during development to monitor critical game variables; remove or hide it in release builds
  • Attach GUI objects to the correct screen in multi-screen configurations; events are filtered by windowID and objects on a hidden screen receive the crafted focus-lost event
  • Access the manager exclusively through Main::guiMgr()
Note
The GUI Manager is a singleton, automatically created once Main is instantiated. You can get a reference to it using Main::guiMgr().
The GUI Manager is automatically released when Main::terminate() is called. Any resource still loaded at that point is released, avoiding leaks.

Classes

class  CRM64Pro::Panel
 Panel Object class. More...
class  CRM64Pro::Console
 Console Object class. More...
class  CRM64Pro::DebugWindow
 DebugWindow Object class. More...
class  CRM64Pro::GUIMgr
 GUI Manager class. More...

Macros

#define CRM64PRO_GUI_PANEL   0x42000000
#define CRM64PRO_GUI_CONSOLE   0x44000000
#define CRM64PRO_GUI_DEBUGWINDOW   0x48000000

Enumerations

enum  CRM64Pro::ePanelType : Sint32 { CRM64Pro::PT_MODELESS = 0 , CRM64Pro::PT_MODAL = 1 , CRM64Pro::PT_EPHEMERAL = 2 }
 Panel Type. More...
enum  CRM64Pro::ePanelSizeMode : Sint32 { CRM64Pro::PSM_MANUAL = 0 , CRM64Pro::PSM_SCREEN = 1 }
 Panel size mode. More...
enum  CRM64Pro::ePanelLayout : Uint32 { CRM64Pro::PL_NONE = 0 , CRM64Pro::PL_HFLOW = 1 , CRM64Pro::PL_VFLOW = 2 }
 Panel layout flags. More...
enum  CRM64Pro::eLayoutJustify : Sint32 { CRM64Pro::LJ_START = 0 , CRM64Pro::LJ_CENTER = 1 , CRM64Pro::LJ_END = 2 , CRM64Pro::LJ_SPACE = 3 }
 Flow layout distribution along the main axis. More...
enum  CRM64Pro::eLayoutAlign : Sint32 { CRM64Pro::LA_START = 0 , CRM64Pro::LA_CENTER = 1 , CRM64Pro::LA_END = 2 , CRM64Pro::LA_STRETCH = 3 }
 Flow layout alignment on the cross axis. More...

Functions

bool CRM64Pro::GUIMgr::info (Sint32 iMode=0) override
 Request GUI Manager information.
Sint32 CRM64Pro::GUIMgr::create (const string &sName, Uint32 iType=CRM64PRO_GUI_PANEL) override
 Creates a new GUI object.
Sint32 CRM64Pro::GUIMgr::close (Sint32 idGUI) override
 Close and destroy a GUI object.
Sint32 CRM64Pro::GUIMgr::getCount () const override
 Get number of loaded objects.
Sint32 CRM64Pro::GUIMgr::setName (Sint32 idGUI, const string &sName) override
 Change the object name.
PanelCRM64Pro::GUIMgr::getPanel (Sint32 idGUI)
 Get a pointer to a Panel using its handle.
Sint32 CRM64Pro::GUIMgr::getPanelFocus () const
 Get the focused GUI panel id.
Sint32 CRM64Pro::GUIMgr::setPanelFocus (Sint32 idGUI)
 Set the focus on the given GUI panel id.
Console * CRM64Pro::GUIMgr::getConsole (Sint32 idGUI=CRM64PRO_GUI_CONSOLE)
 Get a pointer to a Console using its handle.
DebugWindowCRM64Pro::GUIMgr::getDebugWindow (Sint32 idGUI)
 Get a pointer to a DebugWindow using its handle.
Sint32 CRM64Pro::GUIMgr::load (const string &sCDCFile, const string &sName)
 Load a panel and its widgets stored in a CDC file.
Sint32 CRM64Pro::GUIMgr::load (Sint32 idCDC, const string &sName)
 Load a panel and its widgets stored in a CDC file.
Sint32 CRM64Pro::GUIMgr::remove (Sint32 idCDC, const string &sName)
 Remove a panel and its widgets stored in a CDC file.
Sint32 CRM64Pro::GUIMgr::getIconInfo () const
 Get the built-in info icon.
Sint32 CRM64Pro::GUIMgr::getIconWarning () const
 Get the built-in warning icon.
Sint32 CRM64Pro::GUIMgr::getIconQuestion () const
 Get the built-in question icon.
Sint32 CRM64Pro::GUIMgr::getIconError () const
 Get the built-in error icon.
Sint32 CRM64Pro::GUIMgr::createTheme (const string &sName)
 Create a new custom theme initialized from the built-in Default theme.
GUIThemeCRM64Pro::GUIMgr::getTheme (Sint32 idTheme)
 Get a theme by id.
Sint32 CRM64Pro::GUIMgr::setGlobalTheme (Sint32 idTheme)
 Set the active global theme.
Sint32 CRM64Pro::GUIMgr::getGlobalTheme () const
 Get the active global theme id.
bool CRM64Pro::GUIMgr::closeTheme (Sint32 idTheme)
 Close and destroy a custom theme.
Sint32 CRM64Pro::GUIMgr::getThemeDefault () const
 Get the built-in Default theme id.
Sint32 CRM64Pro::GUIMgr::getThemeDark () const
 Get the built-in Dark theme id.
Sint32 CRM64Pro::GUIMgr::getThemeFlat () const
 Get the built-in Flat theme id.
bool CRM64Pro::Console::info (Sint32 iMode=0) override
 Request Console information.
const string & CRM64Pro::Console::getName () const override
 Get the name.
Sint32 CRM64Pro::Console::getID () const override
 Get the ID.
WidgetCRM64Pro::Console::baseWidget ()
 Get the reference to base Widget for this object.
Sint32 CRM64Pro::Console::attachTo (Sint32 idScreen)
 Attach this console to a screen.
Sint32 CRM64Pro::Console::getScreen () const
 Return the screen id where this console is attached to.
Sint32 CRM64Pro::Console::print (const char *format,...)
 Print a formatted message to the console.
Sint32 CRM64Pro::Console::vPrint (const char *format, va_list args)
 Print a formatted message to the console.
Sint32 CRM64Pro::Console::addCmdHandler (const string &sCommandName, const string &sCommandHelp, Sint32(*fnCmdHandler)(vector< string > *, Console *pCon))
 Add a new command handler to the console.
Sint32 CRM64Pro::Console::executeCmd (const string &sCmd)
 Execute a command on this console.
Sint32 CRM64Pro::Console::setReadOnly (bool bEnable=true)
 Enable or disable read-only mode for the console prompt.
bool CRM64Pro::Console::isReadOnly () const
 Check whether the console prompt is in read-only mode.
bool CRM64Pro::DebugWindow::info (Sint32 iMode=0) override
 Request DebugWindow information.
const string & CRM64Pro::DebugWindow::getName () const override
 Get the name.
Sint32 CRM64Pro::DebugWindow::getID () const override
 Get the ID.
WidgetCRM64Pro::DebugWindow::baseWidget ()
 Get the reference to base Widget for this object.
Sint32 CRM64Pro::DebugWindow::addWatch (const string &sName, Sint32 *iIntegerVar, float *fFloatVar=nullptr)
 Add a watch.
Sint32 CRM64Pro::DebugWindow::removeWatch (const string &sName)
 Remove a watch.
Sint32 CRM64Pro::DebugWindow::attachTo (Sint32 idScreen)
 Attach this debugwindow to a screen.
Sint32 CRM64Pro::DebugWindow::getScreen () const
 Return the screen id where this debugwindow is attached to.
Sint32 CRM64Pro::DebugWindow::setRefreshInterval (Sint32 iRefresh)
 Set the refresh interval.
Sint32 CRM64Pro::DebugWindow::getRefreshInterval () const
 Get the refresh interval.
bool CRM64Pro::Panel::info (Sint32 iMode=0) override
 Request Panel information.
const string & CRM64Pro::Panel::getName () const override
 Get the name.
Sint32 CRM64Pro::Panel::getID () const override
 Get the ID.
Widget & CRM64Pro::Panel::baseWidget ()
 Get the reference to base Widget for this object.
Sint32 CRM64Pro::Panel::setTitle (const string &sText, const Position &rPosX=Position(PH_CENTER), const Position &rPosY=Position(PH_CENTER))
 Set the panel title text.
Sint32 CRM64Pro::Panel::getTitle (string &sText) const
 Get the panel title text.
Sint32 CRM64Pro::Panel::attachTo (Sint32 idScreen)
 Attach this panel to a screen.
Sint32 CRM64Pro::Panel::setScreenDesired (Sint32 iScreenDesired)
 Set the desired screen index persisted for this panel.
Sint32 CRM64Pro::Panel::getScreen () const
 Return the screen id this panel is attached to.
Sint32 CRM64Pro::Panel::getScreenDesired () const
 Return the desired screen index persisted for this panel.
Sint32 CRM64Pro::Panel::setTheme (Sint32 idTheme)
 Set the panel theme.
Sint32 CRM64Pro::Panel::getTheme () const
 Get the panel theme.
Widget * CRM64Pro::Panel::createWidgetByType (const string &sName, eWidgetType eWT, Sint32 idWidget)
 Create a widget by runtime type.
eWidgetType CRM64Pro::Panel::getWidgetType (Sint32 idWidget) const
 Return the type of a widget using its ID.
Widget * CRM64Pro::Panel::getWidgetByID (Sint32 idWidget)
 Get a pointer to a Widget using its ID.
Sint32 CRM64Pro::Panel::setWidgetName (Sint32 idWidget, const string &sName)
 Rename an owned widget.
WidgetLabelCRM64Pro::Panel::createLabel (const string &sName, Sint32 idWidget)
 Create a Label widget and return its typed pointer.
WidgetImageCRM64Pro::Panel::createImage (const string &sName, Sint32 idWidget)
 Create an Image widget and return its typed pointer.
WidgetFrameCRM64Pro::Panel::createFrame (const string &sName, Sint32 idWidget)
 Create a Frame widget and return its typed pointer.
WidgetButtonCRM64Pro::Panel::createButton (const string &sName, Sint32 idWidget)
 Create a Button widget and return its typed pointer.
WidgetCheckBox * CRM64Pro::Panel::createCheckBox (const string &sName, Sint32 idWidget)
 Create a CheckBox widget and return its typed pointer.
WidgetProgressCRM64Pro::Panel::createProgress (const string &sName, Sint32 idWidget)
 Create a Progress widget and return its typed pointer.
WidgetSliderCRM64Pro::Panel::createSlider (const string &sName, Sint32 idWidget, eSliderAxis eAxis=SA_HORIZONTAL)
 Create a Slider widget and return its typed pointer.
WidgetTextEditCRM64Pro::Panel::createTextEdit (const string &sName, Sint32 idWidget)
 Create a TextEdit widget and return its typed pointer.
WidgetListCRM64Pro::Panel::createList (const string &sName, Sint32 idWidget)
 Create a List widget and return its typed pointer.
WidgetComboBox * CRM64Pro::Panel::createComboBox (const string &sName, Sint32 idWidget)
 Create a ComboBox widget and return its typed pointer.
WidgetNumberEditCRM64Pro::Panel::createNumberEdit (const string &sName, Sint32 idWidget)
 Create a NumberEdit widget and return its typed pointer.
WidgetLabelCRM64Pro::Panel::getLabel (Sint32 idWidget)
 Get a typed Label widget using its ID.
WidgetImageCRM64Pro::Panel::getImage (Sint32 idWidget)
 Get a typed Image widget using its ID.
WidgetFrameCRM64Pro::Panel::getFrame (Sint32 idWidget)
 Get a typed Frame widget using its ID.
WidgetButtonCRM64Pro::Panel::getButton (Sint32 idWidget)
 Get a typed Button widget using its ID.
WidgetCheckBox * CRM64Pro::Panel::getCheckBox (Sint32 idWidget)
 Get a typed CheckBox widget using its ID.
WidgetProgressCRM64Pro::Panel::getProgress (Sint32 idWidget)
 Get a typed Progress widget using its ID.
WidgetSliderCRM64Pro::Panel::getSlider (Sint32 idWidget)
 Get a typed Slider widget using its ID.
WidgetTextEditCRM64Pro::Panel::getTextEdit (Sint32 idWidget)
 Get a typed TextEdit widget using its ID.
WidgetListCRM64Pro::Panel::getList (Sint32 idWidget)
 Get a typed List widget using its ID.
WidgetComboBox * CRM64Pro::Panel::getComboBox (Sint32 idWidget)
 Get a typed ComboBox widget using its ID.
WidgetNumberEditCRM64Pro::Panel::getNumberEdit (Sint32 idWidget)
 Get a typed NumberEdit widget using its ID.
void CRM64Pro::Panel::getWidgetInfoList (vector< WidgetInfo > &vOut) const
 Fill widget metadata of this panel.
Sint32 CRM64Pro::Panel::closeWidget (Sint32 idWidget)
 Close and destroy a Widget.
Sint32 CRM64Pro::Panel::setPanelType (ePanelType ePT, Sint32 iTime=0)
 Set the panel type.
ePanelType CRM64Pro::Panel::getPanelType () const
 Get the panel type.
Sint32 CRM64Pro::Panel::getPanelTTL () const
 Get the panel time to live.
Sint32 CRM64Pro::Panel::setSizeMode (ePanelSizeMode ePSM)
 Set the panel size mode.
ePanelSizeMode CRM64Pro::Panel::getSizeMode () const
 Get the panel size mode.
Sint32 CRM64Pro::Panel::setLayout (ePanelLayout ePL)
 Set the panel child layout mode.
ePanelLayout CRM64Pro::Panel::getLayout () const
 Get the panel child layout mode.
Sint32 CRM64Pro::Panel::setLayoutSpacing (Sint32 iSpacing)
 Set spacing between child widgets in flow layouts.
Sint32 CRM64Pro::Panel::getLayoutSpacing () const
 Get spacing between child widgets in flow layouts.
Sint32 CRM64Pro::Panel::setLayoutPadding (Sint32 iTop, Sint32 iRight, Sint32 iBottom, Sint32 iLeft)
 Set padding inside the panel base widget for flow layouts.
Sint32 CRM64Pro::Panel::getLayoutPadding (Sint32 *iTop, Sint32 *iRight, Sint32 *iBottom, Sint32 *iLeft) const
 Get padding inside the panel base widget for flow layouts.
Sint32 CRM64Pro::Panel::setLayoutJustify (eLayoutJustify eJustify)
 Set flow-layout distribution along the main axis.
eLayoutJustify CRM64Pro::Panel::getLayoutJustify () const
 Get flow-layout distribution along the main axis.
Sint32 CRM64Pro::Panel::setLayoutAlign (eLayoutAlign eAlign)
 Set flow-layout alignment along the cross axis.
eLayoutAlign CRM64Pro::Panel::getLayoutAlign () const
 Get flow-layout alignment along the cross axis.
void CRM64Pro::Panel::invalidateLayout ()
 Mark the flow layout dirty so child positions are recomputed on the next update/render pass.
Sint32 CRM64Pro::Panel::save (const string &sCDCFile)
 Save the panel and all its widgets to a CDC file.
Sint32 CRM64Pro::Panel::save (Sint32 idCDC)
 Save the panel and all its widgets to a CDC file.

Macro Definition Documentation

◆ CRM64PRO_GUI_PANEL

#define CRM64PRO_GUI_PANEL   0x42000000

GUI object: Panel.

◆ CRM64PRO_GUI_CONSOLE

#define CRM64PRO_GUI_CONSOLE   0x44000000

GUI object: Console.

◆ CRM64PRO_GUI_DEBUGWINDOW

#define CRM64PRO_GUI_DEBUGWINDOW   0x48000000

GUI object: DebugWindow.

Enumeration Type Documentation

◆ ePanelType

enum CRM64Pro::ePanelType : Sint32

Panel Type.

Enumerator
PT_MODELESS 

Modeless panel. When it gets the focus, it does not block the input for others panels.

PT_MODAL 

Modal panel. When it gets the focus, it blocks the input for others panels on the same screen.

PT_EPHEMERAL 

Ephemeral and modeless panel. Its lasts the given time duration.

◆ ePanelSizeMode

enum CRM64Pro::ePanelSizeMode : Sint32

Panel size mode.

Enumerator
PSM_MANUAL 

Panel uses its stored base widget size.

PSM_SCREEN 

Panel base widget size tracks the attached screen size at runtime.

◆ ePanelLayout

enum CRM64Pro::ePanelLayout : Uint32

Panel layout flags.

Enumerator
PL_NONE 

Manual widgets positioning.

PL_HFLOW 

Arrange widgets left to right.

PL_VFLOW 

Arrange widgets top to bottom.

◆ eLayoutJustify

enum CRM64Pro::eLayoutJustify : Sint32

Flow layout distribution along the main axis.

Enumerator
LJ_START 

Widgets are packed at the start of the main axis.

LJ_CENTER 

Widgets are centered along the main axis.

LJ_END 

Widgets are packed at the end of the main axis.

LJ_SPACE 

Remaining main-axis space is distributed between widgets.

◆ eLayoutAlign

enum CRM64Pro::eLayoutAlign : Sint32

Flow layout alignment on the cross axis.

Enumerator
LA_START 

Widgets are aligned at the start of the cross axis.

LA_CENTER 

Widgets are centered along the cross axis.

LA_END 

Widgets are aligned at the end of the cross axis.

LA_STRETCH 

Widgets are stretched across the cross axis.

Function Documentation

◆ info() [1/4]

bool CRM64Pro::GUIMgr::info ( Sint32 iMode = 0)
override

Request GUI Manager information.

Writes information to the default log.

Parameters
iMode-1 to display only manager information. 0 (default) to display manager and all GUI objects. A specific GUI ID displays manager information and only that GUI object.
Returns
true on success, or false on failure.

◆ create()

Sint32 CRM64Pro::GUIMgr::create ( const string & sName,
Uint32 iType = CRM64PRO_GUI_PANEL )
override

Creates a new GUI object.

Parameters
sNameThe name for the GUI object (e.g. 'demoPanel'). Must be unique and shorter than 64 characters.
iTypeGUI object type (CRM64PRO_GUI_PANEL, CRM64PRO_GUI_CONSOLE or CRM64PRO_GUI_DEBUGWINDOW) OR'ed with version (10 = v1.0, only version supported). Default is CRM64PRO_GUI_PANEL with v1.0.
Returns
Greater than 0 on success (the GUI id), or a negative error code on failure.
Note
All GUI objects are attached to the default screen by default but can be changed via attachTo() methods. Created objects have baseWidget enabled but hidden (::GS_HIDDEN).

◆ close()

Sint32 CRM64Pro::GUIMgr::close ( Sint32 idGUI)
override

Close and destroy a GUI object.

Parameters
idGUI0 for closing all GUI objects or a specific GUI id. The default console cannot be removed. Shared Panel ids are not removed until the last owner calls this method.
Returns
0 on success, or a negative error code on failure.
Note
Unclosed objects are automatically closed when the GDK terminates.

◆ getCount()

Sint32 CRM64Pro::GUIMgr::getCount ( ) const
override

Get number of loaded objects.

Returns
The number of GUI objects.

◆ setName()

Sint32 CRM64Pro::GUIMgr::setName ( Sint32 idGUI,
const string & sName )
override

Change the object name.

Parameters
idGUIGUI id. Can be a Panel, Console or DebugWindow.
sNameObject name, e.g. 'demoPanel'. Must be unique and shorter than 64 characters.
Returns
0 on success, or a negative error code on failure.

◆ getPanel()

Panel * CRM64Pro::GUIMgr::getPanel ( Sint32 idGUI)

Get a pointer to a Panel using its handle.

Parameters
idGUIPanel GUI id.
Returns
Borrowed pointer to the Panel object, or nullptr if not found.
Note
The returned pointer must not be deleted. It remains valid until the Panel is closed or GUIMgr is reset or terminated.

◆ getPanelFocus()

Sint32 CRM64Pro::GUIMgr::getPanelFocus ( ) const

Get the focused GUI panel id.

Returns
Greater than 0 on success (the GUI panel id), or a negative error code on failure.

◆ setPanelFocus()

Sint32 CRM64Pro::GUIMgr::setPanelFocus ( Sint32 idGUI)

Set the focus on the given GUI panel id.

Parameters
idGUIThe GUI panel id. In order to get the focus, the panel must be shown.
Returns
0 on success, or a negative error code on failure.

◆ getConsole()

Console * CRM64Pro::GUIMgr::getConsole ( Sint32 idGUI = CRM64PRO_GUI_CONSOLE)

Get a pointer to a Console using its handle.

By default it returns the default console.

Parameters
idGUIConsole GUI id. With CRM64PRO_GUI_CONSOLE (default value), it returns the default console.
Returns
Borrowed pointer to the Console object, or nullptr if not found.
Note
The returned pointer must not be deleted. It remains valid until the Console is closed or GUIMgr is reset or terminated.

◆ getDebugWindow()

DebugWindow * CRM64Pro::GUIMgr::getDebugWindow ( Sint32 idGUI)

Get a pointer to a DebugWindow using its handle.

Parameters
idGUIDebugWindow GUI id.
Returns
Borrowed pointer to the DebugWindow object, or nullptr if not found.
Note
The returned pointer must not be deleted. It remains valid until the DebugWindow is closed or GUIMgr is reset or terminated.

◆ load() [1/2]

Sint32 CRM64Pro::GUIMgr::load ( const string & sCDCFile,
const string & sName )

Load a panel and its widgets stored in a CDC file.

The GUI Manager can share Panel ids based on name, checking if already loaded before creating new ones.

Parameters
sCDCFilestring containing [directory]+filename. Directory separators '\' and '/' are supported.
sNamestring with the panel name (shorter than 64 characters).
Note
If the stored desired screen is not currently available, the loaded panel is attached to the default screen.
Stored child widget entries are expected in the PanelName/WidgetName format used by panel save.
Returns
Greater than 0 on success (the Panel id), or a negative error code on failure.

◆ load() [2/2]

Sint32 CRM64Pro::GUIMgr::load ( Sint32 idCDC,
const string & sName )

Load a panel and its widgets stored in a CDC file.

The GUI Manager shares Panel IDs by name. Before loading a panel, the manager checks whether it is already loaded and shares the existing instance.

Parameters
idCDCCDC id.
sNamestring with the panel name (shorter than 64 characters).
Note
Stored child widget entries are expected in the PanelName/WidgetName format used by panel save.
Returns
Greater than 0 on success (the Panel id), or a negative error code on failure.

◆ remove()

Sint32 CRM64Pro::GUIMgr::remove ( Sint32 idCDC,
const string & sName )

Remove a panel and its widgets stored in a CDC file.

Parameters
idCDCCDC id.
sNamestring with the panel name (shorter than 64 characters).
Returns
0 on success, or a negative error code on failure.
Note
This permanently removes the panel block and all associated widget blocks from the archive.

◆ getIconInfo()

Sint32 CRM64Pro::GUIMgr::getIconInfo ( ) const

Get the built-in info icon.

Returns
Greater than 0 on success (the Image id), or a negative error code on failure.

◆ getIconWarning()

Sint32 CRM64Pro::GUIMgr::getIconWarning ( ) const

Get the built-in warning icon.

Returns
Greater than 0 on success (the Image id), or a negative error code on failure.

◆ getIconQuestion()

Sint32 CRM64Pro::GUIMgr::getIconQuestion ( ) const

Get the built-in question icon.

Returns
Greater than 0 on success (the Image id), or a negative error code on failure.

◆ getIconError()

Sint32 CRM64Pro::GUIMgr::getIconError ( ) const

Get the built-in error icon.

Returns
Greater than 0 on success (the Image id), or a negative error code on failure.

◆ createTheme()

Sint32 CRM64Pro::GUIMgr::createTheme ( const string & sName)

Create a new custom theme initialized from the built-in Default theme.

Parameters
sNameTheme name. Must be unique and shorter than 64 characters.
Returns
Greater than 0 on success (the Theme id), or a negative error code on failure.

◆ getTheme() [1/2]

GUITheme * CRM64Pro::GUIMgr::getTheme ( Sint32 idTheme)

Get a theme by id.

Parameters
idThemeTheme id.
Returns
Borrowed pointer to the theme, or nullptr if not found.
Note
The returned pointer must not be deleted. It remains valid until the theme is destroyed or GUIMgr is reset or terminated.

◆ setGlobalTheme()

Sint32 CRM64Pro::GUIMgr::setGlobalTheme ( Sint32 idTheme)

Set the active global theme.

Parameters
idThemeTheme id. Use -1 to restore the built-in Default theme.
Returns
0 on success, or a negative error code on failure.
GUIMgr& gui = Main::instance().guiMgr();
Sint32 getThemeDark() const
Get the built-in Dark theme id.
Definition GUI.cpp:1733

◆ getGlobalTheme()

Sint32 CRM64Pro::GUIMgr::getGlobalTheme ( ) const

Get the active global theme id.

Returns
The current global theme id.

◆ closeTheme()

bool CRM64Pro::GUIMgr::closeTheme ( Sint32 idTheme)

Close and destroy a custom theme.

Parameters
idThemeTheme id.
Returns
true on success, or false when nothing changed.
Note
Built-in themes cannot be closed.

◆ getThemeDefault()

Sint32 CRM64Pro::GUIMgr::getThemeDefault ( ) const

Get the built-in Default theme id.

Returns
The built-in Default theme id.

◆ getThemeDark()

Sint32 CRM64Pro::GUIMgr::getThemeDark ( ) const

Get the built-in Dark theme id.

Returns
The built-in Dark theme id.

◆ getThemeFlat()

Sint32 CRM64Pro::GUIMgr::getThemeFlat ( ) const

Get the built-in Flat theme id.

Returns
The built-in Flat theme id.

◆ info() [2/4]

bool CRM64Pro::Console::info ( Sint32 iMode = 0)
override

Request Console information.

Writes information to the default log.

Parameters
iModecurrently ignored. The method always prints full console information, including the command list and base widget state.
Returns
true on success, or false on failure.

◆ getName() [1/3]

const string & CRM64Pro::Console::getName ( ) const
override

Get the name.

Returns
The object name.

◆ getID() [1/3]

Sint32 CRM64Pro::Console::getID ( ) const
override

Get the ID.

Returns
Object ID.

◆ baseWidget() [1/3]

Widget & CRM64Pro::Console::baseWidget ( )

Get the reference to base Widget for this object.

Returns
a reference to the base Widget.

◆ attachTo() [1/3]

Sint32 CRM64Pro::Console::attachTo ( Sint32 idScreen)

Attach this console to a screen.

Parameters
idScreena valid screen handle. Default is the default screen (0).
Returns
0 on success, or a negative error code on failure.

◆ getScreen() [1/3]

Sint32 CRM64Pro::Console::getScreen ( ) const

Return the screen id where this console is attached to.

Returns
the screen id.

◆ print()

Sint32 CRM64Pro::Console::print ( const char * format,
... )

Print a formatted message to the console.

Parameters
formatformat control, same as printf() function.
...optional arguments, same as printf() function.
Returns
0 on success, or a negative error code on failure.
Note
If the baseWidget is disabled (::GS_DISABLED), this method does nothing.

◆ vPrint()

Sint32 CRM64Pro::Console::vPrint ( const char * format,
va_list args )

Print a formatted message to the console.

Parameters
formatformat control, same as printf() function.
argspointer to list of arguments, same as vprintf() function.
Returns
0 on success, or a negative error code on failure.
Note
If the baseWidget is disabled (::GS_DISABLED), this method does nothing.

◆ addCmdHandler()

Sint32 CRM64Pro::Console::addCmdHandler ( const string & sCommandName,
const string & sCommandHelp,
Sint32(* fnCmdHandler )(vector< string > *, Console *pCon) )

Add a new command handler to the console.

Parameters
sCommandNamestring with the command name (must be unique). Reserved commands: 'con' (Console control), 'dw' (Debug Window control), 'help' (List all commands).
sCommandHelpstring with a brief command description.
fnCmdHandlerPointer to the command callback. The vector<string>* parameter contains the tokenized command and Console* is the calling console. Must return 0 on success or a negative error code on failure.
Returns
0 on success, or a negative error code on failure.

◆ executeCmd()

Sint32 CRM64Pro::Console::executeCmd ( const string & sCmd)

Execute a command on this console.

Parameters
sCmdstring with the command plus arguments to be executed by this console.
Returns
0 on success, or a negative error code on failure.
Note
If the baseWidget is disabled (::GS_DISABLED), this method does nothing.

◆ setReadOnly()

Sint32 CRM64Pro::Console::setReadOnly ( bool bEnable = true)

Enable or disable read-only mode for the console prompt.

In read-only mode the console remains visible and can still print output, but prompt editing and command execution are blocked.

Parameters
bEnabletrue to enable read-only mode, false to allow prompt input again.
Returns
0 on success, or a negative error code on failure.

◆ isReadOnly()

bool CRM64Pro::Console::isReadOnly ( ) const

Check whether the console prompt is in read-only mode.

Returns
true when the console prompt is read-only, or false otherwise.

◆ info() [3/4]

bool CRM64Pro::DebugWindow::info ( Sint32 iMode = 0)
override

Request DebugWindow information.

Writes information to the default log.

Parameters
iModecurrently ignored. The method always prints full debug-window information, including watch count, refresh interval and base widget state.
Returns
true on success, or false on failure.

◆ getName() [2/3]

const string & CRM64Pro::DebugWindow::getName ( ) const
override

Get the name.

Returns
The object name.

◆ getID() [2/3]

Sint32 CRM64Pro::DebugWindow::getID ( ) const
override

Get the ID.

Returns
Object ID.

◆ baseWidget() [2/3]

Widget & CRM64Pro::DebugWindow::baseWidget ( )

Get the reference to base Widget for this object.

Returns
a reference to the base Widget.

◆ addWatch()

Sint32 CRM64Pro::DebugWindow::addWatch ( const string & sName,
Sint32 * iIntegerVar,
float * fFloatVar = nullptr )

Add a watch.

Parameters
sNamewatch name. Must be unique.
iIntegerVarPointer to an integer variable associated with this watch. Pass nullptr to leave this value unbound.
fFloatVarPointer to a float variable associated with this watch. Pass nullptr to leave this value unbound.
Returns
0 on success, or a negative error code on failure.
Note
If the baseWidget is disabled (::GS_DISABLED), this method does nothing.
Watched pointers are stored as raw pointers and dereferenced during refresh. The caller must guarantee that the pointed storage remains valid for the lifetime of the watch, or until removeWatch() is called.

◆ removeWatch()

Sint32 CRM64Pro::DebugWindow::removeWatch ( const string & sName)

Remove a watch.

Parameters
sNamewatch name.
Returns
0 on success, or a negative error code on failure.
Note
If the baseWidget is disabled (::GS_DISABLED), this method does nothing.

◆ attachTo() [2/3]

Sint32 CRM64Pro::DebugWindow::attachTo ( Sint32 idScreen)

Attach this debugwindow to a screen.

Parameters
idScreena valid screen handle. Default is the default screen (0).
Returns
0 on success, or a negative error code on failure.

◆ getScreen() [2/3]

Sint32 CRM64Pro::DebugWindow::getScreen ( ) const

Return the screen id where this debugwindow is attached to.

Returns
the screen id.

◆ setRefreshInterval()

Sint32 CRM64Pro::DebugWindow::setRefreshInterval ( Sint32 iRefresh)

Set the refresh interval.

Parameters
iRefreshtime interval in milliseconds for refreshing the value of the watches. By default it is set to 500ms.
Returns
0 on success, or a negative error code on failure.

◆ getRefreshInterval()

Sint32 CRM64Pro::DebugWindow::getRefreshInterval ( ) const

Get the refresh interval.

Returns
The refresh interval on success, or a negative error code on failure.

◆ info() [4/4]

bool CRM64Pro::Panel::info ( Sint32 iMode = 0)
override

Request Panel information.

Writes information to the default log.

Parameters
iModecurrently ignored. The method always prints full panel information, including the base widget and all owned widgets.
Returns
true on success, or false on failure.

◆ getName() [3/3]

const string & CRM64Pro::Panel::getName ( ) const
override

Get the name.

Returns
The object name.

◆ getID() [3/3]

Sint32 CRM64Pro::Panel::getID ( ) const
override

Get the ID.

Returns
Object ID.

◆ baseWidget() [3/3]

Widget & CRM64Pro::Panel::baseWidget ( )

Get the reference to base Widget for this object.

Returns
a reference to the base Widget.
Note
Use setTitle()/getTitle() for panel title text instead of writing text through the returned Widget directly.

◆ setTitle()

Sint32 CRM64Pro::Panel::setTitle ( const string & sText,
const Position & rPosX = Position(PH_CENTER),
const Position & rPosY = Position(PH_CENTER) )

Set the panel title text.

Parameters
sTextTitle text to show in the base widget.
rPosXTitle X position. Default is PH_CENTER.
rPosYTitle Y position. Default is PH_CENTER.
Returns
0 on success, or a negative error code on failure.

◆ getTitle()

Sint32 CRM64Pro::Panel::getTitle ( string & sText) const

Get the panel title text.

Parameters
sTextString reference receiving the current title.
Returns
0 on success, or a negative error code on failure.

◆ attachTo() [3/3]

Sint32 CRM64Pro::Panel::attachTo ( Sint32 idScreen)

Attach this panel to a screen.

Parameters
idScreena valid screen handle. Default is the default screen (0).
Returns
0 on success, or a negative error code on failure.

◆ setScreenDesired()

Sint32 CRM64Pro::Panel::setScreenDesired ( Sint32 iScreenDesired)

Set the desired screen index persisted for this panel.

Parameters
iScreenDesireddesired screen index. Values below 0 are clamped to 0.
Returns
0 on success, or a negative error code on failure.

◆ getScreen() [3/3]

Sint32 CRM64Pro::Panel::getScreen ( ) const

Return the screen id this panel is attached to.

Returns
the screen id.

◆ getScreenDesired()

Sint32 CRM64Pro::Panel::getScreenDesired ( ) const

Return the desired screen index persisted for this panel.

Returns
the desired screen index.

◆ setTheme()

Sint32 CRM64Pro::Panel::setTheme ( Sint32 idTheme)

Set the panel theme.

Parameters
idThemeTheme id managed by GUIMgr. Use 0 to clear the panel override and fall back to the global theme.
Returns
0 on success, or a negative error code on failure.
Panel* pPanel = Main::instance().guiMgr().getPanel(idPanel);
if(pPanel)
{
pPanel->setTheme(Main::instance().guiMgr().getThemeFlat());
}
Panel * getPanel(Sint32 idGUI)
Get a pointer to a Panel using its handle.
Definition GUI.cpp:1291
Sint32 setTheme(Sint32 idTheme)
Set the panel theme.
Definition GUIPanel.cpp:908

◆ getTheme() [2/2]

Sint32 CRM64Pro::Panel::getTheme ( ) const

Get the panel theme.

Returns
Panel theme id, or 0 when the panel uses the global theme.

◆ createWidgetByType()

Widget * CRM64Pro::Panel::createWidgetByType ( const string & sName,
eWidgetType eWT,
Sint32 idWidget )

Create a widget by runtime type.

Parameters
sNameThe short runtime widget name. Must be unique inside the panel.
eWTWidget type. Check ::eWidgetType enum for further information.
idWidgetUnique Widget ID.
Returns
Borrowed pointer to the created Widget object on success, or nullptr on failure.
Note
This is the dynamic creation entry point intended for editor/import/runtime-driven code. For normal usage, prefer the typed creators such as createButton(), createTextEdit() or createList(). Different widget versions may exist but creation always uses the newest. Created widgets are enabled but hidden (GS_HIDDEN).
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.
The maximum allowed widget-name length depends on the current panel name because child widgets are persisted internally as PanelName/WidgetName inside CDC archives.

◆ getWidgetType()

eWidgetType CRM64Pro::Panel::getWidgetType ( Sint32 idWidget) const

Return the type of a widget using its ID.

Parameters
idWidgetWidget id.
Returns
The widget type, or WT_BASE if the widget was not found.

◆ getWidgetByID()

Widget * CRM64Pro::Panel::getWidgetByID ( Sint32 idWidget)

Get a pointer to a Widget using its ID.

Parameters
idWidgetWidget id.
Returns
Borrowed pointer to the Widget object, or nullptr if not found.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.
This is the dynamic lookup entry point intended for editor/import/runtime-driven code. For normal usage, prefer the typed getters such as getButton(), getTextEdit() or getList().

◆ setWidgetName()

Sint32 CRM64Pro::Panel::setWidgetName ( Sint32 idWidget,
const string & sName )

Rename an owned widget.

Parameters
idWidgetWidget id. The base widget (0) is not handled by this method.
sNameNew short runtime widget name. Must be unique inside this panel.
Returns
0 on success, or a negative error code on failure.
Note
Use panel renaming for the base widget. This method only renames child widgets owned by the panel.
The maximum allowed widget-name length depends on the current panel name because child widgets are persisted internally as PanelName/WidgetName inside CDC archives.

◆ createLabel()

WidgetLabel * CRM64Pro::Panel::createLabel ( const string & sName,
Sint32 idWidget )

Create a Label widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
Returns
Borrowed pointer to the created Label widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ createImage()

WidgetImage * CRM64Pro::Panel::createImage ( const string & sName,
Sint32 idWidget )

Create an Image widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
Returns
Borrowed pointer to the created Image widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ createFrame()

WidgetFrame * CRM64Pro::Panel::createFrame ( const string & sName,
Sint32 idWidget )

Create a Frame widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
Returns
Borrowed pointer to the created Frame widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ createButton()

WidgetButton * CRM64Pro::Panel::createButton ( const string & sName,
Sint32 idWidget )

Create a Button widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
Returns
Borrowed pointer to the created Button widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ createCheckBox()

WidgetCheckBox * CRM64Pro::Panel::createCheckBox ( const string & sName,
Sint32 idWidget )

Create a CheckBox widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
Returns
Borrowed pointer to the created CheckBox widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ createProgress()

WidgetProgress * CRM64Pro::Panel::createProgress ( const string & sName,
Sint32 idWidget )

Create a Progress widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
Returns
Borrowed pointer to the created Progress widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ createSlider()

WidgetSlider * CRM64Pro::Panel::createSlider ( const string & sName,
Sint32 idWidget,
eSliderAxis eAxis = SA_HORIZONTAL )

Create a Slider widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
eAxisSlider axis. Horizontal by default.
Returns
Borrowed pointer to the created Slider widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ createTextEdit()

WidgetTextEdit * CRM64Pro::Panel::createTextEdit ( const string & sName,
Sint32 idWidget )

Create a TextEdit widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
Returns
Borrowed pointer to the created TextEdit widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ createList()

WidgetList * CRM64Pro::Panel::createList ( const string & sName,
Sint32 idWidget )

Create a List widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
Returns
Borrowed pointer to the created List widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ createComboBox()

WidgetComboBox * CRM64Pro::Panel::createComboBox ( const string & sName,
Sint32 idWidget )

Create a ComboBox widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
Returns
Borrowed pointer to the created ComboBox widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ createNumberEdit()

WidgetNumberEdit * CRM64Pro::Panel::createNumberEdit ( const string & sName,
Sint32 idWidget )

Create a NumberEdit widget and return its typed pointer.

Parameters
sNameWidget name.
idWidgetWidget unique id.
Returns
Borrowed pointer to the created NumberEdit widget on success, or nullptr on failure.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getLabel()

WidgetLabel * CRM64Pro::Panel::getLabel ( Sint32 idWidget)

Get a typed Label widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the Label widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getImage()

WidgetImage * CRM64Pro::Panel::getImage ( Sint32 idWidget)

Get a typed Image widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the Image widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getFrame()

WidgetFrame * CRM64Pro::Panel::getFrame ( Sint32 idWidget)

Get a typed Frame widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the Frame widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getButton()

WidgetButton * CRM64Pro::Panel::getButton ( Sint32 idWidget)

Get a typed Button widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the Button widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getCheckBox()

WidgetCheckBox * CRM64Pro::Panel::getCheckBox ( Sint32 idWidget)

Get a typed CheckBox widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the CheckBox widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getProgress()

WidgetProgress * CRM64Pro::Panel::getProgress ( Sint32 idWidget)

Get a typed Progress widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the Progress widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getSlider()

WidgetSlider * CRM64Pro::Panel::getSlider ( Sint32 idWidget)

Get a typed Slider widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the Slider widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getTextEdit()

WidgetTextEdit * CRM64Pro::Panel::getTextEdit ( Sint32 idWidget)

Get a typed TextEdit widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the TextEdit widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getList()

WidgetList * CRM64Pro::Panel::getList ( Sint32 idWidget)

Get a typed List widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the List widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getComboBox()

WidgetComboBox * CRM64Pro::Panel::getComboBox ( Sint32 idWidget)

Get a typed ComboBox widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the ComboBox widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getNumberEdit()

WidgetNumberEdit * CRM64Pro::Panel::getNumberEdit ( Sint32 idWidget)

Get a typed NumberEdit widget using its ID.

Parameters
idWidgetWidget unique id.
Returns
Borrowed pointer to the NumberEdit widget, or nullptr if the widget was not found or has a different type.
Note
The returned widget is owned by this Panel. It must not be deleted. It remains valid until the widget or Panel is closed.

◆ getWidgetInfoList()

void CRM64Pro::Panel::getWidgetInfoList ( vector< WidgetInfo > & vOut) const

Fill widget metadata of this panel.

Parameters
vOutOutput vector receiving widget id, name and type for each widget currently owned by this panel. Existing contents are cleared before writing.
Note
This is the preferred inspection API when code only needs metadata and not direct widget access.

◆ closeWidget()

Sint32 CRM64Pro::Panel::closeWidget ( Sint32 idWidget)

Close and destroy a Widget.

Parameters
idWidget0 for closing all Widgets or the Widget id.
Returns
0 on success, or a negative error code on failure.
Note
If you forget to close a widget, it will be automatically closed once the panel is closed.

◆ setPanelType()

Sint32 CRM64Pro::Panel::setPanelType ( ePanelType ePT,
Sint32 iTime = 0 )

Set the panel type.

Parameters
ePTPanel type. Check ::ePanelType enum for further information.
iTimeTime to live (in milliseconds) for PT_EPHEMERAL panels. Minimum is 1000ms.
Returns
0 on success, or a negative error code on failure.
Note
Panel behavior type is independent from panel layout. Use setLayout() to enable automatic child arrangement.

◆ getPanelType()

ePanelType CRM64Pro::Panel::getPanelType ( ) const

Get the panel type.

Returns
Current panel type.

◆ getPanelTTL()

Sint32 CRM64Pro::Panel::getPanelTTL ( ) const

Get the panel time to live.

Returns
TTL in milliseconds for PT_EPHEMERAL panels, or 0 for other panel types.

◆ setSizeMode()

Sint32 CRM64Pro::Panel::setSizeMode ( ePanelSizeMode ePSM)

Set the panel size mode.

Parameters
ePSMSize mode. PSM_MANUAL keeps the stored base widget size. PSM_SCREEN tracks the attached screen size at runtime.
Returns
0 on success, or a negative error code on failure.
Note
Screen-sized panels preserve their manual size internally so they can switch back to manual mode without losing it.

◆ getSizeMode()

ePanelSizeMode CRM64Pro::Panel::getSizeMode ( ) const

Get the panel size mode.

Returns
Current size mode.

◆ setLayout()

Sint32 CRM64Pro::Panel::setLayout ( ePanelLayout ePL)

Set the panel child layout mode.

Parameters
ePLLayout flags. PL_NONE keeps manual child positioning. PL_HFLOW and PL_VFLOW are mutually exclusive.
Returns
0 on success, or a negative error code on failure.
Note
In flow layouts, child widget positions are owned by the panel and may be overwritten during update/render reflow.

◆ getLayout()

ePanelLayout CRM64Pro::Panel::getLayout ( ) const

Get the panel child layout mode.

Returns
Current panel layout flags.

◆ setLayoutSpacing()

Sint32 CRM64Pro::Panel::setLayoutSpacing ( Sint32 iSpacing)

Set spacing between child widgets in flow layouts.

Parameters
iSpacingSpacing in pixels between adjacent children. Negative values are clamped to 0.
Returns
0 on success, or a negative error code on failure.
Note
Returns an error when the panel layout is PL_NONE.

◆ getLayoutSpacing()

Sint32 CRM64Pro::Panel::getLayoutSpacing ( ) const

Get spacing between child widgets in flow layouts.

Returns
Spacing in pixels between adjacent children.

◆ setLayoutPadding()

Sint32 CRM64Pro::Panel::setLayoutPadding ( Sint32 iTop,
Sint32 iRight,
Sint32 iBottom,
Sint32 iLeft )

Set padding inside the panel base widget for flow layouts.

Parameters
iTopTop padding.
iRightRight padding.
iBottomBottom padding.
iLeftLeft padding.
Returns
0 on success, or a negative error code on failure.
Note
Returns an error when the panel layout is PL_NONE.

◆ getLayoutPadding()

Sint32 CRM64Pro::Panel::getLayoutPadding ( Sint32 * iTop,
Sint32 * iRight,
Sint32 * iBottom,
Sint32 * iLeft ) const

Get padding inside the panel base widget for flow layouts.

Parameters
iToppointer to receive top padding.
iRightpointer to receive right padding.
iBottompointer to receive bottom padding.
iLeftpointer to receive left padding.
Returns
0 on success, or a negative error code on failure.

◆ setLayoutJustify()

Sint32 CRM64Pro::Panel::setLayoutJustify ( eLayoutJustify eJustify)

Set flow-layout distribution along the main axis.

Parameters
eJustifyJustification mode.
Returns
0 on success, or a negative error code on failure.
Note
Returns an error when the panel layout is PL_NONE.

◆ getLayoutJustify()

eLayoutJustify CRM64Pro::Panel::getLayoutJustify ( ) const

Get flow-layout distribution along the main axis.

Returns
Current justification mode.

◆ setLayoutAlign()

Sint32 CRM64Pro::Panel::setLayoutAlign ( eLayoutAlign eAlign)

Set flow-layout alignment along the cross axis.

Parameters
eAlignAlignment mode.
Returns
0 on success, or a negative error code on failure.
Note
LA_STRETCH stores each child's non-stretched size so it can be restored when leaving stretch mode.
Calling Widget::setSize() manually while LA_STRETCH is active updates that stored restore size.
Returns an error when the panel layout is PL_NONE.

◆ getLayoutAlign()

eLayoutAlign CRM64Pro::Panel::getLayoutAlign ( ) const

Get flow-layout alignment along the cross axis.

Returns
Current alignment mode.

◆ invalidateLayout()

void CRM64Pro::Panel::invalidateLayout ( )

Mark the flow layout dirty so child positions are recomputed on the next update/render pass.

Automatic invalidation already happens for child show(), hide() and setSize() changes. This method is provided for edge cases where caller-controlled reflow is still desirable.

◆ save() [1/2]

Sint32 CRM64Pro::Panel::save ( const string & sCDCFile)

Save the panel and all its widgets to a CDC file.

Widgets images/sprites will also be saved to the same CDC file.

Parameters
sCDCFilestring containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported.
Returns
0 on success, or a negative error code on failure.
Note
Child widgets keep their short runtime names in memory, but are persisted internally as PanelName/WidgetName inside the CDC.
If the panel, widget or any associated image/sprite already exist, they will be overwritten.

◆ save() [2/2]

Sint32 CRM64Pro::Panel::save ( Sint32 idCDC)

Save the panel and all its widgets to a CDC file.

Widgets images/sprites will also be saved into the same CDC file.

Parameters
idCDCCDC id.
Returns
0 on success, or a negative error code on failure.
Note
Child widgets keep their short runtime names in memory, but are persisted internally as PanelName/WidgetName inside the CDC.
If the panel, widget or any associated image/sprite already exist, they will be overwritten.