Several patches from Petteri Aimonen (mostly NxWidgets)

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5324 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-11-09 14:54:29 +00:00
parent bf340e0ab5
commit d04ce723f0
24 changed files with 616 additions and 133 deletions
+20 -10
View File
@@ -241,6 +241,7 @@ bool CApplicationWindow::open(void)
m_stopImage->addWidgetEventHandler(this);
}
#ifndef CONFIG_NXWM_DISABLE_MINIMIZE
// Create MINIMIZE application bitmap container
m_minimizeBitmap = new NXWidgets::CRlePaletteBitmap(&g_minimizeBitmap);
@@ -289,6 +290,7 @@ bool CApplicationWindow::open(void)
m_minimizeImage->setBorderless(true);
m_minimizeImage->addWidgetEventHandler(this);
#endif
// The rest of the toolbar will hold the left-justified application label
// Create the default font instance
@@ -364,12 +366,16 @@ void CApplicationWindow::redraw(void)
m_stopImage->setRaisesEvents(true);
}
// Draw the minimize image
m_minimizeImage->enableDrawing();
m_minimizeImage->redraw();
m_minimizeImage->setRaisesEvents(true);
// Draw the minimize image (which may not be present if this is a
// mimimization is disabled)
if (m_minimizeImage)
{
m_minimizeImage->enableDrawing();
m_minimizeImage->redraw();
m_minimizeImage->setRaisesEvents(true);
}
// And finally draw the window label
m_windowLabel->enableDrawing();
@@ -392,11 +398,15 @@ void CApplicationWindow::hide(void)
m_stopImage->setRaisesEvents(false);
}
// Disable the minimize image
m_minimizeImage->disableDrawing();
m_minimizeImage->setRaisesEvents(false);
// Disable the minimize image(which may not be present if this is a
// mimimization is disabled)
if (m_minimizeImage)
{
m_minimizeImage->disableDrawing();
m_minimizeImage->setRaisesEvents(false);
}
// Disable the window label
m_windowLabel->disableDrawing();
@@ -570,7 +580,7 @@ void CApplicationWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e)
// Check the minimize image (only if the stop application image is not pressed)
else if (m_minimizeImage->isClicked())
else if (m_minimizeImage && m_minimizeImage->isClicked())
{
// Notify the controlling logic that the application should be miminsed
+2
View File
@@ -191,6 +191,8 @@ namespace NxWM
* CHexCalculator Method Implementations
********************************************************************************************/
extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_HEXCALCULATOR_ICON;
using namespace NxWM;
/**
+2
View File
@@ -71,6 +71,8 @@ FAR const char *NxWM::g_startWindowMqName = CONFIG_NXWM_STARTWINDOW_MQNAME;
* CStartWindow Method Implementations
********************************************************************************************/
extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_STARTWINDOW_ICON;
using namespace NxWM;
/**
+17 -2
View File
@@ -991,6 +991,7 @@ bool CTaskbar::createBackgroundWindow(void)
bool CTaskbar::createBackgroundImage(void)
{
#ifndef CONFIG_NXWM_DISABLE_BACKGROUND_IMAGE
// Get the size of the display
struct nxgl_size_s windowSize;
@@ -1054,6 +1055,8 @@ bool CTaskbar::createBackgroundImage(void)
m_backImage->setBorderless(true);
m_backImage->setRaisesEvents(false);
#endif
return true;
}
@@ -1128,6 +1131,10 @@ bool CTaskbar::redrawTaskbarWindow(void)
image->disableDrawing();
image->setRaisesEvents(false);
// Highlight the icon for the top-most window
image->highlight(m_slots.at(i).app == m_topApp);
// Get the size of the icon image
NXWidgets::CRect rect;
@@ -1302,8 +1309,12 @@ bool CTaskbar::redrawBackgroundWindow(void)
// Then re-draw the background image on the window
m_backImage->enableDrawing();
m_backImage->redraw();
if (m_backImage)
{
m_backImage->enableDrawing();
m_backImage->redraw();
}
return true;
}
@@ -1330,6 +1341,10 @@ bool CTaskbar::redrawApplicationWindow(IApplication *app)
raiseTopApplication();
// Redraw taskbar
redrawTaskbarWindow();
// Every application provides a method to obtain its application window
IApplicationWindow *appWindow = app->getWindow();