NXWidgets: NXWidgets::CGlyphSliderHorizontal Class Reference

NXWidgets 1.19

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

`#include <cglyphsliderhorizontal.hxx>`

Inheritance diagram for NXWidgets::CGlyphSliderHorizontal:

## Public Member Functions
| CGlyphSliderHorizontal (CWidgetControl *control, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t thickness, IBitmap *gripBitmap, nxwidget_pixel_t fillColor, bool fill=true)
virtual | ~CGlyphSliderHorizontal (void)
const int | getMinimumValue (void) const
const int | getMaximumValue (void) const
const int | getValue (void) const
const nxgl_coord_t | getPageSize (void) const
void | setMinimumValue (const int value)
void | setMaximumValue (const int value)
void | setValue (const int value)
void | setValueWithBitshift (const int32_t value)
void | setPageSize (const nxgl_coord_t pageSize)
void | setBarThickness (const nxgl_coord_t thickness)
virtual void | handleDragEvent (const CWidgetEventArgs &e)
nxgl_coord_t | getMinimumStep (void) const
Public Member Functions inherited from NXWidgets::ISlider
virtual | ~ISlider (void)
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)
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)
Public Member Functions inherited from NXWidgets::CWidgetEventHandler
| CWidgetEventHandler ()
virtual | ~CWidgetEventHandler ()
virtual void | handleClickEvent (const CWidgetEventArgs &e)
virtual void | handleDropEvent (const CWidgetEventArgs &e)
virtual void | handleReleaseEvent (const CWidgetEventArgs &e)
virtual void | handleReleaseOutsideEvent (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)
virtual void | handleActionEvent (const CWidgetEventArgs &e)

## Protected Member Functions
int32_t | getPhysicalMaximumValueWithBitshift (void) const
const int32_t | getGripValue (void) const
virtual void | drawContents (CGraphicsPort *port)
virtual void | drawBorder (CGraphicsPort *port)
virtual void | onResize (nxgl_coord_t width, nxgl_coord_t height)
virtual void | onClick (nxgl_coord_t x, nxgl_coord_t y)
Protected Member Functions inherited from NXWidgets::CNxWidget
void | useWidgetStyle (const CWidgetStyle *style)
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 | 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
CGlyphSliderHorizontalGrip * | m_grip
int | m_minimumValue
int | m_maximumValue
int32_t | m_value
nxgl_coord_t | m_minimumGripWidth
nxgl_coord_t | m_pageSize
int32_t | m_gutterWidth
uint32_t | m_contentSize
nxwidget_pixel_t | m_fillColor
bool | m_fill
uint32_t | m_barThickness
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

Widget providing a sliding "grip" that can be moved left and right in the "gutter". Essentially a scrollbar, but more generic.

Definition at line 98 of file cglyphsliderhorizontal.hxx.

## Constructor & Destructor Documentation

## ◆ CGlyphSliderHorizontal()

CGlyphSliderHorizontal::CGlyphSliderHorizontal | ( | CWidgetControl * | control,
|  | nxgl_coord_t | x,
|  | nxgl_coord_t | y,
|  | nxgl_coord_t | width,
|  | nxgl_coord_t | thickness,
|  | IBitmap * | gripBitmap,
|  | nxwidget_pixel_t | fillColor,
|  | bool | fill = `true`
| ) |  |

Constructor.

Parameters

  control | The widget control instance for the window.
  x | The x coordinate of the slider, relative to its parent.
  y | The y coordinate of the slider, relative to its parent.
  width | The width of the slider.
  thickness | The thickness of the slider.
  gripBitmap | The slider grip image
  fillColor | The color to use when filling the grip
  fill | True: The grip will be filled with fillColor

Definition at line 112 of file cglyphsliderhorizontal.cxx.

## ◆ ~CGlyphSliderHorizontal()

virtual NXWidgets::CGlyphSliderHorizontal::~CGlyphSliderHorizontal | ( | void |  | ) |
| inlinevirtual

Destructor.

NOTE: That the contained bitmap image is not destroyed when the image container is destroyed.

Definition at line 199 of file cglyphsliderhorizontal.hxx.

## Member Function Documentation

## ◆ drawBorder()

void CGlyphSliderHorizontal::drawBorder | ( | CGraphicsPort * | port | ) |
| protectedvirtual

Draw the area of this widget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters

  port | The CGraphicsPort to draw to.

See also
  redraw()

Reimplemented from NXWidgets::CNxWidget.

