From b6abad5fbf5877bf9c26269bff418726f26e4b9d Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 8 Feb 2013 15:28:07 +0000 Subject: Several patches from Petteri Aimonen git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5625 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/libnxwidgets/include/ccyclebutton.hxx | 2 +- NxWidgets/libnxwidgets/include/cnxwidget.hxx | 7 +++++++ NxWidgets/libnxwidgets/src/ccyclebutton.cxx | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'NxWidgets/libnxwidgets') diff --git a/NxWidgets/libnxwidgets/include/ccyclebutton.hxx b/NxWidgets/libnxwidgets/include/ccyclebutton.hxx index f7f965933..d8a32175e 100644 --- a/NxWidgets/libnxwidgets/include/ccyclebutton.hxx +++ b/NxWidgets/libnxwidgets/include/ccyclebutton.hxx @@ -152,7 +152,7 @@ namespace NXWidgets * @param y The y coordinate of the mouse. */ - virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); + virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y); /** * Redraws the button. diff --git a/NxWidgets/libnxwidgets/include/cnxwidget.hxx b/NxWidgets/libnxwidgets/include/cnxwidget.hxx index 32e3dfbc6..a6982660b 100644 --- a/NxWidgets/libnxwidgets/include/cnxwidget.hxx +++ b/NxWidgets/libnxwidgets/include/cnxwidget.hxx @@ -796,6 +796,13 @@ namespace NXWidgets return m_style.colors.selectedText; } + /** + * Get the style used by this widget + * + * @return Const pointer to CWidgetStyle stored inside this widget. + */ + inline const CWidgetStyle *getWidgetStyle() const { return &m_style; } + /** * Sets this widget's border state. * diff --git a/NxWidgets/libnxwidgets/src/ccyclebutton.cxx b/NxWidgets/libnxwidgets/src/ccyclebutton.cxx index 0fdbba73c..b4dff685b 100644 --- a/NxWidgets/libnxwidgets/src/ccyclebutton.cxx +++ b/NxWidgets/libnxwidgets/src/ccyclebutton.cxx @@ -424,7 +424,7 @@ void CCycleButton::drawOutline(CGraphicsPort *port) * @param y The y coordinate of the mouse. */ -void CCycleButton::onRelease(nxgl_coord_t x, nxgl_coord_t y) +void CCycleButton::onPreRelease(nxgl_coord_t x, nxgl_coord_t y) { // Choose next option @@ -447,6 +447,8 @@ void CCycleButton::onRelease(nxgl_coord_t x, nxgl_coord_t y) } redraw(); + + CButton::onPreRelease(x, y); } /** -- cgit v1.2.3