|
NXWidgets
1.19
|
#include <cnxwidget.hxx>

Classes | |
| struct | Flags |
| struct | WidgetBorderSize |
Public Types | |
| enum | WidgetFlagType { WIDGET_BORDERLESS = 0x0001, WIDGET_DRAGGABLE = 0x0002, WIDGET_PERMEABLE = 0x0004, WIDGET_DOUBLE_CLICKABLE = 0x0008, WIDGET_NO_RAISE_EVENTS = 0x0010 } |
Public Member Functions | |
| CNxWidget (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, uint32_t flags, FAR const CWidgetStyle *style=(FAR const CWidgetStyle *) NULL) | |
| virtual | ~CNxWidget (void) |
| nxgl_coord_t | getX (void) const |
| nxgl_coord_t | getY (void) const |
| nxgl_coord_t | getRelativeX (void) const |
| nxgl_coord_t | getRelativeY (void) const |
| bool | hasFocus (void) const |
| bool | isDeleted (void) const |
| bool | isDrawingEnabled (void) const |
| bool | isHidden (void) const |
| bool | isEnabled (void) const |
| bool | isPermeable (void) const |
| bool | isDoubleClickable (void) const |
| bool | isBorderless (void) const |
| bool | isClicked (void) const |
| bool | isBeingDragged (void) const |
| nxgl_coord_t | getWidth (void) const |
| nxgl_coord_t | getHeight (void) const |
| void | getSize (struct nxgl_size_s &size) const |
| void | getPos (struct nxgl_point_s &pos) const |
| CRect | getBoundingBox (void) |
| void | getBorderSize (WidgetBorderSize &borderSize) |
| CNxWidget * | getParent (void) const |
| CNxWidget * | getFocusedWidget (void) |
| virtual void | getPreferredDimensions (CRect &rect) const |
| void | getClientRect (CRect &rect) const |
| void | getRect (CRect &rect) const |
| CNxFont * | getFont (void) const |
| nxgl_mxpixel_t | getBackgroundColor (void) const |
| nxgl_mxpixel_t | getSelectedBackgroundColor (void) const |
| nxgl_mxpixel_t | getShineEdgeColor (void) const |
| nxgl_mxpixel_t | getShadowEdgeColor (void) const |
| nxgl_mxpixel_t | getHighlightColor (void) const |
| nxgl_mxpixel_t | getDisabledTextColor (void) const |
| nxgl_mxpixel_t | getEnabledTextColor (void) const |
| nxgl_mxpixel_t | getSelectedTextColor (void) const |
| const CWidgetStyle * | getWidgetStyle () const |
| void | setBorderless (bool isBorderless) |
| void | setDraggable (bool isDraggable) |
| void | setPermeable (bool permeable) |
| void | setDoubleClickable (bool doubleClickable) |
| void | addWidgetEventHandler (CWidgetEventHandler *eventHandler) |
| void | removeWidgetEventHandler (CWidgetEventHandler *eventHandler) |
| int | nWidgetEventHandlers (void) const |
| void | setRaisesEvents (bool raises) |
| bool | raisesEvents (void) const |
| void | disableDrawing (void) |
| void | enableDrawing (void) |
| void | setBackgroundColor (nxgl_mxpixel_t color) |
| void | setSelectedBackgroundColor (nxgl_mxpixel_t color) |
| void | setShineEdgeColor (nxgl_mxpixel_t color) |
| void | setShadowEdgeColor (nxgl_mxpixel_t color) |
| void | setHighlightColor (nxgl_mxpixel_t color) |
| void | setDisabledTextColor (nxgl_mxpixel_t color) |
| void | setEnabledTextColor (nxgl_mxpixel_t color) |
| void | setSelectedTextColor (nxgl_mxpixel_t color) |
| virtual void | setFont (CNxFont *font) |
| void | redraw (void) |
| bool | enable (void) |
| bool | disable (void) |
| void | close (void) |
| bool | show (void) |
| bool | hide (void) |
| virtual bool | click (nxgl_coord_t x, nxgl_coord_t y) |
| virtual bool | isDoubleClick (nxgl_coord_t x, nxgl_coord_t y) |
| bool | doubleClick (nxgl_coord_t x, nxgl_coord_t y) |
| bool | release (nxgl_coord_t x, nxgl_coord_t y) |
| bool | drag (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY) |
| bool | keyPress (nxwidget_char_t key) |
| bool | cursorControl (ECursorControl control) |
| bool | focus (void) |
| bool | blur (void) |
| bool | moveTo (nxgl_coord_t x, nxgl_coord_t y) |
| bool | resize (nxgl_coord_t width, nxgl_coord_t height) |
| bool | changeDimensions (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height) |
| void | moveChildToDeleteQueue (CNxWidget *widget) |
| void | setFocusedWidget (CNxWidget *widget) |
| virtual bool | checkCollision (nxgl_coord_t x, nxgl_coord_t y) const |
| virtual bool | checkCollision (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height) const |
| bool | checkCollision (CNxWidget *widget) const |
| void | addWidget (CNxWidget *widget) |
| void | insertWidget (CNxWidget *widget) |
| void | setParent (CNxWidget *parent) |
| void | destroy (void) |
| bool | remove (void) |
| bool | removeChild (CNxWidget *widget) |
| const CNxWidget * | getChild (int index) const |
| int | getChildCount (void) const |
| void | setBorderSize (const WidgetBorderSize &borderSize) |
Protected Member Functions | |
| void | useWidgetStyle (const CWidgetStyle *style) |
| virtual void | drawContents (CGraphicsPort *port) |
| virtual void | drawBorder (CGraphicsPort *port) |
| void | drawChildren (void) |
| void | closeChild (CNxWidget *widget) |
| void | startDragging (nxgl_coord_t x, nxgl_coord_t y) |
| void | stopDragging (nxgl_coord_t x, nxgl_coord_t y) |
| CNxWidget (const CNxWidget &widget) | |
| virtual void | onClick (nxgl_coord_t x, nxgl_coord_t y) |
| virtual void | onDoubleClick (nxgl_coord_t x, nxgl_coord_t y) |
| virtual void | onPreRelease (nxgl_coord_t x, nxgl_coord_t y) |
| virtual void | onRelease (nxgl_coord_t x, nxgl_coord_t y) |
| virtual void | onReleaseOutside (nxgl_coord_t x, nxgl_coord_t y) |
| virtual void | onDrag (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY) |
| virtual void | onDragStart (void) |
| virtual void | onDragStop (void) |
| virtual void | onFocus (void) |
| virtual void | onBlur (void) |
| virtual void | onEnable (void) |
| virtual void | onDisable (void) |
| virtual void | onResize (nxgl_coord_t width, nxgl_coord_t height) |
Protected Attributes | |
| CWidgetControl * | m_widgetControl |
| CRect | m_rect |
| nxgl_coord_t | m_grabPointX |
| nxgl_coord_t | m_grabPointY |
| nxgl_coord_t | m_newX |
| nxgl_coord_t | m_newY |
| CWidgetStyle | m_style |
| Flags | m_flags |
| CWidgetEventHandlerList * | m_widgetEventHandlers |
| struct timespec | m_lastClickTime |
| nxgl_coord_t | m_lastClickX |
| nxgl_coord_t | m_lastClickY |
| int | m_doubleClickBounds |
| CNxWidget * | m_parent |
| CNxWidget * | m_focusedChild |
| TNxArray< CNxWidget * > | m_children |
| WidgetBorderSize | m_borderSize |
Class providing all the basic functionality of a NxWidget. All other widgets must must inherit from this class.
Definition at line 121 of file cnxwidget.hxx.
| enum NXWidgets::CNxWidget::WidgetFlagType |
Enum listing flags that can be set in the constructor's "flags" parameter.
Definition at line 129 of file cnxwidget.hxx.
|
inlineprotected |
Copy constructor is protected to prevent usage.
Definition at line 271 of file cnxwidget.hxx.
| NXWidgets::CNxWidget::CNxWidget | ( | CWidgetControl * | pWidgetControl, |
| nxgl_coord_t | x, | ||
| nxgl_coord_t | y, | ||
| nxgl_coord_t | width, | ||
| nxgl_coord_t | height, | ||
| uint32_t | flags, | ||
| FAR const CWidgetStyle * | style = (FAR const CWidgetStyle *) NULL |
||
| ) |
CNxWidget constructor.
| pWidgetControl | The controllwing widget for the display |
| x | The x coordinate of the widget. |
| y | The y coordinate of the widget. |
| width | The width of the widget. |
| height | The height of the widget. |
| flags | Bitmask specifying some set-up values for the widget. |
| style | The style that the button should use. If this is not specified, the button will use the global default widget style. |
|
virtual |
Destructor.
Definition at line 203 of file cnxwidget.cxx.
| void CNxWidget::addWidget | ( | CNxWidget * | widget | ) |
Adds a widget to this widget's child stack. The widget is added to the top of the stack. Note that the widget can only be added if it is not already a child of another widget.
| widget | A pointer to the widget to add to the child list. |
Definition at line 1293 of file cnxwidget.cxx.
|
inline |
Adds a widget event handler. The event handler will receive all events raised by this widget.
| eventHandler | A pointer to the event handler. |
Definition at line 854 of file cnxwidget.hxx.
| bool CNxWidget::blur | ( | void | ) |
Remove focus from the widget.
Definition at line 951 of file cnxwidget.cxx.
| bool CNxWidget::changeDimensions | ( | nxgl_coord_t | x, |
| nxgl_coord_t | y, | ||
| nxgl_coord_t | width, | ||
| nxgl_coord_t | height | ||
| ) |
Resize and move the widget in one operation. Only performs one redraw so it is faster than calling the two separate functions.
| x | The new x coordinate. |
| y | The new y coordinate. |
| width | The new width. |
| height | The new height. |
Definition at line 1151 of file cnxwidget.cxx.
|
virtual |
Checks if the supplied coordinates collide with this widget.
| x | The x coordinate to check. |
| y | The y coordinate to check. |
Definition at line 1229 of file cnxwidget.cxx.
|
virtual |
Checks if the supplied rectangle definition collides with this widget.
| x | The x coordinate of the rectangle to check. |
| y | The y coordinate of the rectangle to check. |
| width | The width of the rectangle to check. |
| height | The height of the rectangle to check. |
Definition at line 1253 of file cnxwidget.cxx.
| bool CNxWidget::checkCollision | ( | CNxWidget * | widget | ) | const |
Checks if the supplied widget collides with this widget.
| widget | A pointer to another widget to check for collisions with. |
Definition at line 1275 of file cnxwidget.cxx.
|
virtual |
Click this widget at the supplied coordinates. This should only be overridden in subclasses if the default click behaviour needs to be changed. If the subclassed widget should just respond to a standard click, the onClick() method should be overridden instead.
| x | X coordinate of the click. |
| y | Y coordinate of the click. |
Definition at line 630 of file cnxwidget.cxx.
| void CNxWidget::close | ( | void | ) |
Erases the widget, marks it as deleted, and moves it to the CNxWidget deletion queue. Widgets are automatically deleted by the framework and should not be deleted externally.
Definition at line 552 of file cnxwidget.cxx.
|
protected |
Erase and remove the supplied child widget from this widget and send it to the deletion queue.
| widget | The widget to close. |
Remove the supplied child widget from this widget and send it to the deletion queue.
| widget | The widget to close. |
Definition at line 1484 of file cnxwidget.cxx.
| bool CNxWidget::cursorControl | ( | ECursorControl | control | ) |
Send a cursor control event to the widget.
| control | The cursor control code to send to the widget. |
Send a cursor control event to the widget.
| cursorControl | The cursor control code o send to the widget. |
Definition at line 886 of file cnxwidget.cxx.
|
inline |
Delete this widget. This should never be called in user code; widget deletion is handled internally.
Definition at line 1294 of file cnxwidget.hxx.
| bool CNxWidget::disable | ( | void | ) |
Disabled the widget.
Definition at line 532 of file cnxwidget.cxx.
|
inline |
Disabled drawing of this widget. Widgets hidden using this method will still be processed.
Definition at line 908 of file cnxwidget.hxx.
| bool CNxWidget::doubleClick | ( | nxgl_coord_t | x, |
| nxgl_coord_t | y | ||
| ) |
Double-click this widget at the supplied coordinates. This should only be overridden in subclasses if the default double-click behaviour needs to be changed. If the subclassed widget should just respond to a standard double-click, the onDoubleClick() method should be overridden instead.
| x | X coordinate of the click. |
| y | Y coordinate of the click. |
Definition at line 719 of file cnxwidget.cxx.
| bool CNxWidget::drag | ( | nxgl_coord_t | x, |
| nxgl_coord_t | y, | ||
| nxgl_coord_t | vX, | ||
| nxgl_coord_t | vY | ||
| ) |
Drag the widget to the supplied coordinates.
| x | The x coordinate of the mouse. |
| y | The y coordinate of the mouse. |
| vX | The horizontal distance that the mouse was dragged. |
| vY | The vertical distance that the mouse was dragged. |
Definition at line 835 of file cnxwidget.cxx.
|
inlineprotectedvirtual |
Draw the area of this widget that falls within the clipping region. Called by the redraw() function to draw all visible regions.
| port | The CGraphicsPort to draw to. |
Reimplemented in NXWidgets::CMultiLineTextBox, NXWidgets::CTextBox, NXWidgets::CLabel, NXWidgets::CSliderVertical, NXWidgets::CSliderHorizontal, NXWidgets::CButton, NXWidgets::CImage, NXWidgets::CGlyphSliderHorizontal, NXWidgets::CCheckBox, NXWidgets::CScrollingPanel, NXWidgets::CGlyphButton, NXWidgets::CListBox, NXWidgets::CCycleButton, NXWidgets::CStickyButton, NXWidgets::CProgressBar, NXWidgets::CSliderHorizontalGrip, NXWidgets::CSliderVerticalGrip, NXWidgets::CButtonArray, NXWidgets::CStickyImage, and NXWidgets::CTabPanel.
Definition at line 234 of file cnxwidget.hxx.
|
protected |
Draw all visible regions of this widget's children.
Definition at line 1468 of file cnxwidget.cxx.
|
protectedvirtual |
Draw the area of this widget that falls within the clipping region. Called by the redraw() function to draw all visible regions.
| port | The CGraphicsPort to draw to. |
Reimplemented in NXWidgets::CMultiLineTextBox, NXWidgets::CLabel, NXWidgets::CSliderVertical, NXWidgets::CSliderHorizontal, NXWidgets::CGlyphSliderHorizontal, NXWidgets::CScrollbarPanel, NXWidgets::CTextBox, NXWidgets::CButton, NXWidgets::CRadioButton, NXWidgets::CImage, NXWidgets::CCheckBox, NXWidgets::CScrollingPanel, NXWidgets::CGlyphButton, NXWidgets::CListBox, NXWidgets::CScrollingListBox, NXWidgets::CCycleButton, NXWidgets::CScrollingTextBox, NXWidgets::CStickyButton, NXWidgets::CProgressBar, NXWidgets::CRadioButtonGroup, NXWidgets::CSliderHorizontalGrip, NXWidgets::CSliderVerticalGrip, NXWidgets::CButtonArray, NXWidgets::CStickyButtonArray, NXWidgets::CTabPanel, and NXWidgets::CStickyImage.
Definition at line 1458 of file cnxwidget.cxx.
| bool CNxWidget::enable | ( | void | ) |
Enables the widget.
Definition at line 512 of file cnxwidget.cxx.
|
inline |
Enables drawing of this widget.
Definition at line 917 of file cnxwidget.hxx.
| bool CNxWidget::focus | ( | void | ) |
Give the widget focus.
Definition at line 913 of file cnxwidget.cxx.
|
inline |
Gets the color used for the normal background fill.
Definition at line 716 of file cnxwidget.hxx.
|
inline |
Get the dimensions of the border
Definition at line 638 of file cnxwidget.hxx.
|
inline |
Get the window bounding box in physical display coordinated.
Definition at line 628 of file cnxwidget.hxx.
| const CNxWidget * CNxWidget::getChild | ( | int | index | ) | const |
Get the child widget at the specified index.
| index | Index of the child to retrieve. |
Definition at line 1408 of file cnxwidget.cxx.
|
inline |
Get the number of child widgets.
Definition at line 1337 of file cnxwidget.hxx.
| void CNxWidget::getClientRect | ( | CRect & | rect | ) | const |
Insert the properties of the space within this widget that is available for children into the rect passed in as a parameter. All coordinates are relative to this widget.
| rect | Reference to a rect to populate with data. |
Definition at line 421 of file cnxwidget.cxx.
|
inline |
Gets the color used for text in a disabled widget.
Definition at line 771 of file cnxwidget.hxx.
|
inline |
Gets the color used for text in a enabled widget.
Definition at line 782 of file cnxwidget.hxx.
|
inline |
Get a pointer to this widget's focused child.
Definition at line 663 of file cnxwidget.hxx.
|
inline |
Gets a pointer to the widget's font.
Definition at line 705 of file cnxwidget.hxx.
|
inline |
Get the height of the widget.
Definition at line 593 of file cnxwidget.hxx.
|
inline |
Gets the color used as the fill in focused window borders.
Definition at line 760 of file cnxwidget.hxx.
|
inline |
Get a pointer to this widget's parent.
Definition at line 652 of file cnxwidget.hxx.
|
inline |
Get the position of the widget
Definition at line 616 of file cnxwidget.hxx.
|
virtual |
Insert the dimensions that this widget wants to have into the rect passed in as a parameter. All coordinates are relative to the widget's parent.
| rect | Reference to a rect to populate with data. |
Reimplemented in NXWidgets::CScrollingListBox, NXWidgets::CListBox, NXWidgets::CCycleButton, NXWidgets::CLabel, NXWidgets::CButtonArray, NXWidgets::CImage, NXWidgets::CGlyphButton, NXWidgets::CRadioButtonGroup, and NXWidgets::CNumericEdit.
Definition at line 408 of file cnxwidget.cxx.
| void CNxWidget::getRect | ( | CRect & | rect | ) | const |
Insert the properties of the space within this widget that is available for children into the rect passed in as a parameter. Identical to getClientRect() except that all coordinates are absolute positions within the window.
| rect | Reference to a rect to populate with data. |
Definition at line 448 of file cnxwidget.cxx.
| nxgl_coord_t CNxWidget::getRelativeX | ( | void | ) | const |
Get the x coordinate of the widget relative to its parent.
Definition at line 277 of file cnxwidget.cxx.
| nxgl_coord_t CNxWidget::getRelativeY | ( | void | ) | const |
Get the y coordinate of the widget relative to its parent.
Definition at line 288 of file cnxwidget.cxx.
|
inline |
Gets the color used for the background fill when the widget is selected.
Definition at line 727 of file cnxwidget.hxx.
|
inline |
Gets the color used for text in a clicked widget.
Definition at line 793 of file cnxwidget.hxx.
|
inline |
Gets the color used as the dark edge in bevelled boxes.
Definition at line 749 of file cnxwidget.hxx.
|
inline |
Gets the color used as the light edge in bevelled boxes.
Definition at line 738 of file cnxwidget.hxx.
|
inline |
|
inline |
Get the style used by this widget
Definition at line 804 of file cnxwidget.hxx.
|
inline |
| nxgl_coord_t CNxWidget::getX | ( | void | ) | const |
Get the x coordinate of the widget in "Widget space".
Definition at line 245 of file cnxwidget.cxx.
| nxgl_coord_t CNxWidget::getY | ( | void | ) | const |
Get the y coordinate of the widget in "Widget space".
Definition at line 261 of file cnxwidget.cxx.
|
inline |
Is the widget active? A value of true indicates that this widget has focus or is an ancestor of the widget with focus.
Definition at line 472 of file cnxwidget.hxx.
| bool CNxWidget::hide | ( | void | ) |
Erases the widget and makes it invisible. Does not re-assign focus to another widget.
Definition at line 607 of file cnxwidget.cxx.
| void CNxWidget::insertWidget | ( | CNxWidget * | widget | ) |
Inserts a widget into this widget's child stack at the bottom of the stack. Note that the widget can only be added if it is not already a child of another widget.
| widget | A pointer to the widget to add to the child list. |
Definition at line 1321 of file cnxwidget.cxx.
|
inline |
Is the widget being dragged?
Definition at line 571 of file cnxwidget.hxx.
|
inline |
Does the widget have a border?
Definition at line 549 of file cnxwidget.hxx.
|
inline |
Is the widget clicked?
Definition at line 560 of file cnxwidget.hxx.
| bool CNxWidget::isDeleted | ( | void | ) | const |
Has the widget been marked for deletion? This function recurses up the widget hierarchy and only returns true if all of the widgets in the ancestor chain are not deleted.
Widgets marked for deletion are automatically deleted and should not be interacted with.
Definition at line 304 of file cnxwidget.cxx.
|
virtual |
Check if the click is a double-click.
| x | X coordinate of the click. |
| y | Y coordinate of the click. |
Reimplemented in NXWidgets::CListBox.
Definition at line 687 of file cnxwidget.cxx.
|
inline |
IS the widget double-clickable?
Definition at line 538 of file cnxwidget.hxx.
| bool CNxWidget::isDrawingEnabled | ( | void | ) | const |
Is the widget allowed to draw? This function recurses up the widget hierarchy and only returns true if all of the widgets in the ancestor chain are visible.
Definition at line 325 of file cnxwidget.cxx.
| bool CNxWidget::isEnabled | ( | void | ) | const |
Is the widget enabled? This function recurses up the widget hierarchy and only returns true if all of the widgets in the ancestor chain are enabled.
Definition at line 381 of file cnxwidget.cxx.
| bool CNxWidget::isHidden | ( | void | ) | const |
Is the widget hidden? This function recurses up the widget hierarchy and returns true if any of the widgets in the ancestor chain are hidden.
Definition at line 354 of file cnxwidget.cxx.
|
inline |
Are the widget's edges permeable or solid? Permeable widgets do not enforce their dimensions on the coordinates and dimensions of child widgets.
Definition at line 528 of file cnxwidget.hxx.
| bool CNxWidget::keyPress | ( | nxwidget_char_t | key | ) |
Send a keypress to the widget.
| key | The keycode to send to the widget. |
Definition at line 858 of file cnxwidget.cxx.
| void CNxWidget::moveChildToDeleteQueue | ( | CNxWidget * | widget | ) |
Moves the supplied child widget to the deletion queue. For framework use only.
| widget | A pointer to the child widget. |
Definition at line 1168 of file cnxwidget.cxx.
| bool CNxWidget::moveTo | ( | nxgl_coord_t | x, |
| nxgl_coord_t | y | ||
| ) |
Move the widget to the new coordinates. Co-ordinates are relative to the parent widget.
| x | The new x coordinate. |
| y | The new y coordinate. |
Definition at line 990 of file cnxwidget.cxx.
|
inline |
Return the number of registered event handlers
Definition at line 876 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget loses focus. Override this when creating new widgets if the widget should exhibit additional behaviour when losing focus.
Reimplemented in NXWidgets::CTextBox.
Definition at line 374 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget is clicked. Override this when creating new widgets if the widget should exhibit additional behaviour when it is clicked.
| x | The x coordinate of the click. |
| y | The y coordinate of the click. |
Reimplemented in NXWidgets::CMultiLineTextBox, NXWidgets::CButton, NXWidgets::CSliderVertical, NXWidgets::CSliderHorizontal, NXWidgets::CTextBox, NXWidgets::CGlyphSliderHorizontal, NXWidgets::CImage, NXWidgets::CScrollingPanel, NXWidgets::CGlyphButton, NXWidgets::CCheckBox, NXWidgets::CKeypad, NXWidgets::CListBox, NXWidgets::CRadioButton, NXWidgets::CStickyButton, NXWidgets::CGlyphSliderHorizontalGrip, NXWidgets::CSliderHorizontalGrip, NXWidgets::CSliderVerticalGrip, NXWidgets::CButtonArray, NXWidgets::CLatchButton, CDraggableLabel, NXWidgets::CStickyImage, and NXWidgets::CLatchButtonArray.
Definition at line 282 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget is disabled. Override this when creating new widgets if the widget should exhibit additional behaviour when disabled.
Definition at line 390 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget is double-clicked. Override this when creating new widgets if the widget should exhibit additional behaviour when it is double-clicked. To change the conditions that apply in detecting a double-click, override the isDoubleClicked() method.
| x | The x coordinate of the click. |
| y | The y coordinate of the click. |
Reimplemented in NXWidgets::CMultiLineTextBox, NXWidgets::CTextBox, and NXWidgets::CListBox.
Definition at line 295 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget is dragged. Override this when creating new widgets if the widget should exhibit additional behaviour when it is dragged.
| x | The x coordinate of the mouse. |
| y | The y coordinate of the mouse. |
| vX | X distance dragged. |
| vY | Y distance dragged. |
Reimplemented in NXWidgets::CGlyphSliderHorizontalGrip, NXWidgets::CSliderHorizontalGrip, NXWidgets::CSliderVerticalGrip, and NXWidgets::CScrollingPanel.
Definition at line 341 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget starts being dragged. Override this when creating new widgets if the widget should exhibit additional behaviour when dragging starts.
Definition at line 350 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget stops being dragged. Override this when creating new widgets if the widget should exhibit additional behaviour when dragging stops.
Definition at line 358 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget is enabled. Override this when creating new widgets if the widget should exhibit additional behaviour when enabled.
Definition at line 382 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget gains focus. Override this when creating new widgets if the widget should exhibit additional behaviour when gaining focus.
Definition at line 366 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called just before the widget is released; the widget will be in the clicked stated. Override this when creating new widgets if the widget should exhibit additional behaviour when it is released.
| x | The x coordinate of the mouse when released. |
| y | The y coordinate of the mouse when released. |
Reimplemented in NXWidgets::CButton, NXWidgets::CImage, NXWidgets::CGlyphButton, NXWidgets::CCycleButton, and NXWidgets::CButtonArray.
Definition at line 306 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called just after the widget is released; the widget will be in the released stated. Override this when creating new widgets if the widget should exhibit additional behaviour when it is released.
| x | The x coordinate of the mouse when released. |
| y | The y coordinate of the mouse when released. |
Reimplemented in NXWidgets::CButton, NXWidgets::CImage, NXWidgets::CGlyphButton, NXWidgets::CStickyButton, NXWidgets::CGlyphSliderHorizontalGrip, NXWidgets::CButtonArray, NXWidgets::CSliderHorizontalGrip, NXWidgets::CSliderVerticalGrip, and NXWidgets::CStickyImage.
Definition at line 317 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget is released outside of its boundaries. Override this when creating new widgets if the widget should exhibit additional behaviour when it is released outside of its boundaries.
| x | The x coordinate of the mouse when released. |
| y | The y coordinate of the mouse when released. |
Reimplemented in NXWidgets::CButton, NXWidgets::CImage, NXWidgets::CGlyphButton, NXWidgets::CStickyButton, NXWidgets::CCycleButton, NXWidgets::CGlyphSliderHorizontalGrip, NXWidgets::CButtonArray, NXWidgets::CSliderHorizontalGrip, NXWidgets::CSliderVerticalGrip, and NXWidgets::CStickyImage.
Definition at line 328 of file cnxwidget.hxx.
|
inlineprotectedvirtual |
Called when the widget is resized. Override this when creating new widgets if the widget should exhibit additional behaviour when resized.
| width | The new width. |
| height | The new height. |
Reimplemented in NXWidgets::CMultiLineTextBox, NXWidgets::CCycleButton, NXWidgets::CLabel, NXWidgets::CSliderVertical, NXWidgets::CSliderHorizontal, NXWidgets::CGlyphSliderHorizontal, NXWidgets::CScrollingListBox, NXWidgets::CGlyphSliderHorizontalGrip, NXWidgets::CScrollingTextBox, NXWidgets::CNumericEdit, NXWidgets::CScrollbarHorizontal, and NXWidgets::CScrollbarVertical.
Definition at line 401 of file cnxwidget.hxx.
|
inline |
Check if event handling is enabled for this widget.
Definition at line 898 of file cnxwidget.hxx.
| void CNxWidget::redraw | ( | void | ) |
Draws the visible regions of the widget and the widget's child widgets.
Definition at line 483 of file cnxwidget.cxx.
| bool CNxWidget::release | ( | nxgl_coord_t | x, |
| nxgl_coord_t | y | ||
| ) |
Release this widget at the supplied coordinates. This should only be overridden in subclasses if the default release behaviour needs to be changed. If the subclassed widget should just respond to a standard release, the onRelease() method should be overridden instead.
| x | X coordinate of the release. |
| y | Y coordinate of the release. |
Definition at line 771 of file cnxwidget.cxx.
| bool CNxWidget::remove | ( | void | ) |
Remove this widget from the widget hierarchy. Returns responsibility for deleting the widget back to the developer. Does not unregister the widget from the VBL system. Does not erase the widget from the display.
Definition at line 1342 of file cnxwidget.cxx.
| bool CNxWidget::removeChild | ( | CNxWidget * | widget | ) |
Remove a child widget from the widget hierarchy. Returns responsibility for deleting the widget back to the developer. Does not unregister the widget from the VBL system. Does not erase the widget from the display.
| widget | Pointer to the widget to remove from the hierarchy. |
Definition at line 1362 of file cnxwidget.cxx.
|
inline |
Remove a widget event handler.
| eventHandler | A pointer to the event handler to remove. |
Definition at line 865 of file cnxwidget.hxx.
| bool CNxWidget::resize | ( | nxgl_coord_t | width, |
| nxgl_coord_t | height | ||
| ) |
Resize the widget to the new dimensions.
| width | The new width. |
| height | The new height. |
Definition at line 1079 of file cnxwidget.cxx.
|
inline |
Sets the normal background color.
| color | The new background color. |
Definition at line 928 of file cnxwidget.hxx.
| void CNxWidget::setBorderless | ( | bool | borderless | ) |
Sets this widget's border state.
| isBorderless | The border state. |
Definition at line 461 of file cnxwidget.cxx.
| void CNxWidget::setBorderSize | ( | const WidgetBorderSize & | borderSize | ) |
Sets the border size. The border cannot be drawn over in the drawContents() method.
| borderSize | The new border size. |
Definition at line 1425 of file cnxwidget.cxx.
|
inline |
Sets the text color to use when the widget is disabled.
| color | The new text color. |
Definition at line 983 of file cnxwidget.hxx.
|
inline |
Sets whether or not the widgets processes double-clicks.
| doubleClickable | The double-clickable state. |
Definition at line 842 of file cnxwidget.hxx.
|
inline |
Sets whether or not this widget can be dragged.
| isDraggable | The draggable state. |
Definition at line 820 of file cnxwidget.hxx.
|
inline |
Sets the text color to use when the widget is enabled.
| color | The new text color. |
Definition at line 994 of file cnxwidget.hxx.
| void CNxWidget::setFocusedWidget | ( | CNxWidget * | widget | ) |
Sets the supplied widget as the focused child. The widget must be a child of this widget.
| widget | A pointer to the child widget. |
Definition at line 1196 of file cnxwidget.cxx.
|
virtual |
Sets the font.
| font | A pointer to the font to use. |
NOTE: This font is not deleted when the widget is destroyed!
Reimplemented in NXWidgets::CMultiLineTextBox, NXWidgets::CScrollingListBox, NXWidgets::CLabel, NXWidgets::CButtonArray, NXWidgets::CScrollingTextBox, and NXWidgets::CNumericEdit.
Definition at line 474 of file cnxwidget.cxx.
|
inline |
Sets the highlight color.
| color | The new highlight color. |
Definition at line 972 of file cnxwidget.hxx.
|
inline |
Set the widget's parent to the widget passed in as a parameter. Called automatically when a widget is added as a child.
| parent | A pointer to the parent widget. |
Definition at line 1284 of file cnxwidget.hxx.
|
inline |
Sets whether or not child widgets can exceed this widget's dimensions.
| permeable | The permeable state. |
Definition at line 831 of file cnxwidget.hxx.
|
inline |
Enables or disables event firing for this widget.
| raises | True to enable events, false to disable. |
Definition at line 887 of file cnxwidget.hxx.
|
inline |
Sets the background color for a selected widget.
| color | The new selected background color. |
Definition at line 939 of file cnxwidget.hxx.
|
inline |
Sets the text color to use when the widget is highlighted or clicked.
| color | The new selected text color. |
Definition at line 1005 of file cnxwidget.hxx.
|
inline |
Sets the shadow edge color.
| color | The new shadow edge color. |
Definition at line 961 of file cnxwidget.hxx.
|
inline |
Sets the shiny edge color.
| color | The new shine edge color. |
Definition at line 950 of file cnxwidget.hxx.
| bool CNxWidget::show | ( | void | ) |
Draws the widget and makes it visible. Does not steal focus from other widgets.
Definition at line 585 of file cnxwidget.cxx.
|
protected |
Notify this widget that it is being dragged, and set its drag point.
| x | The x coordinate of the drag position relative to this widget. |
| y | The y coordinate of the drag position relative to this widget. |
Definition at line 1542 of file cnxwidget.cxx.
|
protected |
Notify this widget that it is no longer being dragged.
Definition at line 1561 of file cnxwidget.cxx.
|
protected |
Use the provided widget style
Definition at line 1437 of file cnxwidget.cxx.
|
protected |
Size of the widget borders.
Definition at line 208 of file cnxwidget.hxx.
List of child widgets.
Definition at line 204 of file cnxwidget.hxx.
|
protected |
Area in which a click is assumed to be a double-click.
Definition at line 198 of file cnxwidget.hxx.
|
protected |
Flags struct.
Definition at line 187 of file cnxwidget.hxx.
|
protected |
Pointer to the child widget that has focus.
Definition at line 203 of file cnxwidget.hxx.
|
protected |
Physical space x coordinate where dragging began.
Definition at line 176 of file cnxwidget.hxx.
|
protected |
Physical space y coordinate where dragging began.
Definition at line 177 of file cnxwidget.hxx.
|
protected |
System timer when last clicked.
Definition at line 195 of file cnxwidget.hxx.
|
protected |
X coordinate of last click.
Definition at line 196 of file cnxwidget.hxx.
|
protected |
Y coordinate of last click.
Definition at line 197 of file cnxwidget.hxx.
|
protected |
Physical x coordinate where widget is being dragged to.
Definition at line 178 of file cnxwidget.hxx.
|
protected |
Physical y coordinate where widget is being dragged to.
Definition at line 179 of file cnxwidget.hxx.
|
protected |
Pointer to the widget's parent.
Definition at line 202 of file cnxwidget.hxx.
|
protected |
Rectangle bounding the widget.
Definition at line 172 of file cnxwidget.hxx.
|
protected |
All style information used by a widget.
Definition at line 183 of file cnxwidget.hxx.
|
protected |
The controlling widget for the display
Definition at line 171 of file cnxwidget.hxx.
|
protected |
List of event handlers.
Definition at line 191 of file cnxwidget.hxx.
1.8.13