Bugz Door Project
Public Member Functions | Protected Attributes | Friends | List of all members
door::Panel Class Reference
Inheritance diagram for door::Panel:
Inheritance graph
[legend]
Collaboration diagram for door::Panel:
Collaboration graph
[legend]

Public Member Functions

 Panel (int x, int y, int width)
 
 Panel (int width)
 
 Panel (Panel &)=delete
 
 Panel (Panel &&ref)
 
void set (int x, int y)
 Set the panels X and Y screen position. More...
 
void get (int &x, int &y)
 
void setTitle (std::unique_ptr< Line > T, int off=1)
 
void setStyle (BorderStyle bs)
 
void setColor (ANSIColor c)
 
int getWidth (void)
 
int getHeight (void)
 
void hide (void)
 
void show (void)
 
void addLine (std::unique_ptr< Line > l)
 
bool update (Door &d)
 Updates a panel. More...
 
void update (Door &d, int line)
 
void update (void)
 
door::Goto gotoEnd (void)
 
std::unique_ptr< Linespacer_line (bool single)
 Create a spacer line using block drawing characters. More...
 
void lineSetBack (ANSIColor back)
 Set background of all lines in the panel. More...
 

Protected Attributes

int x
 
int y
 
int width
 
BorderStyle border_style
 
ANSIColor border_color
 
std::vector< std::unique_ptr< Line > > lines
 
bool hidden
 
bool shown_once
 
std::unique_ptr< Linetitle
 
int offset
 

Friends

std::ostream & operator<< (std::ostream &os, const Panel &p)
 Output panel to stream. More...
 

Member Function Documentation

◆ lineSetBack()

void door::Panel::lineSetBack ( ANSIColor  back)

Set background of all lines in the panel.

Parameters
back

◆ set()

void door::Panel::set ( int  xp,
int  yp 
)

Set the panels X and Y screen position.

Parameters
[in]xp,ypnew screen position

◆ spacer_line()

std::unique_ptr< Line > door::Panel::spacer_line ( bool  single)

Create a spacer line using block drawing characters.

Return a Line of single or double characters the width of the panel.

Parameters
[in]singlemake single or double line
Returns
std::unique_ptr<Line>

◆ update()

bool door::Panel::update ( Door d)

Updates a panel.

returns True if something was changed (and cursor has moved) False, nothing to do, cursor is ok.

Parameters
d
Returns
true
false
Examples
menu-example.cpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Panel p 
)
friend

Output panel to stream.

This uses the Panel.x, Panel.y to render the panel using ANSI control codes. Border style is considered, and wether or not we are using unicode. Colors of the border, and lines use their color or their renderFunction.

Parameters
os
p
Returns
std::ostream&

Member Data Documentation

◆ lines

std::vector<std::unique_ptr<Line> > door::Panel::lines
protected
Todo:
Fix this to use shared_ptr. I don't think unique_ptr is the right way to go with this. I want to reuse things, and that means shared_ptr!

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