diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-15 16:40:43 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-15 16:40:43 +0000 |
commit | 91e38a73cd93af894ecaf44476ae8e6313670cb5 (patch) | |
tree | cb7832604175934e7af73bad5da00c0581f4fbef /NxWidgets/libnxwidgets/src/cnxwidget.cxx | |
parent | df1d64bd97cfc3039c113a258af134da6e6ba742 (diff) | |
download | nuttx-91e38a73cd93af894ecaf44476ae8e6313670cb5.tar.gz nuttx-91e38a73cd93af894ecaf44476ae8e6313670cb5.tar.bz2 nuttx-91e38a73cd93af894ecaf44476ae8e6313670cb5.zip |
NxWidgets: New pre-release event. Action now raised on pre-release. NxWM: Use action event to process icon touches; Fix initialization of image highlighted state.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4740 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/libnxwidgets/src/cnxwidget.cxx')
-rw-r--r-- | NxWidgets/libnxwidgets/src/cnxwidget.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/NxWidgets/libnxwidgets/src/cnxwidget.cxx b/NxWidgets/libnxwidgets/src/cnxwidget.cxx index 66766dca6..ab4a09b4e 100644 --- a/NxWidgets/libnxwidgets/src/cnxwidget.cxx +++ b/NxWidgets/libnxwidgets/src/cnxwidget.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include <nuttx/config.h> #include <stdint.h> @@ -772,6 +772,17 @@ bool CNxWidget::release(nxgl_coord_t x, nxgl_coord_t y) return false; } + // Notify of the pre-release event. In this event, the widget is still in the + // clicked state. This event is used, for example, by button handlers so + // that the click event is really processed when the button is released + // instead of pressed. The former behavior is needed because the result + // of processing the press may obscure the button and make it impossible + // to receive the release event. + + onPreRelease(x, y); + + // Now mark the widget as NOT clicked and stop draggin actions. + m_flags.clicked = false; stopDragging(x, y); @@ -784,6 +795,9 @@ bool CNxWidget::release(nxgl_coord_t x, nxgl_coord_t y) if (checkCollision(x, y)) { + // Notify of the release event... the widget was NOT dragged outside of + // its original bounding box + onRelease(x, y); // Release occurred within widget; raise release @@ -792,9 +806,12 @@ bool CNxWidget::release(nxgl_coord_t x, nxgl_coord_t y) } else { + // Notify of the release event... the widget WAS dragged outside of + // its original bounding box + onReleaseOutside(x, y); - // Release occurred outside widget; raise release + // Release occurred outside widget; raise release outside event m_widgetEventHandlers->raiseReleaseOutsideEvent(x, y); } |