44 virtual void HScroll(
unsigned total,
unsigned visible,
unsigned start ) {}
49 virtual void VScroll(
unsigned total,
unsigned visible,
unsigned start ) {}
51 virtual void ScrollHead(
NCursesWindow & w,
unsigned ccol ) {}
53 virtual void AdjustPadSize(
wsze & minsze ) {}
76 redirect->ScrollHead( w, ccol );
79 void VSet(
unsigned total,
unsigned visible,
unsigned start )
81 redirect->
VScroll( total, visible, start );
84 void HSet(
unsigned total,
unsigned visible,
unsigned start )
86 redirect->
HScroll( total, visible, start );
89 virtual void SetPadSize(
wsze & minsze )
91 redirect->AdjustPadSize( minsze );
99 virtual void SendHead() {}
151 virtual int dirtyPad() { dirty =
false;
return setpos( CurPos() ); }
159 return setpos( CurPos() + offset );
162 virtual void updateScrollHint();
188 virtual void resize(
wsze nsze );
191 virtual int resize(
int lines,
int columns ) {
return NCursesWindow::resize(
lines, columns );}
192 virtual void wRecoded();
193 virtual void setDirty() { dirty =
true; }
198 virtual wpos CurPos()
const {
return srect.Pos; }
200 int ScrlTo(
const wpos & newpos )
217 int ScrlDown(
int lines = 1 )
222 int ScrlUp(
int lines = 1 )
227 int ScrlRight(
int cols = 1 )
232 int ScrlLeft(
int cols = 1 )
242 virtual bool handleInput( wint_t key );
static int lines()
Number of lines on terminal, not window.
Screen dimension (screen size) in the order height, width: (H, W)
NCursesWindow * destwin
Where to draw us (may be nullptr, not owned)
int ScrlCol(int col)
Scroll to a column, keeping the line.
int ScrlLine(int line)
Scroll to a line, keeping the column.
int vheight() const
The (virtual) height of the Pad (even if truncated).
static int cols()
Number of cols on terminal, not window.
Interface for scroll callbacks.
WINDOW * w
the curses WINDOW
A virtual window with a real viewport (which is NCursesWindow) and a scrolling mechanism.
Screen position pair in the order line, column: (L, C)
virtual void HScroll(unsigned total, unsigned visible, unsigned start)
virtual void VScroll(unsigned total, unsigned visible, unsigned start)
int height() const
Number of lines in this window.
bool paging() const
Whether the Pad is truncated (we're paging).
NCPad(int lines, int cols, const NCWidget &p)
bool dclear
should destwin be cleared before contents is copied there
virtual int setpos(const wpos &newpos)
Set the visible position to newpos (but clamp by maxspos), then update.
A rectangle is defined by its position and size: wpos Pos, wsze Sze.
virtual void directDraw(NCursesWindow &w, const wrect at, unsigned lineno)
Directly draw a table item at a specific location.
wrect srect
Source rectangle: the visible part of this pad.
int adjpos(const wpos &offset)
Adjust CurPos relatively by offset