Classes

CL_SpanLayout Class Reference
[clanDisplay 2D]

Span layout class. More...

#include <span_layout.h>

List of all members.

Classes

struct  HitTestResult

Public Member Functions

Construction

 CL_SpanLayout ()
 ~CL_SpanLayout ()
Operations

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