Nana C++ Library. Reference for users.
What we need to use nana
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
nana::paint::aligner Class Reference

Draw aligned string. More...

Public Types

using graph_reference = graphics &
 

Public Member Functions

 aligner (graph_reference graph, align text_align=align::left)
 Constructor. More...
 
 aligner (graph_reference graph, align text_align, align text_align_if_too_long)
 
void draw (const std::string &text, point pos, unsigned width)
 Draws a text with specified text alignment. More...
 
void draw (const std::wstring &text, point pos, unsigned width)
 

Detailed Description

Draw aligned string.

Member Typedef Documentation

Constructor & Destructor Documentation

nana::paint::aligner::aligner ( graph_reference  graph,
align  text_align = align::left 
)

Constructor.

Parameters
graphReference to a graphics object
text_alignAlignment of text
text_align_if_too_longAlignment of text if the pixels of string is larger than text area
nana::paint::aligner::aligner ( graph_reference  graph,
align  text_align,
align  text_align_if_too_long 
)

Member Function Documentation

void nana::paint::aligner::draw ( const std::string text,
point  pos,
unsigned  width 
)

Draws a text with specified text alignment.

Parameters
textText to draw
posPostion where the text to draw
widthThe width of text area. If the pixels of text is larger than this parameter, it draws ellipsis
void nana::paint::aligner::draw ( const std::wstring text,
point  pos,
unsigned  width 
)