Definition at line 397 of file cglyphsliderhorizontal.cxx.

## ◆ drawContents()

void CGlyphSliderHorizontal::drawContents | ( | CGraphicsPort * | port | ) |
| protectedvirtual

Draw the area of this widget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters

  port | The CGraphicsPort to draw to.

See also
  redraw()

Reimplemented from NXWidgets::CNxWidget.

Definition at line 326 of file cglyphsliderhorizontal.cxx.

## ◆ getGripValue()

const int32_t CGlyphSliderHorizontal::getGripValue | ( | void |  | ) | const
| protected

Get the value represented by the top of the grip. return The value represented by the top of the grip.

Definition at line 304 of file cglyphsliderhorizontal.cxx.

## ◆ getMaximumValue()

const int NXWidgets::CGlyphSliderHorizontal::getMaximumValue | ( | void |  | ) | const
| inlinevirtual

Get the largest value that the slider can represent.

Returns
  The largest value.

Implements NXWidgets::ISlider.

Definition at line 218 of file cglyphsliderhorizontal.hxx.

## ◆ getMinimumStep()

nxgl_coord_t CGlyphSliderHorizontal::getMinimumStep | ( | void |  | ) | const

Get the smallest value that the slider can move through when dragged.

Returns
  The smallest value that the slider can move through when dragged.

Definition at line 263 of file cglyphsliderhorizontal.cxx.

## ◆ getMinimumValue()

const int NXWidgets::CGlyphSliderHorizontal::getMinimumValue | ( | void |  | ) | const
| inlinevirtual

Get the smallest value that the slider can represent.

Returns
  The smallest value.

Implements NXWidgets::ISlider.

Definition at line 207 of file cglyphsliderhorizontal.hxx.

## ◆ getPageSize()

const nxgl_coord_t NXWidgets::CGlyphSliderHorizontal::getPageSize | ( | void |  | ) | const
| inlinevirtual

Get the value represented by the height of the grip. For sliders, this would typically be 1 (so each new grip position is worth 1). For scrollbars, this would be the height of the scrolling widget.

Returns
  The page size.

Implements NXWidgets::ISlider.

Definition at line 242 of file cglyphsliderhorizontal.hxx.

## ◆ getPhysicalMaximumValueWithBitshift()

int32_t CGlyphSliderHorizontal::getPhysicalMaximumValueWithBitshift | ( | void |  | ) | const
| protected

Get the maximum possible value that the slider can represent. Useful when using the slider as a scrollbar, as the height of the grip prevents the full range of values being accessed (intentionally). The returned value is shifted left 16 places for more accuracy in fixed-point calculations.

Returns
  The maximum possible value that the slider can represent.

Definition at line 290 of file cglyphsliderhorizontal.cxx.

## ◆ getValue()

const int NXWidgets::CGlyphSliderHorizontal::getValue | ( | void |  | ) | const
| inlinevirtual

Get the current value of the slider.

return The current slider value.

Implements NXWidgets::ISlider.

Definition at line 229 of file cglyphsliderhorizontal.hxx.

## ◆ handleDragEvent()

void CGlyphSliderHorizontal::handleDragEvent | ( | const CWidgetEventArgs & | e | ) |
| virtual

Process events fired by the grip.

Parameters

  e | The event details.

Reimplemented from NXWidgets::CWidgetEventHandler.

Definition at line 235 of file cglyphsliderhorizontal.cxx.

## ◆ onClick()

void CGlyphSliderHorizontal::onClick | ( | nxgl_coord_t | x,
|  | nxgl_coord_t | y
| ) |  |
| protectedvirtual

Moves the grip towards the mouse.

Parameters

  x | The x coordinate of the click.
  y | The y coordinate of the click.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 507 of file cglyphsliderhorizontal.cxx.

## ◆ onResize()

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

Resize the slider to the new dimensions.

Parameters

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

Reimplemented from NXWidgets::CNxWidget.

Definition at line 479 of file cglyphsliderhorizontal.cxx.

## ◆ setBarThickness()

void NXWidgets::CGlyphSliderHorizontal::setBarThickness | ( | const nxgl_coord_t | thickness | ) |
| inline

Set the thickness of the slider bar

Parameters

  thickness | The slider bar thickness in pixels

Definition at line 312 of file cglyphsliderhorizontal.hxx.

## ◆ setMaximumValue()

void NXWidgets::CGlyphSliderHorizontal::setMaximumValue | ( | const int | value | ) |
| inlinevirtual

Set the largest value that the slider can represent.

