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