Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Friends | List of all members
GuiScriptEdit Class Reference

Text editor with a completion system. More...

Inheritance diagram for GuiScriptEdit:
GuiTextEdit GuiWidget EventObject CoreCustomData CoreBaseObject CoreBaseType

Public Member Functions

 GuiScriptEdit (GuiWidget &parent, const int &x, const int &y, const int &w, const int &h)
 
virtual int process_event (const CoreString &event) override
 This method is called whenever an event happens on this widget. Override this to catch and process them.
 
void set_module (ModuleScripting *engine)
 
void set_module (ModuleLanguage *language)
 
- Public Member Functions inherited from GuiTextEdit
 GuiTextEdit (GuiWidget &parent, const int &x, const int &y, const int &w, const int &h)
 
virtual void show () override
 
void set_background_color (GuiColorScheme::Role color_scheme)
 
void set_text_color (GuiColorScheme::Role color_scheme)
 
void set_show_line_number_column (bool show)
 
void set_show_syntax_color (bool show)
 
GuiFontget_text_font () const
 
void set_text_font (const GuiFont &font)
 
void set_draw_decoration (const bool &enable)
 
const bool & is_draw_decoration () const
 
virtual void resize (const int &x, const int &y, const int &w, const int &h) override
 
CoreString get_text () const
 
CoreString get_text_selected () const
 
CoreString get_current_line () const
 
void set_text (const CoreString &text)
 
void clear ()
 
void append (const CoreString &text, CoreLogLevel::Type type=CoreLogLevel::LOG_LEVEL_INFO)
 
void append_after_cursor (const CoreString &text)
 
void insert (const CoreString &text, int row, int col)
 
void set_current_line (const CoreString &text, const unsigned int cursor_pos=(unsigned int)-1)
 
void remove_whitespaces ()
 
int get_lines_count () const
 
bool is_read_only () const
 
void set_read_only (const bool &readonly, const bool &draw_disable=false)
 
void select_all ()
 
void deselect_all ()
 
void set_padding_line_y (const int &value)
 
int get_padding_line_y () const
 
void set_enable_zoom (const bool &value)
 
bool is_enable_zoom ()
 
const unsigned & get_max_lines () const
 
void set_max_lines (const unsigned int &count)
 
void reset_scrollbar ()
 
virtual void draw (GuiDc &dc) override
 This is the main drawing method of the widget.
 
void set_keywords (const CoreBasicArray< CoreString > &keywords)
 
void set_preprocessor_keywords (const CoreBasicArray< CoreString > &keywords)
 
void set_reserved_keywords (const CoreBasicArray< CoreString > &keywords)
 
void set_block_comments (const CoreBasicArray< CoreString > &block_comments)
 
void set_line_comments (const CoreBasicArray< CoreString > &line_comments)
 
void set_operators (const CoreBasicArray< CoreString > &operators)
 
void set_strings (const CoreBasicArray< CoreString > &strings)
 
void recompute_all_syntax_color ()
 
bool is_text_modified () const
 
void reset_is_text_modified ()
 
int on_edit_undo ()
 
int on_edit_redo ()
 
int on_edit_cut ()
 
int on_edit_copy (bool cut_mode=false)
 
int on_edit_paste ()
 
int on_edit_select_all ()
 
int on_duplicate_lines ()
 
int on_comment_lines ()
 
int on_uncomment_lines ()
 
int on_edit_delete ()
 
void goto_line (const int &line)
 
void zoom_in ()
 
void zoom_out ()
 
void zoom_default ()
 
void set_font_size (const int &size)
 
int get_font_size () const
 
unsigned int get_text_height () const
 
int get_text_line_height () const
 
void get_infos (unsigned int &line, unsigned int &column, unsigned int &lines_count)
 
bool find_next_text (const CoreString &text, bool case_sensitive=false)
 
bool find_next_and_replace_text (const CoreString &text, const CoreString &new_text, bool case_sensitive=false)
 
unsigned int replace_all_text (const CoreString &text, const CoreString &new_text, bool case_sensitive=false)
 
void set_highlighted_word (const CoreString &word, const bool &always_draw, bool case_sesitive=false)
 
void disable_highlighted_word ()
 
void set_highlighted_word_auto_mode (const bool &state)
 
bool is_highlighted_word_auto_mode ()
 
void set_highlighted_cursor_line (const bool &state)
 
