ClanLib  2.3.7
Classes | List of all members
CL_SpanLayout Class Reference

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_Rectget_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...
 

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
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.

Parameters
text= String
font= Font
color= Colorf
id= value
void CL_SpanLayout::clear ( )

Clear.

void CL_SpanLayout::draw_layout ( CL_GraphicContext gc)

Draw layout.

Parameters
gc= Graphic Context
void CL_SpanLayout::draw_layout_ellipsis ( CL_GraphicContext gc,
const CL_Rect content_rect 
)

Draw layout generating ellipsis for clipped text.

Parameters
gc= Graphic Context
content_rect= Clipping rectangle
CL_Size CL_SpanLayout::find_preferred_size ( CL_GraphicContext gc)

Find preferred size.

Parameters
gc= Graphic Context
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

Get Size.

Returns
size
void CL_SpanLayout::hide_cursor ( )

Hides the cursor caret.

HitTestResult CL_SpanLayout::hit_test ( CL_GraphicContext gc,
const CL_Point pos 
)

Hit test.

Parameters
gc= Graphic Context
pos= Point
Returns
Hit Test Result
void CL_SpanLayout::layout ( CL_GraphicContext gc,
int  max_width 
)

Layout.

Parameters
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

Parameters
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.

Parameters
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.

Parameters
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.

Parameters
pos= Index of cursor
void CL_SpanLayout::set_position ( const CL_Point pos)

Set position.

Parameters
pos= Point
void CL_SpanLayout::set_selection_colors ( const CL_Colorf foreground,
const CL_Colorf background 
)

Set selection colors.

Parameters
foreground= Colorf
background= Colorf
void CL_SpanLayout::set_selection_range ( CL_String::size_type  start,
CL_String::size_type  end 
)

Set selection range.

Parameters
size_type= String
size_type= String
void CL_SpanLayout::show_cursor ( )

Shows the cursor caret.


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