summaryrefslogtreecommitdiff
path: root/NxWidgets
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-08 15:28:07 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-08 15:28:07 +0000
commitb6abad5fbf5877bf9c26269bff418726f26e4b9d (patch)
tree945b66a02dfe50fed4a55a500a96f11d81d7d9e3 /NxWidgets
parent1442e62637fa138626671be49b51d5329c6536c3 (diff)
downloadpx4-nuttx-b6abad5fbf5877bf9c26269bff418726f26e4b9d.tar.gz
px4-nuttx-b6abad5fbf5877bf9c26269bff418726f26e4b9d.tar.bz2
px4-nuttx-b6abad5fbf5877bf9c26269bff418726f26e4b9d.zip
Several patches from Petteri Aimonen
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5625 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets')
-rw-r--r--NxWidgets/ChangeLog.txt8
-rw-r--r--NxWidgets/libnxwidgets/include/ccyclebutton.hxx2
-rw-r--r--NxWidgets/libnxwidgets/include/cnxwidget.hxx7
-rw-r--r--NxWidgets/libnxwidgets/src/ccyclebutton.cxx4
-rw-r--r--NxWidgets/nxwm/include/ctaskbar.hxx16
-rwxr-xr-xNxWidgets/tools/bitmap_converter.py2
6 files changed, 28 insertions, 11 deletions
diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt
index 7ebfc6e8a..43347fcdb 100644
--- a/NxWidgets/ChangeLog.txt
+++ b/NxWidgets/ChangeLog.txt
@@ -270,4 +270,12 @@
1.6 2013-xx-xx Gregory Nutt <gnutt@nuttx.org>
* Type of argv[] has changed from const char ** to char * const *
+* NXWidgets::CNxWidget: Add an inline function to get the current style.
+* NxWM::CTaskBar: Make a some methods of CTaskbar virtual to allow
+ customizations. From Petteri Aimonen.
+* NXWidgets::CCycleButton: Make CCycleButton change state in onPreRelease().
+ This way the new value is already available when a listener gets the
+ action event. From Petteri Aimonen.
+* NxWidgets/tools/bitmap_converter.py: Fix bitmap_converter.py so that
+ it works with indexed input images.
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
@@ -797,6 +797,13 @@ namespace NXWidgets
}
/**
+ * 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.
*
* @param isBorderless The 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);
}
/**
diff --git a/NxWidgets/nxwm/include/ctaskbar.hxx b/NxWidgets/nxwm/include/ctaskbar.hxx
index 5aab9e6bf..229e78b22 100644
--- a/NxWidgets/nxwm/include/ctaskbar.hxx
+++ b/NxWidgets/nxwm/include/ctaskbar.hxx
@@ -83,9 +83,9 @@ namespace NxWM
*/
class CTaskbar : public NXWidgets::CNxServer,
- private NXWidgets::CWidgetEventHandler
+ protected NXWidgets::CWidgetEventHandler
{
- private:
+ protected:
/**
* This structure represents an application and its associated icon image
*/
@@ -152,7 +152,7 @@ namespace NxWM
* @return true on success
*/
- bool createTaskbarWindow(void);
+ virtual bool createTaskbarWindow(void);
/**
* Create the background window.
@@ -160,7 +160,7 @@ namespace NxWM
* @return true on success
*/
- bool createBackgroundWindow(void);
+ virtual bool createBackgroundWindow(void);
/**
* Create the background image.
@@ -168,7 +168,7 @@ namespace NxWM
* @return true on success
*/
- bool createBackgroundImage(void);
+ virtual bool createBackgroundImage(void);
/**
* (Re-)draw the task bar window.
@@ -176,7 +176,7 @@ namespace NxWM
* @return true on success
*/
- bool redrawTaskbarWindow(void);
+ virtual bool redrawTaskbarWindow(void);
/**
* Redraw the window at the top of the heirarchy.
@@ -184,7 +184,7 @@ namespace NxWM
* @return true on success
*/
- bool redrawTopApplication(void);
+ virtual bool redrawTopApplication(void);
/**
* Raise the top window to the top of the NXheirarchy.
@@ -200,7 +200,7 @@ namespace NxWM
* @return true on success
*/
- bool redrawBackgroundWindow(void);
+ virtual bool redrawBackgroundWindow(void);
/**
* Redraw the last application in the list of application maintained by
diff --git a/NxWidgets/tools/bitmap_converter.py b/NxWidgets/tools/bitmap_converter.py
index 2cb7e8869..1c5337741 100755
--- a/NxWidgets/tools/bitmap_converter.py
+++ b/NxWidgets/tools/bitmap_converter.py
@@ -121,7 +121,7 @@ if __name__ == '__main__':
print "Usage: bitmap_converter.py source.png output.cxx"
sys.exit(1)
- img = Image.open(sys.argv[1])
+ img = Image.open(sys.argv[1]).convert("RGB")
outfile = open(sys.argv[2], 'w')
palette = get_palette(img)