29 #include "YSingleChildContainerWidget.h" 60 YDialogColorMode
colorMode = YDialogNormalColor );
74 virtual const char *
widgetClass()
const {
return "YDialog"; }
158 bool destroy(
bool doThrow =
true );
339 static void showText(
const std::string & text,
bool richText =
false );
void deleteEvent(YEvent *event)
Delete an event.
static bool showHelpText(YWidget *widget)
Show the help text for the specified widget.
void deleteEventFilters()
Delete all (remaining) event filters.
virtual void setDefaultButton(YPushButton *defaultButton)
Set this dialog's default button (the button that is activated when the user hits [Return] anywhere i...
YDialogType
Type of dialog: Main / Popup / Wizard.
Helper class to manage keyboard shortcuts within one dialog and resolve keyboard shortcut conflicts...
void postponeShortcutCheck()
From now on, postpone keyboard shortcut checks - i.e.
static bool deleteTopmostDialog(bool doThrow=true)
Delete the topmost dialog.
Abstract base class to filter events.
Abstract base class for events to be returned upon UI::UserInput() and related functions.
YEvent * filterInvalidEvents(YEvent *event)
Filter out invalid events: Return 0 if the event does not belong to this dialog or the unchanged even...
bool isTopmostDialog() const
Return 'true' if this dialog is the topmost dialog.
void checkShortcuts(bool force=false)
Checks the keyboard shortcuts of widgets in this dialog unless shortcut checks are postponed or 'forc...
void removeEventFilter(YEventFilter *eventFilter)
Remove an event filter.
YDialogColorMode colorMode() const
Return this dialog's color mode.
virtual const char * widgetClass() const
Return a descriptive name of this widget class for logging, debugging etc.
virtual void openInternal()=0
Internal open() method.
static void deleteAllDialogs()
Delete all open dialogs.
bool isOpen() const
Return 'true' if open() has already been called for this dialog.
virtual YEvent * pollEventInternal()=0
Check if a user event is pending.
static YDialog * currentDialog(bool doThrow=true)
Return the current (topmost) dialog.
bool shortcutCheckPostponed() const
Return whether or not shortcut checking is currently postponed.
YEvent * callEventFilters(YEvent *event)
Call the installed event filters.
virtual void highlight(YWidget *child)
Highlight a child widget of this dialog.
void open()
Open a newly created dialog: Finalize it and make it visible on the screen.
void addEventFilter(YEventFilter *eventFilter)
Add an event filter.
YDialog(YDialogType dialogType, YDialogColorMode colorMode=YDialogNormalColor)
Constructor.
void setInitialSize()
Set the initial dialog size, depending on dialogType: YMainDialog dialogs get the UI's "default main ...
static void deleteTo(YDialog *dialog)
Delete all dialogs from the topmost to the one specified.
static bool showRelNotesText()
Show the release notes.
YDialogType dialogType() const
Return this dialog's type (YMainDialog / YPopupDialog /YWizardDialog).
virtual void activate()=0
Activate this dialog: Make sure that it is shown as the topmost dialog of this application and that i...
static void showText(const std::string &text, bool richText=false)
Show the specified text in a pop-up dialog with a local event loop.
static int openDialogsCount()
Returns the number of currently open dialogs (from 1 on), i.e., the depth of the dialog stack...
virtual ~YDialog()
Destructor.
void recalcLayout()
Recalculate the layout of the dialog and of all its children after children have been added or remove...
YPushButton * defaultButton() const
Return this dialog's default button: The button that is activated when the user hits [Return] anywher...
A window in the desktop environment.
virtual YEvent * waitForEventInternal(int timeout_millisec)=0
Wait for a user event.
YEvent * pollEvent()
Check if a user event is pending.
static YDialog * topmostDialog(bool doThrow=true)
Alias for currentDialog().
bool destroy(bool doThrow=true)
Close and delete this dialog (and all its children) if it is the topmost dialog.
static std::stack< YDialog * > _dialogStack
Stack holding all currently existing dialogs.
YEvent * waitForEvent(int timeout_millisec=0)
Wait for a user event.
bool isMainDialog()
Return 'true' if this dialog is a dialog of main dialog size: YMainDialog or YWizardDialog.