NXWidgets: NXWidgets::CNumericEdit Class Reference

NXWidgets 1.19

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NXWidgets::CNumericEdit Class Reference

`#include <cnumericedit.hxx>`

Inheritance diagram for NXWidgets::CNumericEdit:

## Public Member Functions
| CNumericEdit (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, CWidgetStyle *style=(CWidgetStyle *) NULL)
virtual | ~CNumericEdit ()
virtual void | getPreferredDimensions (CRect &rect) const
virtual void | setFont (CNxFont *font)
int | getValue () const
void | setValue (int value)
int | getMaximum () const
void | setMaximum (int value)
int | getMinimum () const
void | setMinimum (int value)
int | getIncrement () const
void | setIncrement (int value)
Public Member Functions inherited from 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)
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)
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)
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)
Public Member Functions inherited from NXWidgets::CWidgetEventHandler
| CWidgetEventHandler ()
virtual | ~CWidgetEventHandler ()
virtual void | handleDropEvent (const CWidgetEventArgs &e)
virtual void | handleKeyPressEvent (const CWidgetEventArgs &e)
virtual void | handleCursorControlEvent (const CWidgetEventArgs &e)
virtual void | handleFocusEvent (const CWidgetEventArgs &e)
virtual void | handleBlurEvent (const CWidgetEventArgs &e)
virtual void | handleCloseEvent (const CWidgetEventArgs &e)
virtual void | handleHideEvent (const CWidgetEventArgs &e)
virtual void | handleShowEvent (const CWidgetEventArgs &e)
virtual void | handleEnableEvent (const CWidgetEventArgs &e)
virtual void | handleDisableEvent (const CWidgetEventArgs &e)
virtual void | handleValueChangeEvent (const CWidgetEventArgs &e)
virtual void | handleResizeEvent (const CWidgetEventArgs &e)
virtual void | handleMoveEvent (const CWidgetEventArgs &e)
virtual void | handleScrollEvent (const CWidgetEventArgs &e)
virtual void | handleDoubleClickEvent (const CWidgetEventArgs &e)

## Protected Member Functions
virtual void | onResize (nxgl_coord_t width, nxgl_coord_t height)
virtual void | handleClickEvent (const CWidgetEventArgs &e)
virtual void | handleReleaseEvent (const CWidgetEventArgs &e)
virtual void | handleReleaseOutsideEvent (const CWidgetEventArgs &e)
virtual void | handleActionEvent (const CWidgetEventArgs &e)
virtual void | handleDragEvent (const CWidgetEventArgs &e)
| CNumericEdit (const CNumericEdit &num)
Protected Member Functions inherited from NXWidgets::CNxWidget
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)

## Protected Attributes
CLabel * | m_label
CButton * | m_button_minus
CButton * | m_button_plus
CNxTimer * | m_timer
int | m_value
int | m_minimum
int | m_maximum
int | m_increment
int | m_timercount
Protected Attributes inherited from NXWidgets::CNxWidget
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

## Additional Inherited Members
Public Types inherited from NXWidgets::CNxWidget
enum | WidgetFlagType { WIDGET_BORDERLESS = 0x0001, WIDGET_DRAGGABLE = 0x0002, WIDGET_PERMEABLE = 0x0004, WIDGET_DOUBLE_CLICKABLE = 0x0008, WIDGET_NO_RAISE_EVENTS = 0x0010 }

## Detailed Description

Numeric edit control, with plus and minus buttons.

Definition at line 115 of file cnumericedit.hxx.

## Constructor & Destructor Documentation

## ◆ CNumericEdit() [1/2]

NXWidgets::CNumericEdit::CNumericEdit | ( | const CNumericEdit & | num | ) |
| inlineprotected

Copy constructor is protected to prevent usage.

Definition at line 151 of file cnumericedit.hxx.

## ◆ CNumericEdit() [2/2]

CNumericEdit::CNumericEdit | ( | CWidgetControl * | pWidgetControl,
|  | nxgl_coord_t | x,
|  | nxgl_coord_t | y,
|  | nxgl_coord_t | width,
|  | nxgl_coord_t | height,
|  | CWidgetStyle * | style = `(CWidgetStyle *)NULL`
| ) |  |

Constructor for a numeric edit control.

Parameters

  pWidgetControl | The controlling widget for the display
  x | The x coordinate of the text box, relative to its parent.
  y | The y coordinate of the text box, relative to its parent.
  width | The width of the textbox.
  height | The height of the textbox.
  style | The style that the button should use. If this is not specified, the button will use the global default widget style.

Definition at line 132 of file cnumericedit.cxx.

## ◆ ~CNumericEdit()

CNumericEdit::~CNumericEdit | ( |  | ) |
| virtual

Destructor.

Definition at line 159 of file cnumericedit.cxx.

## Member Function Documentation

## ◆ getIncrement()

int NXWidgets::CNumericEdit::getIncrement | ( |  | ) | const
| inline

Definition at line 205 of file cnumericedit.hxx.

## ◆ getMaximum()

int NXWidgets::CNumericEdit::getMaximum | ( |  | ) | const
| inline

Definition at line 199 of file cnumericedit.hxx.

