45class NCWidget :
public tnode<NCWidget*>,
protected NCursesError
49 friend std::ostream & operator<<( std::ostream & str,
const NCWidget & obj );
50 friend std::ostream & operator<<( std::ostream & str,
const NCWidget * obj );
52 NCWidget & operator=(
const NCWidget & );
53 NCWidget(
const NCWidget & );
59 void invalidate() { magic = 0; }
68 virtual const char * location()
const {
return "NCWidget"; }
70 virtual void PreDisconnect();
71 virtual void PostDisconnect();
72 virtual void PreReparent();
73 virtual void PostReparent();
77 NCWidget *
const grabedBy;
79 virtual void grabNotify( NCWidget * ) {}
81 virtual bool wantFocus( NCWidget & ngrab ) {
return false; }
85 void grabSet( NCWidget * ngrab )
87 if ( grabedBy && grabedBy != ngrab )
88 grabedBy->grabNotify(
this );
90 const_cast<NCWidget *&
>( grabedBy ) = ngrab;
93 void grabRelease( NCWidget * ograb )
95 if ( grabedBy && grabedBy != ograb )
96 grabedBy->grabNotify(
this );
98 const_cast<NCWidget *&
>( grabedBy ) = 0;
110 void wMoveChildTo( NCWidget & child,
const wpos & newpos );
111 void wRelocate(
const wrect & newrect );
112 void wRelocate(
const wpos & newpos,
const wsze & newsze )
114 wRelocate(
wrect( newpos, newsze ) );
117 virtual void wCreate(
const wrect & newrect );
118 virtual void wMoveTo(
const wpos & newpos );
119 virtual void wDelete();
120 virtual void wUpdate(
bool forced_br =
false );
122 wpos ScreenPos()
const;
126 virtual void wRedraw();
127 virtual void wRecoded();
137 bool isValid()
const {
return magic == YWIDGET_MAGIC; }
139 bool winExist()
const {
return win != ( NCursesWindow * )0; }
141 virtual const NCstyle::Style & wStyle()
const
144 return Top().Value()->wStyle();
146 return NCurses::style()[NCstyle::DefaultStyle];
149 const NCstyle::StWidget & widgetStyle(
bool nonactive =
false )
const
150 {
return wStyle().getWidget( GetState(), nonactive ); }
152 const NCstyle::StWidget & frameStyle()
const
153 {
return wStyle().getFrame( GetState() ); }
155 const NCstyle::StList & listStyle()
const
156 {
return wStyle().getList( GetState() ); }
158 wsze wGetDefsze()
const {
return defsze; }
160 wrect wGetSize()
const {
return inparent; }
163 void Redraw(
bool sub =
false );
166 NC::WState GetState()
const {
return wstate; }
168 void SetState(
const NC::WState newstate,
bool force =
false );
177 virtual bool HasHotkey(
int key );
178 virtual bool HasFunctionHotkey(
int key )
const;
180 virtual NCursesEvent wHandleHotkey( wint_t key );
181 virtual NCursesEvent wHandleInput( wint_t key );
183 void DumpOn( std::ostream & str, std::string prfx )
const;
Screen position pair in the order line, column: (L, C)
Definition position.h:110
A rectangle is defined by its position and size: wpos Pos, wsze Sze.
Definition position.h:194
Screen dimension (screen size) in the order height, width: (H, W)
Definition position.h:154