Parameters

  value | The largest value.

Implements NXWidgets::ISlider.

Definition at line 266 of file cglyphsliderhorizontal.hxx.

## ◆ setMinimumValue()

void NXWidgets::CGlyphSliderHorizontal::setMinimumValue | ( | const int | value | ) |
| inlinevirtual

Set the smallest value that the slider can represent.

Parameters

  value | The smallest value.

Implements NXWidgets::ISlider.

Definition at line 253 of file cglyphsliderhorizontal.hxx.

## ◆ setPageSize()

void NXWidgets::CGlyphSliderHorizontal::setPageSize | ( | const nxgl_coord_t | pageSize | ) |
| inlinevirtual

Set the page size represented by the grip.

Parameters

  pageSize | The page size.

See also
  getPageSize().

Implements NXWidgets::ISlider.

Definition at line 300 of file cglyphsliderhorizontal.hxx.

## ◆ setValue()

void CGlyphSliderHorizontal::setValue | ( | const int | value | ) |
| virtual

Set the value that of the slider. This will reposition and redraw the grip.

Parameters

  value | The new value.

Set the value of the slider. This will reposition and redraw the grip.

Parameters

  value | The new value.

Implements NXWidgets::ISlider.

Definition at line 172 of file cglyphsliderhorizontal.cxx.

## ◆ setValueWithBitshift()

void CGlyphSliderHorizontal::setValueWithBitshift | ( | const int32_t | value | ) |
| virtual

Set the value that of the slider. This will reposition and redraw the grip. The supplied value should be shifted left 16 places. This ensures greater accuracy than the standard setValue() method if the slider is being used as a scrollbar.

Parameters

  value | The new value.

Implements NXWidgets::ISlider.

Definition at line 186 of file cglyphsliderhorizontal.cxx.

## Member Data Documentation

## ◆ m_barThickness

uint32_t NXWidgets::CGlyphSliderHorizontal::m_barThickness
| protected

Thickness (in pixels) of the bar

Definition at line 113 of file cglyphsliderhorizontal.hxx.

## ◆ m_contentSize

uint32_t NXWidgets::CGlyphSliderHorizontal::m_contentSize
| protected

Number of values in the min/max range.

Definition at line 110 of file cglyphsliderhorizontal.hxx.

## ◆ m_fill

bool NXWidgets::CGlyphSliderHorizontal::m_fill
| protected

Set true if fill is active

Definition at line 112 of file cglyphsliderhorizontal.hxx.

## ◆ m_fillColor

nxwidget_pixel_t NXWidgets::CGlyphSliderHorizontal::m_fillColor
| protected

Fill color for left side of "fuel gague"

Definition at line 111 of file cglyphsliderhorizontal.hxx.

## ◆ m_grip

CGlyphSliderHorizontalGrip* NXWidgets::CGlyphSliderHorizontal::m_grip
| protected

Pointer to the grip.

Definition at line 101 of file cglyphsliderhorizontal.hxx.

## ◆ m_gutterWidth

int32_t NXWidgets::CGlyphSliderHorizontal::m_gutterWidth
| protected

Width of the gutter, taking into account any adjustments made to the width of the grip.

Definition at line 108 of file cglyphsliderhorizontal.hxx.

## ◆ m_maximumValue

int NXWidgets::CGlyphSliderHorizontal::m_maximumValue
| protected

Maximum value that the grip can represent.

Definition at line 103 of file cglyphsliderhorizontal.hxx.

## ◆ m_minimumGripWidth

nxgl_coord_t NXWidgets::CGlyphSliderHorizontal::m_minimumGripWidth
| protected

Smallest width that the grip can become

Definition at line 105 of file cglyphsliderhorizontal.hxx.

## ◆ m_minimumValue

int NXWidgets::CGlyphSliderHorizontal::m_minimumValue
| protected

Minimum value that the grip can represent.

Definition at line 102 of file cglyphsliderhorizontal.hxx.

## ◆ m_pageSize

nxgl_coord_t NXWidgets::CGlyphSliderHorizontal::m_pageSize
| protected

Value of a page of data, used when clicking the gutter.

Definition at line 106 of file cglyphsliderhorizontal.hxx.

## ◆ m_value

int32_t NXWidgets::CGlyphSliderHorizontal::m_value
| protected

Current value of the slider.

Definition at line 104 of file cglyphsliderhorizontal.hxx.

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

- cglyphsliderhorizontal.hxx
- cglyphsliderhorizontal.cxx