apps/graphics/twm4nx: Add logic to hide the window when it is iconified and restore the window when it is de-iconfied. Iconification works, de-iconification does not.

This commit is contained in:
Gregory Nutt 2019-05-05 15:23:50 -06:00
parent 1e4dfd7193
commit 1879949cdc
10 changed files with 157 additions and 60 deletions

View file

@ -228,6 +228,32 @@ namespace NXWidgets
return false;
}
/**
* Show a hidden window
*
* @return Always returns false.
*/
inline bool show(void)
{
// The background is always visible (although perhaps obscured)
return false;
}
/**
* Hide a visible window
*
* @return Always returns false.
*/
inline bool hide(void)
{
// The background cannot be hidden
return false;
}
/**
* May be used to either (1) raise a window to the top of the display and
* select modal behavior, or (2) disable modal behavior. NOTE: The

View file

@ -232,7 +232,10 @@ namespace NXWidgets
* @return True on success, false on any failure.
*/
bool raise(void);
inline bool raise(void)
{
return nxtk_raise(m_hNxTkWindow) == OK;
}
/**
* Lower the window to the bottom of the display.
@ -240,7 +243,32 @@ namespace NXWidgets
* @return True on success, false on any failure.
*/
bool lower(void);
inline bool lower(void)
{
return nxtk_lower(m_hNxTkWindow) == OK;
}
/**
* Show a hidden window
*
* @return True on success, false on any failure.
*/
inline bool show(void)
{
return nxtk_setvisibility(m_hNxTkWindow, false) == OK;
}
/**
* Hide a visible window
*
* @return True on success, false on any failure.
*/
inline bool hide(void)
{
return nxtk_setvisibility(m_hNxTkWindow, true) == OK;
}
/**
* May be used to either (1) raise a window to the top of the display and

View file

@ -221,6 +221,34 @@ namespace NXWidgets
return false;
}
/**
* Show a hidden window. The toolbar is a component of the containing,
* parent, framed window. It cannot be shown separately.
*
* @return Always returns false.
*/
inline bool show(void)
{
// The background is always visible (although perhaps obscured)
return false;
}
/**
* Hide a visible window. The toolbar is a component of the containing,
* parent, framed window. It cannot be hidden separately.
*
* @return Always returns false.
*/
inline bool hide(void)
{
// The background cannot be hidden
return false;
}
/**
* May be used to either (1) raise a window to the top of the display and
* select modal behavior, or (2) disable modal behavior. The toolbar is

View file

@ -201,7 +201,10 @@ namespace NXWidgets
* @return True on success, false on any failure.
*/
bool raise(void);
inline bool raise(void)
{
return nx_raise(m_hNxWindow) == OK;
}
/**
* Lower the window to the bottom of the display.
@ -209,7 +212,32 @@ namespace NXWidgets
* @return True on success, false on any failure.
*/
bool lower(void);
inline bool lower(void)
{
return nx_lower(m_hNxWindow) == OK;
}
/**
* Show a hidden window
*
* @return True on success, false on any failure.
*/
inline bool show(void)
{
return nx_setvisibility(m_hNxWindow, false) == OK;
}
/**
* Hide a visible window
*
* @return True on success, false on any failure.
*/
inline bool hide(void)
{
return nx_setvisibility(m_hNxWindow, true) == OK;
}
/**
* May be used to either (1) raise a window to the top of the display and

View file

@ -190,6 +190,22 @@ namespace NXWidgets
virtual bool lower(void) = 0;
/**
* Show a hidden window
*
* @return True on success, false on any failure.
*/
virtual bool show(void) = 0;
/**
* Hide a visible window
*
* @return True on success, false on any failure.
*/
virtual bool hide(void) = 0;
/**
* May be used to either (1) raise a window to the top of the display and
* select modal behavior, or (2) disable modal behavior.

View file

@ -469,6 +469,23 @@ namespace Twm4Nx
return m_nxWin->lower();
}
/**
* Show a hidden window
*/
inline bool showWindow(void)
{
return m_nxWin->show();
}
/**
* Hide a visible window
*/
inline bool hideWindow(void)
{
return m_nxWin->hide();
}
/**
* Convert the position of a primary window to the position of
* the containing frame.