RADLib
RADical C++ application framework
RADWidgets.h
Go to the documentation of this file.
1 #ifndef RADWIDGETS_H
2 #define RADWIDGETS_H
3 
9 #pragma once
10 
11 #include <RADUi/RADUi.h>
12 
13 #include <cstddef>
14 #include <map>
15 #include <optional>
16 #include <string>
17 #include <string_view>
18 #include <vector>
19 
20 namespace RADUi {
21 
23  class Action : public RADCore::RADObject {
24  public:
25  RADEvents:
30 
32  Action() = default;
34  explicit Action(std::string text);
35 
37  const std::string& text() const;
39  void setText(std::string text);
40 
42  bool isEnabled() const;
44  void setEnabled(bool enabled);
45 
47  bool isCheckable() const;
49  void setCheckable(bool checkable);
50 
52  bool isChecked() const;
54  void setChecked(bool checked);
55 
57  void trigger();
58 
59  private:
60  std::string text_;
61  bool enabled_ = true;
62  bool checkable_ = false;
63  bool checked_ = false;
64  };
65 
67  struct MenuItem {
69  std::string id;
71  std::string text;
73  bool enabled = true;
75  bool checkable = false;
77  bool checked = false;
79  bool separator = false;
80  };
81 
83  struct Menu {
85  std::string text;
87  std::vector<MenuItem> items;
88  };
89 
92  public:
93  RADEvents:
97  RAD_EVENT(itemTriggered, (std::string));
98 
100  const std::vector<Menu>& menus() const;
102  void setMenus(std::vector<Menu> menus);
103 
105  std::optional<size_t> activeMenuIndex() const;
107  void openMenu(size_t index);
109  void toggleMenu(size_t index);
111  void close();
112 
114  bool triggerItem(size_t menuIndex, size_t itemIndex);
116  bool setItemChecked(const std::string& id, bool checked);
117 
118  private:
119  std::vector<Menu> menus_;
120  std::optional<size_t> activeMenuIndex_;
121  };
122 
125  public:
126  RADEvents:
129 
131  size_t rowCount() const;
133  bool empty() const;
135  const std::string& at(size_t index) const;
137  std::vector<std::string> values() const;
138 
140  void append(std::string value);
142  void set(size_t index, std::string value);
144  void remove(size_t index);
146  void clear();
147 
148  private:
149  std::vector<std::string> values_;
150  };
151 
154  public:
155  RADEvents:
160 
162  explicit ButtonModel(std::string text = {});
164  const std::string& text() const;
166  void setText(std::string text);
168  bool isEnabled() const;
170  void setEnabled(bool enabled);
172  void click();
173 
174  private:
175  std::string text_;
176  bool enabled_ = true;
177  };
178 
181  public:
182  RADEvents:
185 
187  bool isChecked() const;
189  void setChecked(bool checked);
191  void toggle();
192 
193  private:
194  bool checked_ = false;
195  };
196 
199  public:
200  RADEvents:
202  RAD_EVENT(changed, (double));
203 
205  SliderModel(double minimum = 0.0, double maximum = 1.0, double value = 0.0);
207  double minimum() const;
209  double maximum() const;
211  double value() const;
213  void setRange(double minimum, double maximum);
215  void setValue(double value);
216 
217  private:
218  double minimum_ = 0.0;
219  double maximum_ = 1.0;
220  double value_ = 0.0;
221  };
222 
225  public:
226  RADEvents:
229 
231  const std::string& text() const;
233  void setText(std::string text);
235  const std::string& placeholder() const;
237  void setPlaceholder(std::string placeholder);
239  bool isReadOnly() const;
241  void setReadOnly(bool readOnly);
242 
243  private:
244  std::string text_;
245  std::string placeholder_;
246  bool readOnly_ = false;
247  };
248 
251  public:
252  RADEvents:
255 
257  const std::string& text() const;
259  void setText(std::string text);
261  const std::string& fileName() const;
263  bool isModified() const;
265  bool loadFromFile(const std::string& fileName);
267  bool save();
269  bool saveAs(const std::string& fileName);
271  void clear();
272 
273  private:
274  std::string text_;
275  std::string fileName_;
276  bool modified_ = false;
277  };
278 
281  public:
282  RADEvents:
285 
287  const std::string& text() const;
289  void setText(std::string text);
291  void setEditorText(std::string text);
293  size_t insertText(size_t byteOffset, std::string_view text);
294 
296  const std::string& displayText() const;
298  const std::string& lineNumberText() const;
300  size_t lineCount() const;
301 
303  bool showLineNumbers() const;
305  void setShowLineNumbers(bool show);
306 
308  bool showWhitespace() const;
310  void setShowWhitespace(bool show);
311 
313  double scrollY() const;
315  void setScrollY(double scrollY);
317  double slintViewportY() const;
319  void setSlintViewportY(double viewportY);
323  double viewportHeight() const;
325  void ensureLineVisible(size_t line, double lineHeight = 19.0, double padding = 12.0);
327  void scrollToLastLine(double lineHeight = 19.0, double padding = 12.0);
328 
330  static std::string makeWhitespaceVisible(std::string_view text);
332  static std::string decodeVisibleWhitespace(std::string_view text);
334  static size_t countLines(std::string_view text);
336  static std::string makeLineNumberText(size_t lineCount);
337 
338  private:
339  void refreshDerived();
340 
341  std::string text_;
342  std::string displayText_;
343  std::string lineNumberText_ = "1";
344  size_t lineCount_ = 1;
345  bool showLineNumbers_ = true;
346  bool showWhitespace_ = false;
347  double scrollY_ = 0.0;
348  double viewportHeight_ = 0.0;
349  };
350 
353  public:
354  RADEvents:
357 
359  std::optional<size_t> currentIndex() const;
361  void setCurrentIndex(std::optional<size_t> index);
363  void clear();
364 
365  private:
366  std::optional<size_t> currentIndex_;
367  };
368 
371  public:
372  RADEvents:
375 
377  size_t rowCount() const;
379  size_t columnCount() const;
381  std::string value(size_t row, size_t column) const;
383  void setColumnCount(size_t columns);
385  void appendRow(std::vector<std::string> row);
387  void setValue(size_t row, size_t column, std::string value);
389  void clear();
390 
391  private:
392  size_t columns_ = 0;
393  std::vector<std::vector<std::string>> rows_;
394  };
395 
397  struct TreeNode {
399  std::string text;
401  std::vector<TreeNode> children;
402  };
403 
405  class TreeModel : public RADCore::RADObject {
406  public:
407  RADEvents:
410 
412  const std::vector<TreeNode>& roots() const;
414  void setRoots(std::vector<TreeNode> roots);
416  void clear();
417 
418  private:
419  std::vector<TreeNode> roots_;
420  };
421 
423  enum class DialogResult {
425  None,
427  Accepted,
429  Rejected
430  };
431 
433  enum class MessageBoxIcon {
435  Information,
437  Warning,
439  Error,
441  Question
442  };
443 
445  enum class FilePickerMode {
447  OpenFile,
449  SaveFile,
452  };
453 
455  struct ToolButton {
457  std::string id;
459  std::string text;
461  std::string icon;
463  bool enabled = true;
465  bool separator = false;
466  };
467 
469  struct StatusItem {
471  std::string id;
473  std::string text;
474  };
475 
479  std::string id;
481  std::string label;
483  std::string value;
485  std::vector<std::string> options;
487  bool isToggle = false;
488  };
489 
492  public:
493  RADEvents:
498 
500  const std::string& title() const;
502  void setTitle(std::string title);
504  bool isOpen() const;
508  void open();
510  void accept();
512  void reject();
513 
514  private:
515  std::string title_;
516  bool open_ = false;
518  };
519 
522  public:
523  RADEvents:
528 
532  const std::string& title() const;
534  const std::string& text() const;
538  bool isOpen() const;
540  void open();
542  void accept();
544  void reject();
545 
546  private:
547  std::string title_;
548  std::string text_;
550  bool open_ = false;
551  };
552 
555  public:
556  RADEvents:
560  RAD_EVENT(accepted, (std::string));
563 
569  void setDirectory(std::string directory);
571  const std::string& directory() const;
573  void setSelectedPath(std::string path);
575  const std::string& selectedPath() const;
577  const std::vector<std::string>& filters() const;
579  void setFilters(std::vector<std::string> filters);
581  bool isOpen() const;
583  void open();
585  void accept();
587  void reject();
588 
589  private:
591  std::string directory_;
592  std::string selectedPath_;
593  std::vector<std::string> filters_;
594  bool open_ = false;
595  };
596 
599  public:
600  RADEvents:
604  RAD_EVENT(triggered, (std::string));
605 
607  const std::vector<ToolButton>& buttons() const;
609  void setButtons(std::vector<ToolButton> buttons);
611  bool setEnabled(const std::string& id, bool enabled);
613  bool trigger(const std::string& id);
614 
615  private:
616  std::vector<ToolButton> buttons_;
617  };
618 
621  public:
622  RADEvents:
625 
627  const std::vector<StatusItem>& items() const;
629  void setItems(std::vector<StatusItem> items);
631  void setText(std::string id, std::string text);
633  std::string text(std::string id) const;
634 
635  private:
636  std::vector<StatusItem> items_;
637  };
638 
641  public:
642  RADEvents:
646  RAD_EVENT(valueChanged, (std::string, std::string));
647 
649  const std::vector<PreferenceField>& fields() const;
651  void setFields(std::vector<PreferenceField> fields);
653  bool setValue(const std::string& id, std::string value);
655  std::string value(const std::string& id) const;
657  std::map<std::string, std::string> values() const;
658 
659  private:
660  std::vector<PreferenceField> fields_;
661  };
662 
664  struct LayoutItem {
666  std::string id;
668  int row = 0;
670  int column = 0;
672  int rowSpan = 1;
674  int columnSpan = 1;
675  };
676 
679  public:
680  RADEvents:
683 
685  const std::vector<LayoutItem>& items() const;
687  void setItems(std::vector<LayoutItem> items);
689  void clear();
690 
691  private:
692  std::vector<LayoutItem> items_;
693  };
694 
695 } // namespace RADUi
696 
697 #endif
#define RAD_EVENT(Name, Signature)
Declares a typed RADCore event; example: RAD_EVENT(done, (int)).
Definition: RADCore.h:97
#define RADEvents
Marks a public event declaration block in RADObject-derived classes.
Definition: RADCore.h:75
Base class for event receivers, senders, and thread-affinity aware objects.
Definition: RADCore.h:963
Backend-neutral command/action model for buttons, menus, and toolbars.
Definition: RADWidgets.h:23
Action(std::string text)
Creates an enabled action with display text.
void setEnabled(bool enabled)
Enables or disables the action.
void trigger()
Emits triggered when enabled.
void setText(std::string text)
Updates the action display text.
RADCore::Event< void() > changed
Raised when text, enabled state, checkable state, or checked state changes.
Definition: RADWidgets.h:27
bool isChecked() const
Returns true when a checkable action is checked.
bool isEnabled() const
Returns true when the action can be triggered.
void setCheckable(bool checkable)
Enables or disables checkable behavior.
RADCore::Event< void() > triggered
Raised when trigger() is called on an enabled action.
Definition: RADWidgets.h:29
void setChecked(bool checked)
Sets the checked state for checkable actions.
const std::string & text() const
Returns the action display text.
Action()=default
Creates an empty enabled action.
bool isCheckable() const
Returns true when the action has a checked state.
Push-button state model.
Definition: RADWidgets.h:153
RADCore::Event< void() > changed
Raised when text or enabled state changes.
Definition: RADWidgets.h:157
const std::string & text() const
Returns button text.
void setText(std::string text)
Updates button text.
RADCore::Event< void() > clicked
Raised when click() is called while enabled.
Definition: RADWidgets.h:159
void setEnabled(bool enabled)
Enables or disables the button.
void click()
Emits clicked when enabled.
bool isEnabled() const
Returns true when the button can be clicked.
ButtonModel(std::string text={})
Creates a button model with optional text.
Generic dialog state model.
Definition: RADWidgets.h:491
void setTitle(std::string title)
Sets dialog title.
RADCore::Event< void(RADUi::DialogResult) > finished
Raised when the dialog accepts or rejects.
Definition: RADWidgets.h:497
void accept()
Accepts and closes the dialog.
void reject()
Rejects and closes the dialog.
RADCore::Event< void() > changed
Raised when title/open/result changes.
Definition: RADWidgets.h:495
bool isOpen() const
Returns true when dialog should be visible.
void open()
Opens the dialog and resets result to None.
DialogResult result() const
Returns current dialog result.
const std::string & title() const
Returns dialog title.
File picker state model with accept/reject events.
Definition: RADWidgets.h:554
void setSelectedPath(std::string path)
Sets selected path.
void open()
Opens the picker.
RADCore::Event< void() > rejected
Raised when rejected/cancelled.
Definition: RADWidgets.h:562
RADCore::Event< void() > changed
Raised when mode, directory, selection, filters, or open state changes.
Definition: RADWidgets.h:558
void setMode(FilePickerMode mode)
Sets picker mode.
void accept()
Accepts selectedPath and closes the picker.
bool isOpen() const
Returns true when picker should be visible.
void setDirectory(std::string directory)
Sets current directory.
void setFilters(std::vector< std::string > filters)
Sets active file filters.
FilePickerMode mode() const
Returns picker mode.
RADCore::Event< void(std::string) > accepted
Raised with selectedPath when accepted.
Definition: RADWidgets.h:560
const std::string & directory() const
Returns current directory.
const std::vector< std::string > & filters() const
Returns active file filters.
void reject()
Rejects and closes the picker.
const std::string & selectedPath() const
Returns selected path.
Simple grid layout descriptor model.
Definition: RADWidgets.h:678
const std::vector< LayoutItem > & items() const
Returns layout items.
RADCore::Event< void() > changed
Raised when layout items change.
Definition: RADWidgets.h:682
void setItems(std::vector< LayoutItem > items)
Replaces layout items.
void clear()
Removes all layout items.
State model for a conventional menu bar.
Definition: RADWidgets.h:91
std::optional< size_t > activeMenuIndex() const
Returns the active/open top-level menu index, if any.
void openMenu(size_t index)
Opens a top-level menu by index.
bool triggerItem(size_t menuIndex, size_t itemIndex)
Triggers an item by menu and item index.
void close()
Closes the active menu.
bool setItemChecked(const std::string &id, bool checked)
Updates a checkable item by stable id.
RADCore::Event< void(std::string) > itemTriggered
Raised with MenuItem::id when an item is triggered.
Definition: RADWidgets.h:97
RADCore::Event< void() > changed
Raised when menu contents or active menu state changes.
Definition: RADWidgets.h:95
void setMenus(std::vector< Menu > menus)
Replaces the complete menu structure.
void toggleMenu(size_t index)
Opens index or closes it if already active.
const std::vector< Menu > & menus() const
Returns all top-level menus.
Message box state model.
Definition: RADWidgets.h:521
MessageBoxIcon icon() const
Returns message icon category.
void reject()
Rejects and closes the message box.
void open()
Opens the message box.
RADCore::Event< void() > changed
Raised when message box configuration or open state changes.
Definition: RADWidgets.h:525
RADCore::Event< void(RADUi::DialogResult) > finished
Raised when the message box accepts or rejects.
Definition: RADWidgets.h:527
void configure(std::string title, std::string text, MessageBoxIcon icon=MessageBoxIcon::Information)
Sets title, text, and icon in one update.
const std::string & text() const
Returns message body text.
const std::string & title() const
Returns message box title.
void accept()
Accepts and closes the message box.
bool isOpen() const
Returns true when the message box should be visible.
Preferences/settings form model.
Definition: RADWidgets.h:640
void setFields(std::vector< PreferenceField > fields)
Replaces field descriptors.
std::map< std::string, std::string > values() const
Returns all values keyed by field id.
const std::vector< PreferenceField > & fields() const
Returns field descriptors.
std::string value(const std::string &id) const
Returns one field value by id or empty string.
RADCore::Event< void(std::string, std::string) > valueChanged
Raised with field id and value when a value changes.
Definition: RADWidgets.h:646
RADCore::Event< void() > changed
Raised when fields or values change.
Definition: RADWidgets.h:644
bool setValue(const std::string &id, std::string value)
Sets one field value by id.
Current-selection model for list/table/tree style views.
Definition: RADWidgets.h:352
void setCurrentIndex(std::optional< size_t > index)
Sets selected index or clears selection with nullopt.
RADCore::Event< void() > changed
Raised when current index changes.
Definition: RADWidgets.h:356
std::optional< size_t > currentIndex() const
Returns selected index, if any.
void clear()
Clears selection.
Numeric slider model with minimum, maximum, and current value.
Definition: RADWidgets.h:198
void setRange(double minimum, double maximum)
Updates range and clamps value as needed.
double maximum() const
Returns maximum accepted value.
double minimum() const
Returns minimum accepted value.
double value() const
Returns current value.
SliderModel(double minimum=0.0, double maximum=1.0, double value=0.0)
Creates a slider with range and initial value.
RADCore::Event< void(double) > changed
Raised with the current value when it changes.
Definition: RADWidgets.h:202
void setValue(double value)
Sets current value, clamped to range.
Status bar text item model.
Definition: RADWidgets.h:620
RADCore::Event< void() > changed
Raised when items or item text changes.
Definition: RADWidgets.h:624
const std::vector< StatusItem > & items() const
Returns status items.
void setItems(std::vector< StatusItem > items)
Replaces status items.
std::string text(std::string id) const
Returns text for item id or empty string.
void setText(std::string id, std::string text)
Sets text for item id, creating no new item when id is missing.
Simple string-list state model for list views and combo boxes.
Definition: RADWidgets.h:124
size_t rowCount() const
Returns the number of list rows.
void clear()
Removes all values and emits changed.
void set(size_t index, std::string value)
Replaces value at index and emits changed.
std::vector< std::string > values() const
Returns a copy of all values.
void append(std::string value)
Appends one value and emits changed.
RADCore::Event< void() > changed
Raised when list contents change.
Definition: RADWidgets.h:128
bool empty() const
Returns true when no values are stored.
void remove(size_t index)
Removes value at index and emits changed.
const std::string & at(size_t index) const
Returns value at index.
Simple string table model for grid/table UI components.
Definition: RADWidgets.h:370
size_t columnCount() const
Returns number of columns.
void setValue(size_t row, size_t column, std::string value)
Sets one cell value.
void appendRow(std::vector< std::string > row)
Appends a row, padding/truncating to column count as needed.
std::string value(size_t row, size_t column) const
Returns a cell value or empty string when out of range.
void clear()
Removes all rows and columns.
RADCore::Event< void() > changed
Raised when row, column, or cell data changes.
Definition: RADWidgets.h:374
void setColumnCount(size_t columns)
Sets the table column count.
size_t rowCount() const
Returns number of rows.
Text document model with file load/save and modified state.
Definition: RADWidgets.h:250
const std::string & fileName() const
Returns associated file path.
bool save()
Saves to the current fileName.
void clear()
Clears text and file state.
bool loadFromFile(const std::string &fileName)
Loads text from fileName.
bool saveAs(const std::string &fileName)
Saves to fileName and updates the current file.
void setText(std::string text)
Replaces document text and marks modified.
RADCore::Event< void() > changed
Raised when text, filename, or modified state changes.
Definition: RADWidgets.h:254
bool isModified() const
Returns true when text changed since load/save.
const std::string & text() const
Returns document text.
Multi-line text editor model with derived display text and scrolling helpers.
Definition: RADWidgets.h:280
static std::string decodeVisibleWhitespace(std::string_view text)
Converts visible whitespace display symbols back to raw text.
bool showWhitespace() const
Returns true when whitespace markers should be shown.
void setScrollY(double scrollY)
Sets model scroll offset in logical pixels.
const std::string & displayText() const
Returns text transformed for display settings.
size_t lineCount() const
Returns current line count.
const std::string & text() const
Returns raw editor text.
const std::string & lineNumberText() const
Returns newline-separated line-number text.
double scrollY() const
Returns model scroll offset in logical pixels.
void scrollToLastLine(double lineHeight=19.0, double padding=12.0)
Scrolls so the last line is visible.
void setShowWhitespace(bool show)
Enables or disables visible whitespace display.
static std::string makeWhitespaceVisible(std::string_view text)
Converts tabs/spaces/newlines into visible display symbols.
double viewportHeight() const
Returns the configured viewport height.
static size_t countLines(std::string_view text)
Counts text lines, treating empty text as one line.
static std::string makeLineNumberText(size_t lineCount)
Builds newline-separated line-number text for lineCount lines.
size_t insertText(size_t byteOffset, std::string_view text)
Inserts text at a byte offset and returns the new offset.
void setShowLineNumbers(bool show)
Enables or disables line-number display.
bool showLineNumbers() const
Returns true when line numbers should be displayed.
void setSlintViewportY(double viewportY)
Sets scroll offset from a Slint viewport position.
void setViewportHeight(double viewportHeight)
Sets the visible viewport height used by ensureLineVisible().
void setText(std::string text)
Replaces raw editor text.
RADCore::Event< void() > changed
Raised when editor text, display settings, or scroll state changes.
Definition: RADWidgets.h:284
void setEditorText(std::string text)
Replaces editor text after decoding visible whitespace when needed.
void ensureLineVisible(size_t line, double lineHeight=19.0, double padding=12.0)
Scrolls as needed so zero-based line is visible.
double slintViewportY() const
Returns Slint-compatible viewport offset.
Single-line text input state model.
Definition: RADWidgets.h:224
const std::string & placeholder() const
Returns placeholder text.
void setPlaceholder(std::string placeholder)
Updates placeholder text.
void setText(std::string text)
Updates input text.
bool isReadOnly() const
Returns true when user editing should be disabled.
void setReadOnly(bool readOnly)
Sets read-only state.
const std::string & text() const
Returns input text.
RADCore::Event< void() > changed
Raised when text, placeholder, or read-only state changes.
Definition: RADWidgets.h:228
Boolean toggle/check model.
Definition: RADWidgets.h:180
void setChecked(bool checked)
Sets checked state.
void toggle()
Inverts checked state.
RADCore::Event< void() > changed
Raised when checked state changes.
Definition: RADWidgets.h:184
bool isChecked() const
Returns current checked state.
Toolbar state model.
Definition: RADWidgets.h:598
RADCore::Event< void() > changed
Raised when button descriptors change.
Definition: RADWidgets.h:602
void setButtons(std::vector< ToolButton > buttons)
Replaces toolbar buttons.
const std::vector< ToolButton > & buttons() const
Returns toolbar buttons.
bool setEnabled(const std::string &id, bool enabled)
Updates one button enabled state by id.
RADCore::Event< void(std::string) > triggered
Raised with button id when a button is triggered.
Definition: RADWidgets.h:604
bool trigger(const std::string &id)
Triggers one enabled button by id.
Tree-view state model.
Definition: RADWidgets.h:405
void setRoots(std::vector< TreeNode > roots)
Replaces root nodes.
void clear()
Removes all root nodes.
const std::vector< TreeNode > & roots() const
Returns root nodes.
RADCore::Event< void() > changed
Raised when roots change.
Definition: RADWidgets.h:409
Definition: RADAppKit.h:20
DialogResult
Result state for dialogs and message boxes.
Definition: RADWidgets.h:423
@ Accepted
Dialog was accepted.
@ None
Dialog has not finished.
@ Rejected
Dialog was rejected/cancelled.
MessageBoxIcon
Message box icon category.
Definition: RADWidgets.h:433
@ Warning
Warning message.
@ Error
Error message.
@ Information
Informational message.
@ Question
Question/confirmation message.
FilePickerMode
File picker operation mode.
Definition: RADWidgets.h:445
@ OpenFile
Select an existing file to open.
@ SelectDirectory
Select a directory.
@ SaveFile
Select or enter a file to save.
Grid layout item descriptor.
Definition: RADWidgets.h:664
std::string id
Stable id for the item.
Definition: RADWidgets.h:666
int row
Starting grid row.
Definition: RADWidgets.h:668
int column
Starting grid column.
Definition: RADWidgets.h:670
int rowSpan
Number of rows occupied.
Definition: RADWidgets.h:672
int columnSpan
Number of columns occupied.
Definition: RADWidgets.h:674
One menu item in a MenuBarModel menu.
Definition: RADWidgets.h:67
std::string id
Stable id emitted when the item is triggered.
Definition: RADWidgets.h:69
bool checked
Current checked state.
Definition: RADWidgets.h:77
bool enabled
Whether the item can be triggered.
Definition: RADWidgets.h:73
bool checkable
Whether the item has a checked state.
Definition: RADWidgets.h:75
std::string text
User-visible item text.
Definition: RADWidgets.h:71
bool separator
Whether this item is a visual separator.
Definition: RADWidgets.h:79
One top-level menu and its items.
Definition: RADWidgets.h:83
std::vector< MenuItem > items
Items contained by this menu.
Definition: RADWidgets.h:87
std::string text
Top-level menu text.
Definition: RADWidgets.h:85
Settings/preferences field descriptor.
Definition: RADWidgets.h:477
std::vector< std::string > options
Optional list of allowed choices.
Definition: RADWidgets.h:485
std::string value
Current serialized value.
Definition: RADWidgets.h:483
std::string id
Stable id for updates.
Definition: RADWidgets.h:479
bool isToggle
Whether the field should be presented as a toggle.
Definition: RADWidgets.h:487
std::string label
Display label.
Definition: RADWidgets.h:481
Status bar item descriptor.
Definition: RADWidgets.h:469
std::string text
Display text.
Definition: RADWidgets.h:473
std::string id
Stable id for updates.
Definition: RADWidgets.h:471
Toolbar button descriptor.
Definition: RADWidgets.h:455
bool enabled
Whether the button can be triggered.
Definition: RADWidgets.h:463
std::string id
Stable id emitted when triggered.
Definition: RADWidgets.h:457
std::string text
Display text.
Definition: RADWidgets.h:459
bool separator
Whether this item is a visual separator.
Definition: RADWidgets.h:465
std::string icon
Optional icon name/path.
Definition: RADWidgets.h:461
Tree node with display text and recursive children.
Definition: RADWidgets.h:397
std::string text
Node display text.
Definition: RADWidgets.h:399
std::vector< TreeNode > children
Child nodes.
Definition: RADWidgets.h:401