diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-22 19:29:22 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-22 19:29:22 +0000 |
commit | 237d7e4c1c99762ee856d360eb64c3aab453c4bf (patch) | |
tree | 04068c4b1d4a29f018e68a81ef1f49de984db433 /NxWidgets/UnitTests/nxwm | |
parent | daee19b01c502ead55496801fe82548457229a8b (diff) | |
download | px4-nuttx-237d7e4c1c99762ee856d360eb64c3aab453c4bf.tar.gz px4-nuttx-237d7e4c1c99762ee856d360eb64c3aab453c4bf.tar.bz2 px4-nuttx-237d7e4c1c99762ee856d360eb64c3aab453c4bf.zip |
Add a hex calculator example to NxWM
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4760 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/UnitTests/nxwm')
-rw-r--r-- | NxWidgets/UnitTests/nxwm/main.cxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/NxWidgets/UnitTests/nxwm/main.cxx b/NxWidgets/UnitTests/nxwm/main.cxx index 3cc85dc43..f61252904 100644 --- a/NxWidgets/UnitTests/nxwm/main.cxx +++ b/NxWidgets/UnitTests/nxwm/main.cxx @@ -47,6 +47,7 @@ #include "ctaskbar.hxx" #include "cstartwindow.hxx" #include "cnxconsole.hxx" +#include "chexcalculator.hxx" #ifdef CONFIG_NXWM_TOUCHSCREEN # include "ctouchscreen.hxx" @@ -541,6 +542,35 @@ static bool createNxConsole(void) } ///////////////////////////////////////////////////////////////////////////// +// Name: createHexCalculator +///////////////////////////////////////////////////////////////////////////// + +static bool createHexCalculator(void) +{ + // Add the hex calculator application to the start window + + printf("createHexCalculator: Creating the hex calculator application\n"); + NxWM::CHexCalculatorFactory *calculator = new NxWM::CHexCalculatorFactory(g_nxwmtest.taskbar); + if (!calculator) + { + printf("createHexCalculator: ERROR: Failed to instantiate CHexCalculatorFactory\n"); + return false; + } + showTestCaseMemory("createHexCalculator: After creating the hex calculator application"); + + printf("createHexCalculator: Adding the hex calculator application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(calculator)) + { + printf("createHexCalculator: ERROR: Failed to add CNxConsoleFactory to the start window\n"); + delete calculator; + return false; + } + + showTestCaseMemory("createHexCalculator: After adding the hex calculator application"); + return true; +} + +///////////////////////////////////////////////////////////////////////////// // Public Functions ///////////////////////////////////////////////////////////////////////////// @@ -645,6 +675,14 @@ int MAIN_NAME(int argc, char *argv[]) testCleanUpAndExit(EXIT_FAILURE); } + // Create the hex calculator application and add it to the start window + + if (!createHexCalculator()) + { + printf(MAIN_STRING "ERROR: Failed to create the hex calculator application\n"); + testCleanUpAndExit(EXIT_FAILURE); + } + // Call CTaskBar::startWindowManager to start the display with applications in place. if (!startWindowManager()) |