summaryrefslogtreecommitdiff
path: root/NxWidgets/libnxwidgets/src/cimage.cxx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-07-15 09:29:28 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-07-15 09:29:28 -0600
commit612dc509723bafbc28e09e1489fa21e06688be27 (patch)
tree96dc3211cece1a4739a33b65dc6d1e6ec9ea6085 /NxWidgets/libnxwidgets/src/cimage.cxx
parentc5b8bd6d3a309d7c075c59df1dbbd03218d679cb (diff)
downloadnuttx-612dc509723bafbc28e09e1489fa21e06688be27.tar.gz
nuttx-612dc509723bafbc28e09e1489fa21e06688be27.tar.bz2
nuttx-612dc509723bafbc28e09e1489fa21e06688be27.zip
NxWidgets::CStickyImage: New image class
Diffstat (limited to 'NxWidgets/libnxwidgets/src/cimage.cxx')
-rw-r--r--NxWidgets/libnxwidgets/src/cimage.cxx37
1 files changed, 32 insertions, 5 deletions
diff --git a/NxWidgets/libnxwidgets/src/cimage.cxx b/NxWidgets/libnxwidgets/src/cimage.cxx
index eb7e5157f..1140df35d 100644
--- a/NxWidgets/libnxwidgets/src/cimage.cxx
+++ b/NxWidgets/libnxwidgets/src/cimage.cxx
@@ -165,13 +165,14 @@ void CImage::getPreferredDimensions(CRect &rect) const
/**
* Draw the area of this widget that falls within the clipping region.
- * Called by the redraw() function to draw all visible regions.
+ * Called by the drawContents(port) and by classes that inherit from
+ * CImage.
*
* @param port The CGraphicsPort to draw to.
* @see redraw()
*/
-void CImage::drawContents(CGraphicsPort *port)
+void CImage::drawContents(CGraphicsPort *port, bool selected)
{
if (!m_bitmap)
{
@@ -201,7 +202,7 @@ void CImage::drawContents(CGraphicsPort *port)
// Select the correct colorization
- m_bitmap->setSelected(isClicked() || m_highlighted);
+ m_bitmap->setSelected(selected || m_highlighted);
// This is the end row + 1 that we can write into
@@ -349,7 +350,20 @@ void CImage::drawContents(CGraphicsPort *port)
* @see redraw()
*/
-void CImage::drawBorder(CGraphicsPort *port)
+void CImage::drawContents(CGraphicsPort *port)
+{
+ drawContents(port, isClicked());
+}
+
+/**
+ * Draw the border of this widget. Called by the indirectly via
+ * drawBoard(port) and also by classes that inherit from CImage.
+ *
+ * @param port The CGraphicsPort to draw to.
+ * @see redraw()
+ */
+
+void CImage::drawBorder(CGraphicsPort *port, bool selected)
{
// Stop drawing if the widget indicates it should not have an outline
@@ -363,7 +377,7 @@ void CImage::drawBorder(CGraphicsPort *port)
nxgl_coord_t color1;
nxgl_coord_t color2;
- if (isClicked())
+ if (selected)
{
// Bevelled into the screen
@@ -382,6 +396,19 @@ void CImage::drawBorder(CGraphicsPort *port)
}
/**
+ * Draw the border of this widget. Called by the redraw() function to draw
+ * all visible regions.
+ *
+ * @param port The CGraphicsPort to draw to.
+ * @see redraw()
+ */
+
+void CImage::drawBorder(CGraphicsPort *port)
+{
+ drawBorder(port, isClicked());
+}
+
+/**
* Control the highlight state.
*
* @param highlightOn True(1), the image will be highlighted