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