10 #include "Container.h" 36 std::shared_ptr<Slot<Button::SignalType>> mActionButtonRx{};
37 std::shared_ptr<Slot<Button::SignalType>> mDismissButtonRx{};
41 ~
Popup()
override =
default;
51 explicit Popup(
const shared_ptr <Rose>& parent);
59 Popup(
const shared_ptr <Rose>& parent,
const Position &position);
67 Popup(
const shared_ptr <Rose>& parent,
const Position &pos,
const Size &minimumSize);
72 void initializeComposite()
override;
88 void addChild(
const std::shared_ptr<Widget>& widget)
override {
89 mColumn->addChild(widget);
100 std::for_each(actionButtonList.begin(), actionButtonList.end(),
102 createActionButton(dialogActionButton);
120 mActionButtonRx = buttonSlot;
130 std::string mWindowTitle{};
166 void initializeComposite()
override;
175 mTitle->setText(text);
180 bool mouseDragEvent(
const Position &mousePos,
const Position &rel,
int button,
int modifiers)
override;
196 ~
Dialog()
override =
default;
206 explicit Dialog(shared_ptr <Rose> parent);
227 void initializeComposite()
override;
250 static constexpr std::string_view mExitTitle =
"Exit?";
251 static constexpr std::string_view mExitMessage =
"Exit the program?";
252 static constexpr std::array<DialogActionButton,2> mActionButtons = {
269 explicit ExitDialog(shared_ptr <Rose> parent);
290 void initializeComposite()
override;
300 static constexpr std::string_view mTitle =
"Discard Changes?";
301 static constexpr std::string_view mMessage =
"You have unsaved changes, discard them?";
302 static constexpr std::array<DialogActionButton,2> mActionButtons = {
340 void initializeComposite()
override;
358 template<
class W
idgetType,
size_t N>
359 inline std::shared_ptr<WidgetType> operator << (std::shared_ptr<WidgetType> &widget,
360 std::array<rose::DialogActionButton,N> &container) {
361 static_assert(std::is_base_of_v<rose::Popup, WidgetType>,
362 "Dialog action buttons are only created on classes derived from rose::Popup." );
363 widget->setActionbuttons(container);
375 template<
class W
idgetType>
376 inline std::shared_ptr<WidgetType> operator << (std::shared_ptr<WidgetType> &widget,
377 std::vector<rose::DialogActionButton> &container) {
378 static_assert(std::is_base_of_v<rose::Popup, WidgetType>,
379 "Dialog action buttons are only created on classes derived from rose::Popup." );
380 widget->setActionbuttons(container);
384 template<
class W
idgetType>
385 inline std::shared_ptr<WidgetType> operator << (std::shared_ptr<WidgetType> &widget,
386 std::shared_ptr<rose::Slot<rose::Button::SignalType>> &rxSlot) {
387 static_assert(std::is_base_of_v<rose::Popup, WidgetType>,
388 "Button Slot can only be set on objects derived from rose::Popup." );
389 widget->setButtonSlot(rxSlot,
true);
A Dialog specialized to guard the exit path.
Definition: PopupWindow.h:248
uint32_t SignalToken
A type definition for SignalToken used to identify the source of a Signal.
Definition: Types.h:53
A Window is a visual abstraction of a number of related user interface objects.
Definition: Visual.h:315
ExitDialog Ok ActionButton.
Definition: Constants.h:58
ActionButtonType
Types of Dialog action buttons.
Definition: Constants.h:69
std::shared_ptr< Row > mButtonRow
The area where the Dialog ActionButtons are held.
Definition: PopupWindow.h:192
A Dialog is a way for the application to have a brief conversation with the user. ...
Definition: Popup.h:62
A position in integer (x, y) co-ordinates.
Definition: Types.h:95
A Dialog specialized to guard the exit path.
Definition: PopupWindow.h:298
A composite of a Position and a Size.
Definition: Types.h:307
General Dialog Ok Action Button.
Definition: Constants.h:54
std::shared_ptr< Row > mMessageRow
The area where the Dialog badge and message are held.
Definition: PopupWindow.h:191
Cancel the action described in the dialog.
Definition: Constants.h:71
Written as a workaround for an issue in the SDL2 Library.
Definition: Renderer.h:64
ExitDialog Cancel ActionButton.
Definition: Constants.h:59
A size in integer dimensions.
Definition: Types.h:230
Acknowledge the message or authorize the action described in the dialog.
Definition: Constants.h:70
ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Wid...
Definition: CelestialOverlay.cpp:13
The receiver portion of a Signal-Slot transmitter receiver pair.
Definition: Signals.h:25
Establish an intra-application signaling protocol.
General Dialog Cancel Action Button.
Definition: Constants.h:56