summaryrefslogtreecommitdiff
path: root/NxWidgets/libnxwidgets
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-07-16 11:11:00 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-07-16 11:11:00 -0600
commit8e932634ac53d6ac42d60d805ccee4e2e285aa72 (patch)
treea3e76681eaf573592e4cbec182e30e0e4748110e /NxWidgets/libnxwidgets
parente891faed75967e2c257385212f788a80a64ffc83 (diff)
downloadnuttx-8e932634ac53d6ac42d60d805ccee4e2e285aa72.tar.gz
nuttx-8e932634ac53d6ac42d60d805ccee4e2e285aa72.tar.bz2
nuttx-8e932634ac53d6ac42d60d805ccee4e2e285aa72.zip
NxWM::CMediaPlayer: Fix of state related bugs + Size if CLabel is increased (in preparation for becoming a CListBox)
Diffstat (limited to 'NxWidgets/libnxwidgets')
-rw-r--r--NxWidgets/libnxwidgets/include/cglyphsliderhorizontal.hxx62
1 files changed, 32 insertions, 30 deletions
diff --git a/NxWidgets/libnxwidgets/include/cglyphsliderhorizontal.hxx b/NxWidgets/libnxwidgets/include/cglyphsliderhorizontal.hxx
index 7f5ea5445..354a097ac 100644
--- a/NxWidgets/libnxwidgets/include/cglyphsliderhorizontal.hxx
+++ b/NxWidgets/libnxwidgets/include/cglyphsliderhorizontal.hxx
@@ -1,7 +1,7 @@
/****************************************************************************
* NxWidgets/libnxwidgets/include/cglyphsliderhorizontal.hxx
*
- * Copyright (C) 2013 Ken Pettit. All rights reserved.
+ * Copyright (C) 2013, 2014 Ken Pettit. All rights reserved.
* Author: Ken Pettit <pettitkd@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
@@ -98,25 +98,25 @@ namespace NXWidgets
class CGlyphSliderHorizontal : public ISlider, public CNxWidget, public CWidgetEventHandler
{
protected:
- CGlyphSliderHorizontalGrip *m_grip; /**< Pointer to the grip. */
- nxgl_coord_t m_minimumValue; /**< Minimum value that the grip can represent. */
- nxgl_coord_t m_maximumValue; /**< Maximum value that the grip can represent. */
- int32_t m_value; /**< Current value of the slider. */
- nxgl_coord_t m_minimumGripWidth; /**< Smallest width that the grip can become */
- nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking
- the gutter. */
- int32_t m_gutterWidth; /**< Width of the gutter, taking into account
- any adjustments made to the width of the grip. */
- uint32_t m_contentSize; /**< Number of values in the min/max range. */
- nxwidget_pixel_t m_fillColor; /**< Fill color for left side of "fuel gague" */
- bool m_fill; /**< Set true if fill is active */
- uint32_t m_barThickness; /**< Thickness (in pixels) of the bar */
+ CGlyphSliderHorizontalGrip *m_grip; /**< Pointer to the grip. */
+ int m_minimumValue; /**< Minimum value that the grip can represent. */
+ int m_maximumValue; /**< Maximum value that the grip can represent. */
+ int32_t m_value; /**< Current value of the slider. */
+ nxgl_coord_t m_minimumGripWidth; /**< Smallest width that the grip can become */
+ nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking
+ the gutter. */
+ int32_t m_gutterWidth; /**< Width of the gutter, taking into account
+ any adjustments made to the width of the grip. */
+ uint32_t m_contentSize; /**< Number of values in the min/max range. */
+ nxwidget_pixel_t m_fillColor; /**< Fill color for left side of "fuel gague" */
+ bool m_fill; /**< Set true if fill is active */
+ uint32_t m_barThickness; /**< Thickness (in pixels) of the bar */
/**
* 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 bitshfted left 16 places for more accuracy in fixed-point
+ * The returned value is shifted left 16 places for more accuracy in fixed-point
* calculations.
*
* @return The maximum possible value that the slider can represent.
@@ -182,12 +182,15 @@ namespace NXWidgets
*/
CGlyphSliderHorizontal(CWidgetControl *pWidgetControl,
- nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width,
- nxgl_coord_t height, IBitmap *pGripBitmap,
- nxwidget_pixel_t fillColor, bool fill = true);
+ nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width,
+ nxgl_coord_t height, IBitmap *pGripBitmap,
+ nxwidget_pixel_t fillColor, bool fill = true);
/**
* Destructor.
+ *
+ * NOTE: That the contained bitmap image is not destroyed when the image
+ * container is destroyed.
*/
virtual inline ~CGlyphSliderHorizontal(void) { }
@@ -198,7 +201,7 @@ namespace NXWidgets
* @return The smallest value.
*/
- inline const nxgl_coord_t getMinimumValue(void) const
+ inline const int getMinimumValue(void) const
{
return m_minimumValue;
}
@@ -209,7 +212,7 @@ namespace NXWidgets
* @return The largest value.
*/
- inline const nxgl_coord_t getMaximumValue(void) const
+ inline const int getMaximumValue(void) const
{
return m_maximumValue;
}
@@ -220,16 +223,15 @@ namespace NXWidgets
* return The current slider value.
*/
- inline const nxgl_coord_t getValue(void) const
+ inline const int getValue(void) const
{
- return m_value >> 16;
+ return (int)(m_value >> 16);
}
/**
- * 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.
+ * 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.
*
* @return The page size.
*/
@@ -245,7 +247,7 @@ namespace NXWidgets
* @param value The smallest value.
*/
- inline void setMinimumValue(const nxgl_coord_t value)
+ inline void setMinimumValue(const int value)
{
m_minimumValue = value;
m_contentSize = m_maximumValue - m_minimumValue + 1;
@@ -258,7 +260,7 @@ namespace NXWidgets
* @param value The largest value.
*/
- inline void setMaximumValue(const nxgl_coord_t value)
+ inline void setMaximumValue(const int value)
{
m_maximumValue = value;
m_contentSize = m_maximumValue - m_minimumValue + 1;
@@ -272,11 +274,11 @@ namespace NXWidgets
* @param value The new value.
*/
- void setValue(const nxgl_coord_t value);
+ void setValue(const int value);
/**
* Set the value that of the slider. This will reposition and redraw
- * the grip. The supplied value should be bitshifted left 16 places.
+ * 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.
*