31 #include <ncursesw/etip.h> 32 #include <ncursesw/panel.h> 37 friend std::ostream & operator<<( std::ostream & Stream,
const NCursesPanel & Obj_Cv );
38 friend std::ostream & operator<<( std::ostream & Stream,
const NCursesPanel * Obj_Cv );
80 UserHook* uptr = ( UserHook* )::panel_userptr( p );
81 assert( uptr && uptr->m_back ==
this && uptr->m_owner == p );
85 void *get_user()
const 87 UserHook* uptr = ( UserHook* )::panel_userptr( p );
88 assert( uptr && uptr->m_back ==
this && uptr->m_owner == p );
92 static const NCursesPanel * get_Panel_of(
const PANEL & pan )
94 UserHook* uptr = ( UserHook* )::panel_userptr( &pan );
96 if ( uptr && uptr->m_owner == &pan
97 && uptr->m_back && uptr->m_back->p == &pan )
109 void OnError(
int err )
const THROWS( NCursesPanelException )
112 THROW(
new NCursesPanelException(
this, err ) );
143 ::wresize(
w, lines, columns );
144 return ::replace_panel( p,
w );
185 if ( ::panel_above( 0 ) != p )
187 OnError( ::bottom_panel( p ) );
193 OnError( ::move_panel( p, y, x ) );
202 return ( ::panel_hidden( p ) );
226 inline PANEL * PANEL_above()
const 228 return( p ? ::panel_above( p ) : 0 );
231 inline PANEL * PANEL_below()
const 233 return( p ? ::panel_below( p ) : 0 );
236 int transparent(
int y,
int x );
261 virtual void frame(
const char* title = NULL,
262 const char* btitle = NULL );
267 virtual void boldframe(
const char* title = NULL,
268 const char* btitle = NULL );
273 virtual void label(
const char* topLabel,
274 const char* bottomLabel );
279 virtual void centertext(
int row,
const char* label );
301 const T* p_UserData = ( T* )0 )
325 return ( T* )get_user();
353 #endif // _NCURSESP_H
virtual void label(const char *topLabel, const char *bottomLabel)
Put the title centered in the top line and btitle in the bottom line.
static int lines()
Number of lines on terminal, not window.
NCursesUserPanel(const T *p_UserData=(T *) 0)
This creates an user panel associated with the ::stdscr and user data pointed to by p_UserData...
static void redraw()
Redraw all panels.
virtual int refresh()
Propagate all panel changes to the virtual screen and update the physical screen. ...
void show()
Show the panel, i.e.
int mvwin(int y, int x)
Move window to new position with the new position as top left corner.
virtual void centertext(int row, const char *label)
Put the label text centered in the specified row.
static int cols()
Number of cols on terminal, not window.
virtual void frame(const char *title=NULL, const char *btitle=NULL)
Put a frame around the panel and put the title centered in the top line and btitle in the bottom line...
void OnError(int err) const THROWS(NCursesPanelException)
If err is equal to the curses error indicator ERR, an error handler is called.
void bottom()
Make this panel the bottom panel in the stack.
Associate user data with a panel.
NCursesUserPanel(int lines, int cols, int begin_y=0, int begin_x=0, const T *p_UserData=(T *) 0)
This creates an user panel of the requested size with associated user data pointed to by p_UserData...
NCursesPanel & above() const
The functions panel_above() and panel_below() are not reflected in the NCursesPanel class...
NCursesPanel(int lines, int cols, int begin_y=0, int begin_x=0)
Create a panel with this size starting at the requested position.
bool hidden() const
Return TRUE if the panel is hidden, FALSE otherwise.
void hide()
Hide the panel.
virtual int noutrefresh()
Propagate all panel changes to the virtual screen.
NCursesPanel()
This constructor creates the default Panel associated with the ::stdscr window.
void top()
Make this panel the top panel in the stack.
virtual void boldframe(const char *title=NULL, const char *btitle=NULL)
Same as frame(), but use highlighted attributes.
virtual int resize(int lines, int columns)
Resize the panel window.
virtual void setUserData(const T *p_UserData)
Associate the user panel with the user data pointed to by p_UserData.
static T * UserDataOf(const PANEL &pan)
Retrieve the user data if associated with the PANEL.
WINDOW * w
the curses WINDOW
void set_user(void *user)
Set the user pointer of the panel.
T * UserData(void) const
Retrieve the user data associated with the panel.