mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 09:01:36 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -191,6 +191,8 @@ namespace NxWM
|
||||
* CHexCalculator Method Implementations
|
||||
********************************************************************************************/
|
||||
|
||||
extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_HEXCALCULATOR_ICON;
|
||||
|
||||
using namespace NxWM;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user