bool is_highlighted_cursor_line ()
 
void set_cursor_on_mouse ()
 
void set_force_display_cursor (const bool &state)
 
bool get_current_mouse_location (int &col, int &row) const
 
CoreSet< CoreStringget_variables_from_text ()
 extract and retrun only a varibles list (text without comment or text in ""). Useful for completion system in GuiScriptEdit class.
 
void enable_autoscroll_last_line (const bool &b)
 
- Public Member Functions inherited from GuiWidget
 GuiWidget (GuiWidget &parent, const int &x, const int &y, const int &w, const int &h)
 
 GuiWidget (GuiApp &app, const int &x, const int &y, const int &w, const int &h)
 
virtual void load_settings (const ParserGroup &settings)
 
virtual void save_settings (ParserGroup &settings)
 
void destroy ()
 
virtual bool is_shown () const
 
bool is_hidden () const
 
bool is_recursive_destroyed () const
 
const bool & is_destroyed () const
 
virtual void hide ()
 
virtual GuiWidgetget_parent () const
 
const GuiWindowget_root_window () const
 
virtual void set_parent (GuiWidget *parent)
 
GuiWindowget_window () const
 
const int & get_width () const
 
const int & get_height () const
 
const int & get_x () const
 
const int & get_y () const
 
void set_width (int width)
 
void set_height (int height)
 
virtual const GMathVec2i & get_size () const
 
void set_size (int x, int y, int w, int h)
 
void set_position (const int &x, const int &y, bool origin=true)
 sets position , leave size unchanged.
 
virtual const GMathVec2i & get_position () const
 
void set_mouse_cursor (const Gui::MouseCursorId &cursor)
 
const Gui::MouseCursorId & get_mouse_cursor () const
 
void set_font (const GuiFont &font)
 
GuiFontget_font () const
 
const CoreStringget_tooltip () const
 
virtual void set_tooltip (const CoreString &tooltip)
 
void force_tooltip ()
 
virtual bool is_enabled () const
 
virtual void enable ()
 Activate the widget.
 
virtual void disable ()
 Deativate the widget.
 
bool is_active () const
 Get the active state of the widget, without taking the parents into account.
 
void set_enable (bool enable)
 Set the active state of this widget.
 
virtual GuiColorSchemeget_color_scheme () const
 
void set_color (const GuiColorScheme::Group &group, const GuiColorScheme::Role &role, const unsigned char &r, const unsigned char &g, const unsigned char &b)
 
void set_color (const GuiColorScheme::Group &group, const GuiColorScheme::Role &role, const GMathVec3uc &color)
 
void get_color (const GuiColorScheme::Group &group, const GuiColorScheme::Role &role, unsigned char &r, unsigned char &g, unsigned char &b) const
 
const GMathVec3uc & get_color (const GuiColorScheme::Group &group, const GuiColorScheme::Role &role) const
 
GMathVec3uc get_highlighted_color (const GMathVec3uc &, const float &factor=1.2f, const bool &keep_max_gap=true) const
 
bool is_entered () const
 
virtual void set_focus ()
 
bool children_has_focus (GuiWidget *widget) const
 
bool has_focus () const
 
void lose_focus ()
 
bool is_focus_receiver () const
 
void set_focus_receiver (const bool &receiver)
 
bool is_key_receiver () const
 
void set_key_receiver (const bool &receiver)
 
virtual void redraw ()
 This will ask the widget to be drawn again.
 
virtual CtxDrawget_draw_ctx () const
 Return the drawing context needed by ModuleTool to draw in the widget.
 
void set_is_dirty (const bool &value=true)
 
bool get_is_dirty ()
 returns if widget is dirty or not.
 
void compute_children_bbox (GMathVec2i &lo, GMathVec2i &hi) const
 
const CoreVector< GuiWidget * > & get_children () const
 
GuiAppget_application () const
 
GuiActionregister_action (const CoreString &name, GuiAction::Function function, const CoreString &shortcut, const CoreString &tooltip="", void *data=0, const GuiImage *icon=0)
 
const CoreVector< GuiAction * > & get_actions () const
 
GuiActionget_action (const CoreString &name) const
 
void get_actions_recursively (CoreVector< GuiAction * > &actions) const
 
void remove_action (GuiAction *action, bool delete_it)
 
void remove_all_actions ()
 
void register_hotkey (const CoreString &shortcut, const CoreString &tooltip)
 
