libyui-ncurses  2.55.0
NCursesPanel Class Reference
Inheritance diagram for NCursesPanel:
Collaboration diagram for NCursesPanel:

Public Member Functions

 NCursesPanel (int lines, int cols, int begin_y=0, int begin_x=0)
 Create a panel with this size starting at the requested position.
 
 NCursesPanel ()
 This constructor creates the default Panel associated with the ::stdscr window.
 
virtual int resize (int lines, int columns)
 Resize the panel window.
 
void hide ()
 Hide the panel. More...
 
void show ()
 Show the panel, i.e. More...
 
void top ()
 Make this panel the top panel in the stack.
 
void bottom ()
 Make this panel the bottom panel in the stack. More...
 
int mvwin (int y, int x)
 Move window to new position with the new position as top left corner. More...
 
bool hidden () const
 Return TRUE if the panel is hidden, FALSE otherwise.
 
NCursesPanelabove () const
 The functions panel_above() and panel_below() are not reflected in the NCursesPanel class. More...
 
NCursesPanelbelow () const
 
PANEL * PANEL_above () const
 
PANEL * PANEL_below () const
 
int transparent (int y, int x)
 
virtual int refresh ()
 Propagate all panel changes to the virtual screen and update the physical screen.
 
virtual int noutrefresh ()
 Propagate all panel changes to the virtual screen.
 
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.
 
virtual void boldframe (const char *title=NULL, const char *btitle=NULL)
 Same as frame(), but use highlighted attributes.
 
virtual void label (const char *topLabel, const char *bottomLabel)
 Put the title centered in the top line and btitle in the bottom line.
 
virtual void centertext (int row, const char *label)
 Put the label text centered in the specified row.
 
- Public Member Functions inherited from NCursesWindow
 NCursesWindow (WINDOW *window)
 Constructor. More...
 
 NCursesWindow (int lines, int cols, int begin_y, int begin_x)
 Constructor.
 
 NCursesWindow (NCursesWindow &parent, int lines, int cols, int begin_y, int begin_x, char absrel='a')
 Constructor. More...
 
virtual ~NCursesWindow ()
 Destructor.
 
NCursesWindow Clone ()
 Make an exact copy of the window.
 
int colors () const
 Number of available colors.
 
int height () const
 Number of lines in this window.
 
int width () const
 Number of columns in this window.
 
int begx () const
 Column of top left corner relative to stdscr.
 
int begy () const
 Line of top left corner relative to stdscr.
 
int maxx () const
 Largest x coord in window.
 
int maxy () const
 Largest y coord in window.
 
wsze size () const
 
wpos begpos () const
 
wpos maxpos () const
 
wrect area () const
 
short getcolor () const
 Actual color pair.
 
short foreground () const
 Actual foreground color.
 
short background () const
 Actual background color.
 
int setpalette (short fore, short back)
 Set color palette entry.
 
int setcolor (short pair)
 Set actually used palette entry.
 
int mvsubwin (NCursesWindow *sub, int begin_y, int begin_x)
 
int move (int y, int x)
 Move cursor the this position.
 
void getyx (int &y, int &x) const
 Get current position of the cursor.
 
int mvcur (int oldrow, int oldcol, int newrow, int newcol) const
 Perform lowlevel cursor motion that takes effect immediately.
 
int nodelay (bool bf)
 
int getch ()
 Get a keystroke from the window.
 
int getch (int y, int x)
 Move cursor to position and get a keystroke from the window.
 
int getstr (char *str, int n=-1)
 Read a series of characters into str until a newline or carriage return is received. More...
 
int getstr (int y, int x, char *str, int n=-1)
 Move the cursor to the requested position and then perform the getstr() as described above.
 
int instr (char *s, int n=-1)
 Get a std::string of characters from the window into the buffer s. More...
 
int instr (int y, int x, char *s, int n=-1)
 Move the cursor to the requested position and then perform the instr() as described above.
 
int addch (const char ch)
 Put attributed character to the window.
 
int addch (const chtype ch)
 
int add_attr_char (int y, int x)
 Put attributed character from given position to the window.
 
int add_attr_char ()
 
int add_wch (const cchar_t *cch)
 Put a combined character to the window.
 
int add_wch (int y, int x, const cchar_t *cch)
 
int addch (int y, int x, const char ch)
 Move cursor to the requested position and then put attributed character to the window.
 
int addch (int y, int x, const chtype ch)
 
int echochar (const char ch)
 Put attributed character to the window and refresh it immediately.
 
int echochar (const chtype ch)
 
int addstr (const char *str, int n=-1)
 Write the std::string str to the window, stop writing if the terminating NUL or the limit n is reached. More...
 
int addstr (int y, int x, const char *str, int n=-1)
 Move the cursor to the requested position and then perform the addstr as described above.
 
int addwstr (const wchar_t *str, int n=-1)
 Write the wchar_t str to the window, stop writing if the terminating NUL or the limit n is reached. More...
 
