31 #include <ncursesw/panel.h> 35 friend std::ostream & operator<<( std::ostream & Stream,
const NCursesPanel & Obj_Cv );
36 friend std::ostream & operator<<( std::ostream & Stream,
const NCursesPanel * Obj_Cv );
78 UserHook* uptr = ( UserHook* )::panel_userptr( p );
79 assert( uptr && uptr->m_back ==
this && uptr->m_owner == p );
83 void *get_user()
const 85 UserHook* uptr = ( UserHook* )::panel_userptr( p );
86 assert( uptr && uptr->m_back ==
this && uptr->m_owner == p );
90 static const NCursesPanel * get_Panel_of(
const PANEL & pan )
92 UserHook* uptr = ( UserHook* )::panel_userptr( &pan );
94 if ( uptr && uptr->m_owner == &pan
95 && uptr->m_back && uptr->m_back->p == &pan )
107 void OnError(
int err )
const THROWS( NCursesPanelException )
110 THROW(
new NCursesPanelException(
this, err ) );
141 ::wresize(
w, lines, columns );
142 return ::replace_panel( p,
w );
183 if ( ::panel_above( 0 ) != p )
185 OnError( ::bottom_panel( p ) );
191 OnError( ::move_panel( p, y, x ) );
200 return ( ::panel_hidden( p ) );
224 inline PANEL * PANEL_above()
const 226 return( p ? ::panel_above( p ) : 0 );
229 inline PANEL * PANEL_below()
const 231 return( p ? ::panel_below( p ) : 0 );
234 int transparent(
int y,
int x );
259 virtual void frame(
const char* title = NULL,
260 const char* btitle = NULL );
265 virtual void boldframe(
const char* title = NULL,
266 const char* btitle = NULL );
271 virtual void label(
const char* topLabel,
272 const char* bottomLabel );
277 virtual void centertext(
int row,
const char* label );
299 const T* p_UserData = ( T* )0 )
323 return ( T* )get_user();
351 #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.