26 #include <sys/types.h>
29 #define YUILogComponent "ui"
34 #include "YPushButton.h"
35 #include "YButtonBox.h"
38 #include "YApplication.h"
39 #include "YWidgetFactory.h"
40 #include "YOptionalWidgetFactory.h"
41 #include "YLayoutBox.h"
42 #include "YRichText.h"
43 #include "YAlignment.h"
44 #include "YUIException.h"
45 #include "YEventFilter.h"
46 #include "YWidgetID.h"
61 unsigned int dialogWidth = 45;
62 unsigned int dialogHeight = 15;
67 dialogWidth = (
unsigned int) ( (
float) dialog->
preferredWidth() * 0.8 );
68 dialogHeight = (
unsigned int) ( (
float) dialog->
preferredHeight() * 0.8 );
72 if ( dialogWidth > 80 || dialogHeight > 25 )
96 YUI_CAUGHT( exception );
110 yuiDebug() <<
"Found help text for " << widget << endl;
114 widget = widget->
parent();
119 yuiMilestone() <<
"Showing help text" << endl;
122 yuiMilestone() <<
"Help dialog closed" << endl;
126 yuiWarning() <<
"No help text" << endl;
136 yuiMilestone() <<
"Showing Release Notes" << endl;
140 unsigned int dialogWidth = 45;
141 unsigned int dialogHeight = 15;
146 dialogWidth = (
unsigned int) ( (
float) dialog->
preferredWidth() * 0.8 );
147 dialogHeight = (
unsigned int) ( (
float) dialog->
preferredHeight() * 0.8 );
151 if ( dialogWidth > 80 || dialogHeight > 25 )
161 if ( relnotes.size() == 0)
168 for ( map<string,string>::const_iterator it = relnotes.begin(); it != relnotes.end(); ++it )
170 keys.push_back( it->first );
178 bool usePlainTextMode =
YUI::app()->isTextMode();
186 for ( map<string,string>::const_iterator it = relnotes.begin(); it != relnotes.end(); it++ )
194 (*(relnotes.begin())).second,
200 (*(relnotes.begin())).second,
206 okButton->
setRole( YOKButton );
215 if ( event->eventType() == YEvent::MenuEvent && event->item())
217 YItem * item =
dynamic_cast<YItem *
>(
event->item() );
220 else if ( event->eventType() == YEvent::CancelEvent ||
221 event->widget() == okButton )
234 YUI_CAUGHT( exception );
virtual void addItem(YItem *item)
Add an item (a tab page).
static bool showHelpText(YWidget *widget)
Show the help text for the specified widget.
void setIndex(int index)
Set this item's index.
virtual void setValue(const std::string &newValue)
Change the text content of the RichText widget.
YEvent * waitForEvent(int timeout_millisec=0)
Wait for a user event.
int index() const
Return the index of this item (as set with setIndex() ).
Implementation of all the alignment widgets:
std::map< std::string, std::string > releaseNotes() const
Get the current release notes map.
static YOptionalWidgetFactory * optionalWidgetFactory()
Return the widget factory that provides all the createXY() methods for optional ("special") widgets a...
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.
DumbTab: A very simple tab widget that can display and switch between a number of tabs,...
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 YApplication * app()
Return the global YApplication object.
A vertical or horizontal stacking of widgets, implementing HBox and VBox.
static bool showRelNotesText()
Show the release notes.
static YWidgetFactory * widgetFactory()
Return the widget factory that provides all the createXY() methods for standard (mandatory,...
Text formatted with simple HTML-like tags, with "links" generating events.
Base class for UI Exceptions.
A window in the desktop environment.
Simple item class for SelectionBox, ComboBox, MultiSelectionBox etc.
static YApplication * application()
Aliases for YUI::app()