#include <YWidget.h>
Inheritance diagram for YWidget:
Public Member Functions | |
YWidget (const YWidgetOpt &opt) | |
virtual | ~YWidget () |
virtual char * | widgetClass () |
virtual std::string | debugLabel () |
bool | isValid () const |
int | internalId () const |
void | setId (const YCPValue &id) |
bool | hasId () const |
YCPValue | id () const |
void | setParent (YWidget *parent) |
YWidget * | yParent () const |
YWidget * | yDialog () |
virtual void | childDeleted (YWidget *child) |
virtual bool | isDialog () const |
virtual bool | isContainer () const |
virtual bool | isReplacePoint () const |
virtual bool | isRadioButtonGroup () const |
virtual bool | isLayoutStretch (YUIDimension dim) const |
virtual long | nicesize (YUIDimension dim)=0 |
virtual bool | stretchable (YUIDimension dim) const |
void | setStretchable (YUIDimension dim, bool newStretch) |
void | setDefaultStretchable (YUIDimension dim, bool newStretch) |
virtual long | weight (YUIDimension dim) |
virtual bool | hasWeight (YUIDimension dim) |
virtual void | setSize (long newwidth, long newheight) |
virtual void | setEnabling (bool enabled) |
bool | getEnabling () const |
void | setNotify (bool notify) |
bool | getNotify () const |
bool | sendKeyEvents () const |
void | setSendKeyEvents (bool doSend) |
bool | autoShortcut () const |
void | setAutoShortcut (bool _newAutoShortcut) |
virtual YCPValue | changeWidget (const YCPSymbol &property, const YCPValue &newvalue) |
virtual YCPValue | changeWidgetTerm (const YCPTerm &property, const YCPValue &newvalue) |
virtual YCPValue | queryWidget (const YCPSymbol &property) |
virtual YCPValue | queryWidgetTerm (const YCPTerm &property) |
void * | widgetRep () |
void | setWidgetRep (void *) |
virtual bool | setKeyboardFocus () |
virtual void | saveUserInput (YMacroRecorder *macroRecorder) |
virtual const char * | shortcutProperty () |
virtual const char * | userInputProperty () |
virtual void | startMultipleChanges () |
virtual void | doneMultipleChanges () |
Protected Attributes | |
YCPValue | user_widget_id |
int | internal_widget_id |
YWidget * | yparent |
bool | enabled |
bool | notify |
bool | _sendKeyEvents |
bool | _autoShortcut |
void * | rep |
bool | _stretch [YUIAllDimensions] |
long | _weight [YUIAllDimensions] |
long | windowID |
Static Protected Attributes | |
static int | next_internal_widget_id = 0 |
Private Member Functions | |
void | invalidate () |
Private Attributes | |
int | magic |
Classes | |
class | OptimizeChanges |
|
Constructor |
|
Destructor |
|
Returns 'true' if a keyboard shortcut should automatically be assigned to this widget - without complaints in the log file. |
|
Implements the ui command ChangeWidget. Implement this method in your widget subclass and handle their all properties special to that widget. If you encounter an unknown property, call YWidget::changeWidget Reimplemented in YBarGraph, YCheckBox, YColoredLabel, YComboBox, YDate, YDownloadProgress, YDumbTab, YFrame, YIntField, YLabel, YLogView, YMenuButton, YMultiLineEdit, YMultiProgressMeter, YMultiSelectionBox, YPartitionSplitter, YProgressBar, YPushButton, YRadioButton, YRadioButtonGroup, YRichText, YSelectionBox, YSlider, YTable, YTextEntry, YTime, and YTree. |
|
Implements the ui command ChangeWidget in the incarnation, where the property is given in form of a term rather than a symbol. Implement this method in your widget subclass and handle their all properties special to that widget. If you encounter an unknown property, call YWidget::changeWidget Reimplemented in YTable. |
|
Notify a widget that can have children that a child has been deleted. This is called in the YWidget destructor for the parent widget. All container widgets should overwrite this function and update any internal pointers accordingly. Background: Qt widgets (and objects inherited from them) automatically delete any child widgets if they are deleted themselves. This conflicts with destructors that delete child widgets. Reimplemented in YContainerWidget. |
|
Returns a descriptive label of this widget instance. This default implementation returns this widget's "shortcut property" (possibly trunctated to avoid over-long texts) - the property that contains the keyboard shortcut used to activate this widget or to move the keyboard focus to it. In most cases this is this widget's label. Note: This is usually translated to the user's target language. This makes this useful for debugging only. Reimplemented in YContainerWidget, YDialog, and YLabel. |
|
In some UIs updating the screen content is an expensive operation. Use startMultipleChanges() to tell the ui that you're going to perform multiple chages to the widget. The UI may delay any screen updates until doneMultipleChanges() is called. |
|
Queries the enabled of a widget. |
|
Returns whether the widget will notify, i.e. will case UserInput to return. |
|
Checks whether or not the widget has an ID |
|
Return whether or not the widget has a weight. |
|
Gets the id of the widget |
|
Return the widget serial number (the internal widget ID). |
|
Make this widget invalid. This operation cannot be reversed. |
|
Returns true if this is a container widget. The default implementation returns false. Reimplemented in YContainerWidget. |
|
Returns true if this is a dialog widget. The default implementation returns 'false'. Reimplemented in YDialog. |
|
Returns true if this is a layout stretch space in dimension "dim". Such widgets will receive special treatment in layout calculations. The default implementation returns false. |
|
Returns true if this is a button group widget. The default implementation return false. Reimplemented in YRadioButtonGroup. |
|
Returns true if this is a replace point widget. The default implementation returns false. Reimplemented in YReplacePoint. |
|
Checks whether or not this object is valid. This is to enable dangling pointer error checking ( i.e. this object is already deallocated, but a pointer to it is still in use ). |
|
Minimum size the widget should have to make it look and feel nice. For a push button this would include some space around the text to make it look nice.
Implemented in YAlignment, YContainerWidget, YEmpty, YSpacing, and YSplit. |
|
Implements the ui command QueryWidget. Implement this method in your widget subclass and handle their all properties special to that widget. If you encounter an unknown property, call YWidget::queryWidget Reimplemented in YCheckBox, YColoredLabel, YComboBox, YDate, YDialog, YDownloadProgress, YDumbTab, YFrame, YIntField, YLabel, YLogView, YMenuButton, YMultiLineEdit, YMultiProgressMeter, YMultiSelectionBox, YPartitionSplitter, YProgressBar, YPushButton, YRadioButton, YRadioButtonGroup, YRichText, YSelectionBox, YSlider, YTable, YTextEntry, YTime, YTree, and YWizard. |
|
Implements the ui command QueryWidget in the incarnation, where the property is given in form of a term rather than a symbol. Implement this method in your widget subclass and handle their all properties special to that widget. If you encounter an unknown property, call YWidget::queryWidget Reimplemented in YTable. |
|
Save the user input of this widget to a macro recorder, e.g. input field contents, check box state etc. This default implementation does nothing. Overwrite this method in any derived class that has user input to save, e.g. TextEntry etc. and call YMacroRecorder::recordWidgetProperty() in the overwritten method. Reimplemented in YCheckBox, YComboBox, YContainerWidget, YIntField, YMultiLineEdit, YMultiSelectionBox, YPartitionSplitter, YRadioButton, YSelectionBox, YSlider, YTable, YTextEntry, and YTree. |
|
Returns 'true' if this widget should send key events, i.e. if it has `opt(`keyEvent) set. |
|
Sets the 'autoShortcut' flag. |
|
Set the stretchable state to "newStretch". `hstretch or `vstretch options may override this. |
|
Sets the enabled state of the widget. All new widgets are enabled per definition. Only enabled widgets can take user input. |
|
Sets the id of the widget |
|
Set the keyboard focus to this widget. The default implementation just emits a warning message. Overwrite this function for all widgets that can accept the keyboard focus. This function returns true if the widget did accept the keyboard focus, and false if not. |
|
Sets the Notify property |
|
Set the parent YWidget of this widget. |
|
Specify whether or not this widget should send key events. |
|
Sets the new size of the widget. If you overload this function make the underlying ui specific widget have exactly that size. You should _not_ change the nicesize, of course. The unit is according to and nicesize(). This function is called from the layout algorithm, which has decides ( using the layout properties ) how large the widget now actually should be. The default implementation does nothing. Reimplemented in YAlignment, YContainerWidget, and YSplit. |
|
Set the stretchable state to "newStretch" regardless of any `hstretch or `vstretch options. |
|
Sets the pointer to the ui specific widget implementation. |
|
The name of the widget property that holds the keyboard shortcut, if any. Overwrite this for widgets that can have keyboard shortcuts. Reimplemented in YCheckBox, YIntField, YLogView, YMenuButton, YMultiLineEdit, YPartitionSplitter, YPushButton, YRadioButton, YSelectionWidget, YSlider, YTextEntry, and YTree. |
|
In some UIs updating the screen content is an expensive operation. Use startMultipleChanges() to tell the ui that you're going to perform multiple chages to the widget. The UI may delay any screen updates until doneMultipleChanges() is called. |
|
This is a boolean value that determines whether the widget is resizable beyond its nice size in the specified dimension. A selection box is stretchable in both dimensions, a push button is not stretchable by default, a frame is stretchable if its contents are stretchable. Most widgets accept a `hstretch or `vstretch option to become stretchable even when they are not by default.
Reimplemented in YAlignment, YContainerWidget, YSplit, and YSquash. |
|
The name of the widget property that will return user input, if there is any. Widgets that do have user input (such as TextEntry, ComboBox, SelBox) should overwrite this methods. Widgets that are purely passive (such as Label, RichText) should not. Reimplemented in YCheckBox, YComboBox, YIntField, YMultiLineEdit, YMultiSelectionBox, YPartitionSplitter, YRadioButton, YSelectionBox, YSlider, YTable, YTextEntry, and YTree. |
|
The weight is used in situations where all widgets can get there nice size and yet space is available. The remaining space will be devided between all stretchable widgets according to their weights. A widget with greater weight will get more space. The default weight for all widgets is 0.
|
|
Returns a descriptive name of this widget class for logging, debugging etc. Reimplemented in YAlignment, YBarGraph, YCheckBox, YColoredLabel, YComboBox, YContainerWidget, YDate, YDialog, YDownloadProgress, YDumbTab, YEmpty, YFrame, YImage, YIntField, YLabel, YLogView, YMenuButton, YMultiLineEdit, YMultiProgressMeter, YMultiSelectionBox, YPackageSelector, YPartitionSplitter, YProgressBar, YPushButton, YRadioButton, YRadioButtonGroup, YReplacePoint, YRichText, YSelectionBox, YSelectionWidget, YSlider, YSpacing, YSplit, YSquash, YTable, YTextEntry, YTime, YTree, and YWizard. |
|
Returns a pointer to the ui specific widget implementation. |
|
Return the YDialog this widget belongs to. Returns 0 if there is no dialog parent. |
|
Return the parent YWidget of this widget. |
|
Flag: Automatically assign a keyboard shortcut without complaints in the log file? |
|
Flag: Make UserInput() return on single key events? |
|
Stretchability in both dimensions. |
|
Weight in both dimensions. |
|
Flag: Can this widget currently receive user input? |
|
The internal unique widget id of this widget. Used to compare widget identity. |
|
This object is only valid if this magic number is YWIDGET_MAGIC. Use YWidget::isValid() to check this. |
|
The next internal widget id to be used for the next object of this class. Initialized in YWidget.cc. |
|
Flag: Make UserInput() return on detailed events? |
|
Pointer to the UI specific widget representation that belongs to this widget. For Qt, this will be a pointer to a QWidget (subclass). |
|
The user provided widget id of this widget - strictly for user purposes. May or may not be set. May or may not be unique. |
|
window ID of the current widget |
|
The parent YWidget. |