From 4b489525b44d49fa0f8cb95733dd0fdf4553c884 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 2 May 2012 22:03:05 +0000 Subject: NxWM updates (with some NX and NxWidget fixes too) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4689 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/nxwm/include/ctaskbar.hxx | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'NxWidgets/nxwm/include/ctaskbar.hxx') diff --git a/NxWidgets/nxwm/include/ctaskbar.hxx b/NxWidgets/nxwm/include/ctaskbar.hxx index 994b918ae..7a6812901 100644 --- a/NxWidgets/nxwm/include/ctaskbar.hxx +++ b/NxWidgets/nxwm/include/ctaskbar.hxx @@ -97,7 +97,7 @@ namespace NxWM NXWidgets::CNxWindow *m_taskbar; /**< The task bar window */ NXWidgets::CNxWindow *m_background; /**< The background window */ NXWidgets::CImage *m_backImage; /**< The background image */ - IApplication *m_topapp; /**< The top application in the hierarchy */ + IApplication *m_topApp; /**< The top application in the hierarchy */ TNxArray m_slots; /**< List of application slots in the task bar */ /** @@ -191,6 +191,15 @@ namespace NxWM bool redrawApplicationWindow(IApplication *app); + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + * + * @param app. The application to hide + */ + + void hideApplicationWindow(IApplication *app); + /** * Handle a mouse button click event. * @@ -353,14 +362,28 @@ namespace NxWM /** * Simulate a mouse click on the icon at index. This inline method is only - * used duringautomated testing of NxWM. + * used during automated testing of NxWM. */ inline void clickIcon(int index) { if (index < m_slots.size()) { - m_slots.at(index).image->click(0,0); + // Get the image widget at this index + + NXWidgets::CImage *image = m_slots.at(index).image; + + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + image->getSize(imageSize); + + struct nxgl_point_s imagePos; + image->getPos(imagePos); + + // And click the image at its center + + image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } } }; -- cgit v1.2.3