summaryrefslogtreecommitdiff
path: root/NxWidgets
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-07-28 12:47:01 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-07-28 12:47:01 -0600
commitf73e309d512f3740b683fd2fe680b894c8515262 (patch)
treeeca70de3c414b33cd189af1e738dcc2a75aca88b /NxWidgets
parentf51eff41cbef57f7983d836a1155c160989cca9e (diff)
downloadnuttx-f73e309d512f3740b683fd2fe680b894c8515262.tar.gz
nuttx-f73e309d512f3740b683fd2fe680b894c8515262.tar.bz2
nuttx-f73e309d512f3740b683fd2fe680b894c8515262.zip
NXWidgets::CNxWidget: Remove an unused bit field
Diffstat (limited to 'NxWidgets')
-rw-r--r--NxWidgets/libnxwidgets/include/cnxwidget.hxx25
-rw-r--r--NxWidgets/libnxwidgets/src/clabel.cxx25
-rw-r--r--NxWidgets/libnxwidgets/src/cnxwidget.cxx25
3 files changed, 43 insertions, 32 deletions
diff --git a/NxWidgets/libnxwidgets/include/cnxwidget.hxx b/NxWidgets/libnxwidgets/include/cnxwidget.hxx
index d6a2654e1..854e869a3 100644
--- a/NxWidgets/libnxwidgets/include/cnxwidget.hxx
+++ b/NxWidgets/libnxwidgets/include/cnxwidget.hxx
@@ -141,19 +141,18 @@ namespace NXWidgets
typedef struct
{
- uint8_t clicked : 1; /**< True if the widget is currently clicked. */
- uint8_t hasFocus : 1; /**< True if the widget has focus. */
- uint8_t dragging : 1; /**< True if the widget is being dragged. */
- uint8_t deleted : 1; /**< True if the widget has been deleted. */
- uint8_t borderless : 1; /**< True if the widget is borderless. */
- uint8_t draggable : 1; /**< True if the widget can be dragged. */
- uint8_t drawingEnabled : 1; /**< True if the widget can be drawn. */
- uint8_t enabled : 1; /**< True if the widget is enabled. */
- uint8_t permeable : 1; /**< True if the widget's children can exceed its dimensions. */
- uint8_t erased : 1; /**< True if the widget is currently erased from the frame buffer. */
- uint8_t visibleRegionCacheInvalid : 1; /**< True if the region cache is invalid. */
- uint8_t hidden : 1; /**< True if the widget is hidden. */
- uint8_t doubleClickable : 1; /**< True if the widget can be double-clicked. */
+ uint8_t clicked : 1; /**< True if the widget is currently clicked. */
+ uint8_t hasFocus : 1; /**< True if the widget has focus. */
+ uint8_t dragging : 1; /**< True if the widget is being dragged. */
+ uint8_t deleted : 1; /**< True if the widget has been deleted. */
+ uint8_t borderless : 1; /**< True if the widget is borderless. */
+ uint8_t draggable : 1; /**< True if the widget can be dragged. */
+ uint8_t drawingEnabled : 1; /**< True if the widget can be drawn. */
+ uint8_t enabled : 1; /**< True if the widget is enabled. */
+ uint8_t permeable : 1; /**< True if the widget's children can exceed its dimensions. */
+ uint8_t erased : 1; /**< True if the widget is currently erased from the frame buffer. */
+ uint8_t hidden : 1; /**< True if the widget is hidden. */
+ uint8_t doubleClickable : 1; /**< True if the widget can be double-clicked. */
} Flags;
/**
diff --git a/NxWidgets/libnxwidgets/src/clabel.cxx b/NxWidgets/libnxwidgets/src/clabel.cxx
index f9132c3c2..560d7033e 100644
--- a/NxWidgets/libnxwidgets/src/clabel.cxx
+++ b/NxWidgets/libnxwidgets/src/clabel.cxx
@@ -322,15 +322,26 @@ void CLabel::drawContents(CGraphicsPort *port)
int width = font->getStringWidth(m_text);
// Draw the background (excluding the border and the text area)
+ // Left
port->drawFilledRect(rect.getX(), rect.getY(),
- pos.x - rect.getX(), rect.getHeight(), backColor); // Left
+ pos.x - rect.getX(), rect.getHeight(), backColor);
+
+ // Right
+
port->drawFilledRect(pos.x + width, rect.getY(),
- rect.getX2() - (pos.x + width) + 1, rect.getHeight(), backColor); // Right
- port->drawFilledRect(pos.x, rect.getY(),
- width, pos.y - rect.getY(), backColor); // Top
- port->drawFilledRect(pos.x, pos.y + height,
- width, rect.getY2() - (pos.y + height) + 1, backColor); // Bottom
+ rect.getX2() - (pos.x + width) + 1,
+ rect.getHeight(), backColor);
+
+ // Top
+
+ port->drawFilledRect(pos.x, rect.getY(), width, pos.y - rect.getY(),
+ backColor);
+
+ // Bottom
+
+ port->drawFilledRect(pos.x, pos.y + height, width,
+ rect.getY2() - (pos.y + height) + 1, backColor);
#endif
// Add the text using the selected color and background color
@@ -350,7 +361,7 @@ void CLabel::drawContents(CGraphicsPort *port)
void CLabel::drawBorder(CGraphicsPort *port)
{
// Check if the widget indicates it should have an outline: That
- // the outline is enabled and the this is not just a text-only
+ // (1) the outline is enabled and (2) that this is not just a text-only
// redraw
if (!isBorderless() && !isTextChange())
diff --git a/NxWidgets/libnxwidgets/src/cnxwidget.cxx b/NxWidgets/libnxwidgets/src/cnxwidget.cxx
index 5060e42c2..45238d42c 100644
--- a/NxWidgets/libnxwidgets/src/cnxwidget.cxx
+++ b/NxWidgets/libnxwidgets/src/cnxwidget.cxx
@@ -165,15 +165,14 @@ CNxWidget::CNxWidget(CWidgetControl *pWidgetControl,
// Set initial flag values
- m_flags.clicked = false;
- m_flags.dragging = false;
- m_flags.hasFocus = false;
- m_flags.deleted = false;
- m_flags.drawingEnabled = false;
- m_flags.enabled = true;
- m_flags.erased = true;
- m_flags.visibleRegionCacheInvalid = true;
- m_flags.hidden = false;
+ m_flags.clicked = false;
+ m_flags.dragging = false;
+ m_flags.hasFocus = false;
+ m_flags.deleted = false;
+ m_flags.drawingEnabled = false;
+ m_flags.enabled = true;
+ m_flags.erased = true;
+ m_flags.hidden = false;
// Set hierarchy pointers
@@ -329,14 +328,16 @@ bool CNxWidget::isDrawingEnabled(void) const
{
if (m_parent->isDrawingEnabled())
{
- // Drawing is enabled if the widget is drawable and not deleted
+ // Drawing is enabled if the widget is drawable, not deleted, and not hidden
- return (m_flags.drawingEnabled && (!m_flags.deleted) && (!m_flags.hidden));
+ return (m_flags.drawingEnabled && !m_flags.deleted && !m_flags.hidden);
}
}
else
{
- return (m_flags.drawingEnabled && (!m_flags.deleted) && (!m_flags.hidden));
+ // Drawing is enabled if the widget is drawable, not deleted, and not hidden
+
+ return (m_flags.drawingEnabled && !m_flags.deleted && !m_flags.hidden);
}
return false;