From 4b489525b44d49fa0f8cb95733dd0fdf4553c884 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 2 May 2012 22:03:05 +0000 Subject: NxWM updates (with some NX and NxWidget fixes too) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4689 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/ChangeLog.txt | 3 + NxWidgets/UnitTests/nxwm/main.cxx | 18 +++- NxWidgets/libnxwidgets/include/cnxtkwindow.hxx | 5 +- NxWidgets/libnxwidgets/include/cnxwidget.hxx | 35 +++++++ NxWidgets/libnxwidgets/src/cnxtkwindow.cxx | 43 ++++++-- NxWidgets/libnxwidgets/src/cnxtoolbar.cxx | 6 ++ NxWidgets/nxwm/include/capplicationwindow.hxx | 39 +++++++- NxWidgets/nxwm/include/cstartwindow.hxx | 18 +++- NxWidgets/nxwm/include/ctaskbar.hxx | 29 +++++- NxWidgets/nxwm/src/capplicationwindow.cxx | 69 +++++++++++++ NxWidgets/nxwm/src/cnxconsole.cxx | 5 + NxWidgets/nxwm/src/cstartwindow.cxx | 5 + NxWidgets/nxwm/src/ctaskbar.cxx | 130 +++++++++++++++---------- nuttx/ChangeLog | 7 +- nuttx/configs/sim/README.txt | 8 +- nuttx/configs/sim/nxwm/defconfig | 4 +- nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c | 8 +- 17 files changed, 358 insertions(+), 74 deletions(-) diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index d9dfda7b2..452ba1deb 100755 --- a/NxWidgets/ChangeLog.txt +++ b/NxWidgets/ChangeLog.txt @@ -13,3 +13,6 @@ * CImage: Add logic to hightlight an CImage (using the selected LUT). * nxwm: The tiny NX window manager (NxWM) is being developed in this directory. * UnitTests/nxwm: A unit test for the NX window manager. +* During integration of NxWM, corrected numerous problems with NxWidgets + running on toolbars and framed windows. That capability was commented + out in the 1.0 release but is verfied functional in 1.1. \ No newline at end of file diff --git a/NxWidgets/UnitTests/nxwm/main.cxx b/NxWidgets/UnitTests/nxwm/main.cxx index 8da6839a6..068452cff 100644 --- a/NxWidgets/UnitTests/nxwm/main.cxx +++ b/NxWidgets/UnitTests/nxwm/main.cxx @@ -42,6 +42,7 @@ #include #include +#include #include "ctaskbar.hxx" #include "cstartwindow.hxx" @@ -154,7 +155,7 @@ int MAIN_NAME(int argc, char *argv[]) // window application. printf(MAIN_STRING "Opening the start window application window\n"); - NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); + NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); if (!window) { printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n"); @@ -308,6 +309,21 @@ nocalculator: return EXIT_FAILURE; } + // Wait a little bit for the display to stabilize. The simulation pressing of + // the 'start window' icon in the task bar + + sleep(2); + g_nxwmtest.taskbar->clickIcon(0); + + // Wait bit to see the result of the button press. The press the first icon + // in the start menu. That should be the NxConsole icon. + + sleep(2); + g_nxwmtest.startwindow->clickIcon(0); + + // Wait bit to see the result of the button press. + + sleep(2); return EXIT_SUCCESS; } diff --git a/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx b/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx index b6915a6c1..32d634182 100644 --- a/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx +++ b/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx @@ -139,8 +139,9 @@ namespace NXWidgets CWidgetControl *getWidgetControl(void) const; /** - * Open a toolbar on the framed window. Toolbar creation is separate - * from object instantion so that errors can be reported + * Open a toolbar on the framed window. This method both instantiates + * the toolbar object AND calls the INxWindow::open() method to + * create the toolbar. The toolbar is ready for use upon return. * * @return True if the toolbar was successfully created. */ diff --git a/NxWidgets/libnxwidgets/include/cnxwidget.hxx b/NxWidgets/libnxwidgets/include/cnxwidget.hxx index eb1b18710..f46c2e73a 100644 --- a/NxWidgets/libnxwidgets/include/cnxwidget.hxx +++ b/NxWidgets/libnxwidgets/include/cnxwidget.hxx @@ -695,6 +695,41 @@ namespace NXWidgets return m_rect.getHeight(); } + /** + * Get the size of the widget + * + * @return The widgets's size + */ + + inline void getSize(struct nxgl_size_s &size) const + { + size.h = m_rect.getHeight(); + size.w = m_rect.getWidth(); + } + + /** + * Get the position of the widget + * + * @return The widgets's position + */ + + inline void getPos(struct nxgl_point_s &pos) const + { + pos.x = m_rect.getX(); + pos.y = m_rect.getY(); + } + + /** + * Get the window bounding box in physical display coordinated. + * + * @return This function returns the window handle. + */ + + inline CRect getBoundingBox(void) + { + return CRect(m_rect); + } + /** * Get the dimensions of the border * diff --git a/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx b/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx index bae9cb815..520896fa2 100644 --- a/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx +++ b/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx @@ -124,7 +124,9 @@ CWidgetControl *CNxTkWindow::getWidgetControl(void) const } /** - * Open a toolbar on the framed window + * Open a toolbar on the framed window. This method both instantiates + * the toolbar object AND calls the INxWindow::open() method to + * create the toolbar. The toolbar is ready for use upon return. * * @param height Height of the toolbar */ @@ -133,13 +135,42 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) { if (m_hNxTkWindow && !m_toolbar) { - // Create the toolbar. Note that we use the SAME underlying - // widget control. That is because the tool bar really resides - // in the same "physical" window. - + // Get current window style from the widget control + + CWidgetStyle style; + m_widgetControl->getWidgetStyle(&style); + + // Set the background color to the color of the toolbar + + style.colors.background = CONFIG_NXTK_BORDERCOLOR1; + + // Create a new controlling widget for the window + + CWidgetControl *widgetControl = new CWidgetControl(&style); + + // And create the toolbar + m_toolbar = new CNxToolbar(this, m_hNxTkWindow, - m_widgetControl, height); + widgetControl, height); + if (!m_toolbar) + { + delete widgetControl; + return (CNxToolbar *)0; + } + + // Create the new toolbar. Toolbar creation is separate from + // object instantiation so that failures can be reported. + + if (!m_toolbar->open()) + { + // Failed to create the toolbar. Clean-up and return NULL + + delete m_toolbar; + delete widgetControl; + return (CNxToolbar *)0; + } } + return m_toolbar; } diff --git a/NxWidgets/libnxwidgets/src/cnxtoolbar.cxx b/NxWidgets/libnxwidgets/src/cnxtoolbar.cxx index 1c560deb1..b14a0b611 100644 --- a/NxWidgets/libnxwidgets/src/cnxtoolbar.cxx +++ b/NxWidgets/libnxwidgets/src/cnxtoolbar.cxx @@ -69,10 +69,16 @@ CNxToolbar::CNxToolbar(CNxTkWindow *pNxTkWindow, NXTKWINDOW hNxTkWindow, CWidgetControl *pWidgetControl, nxgl_coord_t height) : CCallback(pWidgetControl) { + // Initialize toolbar state data + m_nxTkWindow = pNxTkWindow; m_hNxTkWindow = hNxTkWindow; m_widgetControl = pWidgetControl; m_height = height; + + // Create the CGraphicsPort instance for this window + + m_widgetControl->createGraphicsPort(static_cast(this)); } /** diff --git a/NxWidgets/nxwm/include/capplicationwindow.hxx b/NxWidgets/nxwm/include/capplicationwindow.hxx index adeac30dc..167f51997 100644 --- a/NxWidgets/nxwm/include/capplicationwindow.hxx +++ b/NxWidgets/nxwm/include/capplicationwindow.hxx @@ -135,6 +135,19 @@ namespace NxWM bool open(void); + /** + * Re-draw the application window + */ + + void redraw(void); + + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + */ + + void hide(void); + /** * Recover the contained NXTK window instance * @@ -173,7 +186,17 @@ namespace NxWM inline void clickMinimizeIcon(int index) { - m_minimizeImage->click(0,0); + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + m_minimizeImage->getSize(imageSize); + + struct nxgl_point_s imagePos; + m_minimizeImage->getPos(imagePos); + + // And click the image at its center + + m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } /** @@ -183,9 +206,19 @@ namespace NxWM inline void clickStopIcon(int index) { - m_stopImage->click(0,0); + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + m_stopImage->getSize(imageSize); + + struct nxgl_point_s imagePos; + m_stopImage->getPos(imagePos); + + // And click the image at its center + + m_stopImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } - }; + }; } #endif // __cplusplus diff --git a/NxWidgets/nxwm/include/cstartwindow.hxx b/NxWidgets/nxwm/include/cstartwindow.hxx index 86245c427..5eeb51781 100644 --- a/NxWidgets/nxwm/include/cstartwindow.hxx +++ b/NxWidgets/nxwm/include/cstartwindow.hxx @@ -174,7 +174,7 @@ namespace NxWM /** * The application window is hidden (either it is minimized or it is - * maximized, but not at the top of the hierarchy + * maximized, but not at the top of the hierarchy) */ void hide(void); @@ -213,7 +213,21 @@ namespace NxWM { if (index < m_slots.size()) { - m_slots.at(index).image->click(0,0); + // Get the image widget at this index + + NXWidgets::CImage *image = m_slots.at(index).image; + + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + image->getSize(imageSize); + + struct nxgl_point_s imagePos; + image->getPos(imagePos); + + // And click the image at its center + + image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } } }; diff --git a/NxWidgets/nxwm/include/ctaskbar.hxx b/NxWidgets/nxwm/include/ctaskbar.hxx index 994b918ae..7a6812901 100644 --- a/NxWidgets/nxwm/include/ctaskbar.hxx +++ b/NxWidgets/nxwm/include/ctaskbar.hxx @@ -97,7 +97,7 @@ namespace NxWM NXWidgets::CNxWindow *m_taskbar; /**< The task bar window */ NXWidgets::CNxWindow *m_background; /**< The background window */ NXWidgets::CImage *m_backImage; /**< The background image */ - IApplication *m_topapp; /**< The top application in the hierarchy */ + IApplication *m_topApp; /**< The top application in the hierarchy */ TNxArray m_slots; /**< List of application slots in the task bar */ /** @@ -191,6 +191,15 @@ namespace NxWM bool redrawApplicationWindow(IApplication *app); + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + * + * @param app. The application to hide + */ + + void hideApplicationWindow(IApplication *app); + /** * Handle a mouse button click event. * @@ -353,14 +362,28 @@ namespace NxWM /** * Simulate a mouse click on the icon at index. This inline method is only - * used duringautomated testing of NxWM. + * used during automated testing of NxWM. */ inline void clickIcon(int index) { if (index < m_slots.size()) { - m_slots.at(index).image->click(0,0); + // Get the image widget at this index + + NXWidgets::CImage *image = m_slots.at(index).image; + + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + image->getSize(imageSize); + + struct nxgl_point_s imagePos; + image->getPos(imagePos); + + // And click the image at its center + + image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } } }; diff --git a/NxWidgets/nxwm/src/capplicationwindow.cxx b/NxWidgets/nxwm/src/capplicationwindow.cxx index c11f40090..8395c93ab 100644 --- a/NxWidgets/nxwm/src/capplicationwindow.cxx +++ b/NxWidgets/nxwm/src/capplicationwindow.cxx @@ -41,6 +41,10 @@ #include +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "cgraphicsport.hxx" + #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" #include "capplicationwindow.hxx" @@ -224,6 +228,7 @@ bool CApplicationWindow::open(void) // Configure 'this' to receive mouse click inputs from the image + m_stopImage->setBorderless(true); m_stopImage->addWidgetEventHandler(this); // Create MINIMIZE application bitmap container @@ -272,6 +277,7 @@ bool CApplicationWindow::open(void) // Configure 'this' to receive mouse click inputs from the image + m_minimizeImage->setBorderless(true); m_minimizeImage->addWidgetEventHandler(this); // The rest of the toolbar will hold the left-justified application label @@ -311,6 +317,69 @@ bool CApplicationWindow::open(void) return true; } +/** + * Re-draw the application window + */ + +void CApplicationWindow::redraw(void) +{ + // Get the widget control from the task bar + + NXWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); + + // Get the graphics port for drawing on the background window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Get the size of the window + + struct nxgl_size_s windowSize; + if (!m_toolbar->getSize(&windowSize)) + { + return; + } + + // Fill the entire tool bar with the non-shadowed border color + + port->drawFilledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXTK_BORDERCOLOR1); + + // Then draw the images + + m_stopImage->enableDrawing(); + m_stopImage->redraw(); + m_stopImage->setRaisesEvents(true); + + m_minimizeImage->enableDrawing(); + m_minimizeImage->redraw(); + m_minimizeImage->setRaisesEvents(true); + + // And draw the window label + + m_windowLabel->enableDrawing(); + m_windowLabel->redraw(); +} + +/** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + */ + +void CApplicationWindow::hide(void) +{ + // Disable the images + + m_stopImage->disableDrawing(); + m_stopImage->setRaisesEvents(false); + + m_minimizeImage->disableDrawing(); + m_minimizeImage->setRaisesEvents(false); + + // Disable the window label + + m_windowLabel->disableDrawing(); +} + /** * Handle a mouse button click event. * diff --git a/NxWidgets/nxwm/src/cnxconsole.cxx b/NxWidgets/nxwm/src/cnxconsole.cxx index 3652364c7..3cf5e13b9 100644 --- a/NxWidgets/nxwm/src/cnxconsole.cxx +++ b/NxWidgets/nxwm/src/cnxconsole.cxx @@ -120,6 +120,11 @@ CNxConsole::CNxConsole(CTaskbar *taskbar, CApplicationWindow *window) m_pid = -1; m_nxcon = 0; + // Add our personalized window label + + NXWidgets::CNxString myName = getName(); + window->setWindowLabel(myName); + // Add our callbacks to the application window window->registerCallbacks(static_cast(this)); diff --git a/NxWidgets/nxwm/src/cstartwindow.cxx b/NxWidgets/nxwm/src/cstartwindow.cxx index c7a3b27f8..3190f50d9 100644 --- a/NxWidgets/nxwm/src/cstartwindow.cxx +++ b/NxWidgets/nxwm/src/cstartwindow.cxx @@ -70,6 +70,11 @@ CStartWindow::CStartWindow(CTaskbar *taskbar, CApplicationWindow *window) m_taskbar = taskbar; m_window = window; + // Add our personalized window label + + NXWidgets::CNxString myName = getName(); + window->setWindowLabel(myName); + // Add our callbacks to the application window window->registerCallbacks(static_cast(this)); diff --git a/NxWidgets/nxwm/src/ctaskbar.cxx b/NxWidgets/nxwm/src/ctaskbar.cxx index 7630a29b5..1d754c0d5 100644 --- a/NxWidgets/nxwm/src/ctaskbar.cxx +++ b/NxWidgets/nxwm/src/ctaskbar.cxx @@ -70,7 +70,7 @@ CTaskbar::CTaskbar(void) m_taskbar = (NXWidgets::CNxWindow *)0; m_background = (NXWidgets::CNxWindow *)0; m_backImage = (NXWidgets::CImage *)0; - m_topapp = (IApplication *)0; + m_topApp = (IApplication *)0; } /** @@ -279,7 +279,7 @@ CApplicationWindow *CTaskbar::openApplicationWindow(void) /** * Start an application and add its icon to the taskbar. The applications's - * window is brought to the top. Creating a new applicatino in the start + * window is brought to the top. Creating a new application in the start * window requires three steps: * * 1. Create the CTaskbar instance, @@ -334,14 +334,9 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) slot.image = image; m_slots.push_back(slot); - // Mark the application as minimized (or not) + // Assume for now that this is not the top application - app->setMinimized(minimized); - - // Assume for now that this is not the top application (we will - // know when drawApplicationWindow() runs. - - app->setTopApplication(false); + hideApplicationWindow(app); // Then start the application (whatever that means) @@ -366,9 +361,19 @@ bool CTaskbar::topApplication(IApplication *app) { // Verify that the application is not minimized - if (!app->isMinimized()) + if (!app->isMinimized() && !app->isTopApplication()) { - // It is not... Make the application the top application and redraw it + // It is not minimized. We are going to bring it to the top of the display. + // Is there already a top application? + + if (m_topApp) + { + // Yes.. then disable it + + hideApplicationWindow(m_topApp); + } + + // Make the application the top application and redraw it return redrawApplicationWindow(app); } @@ -410,32 +415,12 @@ bool CTaskbar::minimizeApplication(IApplication *app) if (!app->isMinimized()) { - // Every application provides a method to obtain its application window - - CApplicationWindow *appWindow = app->getWindow(); - - // Each application window provides a method to get the underlying NX window - - NXWidgets::CNxTkWindow *window = appWindow->getWindow(); + // No, then we are going to minimize it but disabling its components, + // marking it as minized, then raising a new window to the top window. - // Mark the window as minimized + hideApplicationWindow(app); - app->setMinimized(true); - - // And it certainly is no longer the top application. If it was before - // then redrawTopWindow() will pick a new one (rather arbitrarily). - - if (app->isTopApplication()) - { - m_topapp = (IApplication *)0; - app->setTopApplication(false); - } - - // Lower the window to the bottom of the hierarchy - - window->lower(); - - // And re-draw the new top, non-minimized application + // Re-draw the new top, non-minimized application return redrawTopWindow(); } @@ -882,7 +867,8 @@ bool CTaskbar::redrawTaskbarWindow(void) // Do we add icons left-to-right? Or top-to-bottom? - bool moveTo(nxgl_coord_t x, nxgl_coord_t y); + bool moveTo(nxgl_coord_t x, nxgl_coord_t y); + #if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) // left-to-right ... increment the X display position @@ -915,7 +901,7 @@ bool CTaskbar::redrawTopWindow(void) { // Check if there is already a top application - IApplication *app = m_topapp; + IApplication *app = m_topApp; if (!app) { // No.. Search for that last, non-minimized application @@ -944,7 +930,7 @@ bool CTaskbar::redrawTopWindow(void) { // Otherwise, there is no top application. Re-draw the background image. - m_topapp = (IApplication *)0; + m_topApp = (IApplication *)0; return redrawBackgroundWindow(); } } @@ -973,7 +959,7 @@ bool CTaskbar::redrawBackgroundWindow(void) return false; } - // Raise the background window to the top of the display + // Raise the background window to the top of the hierarchy m_background->raise(); @@ -1005,6 +991,15 @@ bool CTaskbar::redrawBackgroundWindow(void) bool CTaskbar::redrawApplicationWindow(IApplication *app) { + // Mark the window as the top application + + m_topApp = app; + app->setTopApplication(true); + + // Disable drawing of the background image. + + m_backImage->disableDrawing(); + // Every application provides a method to obtain its application window CApplicationWindow *appWindow = app->getWindow(); @@ -1013,25 +1008,62 @@ bool CTaskbar::redrawApplicationWindow(IApplication *app) NXWidgets::CNxTkWindow *window = appWindow->getWindow(); - // Mark the window as the top application - - m_topapp = app; - app->setTopApplication(true); - - // Disable drawing of the background image. + // Raise the application window to the top of the hierarchy - m_backImage->disableDrawing(); + window->raise(); - // Raise the window to the top of the hierarchy + // Re-draw the application window toolbar - window->raise(); + appWindow->redraw(); - // And re-draw it + // And re-draw the application window itself app->redraw(); return true; } +/** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + * + * @param app. The application to hide + */ + +void CTaskbar::hideApplicationWindow(IApplication *app) +{ + // The hidden window is certainly not the top application any longer + // If it was before then redrawTopWindow() will pick a new one (rather + // arbitrarily). + + if (app->isTopApplication()) + { + m_topApp = (IApplication *)0; + app->setTopApplication(false); + } + + // Make sure that the application is marked as minimized. + + app->setMinimized(true); + + // We do not need to lower the application to the back.. the new top + // window will be raised instead. + // + // So all that we really have to do is to make sure that all of the + // components of the hidden window are inactive. + + // Every application provides a method to obtain its application window + + CApplicationWindow *appWindow = app->getWindow(); + + // Hide the application window toolbar + + appWindow->hide(); + + // The hide the application window itself + + app->hide(); +} + /** * Handle a mouse button click event. * diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index a01b93c44..84f349a46 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -2696,4 +2696,9 @@ * include/cxx/cunistd: C++ header file to make sure that everything in unistd.h is in the std:: namespace. * configs/sim/nxwm: Added a configuration for testing the NuttX Window Manager - (NxWM) \ No newline at end of file + (NxWM) + * fs/fs_fcntl.h: On success, always returned OK. However, some fcntl commands + require returning other values on success. + * Various files. Fix warnings about variables that were initialized by not used. + * configs/sim/*/defconfig: Changes to build a 32-bit simulation on a 32-bit + platform did not make into all of the Make.defs files. diff --git a/nuttx/configs/sim/README.txt b/nuttx/configs/sim/README.txt index f02f44258..4886a4295 100644 --- a/nuttx/configs/sim/README.txt +++ b/nuttx/configs/sim/README.txt @@ -111,11 +111,17 @@ http://tech.groups.yahoo.com/group/nuttx/files. Compiler differences -------------------- -operator new +operator new: Problem: "'operator new' takes size_t ('...') as first parameter" Workaround: Add -fpermissive to the compilation flags +Continue up_setjmp() issues: + + With some newer compilers, I am now getting segmentation faults in + up_setjmp.S (even when built with the -m32 option). I have not looked into + this yet. + Stack Size Issues ----------------- When you run the NuttX simulation, it uses stacks allocated by NuttX from the diff --git a/nuttx/configs/sim/nxwm/defconfig b/nuttx/configs/sim/nxwm/defconfig index 74b5aea15..5fead7bb8 100644 --- a/nuttx/configs/sim/nxwm/defconfig +++ b/nuttx/configs/sim/nxwm/defconfig @@ -524,8 +524,8 @@ CONFIG_NX_PACKEDMSFIRST=n CONFIG_NX_MOUSE=y CONFIG_NX_KBD=y #CONFIG_NXTK_BORDERWIDTH=4 -#CONFIG_NXTK_BORDERCOLOR1 -#CONFIG_NXTK_BORDERCOLOR2 +CONFIG_NXTK_BORDERCOLOR1=0x00a9a9a9 +CONFIG_NXTK_BORDERCOLOR2=0x00696969 CONFIG_NXTK_AUTORAISE=n CONFIG_NXFONT_SANS22X29=n CONFIG_NXFONT_SANS23X27=y diff --git a/nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c b/nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c index 6a2063a26..50bd5aff4 100644 --- a/nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c +++ b/nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c @@ -1,8 +1,8 @@ /**************************************************************************** * graphics/nxtk/nxtk_bitmaptoolbar.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -122,7 +122,7 @@ int nxtk_bitmaptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest, * Temporarily, position the origin in absolute screen coordinates */ - nxgl_vectoradd(&wndorigin, origin, &fwnd->fwrect.pt1); + nxgl_vectoradd(&wndorigin, origin, &fwnd->tbrect.pt1); /* Then move the origin so that is relative to the containing window, not the * client subwindow @@ -132,6 +132,6 @@ int nxtk_bitmaptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest, /* Then copy the bitmap */ - nx_bitmap((NXWINDOW)hfwnd, &clipdest, src, origin, stride); + nx_bitmap((NXWINDOW)hfwnd, &clipdest, src, &wndorigin, stride); return OK; } -- cgit v1.2.3