const CoreVector< Hotkey > & get_hotkeys () const
 
void get_hotkeys_recursively (CoreVector< Hotkey > &hotkeys) const
 
const int & get_top_offset () const
 
const int & get_bottom_offset () const
 
const int & get_left_offset () const
 
const int & get_right_offset () const
 
const Constraint & get_top_constraint () const
 
const Constraint & get_bottom_constraint () const
 
const Constraint & get_left_constraint () const
 
const Constraint & get_right_constraint () const
 
virtual void set_constraints (const Constraint &left, const Constraint &top, const Constraint &right, const Constraint &bottom)
 
void set_active_constraints (const bool &active)
 
virtual const bool & is_active_constraints () const
 
void set_recursive_constraints (const bool &recursive)
 
virtual const bool & is_recursive_constraints () const
 
void disable_clipping ()
 
void enable_clipping ()
 
void get_clip_region (int &x, int &y, int &w, int &h) const
 
virtual void set_clip_region (const int &x, const int &y, const int &w, const int &h)
 
const bool & is_clipping_enabled () const
 
void bring_to_front ()
 
void enable_tab_navigation (const bool &enable)
 
const bool & is_tab_navigation_enabled () const
 
virtual bool is_visible () const
 
virtual void update_color_scheme (const GuiColorScheme &scheme)
 
virtual void paste (const CoreString &clipboard)
 
bool initiate_dnd_event (const CoreVector< CoreBaseObject * > &data)
 Initiate Drag'n drop event.
 
bool initiate_dnd_event (CoreVector< OfHandle > &data)
 
bool initiate_dnd_event (CoreBaseObject *data)
 See initiate_dnd_event.
 
bool initiate_dnd_event (OfHandle data)
 
virtual GuiWidgetget_next_focus_widget () const
 
virtual GuiWidgetget_previous_focus_widget () const
 
void give_focus_to_next_widget ()
 
void give_focus_to_previous_widget ()
 
void get_parent_effective_clip_region (int &x, int &y, int &w, int &h) const
 
const bool & is_widget_visible (GuiWidget &child) const
 
const bool & is_show_children () const
 
void set_show_children (const bool &show_children)
 
template<class WidgetType >
WidgetType * get_parent_widget () const
 Return the first occurence of WidgetType* in the widget parent hierarchy, or 0 if not found.
 
virtual size_t get_memory_size () const override
 
- Public Member Functions inherited from EventObject
 EventObject ()
 Constructor.
 
 EventObject (const EventObject &src)
 Copy Constructor.
 
virtual ~EventObject () override
 Destructor.
 
void connect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 
bool disconnect_all (EventObject &sender)
 Disconnects from all objects sender was listening on.
 
void disconnect_all ()
 Disconnects from all objects we were listening on.
 
void remove_all_connection ()
 Disconnects object from other objects it is listening to, and also disconnects all objects listening to it.
 
void raise_event (const CoreString &event_id) const
 sends an event
 
void raise_event (const EventInfo &event_info) const
 sends an event
 
bool is_connected (EventObject &sender, const CoreString &event_id, void *data)
 
void set_mute (const bool &mute)
 Asks for object muting. This will increase or decrease the muting counter. Unmuting may not be immediat since it will happen only when counter reaches 0.
 
bool is_mute () const
 Returns if object is muted.
 
CoreArray< EventObject * > get_senders () const
 
unsigned int get_sender_count () const
 
unsigned int get_receiver_count () const
 
void connect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
- Public Member Functions inherited from CoreCustomData
 CoreCustomData (const CoreCustomData &src)
 
void add_custom_data (void *key, const bool &data)
 
void add_custom_data (void *key, const int &data)
 
void add_custom_data (void *key, const unsigned int &data)
 
void add_custom_data (void *key, const char *data)
 
void add_custom_data (void *key, const CoreString &data)
 
void add_custom_data (void *key, const double &data)
 
void add_custom_data (void *key, void *data)
 
void remove_custom_data (void *key)
 
void remove_all_custom_data ()
 
void set_custom_data (void *key, const bool &data)
 
void set_custom_data (void *key, const int &data)
 
void set_custom_data (void *key, const unsigned int &data)
 
void set_custom_data (void *key, const double &data)
 
void set_custom_data (void *key, const char *data)
 
void set_custom_data (void *key, const CoreString &data)
 
void set_custom_data (void *key, void *data)
 
