YWidget Class Reference
Abstract base class of all ui widgets.
More...
#include <YWidget.h>
Inheritance diagram for YWidget:
List of all members.
Detailed Description
Abstract base class of all ui widgets.
AAA_All-Widgets --- none
notify Make UserInput() return on any action in this widget. Normally UserInput() returns only when a button is clicked; with this option on you can make it return for other events, too, e.g. when the user selects an item in a SelectionBox ( if `opt( `notify ) is set for that SelectionBox ). Only widgets with this option set are affected.
disabled Set this widget insensitive, i.e. disable any user interaction. The widget will show this state by being greyed out ( depending on the specific UI ).
hstretch Make this widget stretchable in the horizontal dimension.
See the Layout HOWTO for details.
vstretch Make this widget stretchable in the vertical dimension.
See the Layout HOWTO for details.
hvstretch Make this widget stretchable in both dimensions.
See the Layout HOWTO for details.
autoShortcut Automatically choose a keyboard shortcut for this widget and don't complain in the log file about the missing shortcut.
Don't use this regularly for all widgets - manually chosen keyboard shortcuts are almost always better than those automatically assigned. Refer to the style guide for details.
This option is intended used for automatically generated data, e.g., RadioButtons for software selections that come from file or from some other data base.
key_F1 (NCurses only) activate this widget with the F1 key key_F2 (NCurses only) activate this widget with the F2 key key_Fxx (NCurses only) activate this widget with the Fxx key key_F24 (NCurses only) activate this widget with the F24 key key_none (NCurses only) no function key for this widget
keyEvents (NCurses only) Make UserInput() / WaitForEvent() return on keypresses within this widget. Exactly which keys trigger such a key event is UI specific. This is not for general use.
This is not a widget for general usage, this is just a placeholder for descriptions of options that all widgets have in common.
Use them for any widget whenever it makes sense.
AutoShortcut1.ycp AutoShortcut2.ycp
Constructor & Destructor Documentation
Member Function Documentation
bool YWidget::autoShortcut |
( |
|
) |
const [inline] |
|
|
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, YDownloadProgress, YDumbTab, YFrame, YIntField, YLabel, YLogView, YMenuButton, YMultiLineEdit, YMultiSelectionBox, YPartitionSplitter, YProgressBar, YPushButton, YRadioButton, YRadioButtonGroup, YRichText, YSelectionBox, YSlider, YTable, YTextEntry, 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. |
virtual void YWidget::childDeleted |
( |
YWidget * |
child |
) |
[inline, virtual] |
|
|
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. |
string YWidget::debugLabel |
( |
|
) |
[virtual] |
|
|
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. |
virtual void YWidget::doneMultipleChanges |
( |
|
) |
[inline, virtual] |
|
|
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. |
bool YWidget::getEnabling |
( |
|
) |
const |
|
|
Queries the enabled of a widget. |
bool YWidget::getNotify |
( |
|
) |
const |
|
|
Returns whether the widget will notify, i.e. will case UserInput to return. |
bool YWidget::hasId |
( |
|
) |
const |
|
|
Checks whether or not the widget has an ID |
|
Return whether or not the widget has a weight. |
|
Gets the id of the widget |
int YWidget::internalId |
( |
|
) |
const [inline] |
|
|
Return the widget serial number (the internal widget ID). |
void YWidget::invalidate |
( |
|
) |
[inline, private] |
|
|
Make this widget invalid. This operation cannot be reversed. |
bool YWidget::isContainer |
( |
|
) |
const [virtual] |
|
|
Returns true if this is a container widget. The default implementation returns false.
Reimplemented in YContainerWidget. |
bool YWidget::isDialog |
( |
|
) |
const [virtual] |
|
|
Returns true if this is a dialog widget. The default implementation returns 'false'.
Reimplemented in YDialog. |
bool YWidget::isLayoutStretch |
( |
YUIDimension |
dim |
) |
const [virtual] |
|
|
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.
Reimplemented in YEmpty, and YSpacing. |
bool YWidget::isRadioButtonGroup |
( |
|
) |
const [virtual] |
|
|
Returns true if this is a button group widget. The default implementation return false.
Reimplemented in YRadioButtonGroup. |
bool YWidget::isReplacePoint |
( |
|
) |
const [virtual] |
|
|
Returns true if this is a replace point widget. The default implementation returns false.
Reimplemented in YReplacePoint. |
bool YWidget::isValid |
( |
|
) |
const [inline] |
|
|
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.
- Parameters:
-
dim | Dimension, either YD_HORIZ or YD_VERT |
Implemented in 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, YDownloadProgress, YDumbTab, YFrame, YIntField, YLabel, YLogView, YMenuButton, YMultiLineEdit, YMultiSelectionBox, YPartitionSplitter, YProgressBar, YPushButton, YRadioButton, YRadioButtonGroup, YRichText, YSelectionBox, YSlider, YTable, YTextEntry, 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. |
void YWidget::saveUserInput |
( |
YMacroRecorder * |
macroRecorder |
) |
[virtual] |
|
|
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. |
bool YWidget::sendKeyEvents |
( |
|
) |
const [inline] |
|
|
Returns 'true' if this widget should send key events, i.e. if it has `opt(`keyEvent) set. |
void YWidget::setAutoShortcut |
( |
bool |
_newAutoShortcut |
) |
[inline] |
|
|
Sets the 'autoShortcut' flag. |
void YWidget::setDefaultStretchable |
( |
YUIDimension |
dim, |
|
|
bool |
newStretch |
|
) |
|
|
|
Set the stretchable state to "newStretch". `hstretch or `vstretch options may override this. |
void YWidget::setEnabling |
( |
bool |
enabled |
) |
[virtual] |
|
|
Sets the enabled state of the widget. All new widgets are enabled per definition. Only enabled widgets can take user input. |
void YWidget::setId |
( |
const YCPValue & |
id |
) |
|
|
|
Sets the id of the widget |
bool YWidget::setKeyboardFocus |
( |
|
) |
[virtual] |
|
|
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. |
void YWidget::setNotify |
( |
bool |
notify |
) |
|
|
void YWidget::setParent |
( |
YWidget * |
parent |
) |
|
|
|
Set the parent YWidget of this widget. |
void YWidget::setSendKeyEvents |
( |
bool |
doSend |
) |
[inline] |
|
|
Specify whether or not this widget should send key events. |
void YWidget::setSize |
( |
long |
newwidth, |
|
|
long |
newheight |
|
) |
[virtual] |
|
|
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. |
void YWidget::setStretchable |
( |
YUIDimension |
dim, |
|
|
bool |
newStretch |
|
) |
|
|
|
Set the stretchable state to "newStretch" regardless of any `hstretch or `vstretch options. |
void YWidget::setWidgetRep |
( |
void * |
|
) |
|
|
|
Sets the pointer to the ui specific widget implementation. |
virtual const char* YWidget::shortcutProperty |
( |
|
) |
[inline, virtual] |
|
|
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, YComboBox, YIntField, YLogView, YMenuButton, YMultiLineEdit, YMultiSelectionBox, YPartitionSplitter, YPushButton, YRadioButton, YSelectionBox, YSlider, YTextEntry, and YTree. |
virtual void YWidget::startMultipleChanges |
( |
|
) |
[inline, virtual] |
|
|
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. |
bool YWidget::stretchable |
( |
YUIDimension |
dim |
) |
const [virtual] |
|
|
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.
- Parameters:
-
dim | Dimension, either YD_HORIZ or YD_VERT |
Reimplemented in YAlignment, YContainerWidget, YSplit, and YSquash. |
|
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.
- Parameters:
-
dim | Dimension, either YD_HORIZ or YD_VERT |
|
virtual char* YWidget::widgetClass |
( |
|
) |
[inline, virtual] |
|
|
Returns a descriptive name of this widget class for logging, debugging etc.
Reimplemented in YAlignment, YBarGraph, YCheckBox, YColoredLabel, YComboBox, YContainerWidget, YDialog, YDownloadProgress, YDumbTab, YEmpty, YFrame, YImage, YIntField, YLabel, YLogView, YMenuButton, YMultiLineEdit, YMultiSelectionBox, YPackageSelector, YPartitionSplitter, YProgressBar, YPushButton, YRadioButton, YRadioButtonGroup, YReplacePoint, YRichText, YSelectionBox, YSlider, YSpacing, YSplit, YSquash, YTable, YTextEntry, YTree, and YWizard. |
void * YWidget::widgetRep |
( |
|
) |
|
|
|
Returns a pointer to the ui specific widget implementation. |
|
Return the YDialog this widget belongs to. Returns 0 if there is no dialog parent. |
YWidget * YWidget::yParent |
( |
|
) |
const |
|
|
Return the parent YWidget of this widget. |
Member Data Documentation
|
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 documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:25 2007 for yast2-core by
1.3.6