#include <textboxeditor.h>
Public Types | |
enum | Format { FORMAT_PLAIN = 0, FORMAT_BLUE, FORMAT_DATE, FORMAT_TESTIMONY_TITLE } |
Predefined formats for text. | |
Public Member Functions | |
TextBoxEditor () | |
Default constructor. | |
void | set_text (int line, const Glib::ustring &text) |
Set text for a given line. | |
void | set_format (const Format &format) |
Set the format to use for text. | |
Private Member Functions | |
virtual bool | on_expose_event (GdkEventExpose *e) |
virtual bool | on_motion_notify_event (GdkEventMotion *e) |
void | draw_line (Cairo::RefPtr< Cairo::Context > cr, const std::string &text, int x, int y) |
Private Attributes | |
Cairo::RefPtr < Cairo::ImageSurface > | m_BG |
Format | m_Format |
Record of text format. | |
int | m_TextHeight |
Largest height of a line of text. | |
int | m_MouseX |
X-coordinate of mouse. | |
int | m_MouseY |
Y-coordinate of mouse. | |
std::map< int, Glib::ustring > | m_Text |
Map of lines of text. |
In order to provide a good tool for users to insert formatted dialogue, a preview should be shown. This widget draws up to three lines of text, and sizes them so they look as though they were drawn in the player.
void TextBoxEditor::set_text | ( | int | line, | |
const Glib::ustring & | text | |||
) |
Set text for a given line.
line | The line number, a value between [1,3], inclusive | |
text | The text to set |
void TextBoxEditor::set_format | ( | const Format & | format | ) | [inline] |
Set the format to use for text.
format | A predefined format |