Widgets module¶
ConfirmDialog
class¶
ConfirmDialog
A dialog component for confirming an action.
This dialog is used to ask the user to confirm or cancel an action, displaying a message and an icon.
ConfirmDialog(std::string text, std::string icon)
Constructor for ConfirmDialog.
Param text
The confirmation message to display.
Param icon
The icon to display alongside the message.
text
variable¶
std::string text
The confirmation message text.
icon
variable¶
std::string icon
The icon displayed alongside the confirmation message.
DialogComponent
class¶
DialogComponent
A component representing a dialog, with buttons to accept or reject.
A DialogComponent
is a special type of component that includes standard dialog behavior
such as accepting, rejecting, or closing the dialog.
accept
function¶
void accept()
Accepts the dialog.
This is equivalent to the user pressing an "OK" button or accepting the dialog's content.
reject
function¶
void reject()
Rejects the dialog.
This is equivalent to the user pressing a "Cancel" button or rejecting the dialog's content.
close
function¶
void close(bool result)
Closes the dialog with a specific result.
Param result
The result of the dialog, true for accepted and false for rejected.
accepted
function¶
virtual void accepted()
Called when the dialog is accepted.
Derived classes can override this to implement custom behavior on acceptance.
rejected
function¶
virtual void rejected()
Called when the dialog is rejected.
Derived classes can override this to implement custom behavior on rejection.
result
variable¶
bool result = false
The result of the dialog, true if accepted, false if rejected.
onAccepted
variable¶
DeferredCallbacks<> onAccepted
Callback triggered when the dialog is accepted.
onRejected
variable¶
DeferredCallbacks<> onRejected
Callback triggered when the dialog is rejected.
dialogButtons
function¶
RC<Widget>
dialogButtons(DialogButtons buttons,
std::string okBtn = "OK||Button"_tr,
std::string cancelBtn = "Cancel||Button"_tr)
Creates buttons for the dialog.
This method generates OK and Cancel buttons for the dialog.
Param buttons
Specifies the types of buttons to create.
Param okBtn
The label for the OK button. Default is "OK".
Param cancelBtn
The label for the Cancel button. Default is "Cancel".
Returns A reference-counted pointer to the created widget containing the buttons.
Item
class¶
Item
ItemWidget that represents a list item or a menu item.
This class encapsulates the behavior of an item widget, which can have an icon, be checkable, and interact with various user events.
template <WidgetArgument... Args>
explicit Item(const Args&... args) : Item(Construction
Constructor for the Item class.
This constructor initializes the Item widget with the given arguments, including sub-widgets.
Template param Args
The types of the arguments passed to the constructor.
Param args
The arguments used for constructing the Item widget.
icon
variable¶
Property<Item, std::string, &Item::m_icon> icon
The icon property of the Item.
This property represents the icon displayed in the item.
checkable
variable¶
Property<Item, bool, &Item::m_checkable> checkable
The checkable property of the Item.
This property indicates whether the item contains a checkbox and can be checked/unchecked.
checked
variable¶
Property<Item, bool, &Item::m_checked, nullptr, nullptr,
&Item::onChanged> checked
The checked property of the Item.
This property represents the checkbox state of the item. It triggers the(UNKNOWN ID: ('ref', 'onChanged'))function when the state changes.
closesPopup
variable¶
Property<Item, bool, &Item::m_closesPopup> closesPopup
The closesPopup property of the Item.
If true, clicking the item will close the nearest parent widget that is a popup. This is typically used for menu items.
dynamicFocus
variable¶
Property<Item, bool, &Item::m_dynamicFocus> dynamicFocus
The dynamicFocus property of the Item.
If true, the widget will take focus on mouse hover, similar to how a menu item behaves.
MessageDialog
class¶
MessageDialog
A dialog component for displaying messages with an icon.
This dialog is used to show a message along with an optional icon.
MessageDialog(std::string text, std::string icon)
Constructor for MessageDialog.
Param text
The message text to display.
Param icon
The icon to display alongside the message.
text
variable¶
std::string text
The message text.
icon
variable¶
std::string icon
The icon displayed alongside the message.
Progress
class¶
Progress
ProgressA widget that represents the entire progress indicator, including the progress bar and optional decorations.
The Progress
class manages the progress value, handles user-defined changes.
If no custom ProgressBar
is provided during the construction of Progress
, a default instance of
ProgressBar
is automatically created and linked to it.
Progress
ProgressA widget that represents the entire progress indicator, including the progress bar and optional decorations.
The Progress
class manages the progress value, handles user-defined changes.
If no custom ProgressBar
is provided during the construction of Progress
, a default instance of
ProgressBar
is automatically created and linked to it.
template <WidgetArgument... Args>
explicit Progress(const Args&... args) : Progress(Construction
Constructs a Progress widget.
Param args
Widget arguments and property values.
Note If a custom instance of ProgressBar
widget is not provided, a default one is created.
ProgressBar
class¶
ProgressBar
ProgressBarA non-standalone widget that represents the moving bar within a Progress
widget.
The ProgressBar
class is always created as a child widget to a Progress
widget. It visually represents
the moving bar that indicates the current progress, while the Progress
widget represents the entire
progress indicator.
If a ProgressBar
instance is not explicitly provided when constructing a Progress
widget, a default
ProgressBar
instance will be automatically created and associated with the Progress
widget.
Note This class is final and cannot be subclassed.
template <WidgetArgument... Args>
explicit ProgressBar(const Args&... args) : Widget(Construction
Constructs a ProgressBar widget.
The ProgressBar
is meant to be used only as a child to the Progress
widget.
Param args
Widget arguments and property values.
updateValue
function¶
void updateValue()
Updates the value of the progress bar.
TextInputDialog
class¶
TextInputDialog
A dialog component for text input.
This dialog presents a prompt and allows the user to input text.
TextInputDialog(std::string prompt, std::string defaultValue =
Constructor for TextInputDialog.
Param prompt
The prompt text displayed to the user.
Param defaultValue
The default value of the input field. Defaults to an empty string.
prompt
variable¶
std::string prompt
The prompt message displayed to the user.
value
variable¶
std::string value
The input value entered by the user.
Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/