3 #include <cgv/base/named.h>
4 #include <cgv/data/ref_ptr.h>
5 #include <cgv/media/font/font.h>
16 virtual void on_close_editor();
18 virtual void after_read();
20 virtual void after_save();
22 virtual void on_text_insertion(
int text_pos,
int nr_inserted);
24 virtual void on_text_deletion(
int text_pos,
int nr_deleted,
const char* deleted_text);
26 virtual void on_update_callback();
60 virtual bool read(
const std::string& file_name) = 0;
74 virtual void set_text(
const std::string& new_text) = 0;
78 virtual void set_style(
int text_pos,
int length,
const char* style) = 0;
98 #include <cgv/config/lib_end.h>
Definition: text_editor.h:31
text_editor_callback_handler * handler
store a callback handler
Definition: text_editor.h:45
cgv::media::font::font_face_ptr font_face
font face string with font name first, followed by +bold and or +italic
Definition: text_editor.h:35
virtual bool is_visible() const =0
return whether editor is visible
Definition: text_editor.h:14
virtual bool read(const std::string &file_name)=0
read a new text file
data::ref_ptr< text_editor > text_editor_ptr
ref counted pointer to abst control
Definition: text_editor.h:86
virtual bool save()=0
save the current file
virtual void show()=0
show editor
int color
rgb color packed into one integer, i.e. 0xff00ff corresponds to magenta
Definition: text_editor.h:33
virtual void set_base_path(const std::string &path)=0
set a different base path used for the file open and save dialog
virtual bool is_modified() const =0
check if the current file is modified
virtual void set_filter(const std::string &filter)=0
set a file filter for the file open and save dialog, default is "*"
abstract base class for text editors
Definition: text_editor.h:42
virtual void hide()=0
hide editor
text_editor_ptr create_text_editor(unsigned int w, unsigned int h, const std::string &title, int x, int y)
construct a new text editor in a separate window of given size, title and position
Definition: text_editor.cxx:9
virtual void set_style(int text_pos, int length, const char *style)=0
set the style of a given text portion
float font_size
font size in pixels
Definition: text_editor.h:37
virtual const char * get_style() const =0
return pointer to style buffer
virtual const char * get_text() const =0
return pointer to text buffer
virtual unsigned int get_length() const =0
return length of text and style buffer
the cgv namespace
Definition: vr_calib.cxx:9
virtual void set_text(const std::string &new_text)=0
replace the complete text
virtual void set_text_styles(const text_style *table, int nr_styles)=0
set text styles from a table, where the first style is labeled with the character A,...