ClanLib
2.3.7
|
Span layout class. More...
#include <span_layout.h>
Classes | |
struct | HitTestResult |
Public Member Functions | |
Construction | |
CL_SpanLayout () | |
~CL_SpanLayout () | |
Operations | |
void | clear () |
Clear. More... | |
void | add_text (const CL_String &text, const CL_Font &font, const CL_Colorf &color=CL_Colorf::white, int id=-1) |
Add text. More... | |
void | add_image (const CL_Image &image, int baseline_offset=0, int id=-1) |
Add image. More... | |
template<typename T > | |
void | add_component (T *component, int baseline_offset=0, int id=-1) |
Add component. More... | |
void | layout (CL_GraphicContext &gc, int max_width) |
Layout. More... | |
void | set_position (const CL_Point &pos) |
Set position. More... | |
CL_Size | get_size () const |
Get Size. More... | |
std::vector< CL_Rect > | get_rect_by_id (int id) const |
Get Rect By Id. More... | |
HitTestResult | hit_test (CL_GraphicContext &gc, const CL_Point &pos) |
Hit test. More... | |
void | draw_layout (CL_GraphicContext &gc) |
Draw layout. More... | |
void | draw_layout_ellipsis (CL_GraphicContext &gc, const CL_Rect &content_rect) |
Draw layout generating ellipsis for clipped text. More... | |
void | set_component_geometry () |
Set component geometry. More... | |
CL_Size | find_preferred_size (CL_GraphicContext &gc) |
Find preferred size. More... | |
void | set_selection_range (CL_String::size_type start, CL_String::size_type end) |
Set selection range. More... | |
void | set_selection_colors (const CL_Colorf &foreground, const CL_Colorf &background) |
Set selection colors. More... | |
void | show_cursor () |
Shows the cursor caret. More... | |
void | hide_cursor () |
Hides the cursor caret. More... | |
void | set_cursor_pos (CL_String::size_type pos) |
Sets the cursor position. More... | |
void | set_cursor_overwrite_mode (bool enable) |
Toggles whether the cursor caret is shown as a solid box or a line. More... | |
void | set_cursor_color (const CL_Colorf &color) |
Sets the cursor color. More... | |
CL_String | get_combined_text () const |
Get Combined text. More... | |
void | set_align (CL_SpanAlign align) |
Sets the text alignment. More... | |
int | get_first_baseline_offset () |
Returns the baseline offset for the first baseline. More... | |
int | get_last_baseline_offset () |
Returns the baseline offset for the last baseline. More... | |
Span layout class.
CL_SpanLayout::CL_SpanLayout | ( | ) |
CL_SpanLayout::~CL_SpanLayout | ( | ) |
|
inline |
Add component.
component | = T |
baseline_offset | = value |
id | = value |
void CL_SpanLayout::add_image | ( | const CL_Image & | image, |
int | baseline_offset = 0 , |
||
int | id = -1 |
||
) |
Add image.
image | = Image |
baseline_offset | = value |
id | = value |
void CL_SpanLayout::add_text | ( | const CL_String & | text, |
const CL_Font & | font, | ||
const CL_Colorf & | color = CL_Colorf::white , |
||
int | id = -1 |
||
) |
Add text.
text | = String |
font | = Font |
color | = Colorf |
id | = value |
void CL_SpanLayout::clear | ( | ) |
Clear.
void CL_SpanLayout::draw_layout | ( | CL_GraphicContext & | gc) |
Draw layout.
gc | = Graphic Context |
void CL_SpanLayout::draw_layout_ellipsis | ( | CL_GraphicContext & | gc, |
const CL_Rect & | content_rect | ||
) |
Draw layout generating ellipsis for clipped text.
gc | = Graphic Context |
content_rect | = Clipping rectangle |
CL_Size CL_SpanLayout::find_preferred_size | ( | CL_GraphicContext & | gc) |
Find preferred size.
gc | = Graphic Context |
CL_String CL_SpanLayout::get_combined_text | ( | ) | const |
Get Combined text.
int CL_SpanLayout::get_first_baseline_offset | ( | ) |
Returns the baseline offset for the first baseline.
int CL_SpanLayout::get_last_baseline_offset | ( | ) |
Returns the baseline offset for the last baseline.
std::vector<CL_Rect> CL_SpanLayout::get_rect_by_id | ( | int | id) | const |
Get Rect By Id.
CL_Size CL_SpanLayout::get_size | ( | ) | const |
Get Size.
void CL_SpanLayout::hide_cursor | ( | ) |
Hides the cursor caret.
HitTestResult CL_SpanLayout::hit_test | ( | CL_GraphicContext & | gc, |
const CL_Point & | pos | ||
) |
Hit test.
gc | = Graphic Context |
pos | = Point |
void CL_SpanLayout::layout | ( | CL_GraphicContext & | gc, |
int | max_width | ||
) |
Layout.
gc | = Graphic Context |
max_width | = value |
void CL_SpanLayout::set_align | ( | CL_SpanAlign | align) |
Sets the text alignment.
Alignment is applied when layout() is called
align | = The alignment |
void CL_SpanLayout::set_component_geometry | ( | ) |
Set component geometry.
void CL_SpanLayout::set_cursor_color | ( | const CL_Colorf & | color) |
Sets the cursor color.
color | = Color of cursor |
void CL_SpanLayout::set_cursor_overwrite_mode | ( | bool | enable) |
Toggles whether the cursor caret is shown as a solid box or a line.
enable | = Shows the cursor as a solid box if set to true |
void CL_SpanLayout::set_cursor_pos | ( | CL_String::size_type | pos) |
Sets the cursor position.
pos | = Index of cursor |
void CL_SpanLayout::set_position | ( | const CL_Point & | pos) |
Set position.
pos | = Point |
void CL_SpanLayout::set_selection_colors | ( | const CL_Colorf & | foreground, |
const CL_Colorf & | background | ||
) |
Set selection colors.
foreground | = Colorf |
background | = Colorf |
void CL_SpanLayout::set_selection_range | ( | CL_String::size_type | start, |
CL_String::size_type | end | ||
) |
Set selection range.
size_type | = String |
size_type | = String |
void CL_SpanLayout::show_cursor | ( | ) |
Shows the cursor caret.