65 void NCursesPanel::init()
72 UserHook* hook =
new UserHook;
80 ::set_panel_userptr( p, (
void * )hook );
83 NCursesPanel::~NCursesPanel()
85 UserHook* hook = ( UserHook* )::panel_userptr( p );
86 assert( hook && hook->m_back ==
this && hook->m_owner == p );
98 pan = ::panel_above( NULL );
103 pan = ::panel_above( pan );
129 frame( title, btitle );
138 if ( !title && !btitle )
147 label( title, btitle );
168 int x = (
maxx() - strlen( label ) ) / 2;
179 int NCursesPanel::transparent(
int y,
int x )
182 || y < 0 ||
maxy() < y
183 || x < 0 ||
maxx() < x )
192 for ( PANEL * sp = ::panel_below( p ); 1; sp = ::panel_below( sp ) )
194 WINDOW * sw = ( sp ? ::panel_window( sp ) : ::stdscr );
198 int dy = ay - sw->_begy;
200 if ( 0 <= dy && dy <= sw->_maxy )
202 int dx = ax - sw->_begx;
204 if ( 0 <= dx && dx <= sw->_maxx )
206 return addch( y, x, ::mvwinch( sw, dy, dx ) );
219 std::ostream & operator<<( std::ostream & Stream,
const NCursesPanel * Obj_Cv )
222 return Stream << *Obj_Cv;
224 return Stream <<
"(NoNCPan)";
228 std::ostream & operator<<( std::ostream & Stream,
const NCursesPanel & Obj_Cv )
230 return Stream <<
"NCPan(" << Obj_Cv.p <<
')';
virtual void label(const char *topLabel, const char *bottomLabel)
virtual void centertext(int row, const char *label)
virtual void frame(const char *title=NULL, const char *btitle=NULL)
void OnError(int err) const THROWS(NCursesPanelException)
virtual int noutrefresh()
virtual void boldframe(const char *title=NULL, const char *btitle=NULL)
int addstr(const char *str, int n=-1)