## ◆ getMinimum()

int NXWidgets::CNumericEdit::getMinimum | ( |  | ) | const
| inline

Definition at line 202 of file cnumericedit.hxx.

## ◆ getPreferredDimensions()

void CNumericEdit::getPreferredDimensions | ( | CRect & | rect | ) | const
| 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.

Parameters

  rect | Reference to a rect to populate with data.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 168 of file cnumericedit.cxx.

## ◆ getValue()

int NXWidgets::CNumericEdit::getValue | ( | void |  | ) | const
| inline

Definition at line 196 of file cnumericedit.hxx.

## ◆ handleActionEvent()

void CNumericEdit::handleActionEvent | ( | const CWidgetEventArgs & | e | ) |
| protectedvirtual

Handle a widget action event. For CImage, this is a mouse button pre-release event.

Parameters

  e | The event data.

Reimplemented from NXWidgets::CWidgetEventHandler.

Definition at line 213 of file cnumericedit.cxx.

## ◆ handleClickEvent()

void CNumericEdit::handleClickEvent | ( | const CWidgetEventArgs & | e | ) |
| protectedvirtual

Handle a mouse button click event.

Parameters

  e | The event data.

Reimplemented from NXWidgets::CWidgetEventHandler.

Definition at line 181 of file cnumericedit.cxx.

## ◆ handleDragEvent()

void CNumericEdit::handleDragEvent | ( | const CWidgetEventArgs & | e | ) |
| protectedvirtual

Handle a mouse button drag event.

Parameters

  e | The event data.

Reimplemented from NXWidgets::CWidgetEventHandler.

Definition at line 248 of file cnumericedit.cxx.

## ◆ handleReleaseEvent()

void CNumericEdit::handleReleaseEvent | ( | const CWidgetEventArgs & | e | ) |
| protectedvirtual

Handle a mouse button release event that occurred within the bounds of the source widget.

Parameters

  e | The event data.

Reimplemented from NXWidgets::CWidgetEventHandler.

Definition at line 197 of file cnumericedit.cxx.

## ◆ handleReleaseOutsideEvent()

void CNumericEdit::handleReleaseOutsideEvent | ( | const CWidgetEventArgs & | e | ) |
| protectedvirtual

Handle a mouse button release event that occurred outside the bounds of the source widget.

Parameters

  e | The event data.

Reimplemented from NXWidgets::CWidgetEventHandler.

Definition at line 205 of file cnumericedit.cxx.

## ◆ onResize()

void CNumericEdit::onResize | ( | nxgl_coord_t | width,
|  | nxgl_coord_t | height
| ) |  |
| protectedvirtual

Resize the widget to the new dimensions.

Parameters

  width | The new width.
  height | The new height.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 177 of file cnumericedit.cxx.

## ◆ setFont()

void CNumericEdit::setFont | ( | CNxFont * | font | ) |
| virtual

Sets the font.

Parameters

  font | A pointer to the font to use.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 172 of file cnumericedit.cxx.

## ◆ setIncrement()

void NXWidgets::CNumericEdit::setIncrement | ( | int | value | ) |
| inline

Definition at line 206 of file cnumericedit.hxx.

## ◆ setMaximum()

void NXWidgets::CNumericEdit::setMaximum | ( | int | value | ) |
| inline

Definition at line 200 of file cnumericedit.hxx.

## ◆ setMinimum()

void NXWidgets::CNumericEdit::setMinimum | ( | int | value | ) |
| inline

Definition at line 203 of file cnumericedit.hxx.

## ◆ setValue()

void CNumericEdit::setValue | ( | int | value | ) |

Definition at line 256 of file cnumericedit.cxx.

## Member Data Documentation

## ◆ m_button_minus

CButton* NXWidgets::CNumericEdit::m_button_minus
| protected

Definition at line 119 of file cnumericedit.hxx.

## ◆ m_button_plus

CButton* NXWidgets::CNumericEdit::m_button_plus
| protected

Definition at line 120 of file cnumericedit.hxx.

## ◆ m_increment

int NXWidgets::CNumericEdit::m_increment
| protected

Definition at line 125 of file cnumericedit.hxx.

## ◆ m_label

CLabel* NXWidgets::CNumericEdit::m_label
| protected

Definition at line 118 of file cnumericedit.hxx.

## ◆ m_maximum

int NXWidgets::CNumericEdit::m_maximum
| protected

Definition at line 124 of file cnumericedit.hxx.

## ◆ m_minimum

int NXWidgets::CNumericEdit::m_minimum
| protected

Definition at line 123 of file cnumericedit.hxx.

## ◆ m_timer

CNxTimer* NXWidgets::CNumericEdit::m_timer
| protected

Definition at line 121 of file cnumericedit.hxx.

## ◆ m_timercount

int NXWidgets::CNumericEdit::m_timercount
| protected

Definition at line 126 of file cnumericedit.hxx.

## ◆ m_value

int NXWidgets::CNumericEdit::m_value
| protected

Definition at line 122 of file cnumericedit.hxx.

The documentation for this class was generated from the following files:

- cnumericedit.hxx
- cnumericedit.cxx