mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 11:23:34 +08:00
NXWidgets::CImage needs to catch mouse/touchscreen events; All touchscreen drivers need to report the last valid X/Y data when the screen is untouched.
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4731 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -66,3 +66,8 @@
|
||||
never restart the Calibration window.
|
||||
* NxWM::CTaskbar: On a failure to start an application, the application icon
|
||||
CImage was being deleted twice.
|
||||
* NXWidgets::CImage: Now handles mouse click callbacks. CImage is now really
|
||||
a button. Probably should separate basic imaging functionality as CImage
|
||||
and create a new CImageButton.
|
||||
* NxWM::CStartWindow: Now ignores any close application button presses
|
||||
(You can't close the start window).
|
||||
@@ -133,6 +133,33 @@ namespace NXWidgets
|
||||
|
||||
virtual void drawBorder(CGraphicsPort *port);
|
||||
|
||||
/**
|
||||
* Redraws the button.
|
||||
*
|
||||
* @param x The x coordinate of the click.
|
||||
* @param y The y coordinate of the click.
|
||||
*/
|
||||
|
||||
virtual void onClick(nxgl_coord_t x, nxgl_coord_t y);
|
||||
|
||||
/**
|
||||
* Raises an action event and redraws the button.
|
||||
*
|
||||
* @param x The x coordinate of the mouse.
|
||||
* @param y The y coordinate of the mouse.
|
||||
*/
|
||||
|
||||
virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y);
|
||||
|
||||
/**
|
||||
* Redraws the button.
|
||||
*
|
||||
* @param x The x coordinate of the mouse.
|
||||
* @param y The y coordinate of the mouse.
|
||||
*/
|
||||
|
||||
virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y);
|
||||
|
||||
/**
|
||||
* Copy constructor is protected to prevent usage.
|
||||
*/
|
||||
@@ -199,10 +226,7 @@ namespace NXWidgets
|
||||
* @param highlightOn True(1), the image will be highlighted
|
||||
*/
|
||||
|
||||
inline void highlight(bool highlightOn)
|
||||
{
|
||||
m_highlighted = highlightOn;
|
||||
}
|
||||
void highlight(bool highlightOn);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -357,6 +357,58 @@ void CImage::drawBorder(CGraphicsPort *port)
|
||||
port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Control the highlight state.
|
||||
*
|
||||
* @param highlightOn True(1), the image will be highlighted
|
||||
*/
|
||||
|
||||
void CImage::highlight(bool highlightOn)
|
||||
{
|
||||
if (m_highlighted != highlightOn)
|
||||
{
|
||||
m_highlighted = highlightOn;
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Redraws the button.
|
||||
*
|
||||
* @param x The x coordinate of the click.
|
||||
* @param y The y coordinate of the click.
|
||||
*/
|
||||
|
||||
void CImage::onClick(nxgl_coord_t x, nxgl_coord_t y)
|
||||
{
|
||||
redraw();
|
||||
}
|
||||
|
||||
/**
|
||||
* Raises an action event and redraws the button.
|
||||
*
|
||||
* @param x The x coordinate of the mouse.
|
||||
* @param y The y coordinate of the mouse.
|
||||
*/
|
||||
|
||||
void CImage::onRelease(nxgl_coord_t x, nxgl_coord_t y)
|
||||
{
|
||||
m_widgetEventHandlers->raiseActionEvent();
|
||||
redraw();
|
||||
}
|
||||
|
||||
/**
|
||||
* Redraws the button.
|
||||
*
|
||||
* @param x The x coordinate of the mouse.
|
||||
* @param y The y coordinate of the mouse.
|
||||
*/
|
||||
|
||||
void CImage::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y)
|
||||
{
|
||||
redraw();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the horizontal position of the bitmap. Zero is the left edge
|
||||
* of the bitmap and values >0 will move the bit map to the right.
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace NxWM
|
||||
void minimize(void);
|
||||
|
||||
/**
|
||||
* Called when the window minimize close is pressed.
|
||||
* Called when the window close button is pressed.
|
||||
*/
|
||||
|
||||
void close(void);
|
||||
|
||||
@@ -356,7 +356,7 @@ void CStartWindow::minimize(void)
|
||||
|
||||
void CStartWindow::close(void)
|
||||
{
|
||||
m_taskbar->stopApplication(static_cast<IApplication*>(this));
|
||||
// Do nothing... you can't close the start window!!!
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user