Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

PG_RichEdit Class Reference

Inheritance diagram for PG_RichEdit:

Inheritance graph
[legend]
Collaboration diagram for PG_RichEdit:

Collaboration graph
[legend]
List of all members.

Detailed Description

A optionay editable rich text flowing around child widgets. Generally used to make a large 'pane' of widgets and rich text that can be scrolled through in a smaller 'portal' with scrollbars.

Author:
Jaroslav Vozab


Public Types

enum  {
  PG_TEXT_LEFT = MARK_TEXT_LEFT, PG_TEXT_CENTER = MARK_TEXT_CENTER, PG_TEXT_RIGHT = MARK_TEXT_RIGHT, PG_TEXT_BLOCK = MARK_TEXT_BLOCK,
  PG_ALL_LEFT = MARK_ALL_LEFT, PG_ALL_CENTER = MARK_ALL_CENTER, PG_ALL_RIGHT = MARK_ALL_RIGHT
}

Public Member Functions

 PG_RichEdit (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, bool autoVerticalResize=false, Uint32 linewidth=0, Uint32 tabSize=30, Uint32 childsborderwidth=8, const char *style="WidgetList")
 Constructor of the PG_WidgetListEx class.

void SetText (const char *text)
 Sets rich text.

void SetText (const string &text)
 Sets rich text.

void AddChild (PG_Widget *child)
 Add a widget to the list.

bool RemoveChild (PG_Widget *child)
 Remove a widget from the list.

bool LoadText (const char *textfile)
 Load the content of the widget from a text file.

void SetAutoVerticalResize (bool bResize)
void SetAlignment (Uint8 align)
void SetTabSize (Uint32 tabSize)

Protected Types

typedef vector< RichWordDescriptionRichWordDescriptionArray
typedef vector< size_t > Size_tArray
typedef vector< RichLinePartRichLinePartArray
typedef vector< RichLineRichLineArray

Protected Member Functions

void eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst)
 overridable eventhandler to blit the widget contents to the screen


Protected Attributes

bool my_AutoVerticalResize
RichWordDescriptionArray my_ParsedWords
RichLineArray my_RichText
Uint32 my_ChildsBorderWidth
Uint32 my_TabSize


Member Typedef Documentation

typedef vector<RichLine> PG_RichEdit::RichLineArray [protected]
 

typedef vector<RichLinePart> PG_RichEdit::RichLinePartArray [protected]
 

typedef vector<RichWordDescription> PG_RichEdit::RichWordDescriptionArray [protected]
 

typedef vector<size_t> PG_RichEdit::Size_tArray [protected]
 


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
PG_TEXT_LEFT 
PG_TEXT_CENTER 
PG_TEXT_RIGHT 
PG_TEXT_BLOCK 
PG_ALL_LEFT 
PG_ALL_CENTER 
PG_ALL_RIGHT 


Constructor & Destructor Documentation

PG_RichEdit::PG_RichEdit PG_Widget parent,
const PG_Rect r = PG_Rect::null,
bool  autoVerticalResize = false,
Uint32  linewidth = 0,
Uint32  tabSize = 30,
Uint32  childsborderwidth = 8,
const char *  style = "WidgetList"
 

Constructor of the PG_WidgetListEx class.


Member Function Documentation

void PG_RichEdit::AddChild PG_Widget child  )  [virtual]
 

Add a widget to the list.

Parameters:
child pointer to a widget

Reimplemented from PG_ScrollWidget.

void PG_RichEdit::eventBlit SDL_Surface *  surface,
const PG_Rect src,
const PG_Rect dst
[protected, virtual]
 

overridable eventhandler to blit the widget contents to the screen

Parameters:
surface pointer to SDL_Surface to be blitted
src source rectangle (client coordinates)
dst destination rectangle (screen coordinates) Override this eventhandler to perform custom blitting behaviour (without drawing onto the widget surface).

Reimplemented from PG_ThemeWidget.

bool PG_RichEdit::LoadText const char *  textfile  ) 
 

Load the content of the widget from a text file.

This function loads the text of the widget from a file. As ever this file operation is done transparently through PhysFS so you can place any text files into your theme and or file archives.

Parameters:
textfile relative path to the text file

bool PG_RichEdit::RemoveChild PG_Widget child  )  [virtual]
 

Remove a widget from the list.

Parameters:
child pointer to a widget

Reimplemented from PG_Widget.

void PG_RichEdit::SetAlignment Uint8  align  ) 
 

void PG_RichEdit::SetAutoVerticalResize bool  bResize  ) 
 

void PG_RichEdit::SetTabSize Uint32  tabSize  ) 
 

void PG_RichEdit::SetText const string &  text  ) 
 

Sets rich text.

Parameters:
text rich text to set

void PG_RichEdit::SetText const char *  text  )  [virtual]
 

Sets rich text.

Parameters:
text rich text to set

Reimplemented from PG_Widget.


Member Data Documentation

bool PG_RichEdit::my_AutoVerticalResize [protected]
 

Uint32 PG_RichEdit::my_ChildsBorderWidth [protected]
 

RichWordDescriptionArray PG_RichEdit::my_ParsedWords [protected]
 

RichLineArray PG_RichEdit::my_RichText [protected]
 

Uint32 PG_RichEdit::my_TabSize [protected]
 



The ParaGUI Project - Alexander Pipelka