diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-12 13:50:21 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-12 13:50:21 +0000 |
commit | fb8f25a3f43d6c5a10dfa5a99b9cec55feec97f6 (patch) | |
tree | ce467469470404655e332c2ca8bc05d64283c85f /NxWidgets/UnitTests/nxwm/main.cxx | |
parent | e88d1ff1f09ba0ea6999ab2e5e2d55dc88434646 (diff) | |
download | px4-nuttx-fb8f25a3f43d6c5a10dfa5a99b9cec55feec97f6.tar.gz px4-nuttx-fb8f25a3f43d6c5a10dfa5a99b9cec55feec97f6.tar.bz2 px4-nuttx-fb8f25a3f43d6c5a10dfa5a99b9cec55feec97f6.zip |
Add NxWM::CWindowControl; task bar and start window icons now functional
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4725 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/UnitTests/nxwm/main.cxx')
-rw-r--r-- | NxWidgets/UnitTests/nxwm/main.cxx | 65 |
1 files changed, 42 insertions, 23 deletions
diff --git a/NxWidgets/UnitTests/nxwm/main.cxx b/NxWidgets/UnitTests/nxwm/main.cxx index c7433f36e..c230b9f87 100644 --- a/NxWidgets/UnitTests/nxwm/main.cxx +++ b/NxWidgets/UnitTests/nxwm/main.cxx @@ -403,13 +403,9 @@ static bool createTouchScreen(void) #ifdef CONFIG_NXWM_TOUCHSCREEN static bool createCalibration(void) { - // 1. Call CTaskBar::FullScreenWindow to create a window for the application, + // 1. Call CTaskBar::openFullScreenWindow to create a window for the application, // 2. Instantiate the application, providing the window to the application's // constructor, - // 3. Then call CStartWindow::addApplication to add the application to the - // start window. - // 4. Call CTaskBar::startApplication start the application and bring its window to - // the top. printf(MAIN_STRING "Opening the calibration application window\n"); NxWM::CFullScreenWindow *window = g_nxwmtest.taskbar->openFullScreenWindow(); @@ -438,16 +434,6 @@ static bool createCalibration(void) return false; } showTestCaseMemory("After creating CCalibration application"); - - printf(MAIN_STRING "Adding CCalibration application to the start window\n"); - if (!g_nxwmtest.startwindow->addApplication(g_nxwmtest.calibration)) - { - printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); - delete g_nxwmtest.calibration; - return false; - } - - showTestCaseMemory("After adding CCalibration application"); return true; } #endif @@ -503,6 +489,26 @@ static bool runCalibration(void) #endif ///////////////////////////////////////////////////////////////////////////// +// Name: addCalibrationToStartWindow +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_NXWM_TOUCHSCREEN +static bool addCalibrationToStartWindow(void) +{ + printf(MAIN_STRING "Adding CCalibration application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(g_nxwmtest.calibration)) + { + printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); + delete g_nxwmtest.calibration; + return false; + } + + showTestCaseMemory("After adding CCalibration application"); + return true; +} +#endif + +///////////////////////////////////////////////////////////////////////////// // Name: createNxConsole ///////////////////////////////////////////////////////////////////////////// @@ -605,14 +611,6 @@ int MAIN_NAME(int argc, char *argv[]) testCleanUpAndExit(EXIT_FAILURE); } - // Create the start window. - - if (!createStartWindow()) - { - printf(MAIN_STRING "ERROR: Failed to create the start window\n"); - testCleanUpAndExit(EXIT_FAILURE); - } - // Create the touchscreen device #ifdef CONFIG_NXWM_TOUCHSCREEN @@ -645,6 +643,27 @@ int MAIN_NAME(int argc, char *argv[]) } #endif + + // Create the start window. + + if (!createStartWindow()) + { + printf(MAIN_STRING "ERROR: Failed to create the start window\n"); + testCleanUpAndExit(EXIT_FAILURE); + } + +#ifdef CONFIG_NXWM_TOUCHSCREEN + // Add the calibration application to the start window. It can't really + // be used to re-calibrate (because there is nothing to get the calibration + // data). But is a good case to test a full screen appliation + + if (!addCalibrationToStartWindow()) + { + printf(MAIN_STRING "ERROR: Failed to add calibration to the start window\n"); + testCleanUpAndExit(EXIT_FAILURE); + } +#endif + // Add the NxConsole application to the start window if (!createNxConsole()) |