void get_custom_data (void *key, bool &data) const
 
void get_custom_data (void *key, int &data) const
 
void get_custom_data (void *key, unsigned int &data) const
 
void get_custom_data (void *key, double &data) const
 
void get_custom_data (void *key, CoreString &data) const
 
void get_custom_data (void *key, void *&data) const
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
CoreString get_class_info_name () const
 
const unsigned long & get_class_info_id () const
 
virtual bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 

Friends

class ScriptEditCandidatePopup
 

Additional Inherited Members

- Public Types inherited from GuiTextEdit
enum  Validation {
  VALIDATION_NONE,
  VALIDATION_FOCUS_OUT,
  VALIDATION_KEY_ENTER,
  VALIDATION_KEY_RETURN,
  VALIDATION_COUNT
}
 
- Static Public Member Functions inherited from GuiTextEdit
static CoreString get_word_warp (const CoreString &_text, const int &width, const GuiFont &font)
 
- Protected Types inherited from GuiWidget
typedef void(* CreateWidget )(void *inst)
 
- Protected Member Functions inherited from GuiTextEdit
virtual void widget_update () override
 This method is called just before draw() if set_is_dirty() has been called before.
 
virtual void add_to_popup_menu (GuiMenu &menu)
 
void on_scroll (GuiWidget &widget, const EventInfo &event, void *data)
 
void get_cursor_index_from_mouse (const int &pos_mouse_x, const int &pos_mouse_y, int &pos, int &line)
 
void get_cursor_pixel_position (int &x, int &y)
 
void valid_text_selection ()
 
virtual void on_changed ()
 
void on_modified ()
 
void focus_on_cursor ()
 
void get_previous_group_position (int &position, int &line)
 
void get_next_group_position (int &position, int &line)
 
int get_begin_line_text_position (const int line)
 
void split_line (const CoreString &text, CoreVector< CoreString > &result)
 
void draw_text_clamped (GuiDc &dc, const CoreString &text, const int &x, const int &y, const unsigned char &r, const unsigned char &g, const unsigned char &b, const unsigned int offset_position=0)
 
void replace_char (CoreString &text, const CoreString &character, const CoreString &replace_char)
 
void get_text_size_special_char (const CoreString &text, int &w, int &h)
 
void remove_text_selected ()
 
void remove_text (const int &line_index, const int &cursor_pos, const int &count)
 
void insert_text (const int &line_index, const int &cursor_pos, const CoreString &text)
 
void insert_line (const int &line_index, const CoreString &text, GuiTextEditLineInfo *info=0)
 
void remove_line (const int &line_index)
 
void set_line (const int &line_index, const CoreString &text)
 
CoreString get_tabulation (const CoreString &text, const int start_pos)
 
CoreString get_tabulation (const unsigned int &line_index, const int start_pos)
 
void draw_highlighted_word_line (GuiDc &dc, const CoreString &text, GuiTextEditLineInfo &info, const int x, const int y, const int start_text=-1, const int end_text=-1)
 
void draw_syntaxe_color_line (GuiDc &dc, const CoreString &text, GuiTextEditLineInfo &info, const int x, const int y, int start_text=-1, const int end_text=-1)
 
- Protected Attributes inherited from GuiWidget
Fl_Widget * m_widget
 
Fl_Window * m_window
 
Fl_Group * m_group
 
GuiAppm_application
 
int m_child_index
 
Constraint m_top_constraint
 
Constraint m_bottom_constraint
 
Constraint m_left_constraint
 
Constraint m_right_constraint
 
int m_top_offset
 
int m_bottom_offset
 
int m_left_offset
 
int m_right_offset
 
int m_clip_x
 
int m_clip_y
 
int m_clip_w
 
int m_clip_h
 
int m_eff_clip_x
 
int m_eff_clip_y
 
int m_eff_clip_w
 
int m_eff_clip_h
 
GMathVec2i m_size
 
GMathVec2i m_position
 
GuiColorSchemem_color_scheme
 
GuiDcm_dc
 

Detailed Description

Text editor with a completion system.

Member Function Documentation

int GuiScriptEdit::process_event ( const CoreString event_id)
overridevirtual

This method is called whenever an event happens on this widget. Override this to catch and process them.

Parameters
event_idThe event name.
Returns
1 if the event was consumed, 0 otherwise (to let the other widgets catch it)

Reimplemented from GuiTextEdit.