mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-06 05:43:01 +00:00
apps/graphics/NxWidgets: CNxTkWindow, CNxWindow, CNxServer: Add support to create RAM backed windows.
apps/graphics/twm4nx: IconMgr window now comes up correctly. Need to revisit window width setup. All windows are no created as RAM backed windows.
This commit is contained in:
parent
b5ae79b8f3
commit
f3b3d1fc72
11 changed files with 57 additions and 35 deletions
|
|
@ -160,18 +160,18 @@ namespace NXWidgets
|
|||
* Get an instance of a raw NX window.
|
||||
*/
|
||||
|
||||
inline CNxWindow *createRawWindow(CWidgetControl *widgetControl)
|
||||
inline CNxWindow *createRawWindow(CWidgetControl *widgetControl, uint8_t flags = 0)
|
||||
{
|
||||
return new CNxWindow(m_hNxServer, widgetControl);
|
||||
return new CNxWindow(m_hNxServer, widgetControl, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an instance of the framed NX window.
|
||||
*/
|
||||
|
||||
inline CNxTkWindow *createFramedWindow(CWidgetControl *widgetControl)
|
||||
inline CNxTkWindow *createFramedWindow(CWidgetControl *widgetControl, uint8_t flags = 0)
|
||||
{
|
||||
return new CNxTkWindow(m_hNxServer, widgetControl);
|
||||
return new CNxTkWindow(m_hNxServer, widgetControl, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ namespace NXWidgets
|
|||
CWidgetControl *m_widgetControl; /**< Controlling widget for the window */
|
||||
CNxToolbar *m_toolbar; /**< Child toolbar */
|
||||
nxgl_coord_t m_toolbarHeight; /**< The height of the toolbar */
|
||||
uint8_t m_flags; /**< Window properties */
|
||||
|
||||
public:
|
||||
|
||||
|
|
@ -111,9 +112,11 @@ namespace NXWidgets
|
|||
*
|
||||
* @param hNxServer Handle to the NX server.
|
||||
* @param widgetControl Controlling widget for this window.
|
||||
* @param flags Window properties
|
||||
*/
|
||||
|
||||
CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl);
|
||||
CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl,
|
||||
uint8_t flags);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
|
|
|
|||
|
|
@ -52,10 +52,6 @@
|
|||
#include "graphics/nxwidgets/ccallback.hxx"
|
||||
#include "graphics/nxwidgets/inxwindow.hxx"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Implementation Classes
|
||||
****************************************************************************/
|
||||
|
|
@ -89,6 +85,7 @@ namespace NXWidgets
|
|||
NXHANDLE m_hNxServer; /**< Handle to the NX server. */
|
||||
NXWINDOW m_hNxWindow; /**< Handle to the NX raw window */
|
||||
CWidgetControl *m_widgetControl; /**< The controlling widget for the window */
|
||||
uint8_t m_flags; /**< Window properties */
|
||||
|
||||
public:
|
||||
|
||||
|
|
@ -111,9 +108,11 @@ namespace NXWidgets
|
|||
*
|
||||
* @param hNxServer Handle to the NX server.
|
||||
* @param widgetControl Controlling widget for this window.
|
||||
* @param flags Window properties
|
||||
*/
|
||||
|
||||
CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl);
|
||||
CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl,
|
||||
uint8_t flags = 0);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
|
|
|
|||
|
|
@ -334,6 +334,18 @@ namespace Twm4Nx
|
|||
FAR const struct NXWidgets::SRlePaletteBitmap *sbitmap,
|
||||
bool isIconMgr, FAR CIconMgr *iconMgr, bool noToolbar);
|
||||
|
||||
/**
|
||||
* Synchronize the window with the NX server. This function will delay
|
||||
* until the the NX server has caught up with all of the queued requests.
|
||||
* When this function returns, the state of the NX server will be the
|
||||
* same as the state of the application.
|
||||
*/
|
||||
|
||||
inline void synchronize(void)
|
||||
{
|
||||
m_nxWin->synchronize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the widget control instance needed to support application drawing
|
||||
* into the window.
|
||||
|
|
|
|||
|
|
@ -146,15 +146,15 @@
|
|||
// Spacing. Defaults values good at 75 and 100 DPI
|
||||
|
||||
#ifndef CONFIG_TWM4NX_TOOLBAR_HSPACING
|
||||
# define CONFIG_TWM4NX_TOOLBAR_HSPACING 8
|
||||
# define CONFIG_TWM4NX_TOOLBAR_HSPACING 2
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_TWM4NX_ICONMGR_VSPACING
|
||||
# define CONFIG_TWM4NX_FRAME_VSPACING 2
|
||||
#ifndef CONFIG_TWM4NX_FRAME_VSPACING
|
||||
# define CONFIG_TWM4NX_FRAME_VSPACING 2
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_TWM4NX_BUTTON_INDENT
|
||||
# define CONFIG_TWM4NX_BUTTON_INDENT 1
|
||||
# define CONFIG_TWM4NX_BUTTON_INDENT 1
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_TWM4NX_ICONMGR_VSPACING
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue