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