int addwstr (int y, int x, const wchar_t *str, int n=-1)
 Move the cursor to the requested position and then perform the addwstr as described above.
 
int printw (const char *fmt,...)
 Do a formatted print to the window.
 
int printw (int y, int x, const char *fmt,...)
 Move the cursor and then do a formatted print to the window.
 
chtype inch () const
 Retrieve attributed character under the current cursor position.
 
chtype inchar () const
 
chtype inch (int y, int x)
 Move cursor to requested position and then retrieve attributed character at this position.
 
chtype inchar (int y, int x)
 
int in_wchar (cchar_t *cchar)
 Retrieve combined character under the current cursor position.
 
int in_wchar (int y, int x, cchar_t *cchar)
 
int insch (chtype ch)
 Insert attributed character into the window before current cursor position.
 
int insch (int y, int x, chtype ch)
 Move cursor to requested position and then insert the attributed character before that position.
 
int ins_wch (int y, int x, const cchar_t *cchar)
 Move cursor to requested position and then insert the attributed character before that position.
 
int insertln ()
 Insert an empty line above the current line.
 
int insdelln (int n=1)
 If n>0 insert that many lines above the current line. More...
 
int insstr (const char *s, int n=-1)
 Insert the std::string into the window before the current cursor position. More...
 
int insstr (int y, int x, const char *s, int n=-1)
 Move the cursor to the requested position and then perform the insstr() as described above.
 
int attron (chtype at)
 Switch on the window attributes;.
 
int attroff (chtype at)
 Switch off the window attributes;.
 
int attrset (chtype at)
 Set the window attributes;.
 
int chgat (int n, attr_t attr, short color, const void *opts=NULL)
 Change the attributes of the next n characters in the current line. More...
 
int chgat (int y, int x, int n, attr_t attr, short color, const void *opts=NULL)
 Move the cursor to the requested position and then perform chgat() as described above.
 
chtype getbkgd () const
 Get current background setting.
 
int bkgd (const chtype ch)
 Set the background property and apply it to the window.
 
void bkgdset (chtype ch)
 Set the background property.
 
int box ()
 Draw a box around the window with the given vertical and horizontal drawing characters. More...
 
int border (chtype left=0, chtype right=0, chtype top=0, chtype bottom=0, chtype top_left=0, chtype top_right=0, chtype bottom_left=0, chtype bottom_right=0)
 Draw a border around the window with the given characters for the various parts of the border. More...
 
int hline (int len, chtype ch=0)
 Draw a horizontal line of len characters with the given character. More...
 
int hline (int y, int x, int len, chtype ch=0)
 Move the cursor to the requested position and then draw a horizontal line.
 
int vline (int len, chtype ch=0)
 Draw a vertical line of len characters with the given character. More...
 
int vline (int y, int x, int len, chtype ch=0)
 Move the cursor to the requested position and then draw a vertical line.
 
int box (const wrect &dim)
 
int erase ()
 Erase the window.
 
int clear ()
 Clear the window.
 
int clearok (bool bf)
 Set/Reset the clear flag. More...
 
int clrtobot ()
 Clear to the end of the window.
 
int clrtoeol ()
 Clear to the end of the line.
 
int delch ()
 Delete character under the cursor.
 
int delch (int y, int x)
 Move cursor to requested position and delete the character under the cursor.
 
int deleteln ()
 Delete the current line.
 
int scroll (int amount=1)
 Scroll amount lines. More...
 
int scrollok (bool bf)
 If bf is TRUE, window scrolls if cursor is moved off the bottom edge of the window or a scrolling region, otherwise the cursor is left at the bottom line.
 
int setscrreg (int from, int to)
 Define a soft scrolling region.
 
int idlok (bool bf)
 If bf is TRUE, use insert/delete line hardware support if possible. More...
 
void idcok (bool bf)
 If bf is TRUE, use insert/delete character hardware support if possible. More...
 
int touchwin ()
 Mark the whole window as modified.
 
int untouchwin ()
 Mark the whole window as unmodified.
 
int touchln (int s, int cnt, bool changed=TRUE)
 Mark cnt lines beginning from line s as changed or unchanged, depending on the value of the changed flag.
 
bool is_wintouched () const
 Return TRUE if window is marked as changed, FALSE otherwise.
 
int leaveok (bool bf)
 If bf is TRUE, curses will leave the cursor after an update whereever it is after the update.
 
int redrawln (int from, int n)
 Redraw n lines starting from the requested line.
 
int redrawwin ()
 Redraw the whole window.
 
int doupdate ()
 Do all outputs to make the physical screen looking like the virtual one.
 
void syncdown ()
 Propagate the changes down to all descendant windows.
 
void syncup ()
 Propagate the changes up in the hierarchy.
 
void cursyncup ()
 Position the cursor in all ancestor windows corresponding to our setting.
 
int syncok (bool bf)
 If called with bf=TRUE, syncup() is called whenever the window is changed.
 
void immedok (bool bf)
 If called with bf=TRUE, any change in the window will cause an automatic immediate refresh()
 
