summaryrefslogtreecommitdiff
path: root/NxWidgets/nxwm/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-02 22:03:05 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-02 22:03:05 +0000
commit4b489525b44d49fa0f8cb95733dd0fdf4553c884 (patch)
tree8773aca5097c9c4fd1006bf1e35685c55619ce17 /NxWidgets/nxwm/include
parent5ebf11ee63f1baaf070fd8484d99362810cd5bcc (diff)
downloadnuttx-4b489525b44d49fa0f8cb95733dd0fdf4553c884.tar.gz
nuttx-4b489525b44d49fa0f8cb95733dd0fdf4553c884.tar.bz2
nuttx-4b489525b44d49fa0f8cb95733dd0fdf4553c884.zip
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
Diffstat (limited to 'NxWidgets/nxwm/include')
-rw-r--r--NxWidgets/nxwm/include/capplicationwindow.hxx39
-rw-r--r--NxWidgets/nxwm/include/cstartwindow.hxx18
-rw-r--r--NxWidgets/nxwm/include/ctaskbar.hxx29
3 files changed, 78 insertions, 8 deletions
diff --git a/NxWidgets/nxwm/include/capplicationwindow.hxx b/NxWidgets/nxwm/include/capplicationwindow.hxx
index adeac30dc..167f51997 100644
--- a/NxWidgets/nxwm/include/capplicationwindow.hxx
+++ b/NxWidgets/nxwm/include/capplicationwindow.hxx
@@ -136,6 +136,19 @@ namespace NxWM
bool open(void);
/**
+ * Re-draw the application window
+ */
+
+ void redraw(void);
+
+ /**
+ * The application window is hidden (either it is minimized or it is
+ * maximized, but not at the top of the hierarchy)
+ */
+
+ void hide(void);
+
+ /**
* Recover the contained NXTK window instance
*
* @return. The window used by this application
@@ -173,7 +186,17 @@ namespace NxWM
inline void clickMinimizeIcon(int index)
{
- m_minimizeImage->click(0,0);
+ // Get the size and position of the widget
+
+ struct nxgl_size_s imageSize;
+ m_minimizeImage->getSize(imageSize);
+
+ struct nxgl_point_s imagePos;
+ m_minimizeImage->getPos(imagePos);
+
+ // And click the image at its center
+
+ m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1));
}
/**
@@ -183,9 +206,19 @@ namespace NxWM
inline void clickStopIcon(int index)
{
- m_stopImage->click(0,0);
+ // Get the size and position of the widget
+
+ struct nxgl_size_s imageSize;
+ m_stopImage->getSize(imageSize);
+
+ struct nxgl_point_s imagePos;
+ m_stopImage->getPos(imagePos);
+
+ // And click the image at its center
+
+ m_stopImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1));
}
- };
+ };
}
#endif // __cplusplus
diff --git a/NxWidgets/nxwm/include/cstartwindow.hxx b/NxWidgets/nxwm/include/cstartwindow.hxx
index 86245c427..5eeb51781 100644
--- a/NxWidgets/nxwm/include/cstartwindow.hxx
+++ b/NxWidgets/nxwm/include/cstartwindow.hxx
@@ -174,7 +174,7 @@ namespace NxWM
/**
* The application window is hidden (either it is minimized or it is
- * maximized, but not at the top of the hierarchy
+ * maximized, but not at the top of the hierarchy)
*/
void hide(void);
@@ -213,7 +213,21 @@ namespace NxWM
{
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));
}
}
};
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<struct STaskbarSlot> m_slots; /**< List of application slots in the task bar */
/**
@@ -192,6 +192,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.
*
* @param e The event data.
@@ -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));
}
}
};