diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-01 20:36:19 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-01 20:36:19 +0000 |
commit | fd4dd86fe8de2ddda1e8723973e8b5774528ebb7 (patch) | |
tree | 076f03852cb6bcd7a34d313558f7529143337e6d /NxWidgets/nxwm/src/ctaskbar.cxx | |
parent | 990276740afafeb69f64b01050a99f113bb89fa6 (diff) | |
download | nuttx-fd4dd86fe8de2ddda1e8723973e8b5774528ebb7.tar.gz nuttx-fd4dd86fe8de2ddda1e8723973e8b5774528ebb7.tar.bz2 nuttx-fd4dd86fe8de2ddda1e8723973e8b5774528ebb7.zip |
More NxWM support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4682 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/nxwm/src/ctaskbar.cxx')
-rw-r--r-- | NxWidgets/nxwm/src/ctaskbar.cxx | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/NxWidgets/nxwm/src/ctaskbar.cxx b/NxWidgets/nxwm/src/ctaskbar.cxx index 8d2907266..faac2fa76 100644 --- a/NxWidgets/nxwm/src/ctaskbar.cxx +++ b/NxWidgets/nxwm/src/ctaskbar.cxx @@ -83,6 +83,84 @@ CTaskbar::~CTaskbar(void) } /** + * Connect to the server + */ + +bool CTaskbar::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR)) + { + // Failed + } + } + + return nxConnected; +} + +/** + * Disconnect from the server + */ + +void CTaskbar::disconnect(void) +{ + // Stop all applications and remove them from the task bar. Clearly, there + // are some ordering issues here... On an orderly system shutdown, disconnection + // should really occur priority to deleting instances + + while (!m_slots.empty()) + { + IApplication *app = m_slots.at(0).app; + stopApplication(app); + } + + // Close the windows + + NXWidgets::CWidgetControl *control; + if (m_taskbar) + { + // Delete the contained widget control. We are responsible for it + // because we created it + + control = m_taskbar->getWidgetControl(); + if (control) + { + delete control; + } + + // Then delete the task bar window + + delete m_taskbar; + } + + if (m_background) + { + // Delete the contained widget control. We are responsible for it + // because we created it + + control = m_background->getWidgetControl(); + if (control) + { + delete control; + } + + // Then delete the background + + delete m_background; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +/** * Initialize task bar. Task bar initialization is separate from * object instantiation so that failures can be reported. The window * manager start-up sequence is: @@ -427,84 +505,6 @@ bool CTaskbar::stopApplication(IApplication *app) } /** - * Connect to the server - */ - -bool CTaskbar::connect(void) -{ - // Connect to the server - - bool nxConnected = CNxServer::connect(); - if (nxConnected) - { - // Set the background color - - if (!setBackgroundColor(CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR)) - { - // Failed - } - } - - return nxConnected; -} - -/** - * Disconnect from the server - */ - -void CTaskbar::disconnect(void) -{ - // Stop all applications and remove them from the task bar. Clearly, there - // are some ordering issues here... On an orderly system shutdown, disconnection - // should really occur priority to deleting instances - - while (!m_slots.empty()) - { - IApplication *app = m_slots.at(0).app; - stopApplication(app); - } - - // Close the windows - - NXWidgets::CWidgetControl *control; - if (m_taskbar) - { - // Delete the contained widget control. We are responsible for it - // because we created it - - control = m_taskbar->getWidgetControl(); - if (control) - { - delete control; - } - - // Then delete the task bar window - - delete m_taskbar; - } - - if (m_background) - { - // Delete the contained widget control. We are responsible for it - // because we created it - - control = m_background->getWidgetControl(); - if (control) - { - delete control; - } - - // Then delete the background - - delete m_background; - } - - // And disconnect from the server - - CNxServer::disconnect(); -} - -/** * Create a raw window. * * 1) Create a dumb CWigetControl instance @@ -893,7 +893,7 @@ bool CTaskbar::redrawTaskbarWindow(void) // For vertical task bars, the icons will be centered horizontally iconPos.x = (windowSize.w - rect.getWidth()) >> 1; - iconPos.y = taskbarPos.y + iconPos.y = taskbarPos.y; #endif // Set the position of the icon bitmap |