38 #define DLOC location() << ' '
40 #define YWIDGET_MAGIC 42
47 friend std::ostream & operator<<( std::ostream & STREAM,
const NCWidget & OBJ );
48 friend std::ostream & operator<<( std::ostream & STREAM,
const NCWidget * OBJ );
57 void invalidate() { magic = 0; }
66 virtual const char * location()
const {
return "NCWidget"; }
68 virtual void PreDisconnect();
69 virtual void PostDisconnect();
70 virtual void PreReparent();
71 virtual void PostReparent();
77 virtual void grabNotify(
NCWidget * ) {}
79 virtual bool wantFocus(
NCWidget & ngrab ) {
return false; }
85 if ( grabedBy && grabedBy != ngrab )
86 grabedBy->grabNotify(
this );
88 const_cast<NCWidget *&
>( grabedBy ) = ngrab;
93 if ( grabedBy && grabedBy != ograb )
94 grabedBy->grabNotify(
this );
96 const_cast<NCWidget *&
>( grabedBy ) = 0;
108 void wMoveChildTo(
NCWidget & child,
const wpos & newpos );
109 void wRelocate(
const wrect & newrect );
110 void wRelocate(
const wpos & newpos,
const wsze & newsze )
112 wRelocate(
wrect( newpos, newsze ) );
115 virtual void wCreate(
const wrect & newrect );
116 virtual void wMoveTo(
const wpos & newpos );
117 virtual void wDelete();
118 virtual void wUpdate(
bool forced_br =
false );
120 wpos ScreenPos()
const;
124 virtual void wRedraw();
125 virtual void wRecoded();
135 bool isValid()
const {
return magic == YWIDGET_MAGIC; }
137 bool winExist()
const {
return win != (
NCursesWindow * )0; }
142 return Top().Value()->wStyle();
144 return NCurses::style()[NCstyle::DefaultStyle];
148 {
return wStyle().getWidget( GetState(), nonactive ); }
151 {
return wStyle().getFrame( GetState() ); }
154 {
return wStyle().getList( GetState() ); }
156 wsze wGetDefsze()
const {
return defsze; }
158 wrect wGetSize()
const {
return inparent; }
161 void Redraw(
const bool sub =
false );
164 NC::WState GetState()
const {
return wstate; }
166 void SetState(
const NC::WState newstate,
const bool force =
false );
175 virtual bool HasHotkey(
int key );
176 virtual bool HasFunctionHotkey(
int key )
const;
181 void DumpOn( std::ostream & str, std::string prfx )
const;
185 #include "NCstring.h"