From fb8f25a3f43d6c5a10dfa5a99b9cec55feec97f6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 12 May 2012 13:50:21 +0000 Subject: 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 --- NxWidgets/UnitTests/nxwm/main.cxx | 65 +++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 23 deletions(-) (limited to 'NxWidgets/UnitTests') 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 @@ -502,6 +488,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()) -- cgit v1.2.3