Skip to content

File include/brisk/widgets/DialogComponent.hpp


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 (DialogComponent::accept)

void accept()

Accepts the dialog.

This is equivalent to the user pressing an "OK" button or accepting the dialog's content.

reject function (DialogComponent::reject)

void reject()

Rejects the dialog.

This is equivalent to the user pressing a "Cancel" button or rejecting the dialog's content.

close function (DialogComponent::close)

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 (DialogComponent::accepted)

virtual void accepted()

Called when the dialog is accepted.

Derived classes can override this to implement custom behavior on acceptance.

rejected function (DialogComponent::rejected)

virtual void rejected()

Called when the dialog is rejected.

Derived classes can override this to implement custom behavior on rejection.

result variable (DialogComponent::result)

bool result = false

The result of the dialog, true if accepted, false if rejected.

onAccepted variable (DialogComponent::onAccepted)

DeferredCallbacks<> onAccepted

Callback triggered when the dialog is accepted.

onRejected variable (DialogComponent::onRejected)

DeferredCallbacks<> onRejected

Callback triggered when the dialog is rejected.

dialogButtons function (DialogComponent::dialogButtons)

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.


TextInputDialog class

TextInputDialog

A dialog component for text input.

This dialog presents a prompt and allows the user to input text.

TextInputDialog function (TextInputDialog::TextInputDialog)

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 (TextInputDialog::prompt)

std::string prompt

The prompt message displayed to the user.

value variable (TextInputDialog::value)

std::string value

The input value entered by the user.


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 function (MessageDialog::MessageDialog)

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 (MessageDialog::text)

std::string text

The message text.

icon variable (MessageDialog::icon)

std::string icon

The icon displayed alongside the message.


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 function (ConfirmDialog::ConfirmDialog)

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 (ConfirmDialog::text)

std::string text

The confirmation message text.

icon variable (ConfirmDialog::icon)

std::string icon

The icon displayed alongside the confirmation message.


Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/