Skip to main content

Modal

The ControlModal plugin provides a customizable modal dialog widget derived from ControlBase. It supports standard dialog interactions such as Yes, No, Ok, Cancel, and Close, with flexible layout and behavior options. The dialog can display a title and message, and supports extensive visual customization including size, corner radius, background color, gradient styles, and stroke outlines. Additionally, custom Control elements can be embedded directly into the modal content area.

#include <interface/modal/include/TellusimControlModal.h>

Example

// create modal
ControlModal modal(&button, "Modal Control", ControlModal::FlagYesNo);
modal.setGradientStyle(GradientStyle(1.5f, Vector2f(0.0f, 1.0f), Color::magenta, Color::red));
modal.setStrokeStyle(StrokeStyle(4.0f, 0.0f, Color::black));
modal.setColor(Color::white);

// run modal
ControlModal::Result result = modal.run(window);
TS_LOGF(Message, "Result: %s\n", (result == ControlModal::ResultYes) ? "Yes" : "No");

Modal