libyui-ncurses
Loading...
Searching...
No Matches
NCTableStyle Class Reference

Styling for a NCTable: column widths, alignment and colors. More...

#include <NCTableItem.h>

Public Member Functions

 NCTableStyle (const NCWidget &parentWidget)
 
bool SetStyleFrom (const std::vector< NCstring > &head)
 
void SetSepChar (const chtype sepChar)
 
void SetSepWidth (const unsigned sepWidth)
 total width of space between adjacent columns, including the separator character
 
void SetHotCol (int hcol)
 
void ResetToMinCols ()
 Forget sizing based on table content, resize according to headline only.
 
void AssertMinCols (unsigned num)
 Ensure we know width and alignment for at least num columns.
 
void MinColWidth (unsigned num, unsigned val)
 
NC::ADJUST ColAdjust (unsigned num) const
 
unsigned Cols () const
 
unsigned ColWidth (unsigned num) const
 
unsigned ColSepWidth () const
 
chtype ColSepChar () const
 
unsigned HotCol () const
 
const NCstyle::StListlistStyle () const
 
chtype getBG () const
 
chtype getBG (const NCTableLine::STATE lstate, const NCTableCol::STYLE cstyle=NCTableCol::PLAIN) const
 
chtype highlightBG (const NCTableLine::STATE lstate, const NCTableCol::STYLE cstyle, const NCTableCol::STYLE dstyle=NCTableCol::PLAIN) const
 
chtype hotBG (const NCTableLine::STATE lstate, unsigned colidx) const
 
const NCTableLineHeadline () const
 
unsigned TableWidth () const
 Add up the widths of columns with the separators.
 

Static Public Attributes

static const chtype currentBG = (chtype) - 1
 

Friends

std::ostream & operator<< (std::ostream &str, const NCTableStyle &obj)
 

Detailed Description

Styling for a NCTable: column widths, alignment and colors.

Member Function Documentation

◆ MinColWidth()

void NCTableStyle::MinColWidth ( unsigned num,
unsigned val )
inline

Update colWidth[num] to be at least val.

Parameters
numcolumn number (may be bigger than previously)
valwidth of that column for some line

◆ SetStyleFrom()

bool NCTableStyle::SetStyleFrom ( const std::vector< NCstring > & head)

Reset columns, setting their alignment and optionally titles. Column widths are zeroed.

Parameters
headList of strings where their first character is the alignment (L, R, C) and the optional rest is the column heading
Returns
do we have a column heading

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