int keypad (bool bf)
 If called with bf=TRUE, the application will interpret function keys.
 
int meta (bool bf)
 If called with bf=TRUE, keys may generate 8-Bit characters. More...
 
int standout ()
 Enable "standout" attributes.
 
int standend ()
 Disable "standout" attributes.
 
int overlay (NCursesWindow &win)
 Overlay this window over win.
 
int overwrite (NCursesWindow &win)
 Overwrite win with this window.
 
int copywin (NCursesWindow &win, int sminrow, int smincol, int dminrow, int dmincol, int dmaxrow, int dmaxcol, bool overlay=TRUE)
 Overlay or overwrite the rectangle in win given by dminrow,dmincol, dmaxrow,dmaxcol with the rectangle in this window beginning at sminrow,smincol.
 
bool has_mouse () const
 Return TRUE if terminal supports a mouse, FALSE otherwise.
 
NCursesWindowchild ()
 Get the first child window.
 
const NCursesWindowchild () const
 
NCursesWindowsibling ()
 Get the next child of my parent.
 
const NCursesWindowsibling () const
 
NCursesWindowparent ()
 Get my parent.
 
const NCursesWindowparent () const
 
bool isDescendant (NCursesWindow &win)
 Return TRUE if win is a descendant of this.
 

Static Public Member Functions

static void redraw ()
 Redraw all panels.
 
- Static Public Member Functions inherited from NCursesWindow
static void useColors (void)
 Call this routine very early if you want to have colors.
 
static int ripoffline (int ripoff_lines, int(*init)(NCursesWindow &win))
 This function is used to generate a window of ripped-of lines. More...
 
static int lines ()
 Number of lines on terminal, not window.
 
static int cols ()
 Number of cols on terminal, not window.
 
static int tabsize ()
 Size of a tab on terminal, not window.
 
static int NumberOfColors ()
 Number of available colors.
 
static int maxcoord ()
 Ncurses up to ncurses5 internally uses short.
 

Protected Member Functions

void set_user (void *user)
 Set the user pointer of the panel.
 
void * get_user () const
 
void OnError (int err) const THROWS(NCursesPanelException)
 If err is equal to the curses error indicator ERR, an error handler is called.
 
- Protected Member Functions inherited from NCursesWindow
void err_handler (const char *) const THROWS(NCursesException)
 Signal an error with the given message text.
 
void kill_subwindows ()
 Destroy all subwindows.
 
 NCursesWindow ()
 Only for use by derived classes. More...
 

Static Protected Member Functions

static const NCursesPanelget_Panel_of (const PANEL &pan)
 

Protected Attributes

PANEL * p
 
- Protected Attributes inherited from NCursesWindow
WINDOW * w
 the curses WINDOW
 
bool alloced
 TRUE if we own the WINDOW.
 
NCursesWindowpar
 parent, if subwindow
 
NCursesWindowsubwins
 head of subwindows std::list
 
NCursesWindowsib
 next subwindow of parent
 

Static Protected Attributes

static NCursesPaneldummy = ( NCursesPanel* )0
 
- Static Protected Attributes inherited from NCursesWindow
static long count = 0L
 count of all active windows
 

Friends

class NCDialog
 
std::ostream & operator<< (std::ostream &Stream, const NCursesPanel &Obj_Cv)
 
std::ostream & operator<< (std::ostream &Stream, const NCursesPanel *Obj_Cv)
 

Detailed Description

Definition at line 33 of file ncursesp.h.

Member Function Documentation

◆ above()

NCursesPanel& NCursesPanel::above ( ) const
inline

The functions panel_above() and panel_below() are not reflected in the NCursesPanel class.

The reason for this is, that we cannot assume that a panel retrieved by those operations is one wrapped by a C++ class. Although this situation might be handled, we also need a reverse mapping from PANEL to NCursesPanel which needs some redesign of the low level stuff. At the moment, we define them in the interface but they will always produce an error.

Definition at line 212 of file ncursesp.h.

Here is the call graph for this function:

◆ bottom()

void NCursesPanel::bottom ( )
inline

Make this panel the bottom panel in the stack.

N.B.: The panel associated with ::stdscr is always on the bottom. So actually bottom() makes the panel the first above ::stdscr.

Definition at line 178 of file ncursesp.h.

Here is the call graph for this function:

◆ hide()

void NCursesPanel::hide ( )
inline

Hide the panel.

It stays in the stack but becomes invisible.

Definition at line 148 of file ncursesp.h.

Here is the call graph for this function:

◆ mvwin()

int NCursesPanel::mvwin ( int  begin_y,
int  begin_x 
)
inlinevirtual

Move window to new position with the new position as top left corner.

This is virtual because it is redefined in NCursesPanel.

Reimplemented from NCursesWindow.

Definition at line 189 of file ncursesp.h.

Here is the call graph for this function:

◆ show()

void NCursesPanel::show ( )
inline

Show the panel, i.e.

make it visible.

Definition at line 160 of file ncursesp.h.

Here is the call graph for this function:

The documentation for this class was generated from the following files: