diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-19 04:20:56 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-19 04:20:56 +0000 |
commit | 38b3dcac9e4dcb225ceaa7a4798a644537c50ece (patch) | |
tree | aec833bcd4833134c4a769b6e3057a06eb2a9f74 /NxWidgets/nxwm/src/cwindowmessenger.cxx | |
parent | e5350e893168b675cfd96b36fd7aad3ccfabf791 (diff) | |
download | nuttx-38b3dcac9e4dcb225ceaa7a4798a644537c50ece.tar.gz nuttx-38b3dcac9e4dcb225ceaa7a4798a644537c50ece.tar.bz2 nuttx-38b3dcac9e4dcb225ceaa7a4798a644537c50ece.zip |
NxWM unit test now appears bug free (other than some NxConsole-related issues).
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4750 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/nxwm/src/cwindowmessenger.cxx')
-rw-r--r-- | NxWidgets/nxwm/src/cwindowmessenger.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/NxWidgets/nxwm/src/cwindowmessenger.cxx b/NxWidgets/nxwm/src/cwindowmessenger.cxx index b467f533c..032dd1bf2 100644 --- a/NxWidgets/nxwm/src/cwindowmessenger.cxx +++ b/NxWidgets/nxwm/src/cwindowmessenger.cxx @@ -60,9 +60,14 @@ using namespace NxWM; /** * CWindowMessenger Constructor + * + * @param style The default style that all widgets on this display + * should use. If this is not specified, the widget will use the + * values stored in the defaultCWidgetStyle object. */ -CWindowMessenger::CWindowMessenger(void) +CWindowMessenger::CWindowMessenger(FAR const NXWidgets::CWidgetStyle *style) +: NXWidgets::CWidgetControl(style) { // Open a message queue to communicate with the start window task. We need to create // the message queue if it does not exist. @@ -77,6 +82,10 @@ CWindowMessenger::CWindowMessenger(void) { gdbg("ERROR: mq_open(%s) failed: %d\n", g_startWindowMqName, errno); } + + // Add ourself to the list of window event handlers + + addWindowEventHandler(this); } /** @@ -85,6 +94,10 @@ CWindowMessenger::CWindowMessenger(void) CWindowMessenger::~CWindowMessenger(void) { + // Remove ourself from the list of the window event handlers + + removeWindowEventHandler(this); + // Close the message queue (void)mq_close(m_mqd); @@ -127,7 +140,7 @@ void CWindowMessenger::handleMouseEvent(void) struct SStartWindowMessage outmsg; outmsg.msgId = MSGID_MOUSE_INPUT; - outmsg.instance = (FAR void *)this; + outmsg.instance = (FAR void *)static_cast<CWidgetControl*>(this); int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), CONFIG_NXWM_STARTWINDOW_MXMPRIO); @@ -173,7 +186,7 @@ void CWindowMessenger::handleKeyboardEvent(void) struct SStartWindowMessage outmsg; outmsg.msgId = MSGID_KEYBOARD_INPUT; - outmsg.instance = (FAR void *)this; + outmsg.instance = (FAR void *)static_cast<CWidgetControl*>(this); int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), CONFIG_NXWM_STARTWINDOW_MXMPRIO); |