Span layout class.
More...
#include <span_layout.h>
|
| | SpanLayout () |
| |
| | ~SpanLayout () |
| |
| template<typename T > |
| void | add_component (T *component, int baseline_offset=0, int id=-1) |
| | Add component.
|
| |
| void | add_image (const Image &image, int baseline_offset=0, int id=-1) |
| | Add image.
|
| |
| void | add_text (const std::string &text, const Font &font, const Colorf &color=StandardColorf::white(), int id=-1) |
| | Add text.
|
| |
| void | clear () |
| | Clear.
|
| |
| void | draw_layout (Canvas &canvas) |
| | Draw layout.
|
| |
| void | draw_layout_ellipsis (Canvas &canvas, const Rect &content_rect) |
| | Draw layout generating ellipsis for clipped text.
|
| |
| Size | find_preferred_size (Canvas &canvas) |
| | Find preferred size.
|
| |
| std::string | get_combined_text () const |
| | Get Combined text.
|
| |
| 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.
|
| |
| Rect | get_rect () const |
| | Get Rect.
|
| |
| std::vector< Rect > | get_rect_by_id (int id) const |
| | Get Rect By Id.
|
| |
| Size | get_size () const |
| | Get Size.
|
| |
| void | hide_cursor () |
| | Hides the cursor caret.
|
| |
| HitTestResult | hit_test (Canvas &canvas, const Point &pos) |
| | Hit test.
|
| |
| void | layout (Canvas &canvas, int max_width) |
| | Layout.
|
| |
| void | set_align (SpanAlign align) |
| | Sets the text alignment.
|
| |
| void | set_component_geometry () |
| | Set component geometry.
|
| |
| void | set_cursor_color (const Colorf &color) |
| | Sets the cursor color.
|
| |
| void | set_cursor_overwrite_mode (bool enable) |
| | Toggles whether the cursor caret is shown as a solid box or a line.
|
| |
| void | set_cursor_pos (std::string::size_type pos) |
| | Sets the cursor position.
|
| |
| void | set_position (const Point &pos) |
| | Set position.
|
| |
| void | set_selection_colors (const Colorf &foreground, const Colorf &background) |
| | Set selection colors.
|
| |
| void | set_selection_range (std::string::size_type start, std::string::size_type end) |
| | Set selection range.
|
| |
| void | show_cursor () |
| | Shows the cursor caret.
|
| |
◆ SpanLayout()
| clan::SpanLayout::SpanLayout |
( |
| ) |
|
◆ ~SpanLayout()
| clan::SpanLayout::~SpanLayout |
( |
| ) |
|
◆ add_component()
template<typename T >
| void clan::SpanLayout::add_component |
( |
T * | component, |
|
|
int | baseline_offset = 0, |
|
|
int | id = -1 ) |
Add component.
- Parameters
-
| component | = T |
| baseline_offset | = value |
| id | = value |
◆ add_image()
| void clan::SpanLayout::add_image |
( |
const Image & | image, |
|
|
int | baseline_offset = 0, |
|
|
int | id = -1 ) |
Add image.
- Parameters
-
| image | = Image |
| baseline_offset | = value |
| id | = value |
◆ add_text()
◆ clear()
| void clan::SpanLayout::clear |
( |
| ) |
|
◆ draw_layout()
| void clan::SpanLayout::draw_layout |
( |
Canvas & | canvas | ) |
|
◆ draw_layout_ellipsis()
| void clan::SpanLayout::draw_layout_ellipsis |
( |
Canvas & | canvas, |
|
|
const Rect & | content_rect ) |
Draw layout generating ellipsis for clipped text.
- Parameters
-
| canvas | = Canvas |
| content_rect | = Clipping rectangle |
◆ find_preferred_size()
| Size clan::SpanLayout::find_preferred_size |
( |
Canvas & | canvas | ) |
|
Find preferred size.
- Parameters
-
- Returns
- Size
◆ get_combined_text()
| std::string clan::SpanLayout::get_combined_text |
( |
| ) |
const |
Get Combined text.
- Returns
- combined_text
◆ get_first_baseline_offset()
| int clan::SpanLayout::get_first_baseline_offset |
( |
| ) |
|
Returns the baseline offset for the first baseline.
◆ get_last_baseline_offset()
| int clan::SpanLayout::get_last_baseline_offset |
( |
| ) |
|
Returns the baseline offset for the last baseline.
◆ get_rect()
| Rect clan::SpanLayout::get_rect |
( |
| ) |
const |
◆ get_rect_by_id()
| std::vector< Rect > clan::SpanLayout::get_rect_by_id |
( |
int | id | ) |
const |
Get Rect By Id.
- Returns
- rect
◆ get_size()
| Size clan::SpanLayout::get_size |
( |
| ) |
const |
◆ hide_cursor()
| void clan::SpanLayout::hide_cursor |
( |
| ) |
|
◆ hit_test()
Hit test.
- Parameters
-
- Returns
- Hit Test Result
◆ layout()
| void clan::SpanLayout::layout |
( |
Canvas & | canvas, |
|
|
int | max_width ) |
Layout.
- Parameters
-
| canvas | = Canvas |
| max_width | = value |
◆ set_align()
| void clan::SpanLayout::set_align |
( |
SpanAlign | align | ) |
|
Sets the text alignment.
Alignment is applied when layout() is called
- Parameters
-
◆ set_component_geometry()
| void clan::SpanLayout::set_component_geometry |
( |
| ) |
|
◆ set_cursor_color()
| void clan::SpanLayout::set_cursor_color |
( |
const Colorf & | color | ) |
|
Sets the cursor color.
- Parameters
-
◆ set_cursor_overwrite_mode()
| void clan::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 |
◆ set_cursor_pos()
| void clan::SpanLayout::set_cursor_pos |
( |
std::string::size_type | pos | ) |
|
Sets the cursor position.
- Parameters
-
◆ set_position()
| void clan::SpanLayout::set_position |
( |
const Point & | pos | ) |
|
◆ set_selection_colors()
| void clan::SpanLayout::set_selection_colors |
( |
const Colorf & | foreground, |
|
|
const Colorf & | background ) |
Set selection colors.
- Parameters
-
◆ set_selection_range()
| void clan::SpanLayout::set_selection_range |
( |
std::string::size_type | start, |
|
|
std::string::size_type | end ) |
Set selection range.
- Parameters
-
| size_type | = String |
| size_type | = String |
◆ show_cursor()
| void clan::SpanLayout::show_cursor |
( |
| ) |
|
The documentation for this class was generated from the following file: