Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
GuiSpreadsheet Class Reference
Inheritance diagram for GuiSpreadsheet:
GuiWidget EventObject CoreCustomData CoreBaseObject CoreBaseType GuiFileBrowserSpreadsheet GuiOfItemSpreadsheet GuiOfSpreadsheetMultiAttrsSpreadsheetData GuiTableSpreadsheet GuiBrowserSpreadsheet GuiExplorer

Public Types

enum  DndMode {
  DND_MODE_PARENTING,
  DND_MODE_INSERTION,
  DND_MODE_PARENT_INSERT,
  DND_MODE_NONE
}
 
- Public Types inherited from GuiWidget
enum  Roundness {
  ROUNDNESS_NONE = 0,
  ROUNDNESS_TOP_LEFT = 1,
  ROUNDNESS_TOP_RIGHT = 2,
  ROUNDNESS_BOTTOM_LEFT = 4,
  ROUNDNESS_BOTTOM_RIGHT = 8,
  ROUNDNESS_LEFT = ROUNDNESS_TOP_LEFT | ROUNDNESS_BOTTOM_LEFT,
  ROUNDNESS_RIGHT = ROUNDNESS_TOP_RIGHT | ROUNDNESS_BOTTOM_RIGHT,
  ROUNDNESS_TOP = ROUNDNESS_TOP_LEFT | ROUNDNESS_TOP_RIGHT,
  ROUNDNESS_BOTTOM = ROUNDNESS_BOTTOM_LEFT | ROUNDNESS_BOTTOM_RIGHT,
  ROUNDNESS_ALL = ROUNDNESS_TOP | ROUNDNESS_BOTTOM
}
 
enum  Constraint {
  CONSTRAINT_LEFT,
  CONSTRAINT_RIGHT,
  CONSTRAINT_TOP,
  CONSTRAINT_BOTTOM,
  CONSTRAINT_COUNT
}
 
enum  Justify {
  JUSTIFY_LEFT,
  JUSTIFY_RIGHT,
  JUSTIFY_CENTER,
  JUSTIFY_COUNT
}
 
enum  IconPosition {
  ICON_POSITION_LEFT,
  ICON_POSITION_RIGHT,
  ICON_POSITION_COUNT
}
 
- Public Types inherited from EventObject
typedef void(* EventInfoFunction )(EventObject &, const EventInfo &, void *)
 event callback signature for free functions / static methods.
 
typedef void(EventObject::* EventInfoMethod )(EventObject &, const EventInfo &, void *)
 event callback signature for methods.
 
typedef void(* EventFunction )(EventObject &, const CoreString &, void *)
 
typedef void(EventObject::* EventMethod )(EventObject &, const CoreString &, void *)
 

Public Member Functions

 GuiSpreadsheet (GuiWidget &parent, const int &x, const int &y, const int &w, const int &h, CoreVector< GuiWidget * > *toolbar_widget_left=0, CoreVector< GuiWidget * > *toolbar_widget_right=0)
 
virtual void resize (const int &x, const int &y, const int &w, const int &h) override
 
virtual void show () override
 
virtual void draw (GuiDc &dc) override
 This is the main drawing method of the widget.
 
void draw_grid (GuiDc &dc)
 
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 select_all ()
 
void unselect_all (bool reset_cursor=false)
 
void invert_selection_rows ()
 
void add_column (const CoreString &title, const bool &enable=true)
 
void add_column (const CoreString &title, const double &ratio, const bool &resizable=true, const bool &enable=true)
 
void add_column (const CoreString &title, const int &width, const bool &resizable=true, const bool &enable=true)
 
void remove_column (const int &index)
 
void set_column_ratio (const int &index, const double &ratio)
 
int get_column_ratio (const int &index)
 
void set_column_width (const int &index, const int &width)
 
unsigned int get_column_index (const CoreString &title) const
 get column index of first column found with specified title. return CORE_INVALID_INDEX if not column found with this title.
 
int get_column_width (const int &index) const
 
void set_column_resizable (const int &index, const bool &resizable)
 
bool is_column_resizable (const int &index) const
 
void set_column_auto_fit (const int &index, const bool &enable)
 
bool is_column_auto_fit (const int &index) const
 
void set_column_enabled (const int &column_index, const bool &enable)
 
bool is_column_enabled (const int &column_index) const
 
void set_column_can_read_only (const int &column_index, const bool &value)
 
bool is_column_can_read_only (const int &column_index) const
 
virtual void set_column_sort_type (const int &column_index, const int &type)
 
virtual int get_column_sort_type (const int &column_index) const
 
virtual void set_column_icon (const int &column_index, const GuiImage *icon)
 
virtual const GuiImageget_column_icon (const int &column_index) const
 
const CoreStringget_column_title (const int &index) const
 
virtual bool add_column_type (const int type, const CoreString name)
 
virtual bool remove_column_type (const int type)
 
void set_full_row_select (const bool &enable)
 
bool is_full_row_select () const
 
void set_show_cursor (const bool &enable)
 
bool is_show_cursor () const
 
void enable_multi_selection (const bool &enable)
 
bool is_multi_selection () const
 
void set_read_only (const bool &enable)
 
bool is_read_only () const
 
void enable_multiselection_by_drag (const bool &enable)
 
bool is_multiselection_by_drag () const
 
void enable_preselection (const bool &enable)
 
bool is_preselection () const
 
void enable_copy_to_clipboard (const bool &enable)
 
bool is_enable_copy_to_clipboard () const
 
void set_shaded (const bool &enable)
 
bool is_shaded () const
 
virtual void set_tree_mode (const bool &mode)
 
void refresh_rows_visibility ()
 
bool is_tree_mode () const
 
void set_show_grid (const bool &enable)
 
void set_show_horizontal_grid (const bool &enable)
 
void set_show_vertical_grid (const bool &enable)
 
bool is_show_horizontal_grid () const
 
bool is_show_vertical_grid () const
 
int get_horizontal_grid_size () const
 
int get_vertical_grid_size () const
 
void set_show_header_column (const bool &enable)
 
bool is_show_header_column () const
 
void set_show_header_row (const bool &enable)
 
bool is_show_header_row () const
 
void set_resize_only_one_column (const bool &enable)
 
bool is_resize_only_one_column () const
 
void enable_selection_collapsed_rows (const bool &enable)
 
bool is_enable_selection_collapsed_rows () const
 
void set_tree_column_index (const int &index)
 
const int & get_tree_column_index () const
 
void set_fit_button_in_height_cell (const bool &enable)
 
bool is_fit_button_in_height_cell () const
 
void set_focus_on_input_value_edit ()
 
void set_show_line_edit (const bool &enable)
 
bool is_show_line_edit () const
 
void remove_line_edit_from_toolbar ()
 
int get_header_column_height () const
 
int get_header_row_width () const
 
void set_row_height (const int &row_height)
 
const int & get_row_height () const
 
int get_row_total_height () const
 
void set_minimum_column_width (const int &width)
 
const int & get_minimum_column_width () const
 
virtual void insert_row (const unsigned int &index, GuiSpreadsheetRow &row)
 insert row in spreadsheet at the given index
 
virtual void insert_row (const unsigned int &index, GuiSpreadsheetRow &row, const unsigned int &parent_row_index)
 insert row in spreadsheet at the given index
 
virtual void move_row (const unsigned int &row_index, const unsigned int &move_to_index)
 
virtual int add_row (GuiSpreadsheetRow &row, const bool &select=false, const bool &set_dirty=true)
 add a row into spreadsheet
 
virtual void add_rows (const CoreVector< GuiSpreadsheetRow * > &rows, const bool &set_dirty=true)
 
virtual GuiSpreadsheetRowget_row (const int &index) const
 
const CoreVector
< GuiSpreadsheetRow * > & 
get_rows () const
 
CoreVector< GuiSpreadsheetRow * > & get_rows ()
 
virtual void remove_row (const int &index)
 
virtual void remove_rows (const int &index, const int &range)
 
virtual void remove_rows (CoreBasicArray< unsigned int > row_index)
 
virtual void remove_selected_rows ()
 
void expand_all (const bool &expand)
 
void set_selection_row (unsigned int index, bool select)
 
void set_selection_rows (const CoreBasicArray< unsigned int > &index_rows, bool select, bool clear=true)
 
void set_selection_cells (const CoreVector< GMathVec2ui > &select)
 
unsigned int get_column_count () const
 
unsigned int get_row_count () const
 
const CoreVector
< GuiSpreadsheetHeaderData > & 
get_columns () const
 
void set_highlighted_row (unsigned int index, bool select)
 
void get_highlighted_row (CoreVector< int > &rows_selected) const
 
void clear_highlight ()
 
bool is_custom_height_by_row ()
 
void enable_custom_height_by_row (const bool &enable)
 
virtual void remove_all_data (const bool reset_cursor=false)
 
unsigned int is_multi_cell_selected () const
 
bool is_row_selected (const int &index) const
 
bool is_cell_selected (const int &row, const int &column) const
 
void get_selected_rows (CoreVector< unsigned int > &rows_selected) const
 
void get_selected_cells (CoreVector< GMathVec2ui > &cells_selected) const
 
bool has_full_row_selected (const int &index) const
 
void get_ordered_row_selection (CoreVector< unsigned int > &rows_selected) const
 
bool is_row_highlighted (const int &index)
 
void on_cell_line_edit (GuiLineEdit &edit, const EventInfo &evt, void *data)
 
virtual void set_cell_content (GuiSpreadsheetCellBasic &cell, const CoreString &text)
 
virtual void start_edit_cell_content ()
 
virtual void end_edit_cell_content ()
 
void hide_edit_field (GuiSpreadsheetCellBasic &text_cell, bool update_cell_content)
 
void show_edit_field (GuiSpreadsheetCellBasic &edited_cell)
 
GuiLineEditget_cell_line_edit () const
 
bool is_renaming_cell ()
 
void set_column_index_of_full_row_edition (const unsigned int index)
 
unsigned int get_column_index_of_full_row_edition ()
 
void set_enable_focus_by_key (bool enable)
 
void set_column_index_of_key_focus (const unsigned int index)
 
unsigned int get_column_index_of_key_focus ()
 
void set_input_value_edit (const CoreString &value, GuiSpreadsheetCell *cell, const int &column, const int &row)
 
void update_input_value_edit (const CoreString &value, const bool &send_validate)
 
CoreString get_input_value_edit () const
 
GuiSpreadsheetCellget_cell (const int &column, const int &row) const
 
GuiSpreadsheetCellget_cell_under_mouse () const
 
void get_cell_position (GuiSpreadsheetCell &cell, int &column_idx, int &row_idx) const
 get the row where the cell is located if you already know its column
 
unsigned int get_row_index (GuiSpreadsheetRow *row)
 
GMathVec2ui get_cell_indices (GuiSpreadsheetCell *cell)
 
void set_input_value_edit_roundness (const GuiWidget::Roundness &roundness)
 
void get_clicked_cell_position (int &column, int &row) const
 
void set_cursor_position (const int &column, const int &row)
 
void get_cursor_position (int &column, int &row) const
 
const int & get_preselection_column () const
 
const int & get_preselection_row () const
 
const DndMode & get_dnd_mode () const
 
void set_dnd_mode (const DndMode &mode)
 
void set_dnd_reparenting_row_candidates (CoreVector< unsigned int > &parents)
 
unsigned int get_dnd_reparenting_row () const
 
void get_dnd_info (int &dnd_row, int &dnd_column, bool &row_bottom)
 
const int & get_row_offset_index () const
 
void set_row_offset_index (int irow)
 
const int & get_padding_x () const
 
const int & get_padding_y () const
 
void set_padding_x (const int &padding_x)
 
void set_padding_y (const int &padding_y)
 
int get_cell_pos_x (const int &column_index) const
 
int get_cell_pos_y (const int &row_index) const
 
int get_cell_width (const int &column_index) const
 
virtual void enable_column_sort (const bool &enable)
 
virtual const bool & get_is_enable_column_sort () const
 
virtual void set_sort_type (const int &type)
 
virtual const int & get_sort_type () const
 
virtual void set_sort_order (const int &order)
 
virtual const int & get_sort_order () const
 
void reset_cursor_position ()
 
void enabled_highlight_text (const int &column_index, const bool &enable)
 
virtual bool is_highlight_text_enabled (int column_index, int row_index) const
 
virtual void clear_highlight_text ()
 
virtual void set_highlight_text (const CoreString &highlight_text, const bool &refresh=true)
 
const CoreVector< CoreString > & get_highlight_text ()
 
virtual void enable_case_sensitive_highlight (const bool &case_sensitive, const bool &refresh=true)
 
const bool & is_case_sensitive_highlight_enabled ()
 
void set_is_disable_focus_on_row (const bool &value)
 
bool is_disable_focus_on_row ()
 
void clear_rows_is_removed ()
 
void focus_on_row (const int &row_index)
 
bool is_valid_by_text_filter (const CoreString &text)
 
const int & get_row_index_display_start_offset () const
 
void set_row_index_display_start_offset (const int &value)
 
CoreVector< unsigned int > get_permute_rows ()
 
CoreArray< unsigned int > fill_permute_rows ()
 
- 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
 

Static Public Member Functions

static CoreArray< unsigned int > fill_permute_rows (const DndMode &dnd_mode, const CoreBasicArray< unsigned int > &rows_selected, unsigned int row_count, int row_index, bool bottom_side)
 
- Static Public Member Functions inherited from GuiWidget
static CoreString open_file (GuiApp &app, const CoreString &directory="", const CoreString &title="Open file", const CoreString &filter="")
 
static CoreArray< CoreStringopen_files (GuiApp &app, const CoreString &directory="", const CoreString &title="Open files", const CoreString &filter="")
 
static CoreString open_folder (GuiApp &app, const CoreString &directory="", const CoreString &title="Choose folder")
 
static CoreString save_file (GuiApp &app, const CoreString &directory="", const CoreString &title="Save file", const CoreString &filter="", int *filter_selected=0)
 
static CoreVector< OfItemHandlepick_objects (GuiApp &app, const CoreVector< OfItemHandle > &current_selection, const CoreVector< OfClass * > &filter_classes, OfContext *context=0, const CoreVector< OfItem * > &hidden_items=CoreVector< OfItem * >(), const bool &enable_multi_selection=false)
 
static CoreVector< OfItemHandlepick_objects (GuiApp &app, const CoreVector< OfClass * > &filter_classes, OfContext *context=0, const bool &enable_multi_selection=false)
 
static const char * get_roundness_name (const Roundness &roundness)
 
static const char * get_constraint_name (const Constraint &constraint)
 
static const char * get_justify_name (const Justify &justification)
 
static const char * get_icon_position_name (const IconPosition &position)
 
static GuiWidgetget_focused_widget ()
 
static GuiWidgetget_last_focused_widget ()
 
static GuiWidgetget_last_event_widget ()
 
static void intersect_box (const int &x1, const int &y1, const int &w1, const int &h1, const int &x2, const int &y2, const int &w2, const int &h2, int &x, int &y, int &w, int &h)
 
static bool intersect_box (const int &x1, const int &y1, const int &w1, const int &h1, const int &x2, const int &y2, const int &w2, const int &h2)
 
static void on_dnd_timeout (void *data)
 
static const CoreVector
< CoreBaseObject * > & 
get_dnd_event_data ()
 Return the data associated with the current Drag'n drop. The data is only valid if a widget is currently calling initiate_dnd_event, otherwise it is empty.
 
static GuiWidgetget_dnd_widget ()
 Return the GuiWidget that initiated the Drag'n drop. Null otherwise.
 
static GuiWidgetget_dnd_accepting_widget ()
 Return the GuiWidget that accepts the Drag'n drop. Null otherwise.
 
- Static Public Member Functions inherited from EventObject
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 
static void raise_event (EventObject &sender, const CoreString &event_id)
 Sends an event.
 
static void raise_event (EventObject &sender, const EventInfo &event_info)
 Sends an event.
 
static void connect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
- Static Public Member Functions inherited from CoreCustomData
static void * get_custom_data_key (const CoreString &key)
 
- Static Public Member Functions inherited from CoreBaseObject
static const CoreClassInfoclass_info ()
 
template<class T >
static T * cast (CoreBaseObject *object)
 
template<class T >
static const T * cast (const CoreBaseObject *object)
 
- Static Public Member Functions inherited from CoreBaseType
static const CoreClassInfoclass_info ()
 Get the type descriptor of this instance.
 

Protected Member Functions

virtual GuiDcget_dc () override
 
virtual void sorting_rows_by_selected_column ()
 
virtual const GuiImageget_sort_indicator (int column) const
 
virtual int get_column_right_margin (int column) const
 
bool focus_on_item_startwith (const char &key, int &fisrt_item_match, bool &select_next_item)
 
void set_cursor_position (const int &column, const int &row, bool &selection_changed)
 
void select_all_rows (bool &selection_changed)
 
void select_all_rows ()
 
void unselect_all_rows (bool &selection_changed, bool reset_cursor=false)
 
void unselect_all_rows ()
 
virtual bool on_cell_double_click (GuiSpreadsheetCell &cell, const int &column, const int &row)
 
virtual bool on_cell_click (GuiSpreadsheetCell &cell, const int &column, const int &row, const bool &mouse_down)
 
virtual void toggle_show_children (const int &row_index, bool show_children)
 
void refresh_layout ()
 
void reset_scrollbar ()
 
void refresh_horizontal_bar ()
 
void autofit ()
 
int get_previous_page_row_position (const int &current_position) const
 
int get_next_page_row_position (const int &current_position) const
 
int get_row_index_under_mouse (bool &mouse_row_side) const
 returns the row under the mouse cursor. -1 if no row under mouse.
 
int get_row_index_under_mouse () const
 
int get_column_index_under_mouse () const
 
bool is_mouse_over_header_column () const
 
bool is_mouse_over_header_row () const
 
virtual void widget_update () override
 This method is called just before draw() if set_is_dirty() has been called before.
 
virtual bool do_initiate_dnd_event ()
 
virtual bool is_valid_dnd_data ()
 
virtual int on_dnd_enter ()
 
virtual int on_dnd_drag ()
 
virtual int on_dnd_leave ()
 
virtual int on_dnd_release ()
 
virtual void on_removing_row (const unsigned int &row_index)
 
void compute_depth_of_item_tree ()
 
void compute_rows_visibility ()
 
int is_handle_size_column_under_mouse () const
 
void on_scroll (GuiWidget &widget, const EventInfo &event, void *data)
 
void on_toolbar_maximize (GuiToolbar &toolbar, const EventInfo &event, void *data)
 
void on_line_edit_changed (GuiInputValueEdit &line_edit, const EventInfo &event, void *data)
 
void do_permutation (const int column_index, const int &row_index, int &start_row, int &start_col, int &end_row, int &end_col)
 
void do_multiselection (const int column_index, const int row_index, bool &selection_changed)
 
void get_total_width_and_rest (int &total_width_px, double &total_width_pc, int &rest_width_fixed) const
 
void full_row_select (const int &row_index, const bool select, bool &selection_changed)
 
void drag_resize_columns (short step)
 
void autofit_column (const int &column)
 
void refresh_cell_selected_count ()
 
int get_line_edit_toolbar_height () const
 
bool is_mouse_over_collapse (const GuiSpreadsheetRow &row) const
 
bool is_row_visible (unsigned int row_index) const
 
void update_selection (unsigned int column, unsigned int row, bool select)
 
void update_highlight (unsigned int column, unsigned int row, bool select)
 
- Protected Member Functions inherited from GuiWidget
 GuiWidget (CreateWidget create_widget, GuiWidget &parent, const int &x, const int &y, const int &w, const int &h)
 
 GuiWidget (CreateWidget create_widget, GuiApp &app, const int &x, const int &y, const int &w, const int &h)
 
virtual void widget_redraw ()
 
virtual Fl_Widget * get_widget () const
 
virtual Fl_Group * get_group () const
 
void clear_all_children ()
 
void damage (const unsigned char &mask)
 
const bool is_damaged (const unsigned char &mask) const
 
const unsigned char get_damage () const
 
void create_delayed_parenting (Fl_Group *group) const
 
void recompute_constraints ()
 
virtual void push_clip (const int &x, const int &y, const int &w, const int &h)
 
virtual void pop_clip ()
 
void get_text_size (const CoreString &text, int &w, int &h) const
 
void get_text_size (const char *text, int &w, int &h) const
 
virtual void on_add_child (GuiWidget *child)
 
virtual void on_remove_child (GuiWidget *child)
 
virtual void apply_constraints (const int &px, const int &py, const int &pw, const int &ph)
 
void apply_children_constraints (const int &px, const int &py, const int &pw, const int &ph) const
 
void apply_constraints (GuiWidget &child, const int &px, const int &py, const int &pw, const int &ph) const
 
virtual void apply_clipping ()
 
void apply_children_clipping ()
 
void capture_events (const bool &value)
 
virtual bool process_actions ()
 

Protected Attributes

bool m_mouse_drag_actived = false
 
bool m_mouse_down = false
 
GuiScrollbarm_vertical_bar = nullptr
 
bool m_refresh_row_visibility = true
 
CoreVector< CoreStringm_highlight_text
 
CoreString m_highlight_text_raw
 
bool m_case_sensitive_highlight = false
 
int m_preselection_column = -1
 
int m_preselection_row = -1
 
GuiToolbarm_toolbar = nullptr
 
GuiInputValueEditm_line_edit = nullptr
 upper edition
 
GuiLineEditm_cell_line_edit = nullptr
 used when editing directly inside a cell
 
GuiSpreadsheetCellBasicm_edited_cell = nullptr
 cell being edited by m_cell_line_edit
 
GuiScrollbarm_horizontal_bar = nullptr
 
bool m_disable_scrollbar_changed = false
 
int m_row_offset_index = 0
 
int m_column_offset_px = 0
 
int m_height_header = 20
 
int m_vitual_width = 0
 
int m_offset_width_of_resize = 0
 
int m_padding_x = 4
 
int m_padding_y = 2
 
int m_header_row_width = 30
 
int m_fit_button_in_height_cell = true
 
bool m_full_row_select = false
 
bool m_show_cursor = true
 
bool m_multi_selection = true
 
bool m_enable_preselection = false
 
bool m_enable_copy_to_clipboard = true
 
bool m_read_only = false
 
bool m_read_only_header_when_read_only = false
 
bool m_show_horizontal_grid = true
 
bool m_show_vertical_grid = true
 
bool m_show_header_column = true
 
bool m_show_header_row = true
 
bool m_show_line_edit = true
 
bool m_multiselection_by_drag = false
 
bool m_shaded = false
 
bool m_resize_only_one_column = false
 
bool m_tree_mode = false
 
bool m_is_enable_column_sort = false
 
bool m_has_toolbar = true
 
int m_row_index_display_start_offset = 1
 
int m_cursor_column = -1
 
int m_cursor_row = -1
 
int m_clicked_cell_column = -1
 
int m_clicked_cell_row = -1
 
bool m_is_dragging = false
 Specify if we are currently performing a drag.
 
DndMode m_dnd_mode = DND_MODE_NONE
 Drag and drop mode.
 
int m_dnd_over_column = -1
 current column index below the mouse
 
int m_dnd_over_row = -1
 current row index below the mouse
 
bool m_dnd_over_row_bottom = false
 true mouse is on the lower part of the row, false mouse is on the upper part.
 
CoreVector< unsigned int > m_dnd_reparenting_row_candidates
 
unsigned int m_dnd_reparenting_row = CORE_INVALID_INDEX
 the one currently under mouse
 
int m_start_drag_column_index = -1
 
int m_start_drag_row_index = -1
 
bool m_start_drag = false
 
bool m_start_on_header_drag = false
 
bool m_unselected_on_drag = true
 
bool m_resize_drag_column = false
 
int m_resize_drag_column_mouse_px = 0
 
int m_resize_drag_column_index = 0
 
bool m_resize_drag_column_proportional = false
 
CoreVector< int > m_resize_drag_column_width_old
 
int m_resize_drag_next_column_width_old = -1
 
int m_minimum_column_width = 20
 
bool m_multi_cell_selected = false
 
CoreVector< unsigned long long > m_rows_selected
 
CoreVector< unsigned long long > m_rows_highlight
 
CoreVector< unsigned int > m_ordered_row_selection
 
CoreVector< bool > m_visible_rows
 
CoreVector< int > m_visible_rows_indexes
 
CoreVector< int > m_visible_rows_total_height
 
CoreVector< bool > m_shaded_rows
 
int m_total_height = 0
 
bool m_enable_collapsed_rows_selection = false
 
unsigned int m_visible_rows_count = 0
 
int m_tree_column_index = 0
 
unsigned int m_column_index_of_full_row_edition = 0
 
bool m_enable_focus_by_key = false
 
unsigned int m_column_index_of_key_focus = false
 
bool m_is_disable_focus_on_row = false
 
CoreVector
< GuiSpreadsheetHeaderData
m_header
 
CoreVector< GuiSpreadsheetRow * > m_rows
 
bool m_custom_height_by_row = false
 
int m_row_height = 18
 
int m_sort_type = -1
 
int m_sort_order = 0
 
CoreVector< unsigned int > m_rows_dnd_permutations
 
GuiSpreadsheetDrawContextm_draw_context
 
- 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
 

Static Protected Attributes

static unsigned int mask_column_size = 64
 

Friends

class GuiSpreadsheetDrawContext
 
class GuiSpreadsheetHeaderGrid
 
class GuiInputValueEdit
 
class GuiSpreadsheetRow
 
class GuiSpreadsheetCell
 
class GuiOfItemSpreadsheet
 

Additional Inherited Members

- Protected Types inherited from GuiWidget
typedef void(* CreateWidget )(void *inst)
 

Member Function Documentation

int GuiSpreadsheet::add_row ( GuiSpreadsheetRow row,
const bool &  select = false,
const bool &  set_dirty = true 
)
virtual

add a row into spreadsheet

Returns
the index of the inserted row
void GuiSpreadsheet::draw ( GuiDc dc)
overridevirtual

This is the main drawing method of the widget.

Parameters
dcThe drawing context used to draw stuff.

Reimplemented from GuiWidget.

Reimplemented in GuiBrowserSpreadsheet, GuiFileBrowserSpreadsheet, and GuiExplorer.

void GuiSpreadsheet::get_cell_position ( GuiSpreadsheetCell cell,
int &  column_idx,
int &  row_idx 
) const

get the row where the cell is located if you already know its column

Parameters
[in]cellcell to locate
[in]columnfound column. set to -1 if not found.
[out]rowfound row. set to -1 if not found.
int GuiSpreadsheet::get_row_index_under_mouse ( bool &  mouse_row_bottom) const
protected

returns the row under the mouse cursor. -1 if no row under mouse.

Parameters
[in]mouse_row_bottomspecifies whether the mouse is on the lower part of the row (true), or the upper part (false).
void GuiSpreadsheet::hide_edit_field ( GuiSpreadsheetCellBasic text_cell,
bool  update_cell_content 
)

Hide the current editor when it's done editing its cell. If the generic m_cell_line_edit was used, it's destroyed. In case of a custom editor, hide it. Oh and it calls end_edit_cell_content, and trigger a redraw.

Parameters
text_cellThe cell that was edited.
update_cell_contentIf true, will set the cell content and send the EVT_ID_SPREADSHEET_CELL_UPDATED event.
void GuiSpreadsheet::insert_row ( const unsigned int &  index,
GuiSpreadsheetRow row 
)
virtual

insert row in spreadsheet at the given index

Parameters
[in]indexlocation where to insert the row. ex: 0 row is inserted in front, 3 row is inserted after rows 0, 1, 2.
[in]rowrow to insert

Reimplemented in GuiOfItemSpreadsheet.

void GuiSpreadsheet::insert_row ( const unsigned int &  index,
GuiSpreadsheetRow row,
const unsigned int &  parent_row_index 
)
virtual

insert row in spreadsheet at the given index

Parameters
[in]indexlocation where to insert the row. ex: 0 row is inserted in front, 3 row is inserted after rows 0, 1, 2.
[in]rowrow to insert
[in]parent_row_indexparent row index

Reimplemented in GuiOfItemSpreadsheet.

int GuiSpreadsheet::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 GuiWidget.

Reimplemented in GuiOfItemSpreadsheet, GuiFileBrowserSpreadsheet, GuiOfSpreadsheetMultiAttrsSpreadsheetData, GuiBrowserSpreadsheet, and GuiTableSpreadsheet.

void GuiSpreadsheet::remove_rows ( const int &  index,
const int &  range 
)
virtual

Warning: should be protected, as its behavior has to be carefully controlled. If called repeatedly without a call to compute_depth_of_item_tree inbetween, may crash as parent_index are no longer reliable after first call. For performance reason, only a lazy update is requested.

Reimplemented in GuiOfItemSpreadsheet.

void GuiSpreadsheet::set_selection_row ( unsigned int  index,
bool  select 
)

Set the selected state of a row.

index Index of the row. select Selected state.

void GuiSpreadsheet::set_selection_rows ( const CoreBasicArray< unsigned int > &  index_rows,
bool  select,
bool  clear = true 
)

Set the selected state of rows.

Parameters
index_rowsIndices of the rows to select.
selectSelected state.
clearIf true (by default) the selection is first clear (it goes without saying that in this case, using false for select is not really useful.
void GuiSpreadsheet::show_edit_field ( GuiSpreadsheetCellBasic edited_cell)

When edited cell provides its own editor (cell::on_click returning true), ensures that any mouse click outside the editor or any scroll will dismiss it. Invoking this method needs cell::get_edit_field to be implemented.

void GuiSpreadsheet::start_edit_cell_content ( )
virtual

Call to trigger the edition of the "currently selected" cell. I double quoted "currently selected" because I couldn't really figure out the logic behind this. All I know is that it's best not invoking directly, and use GuiSpreadsheetCell::start_edit_content() instead. It will take care of setting itself as the selected one.

Now, this method will call the GuiSpreadsheetCell::on_edit_content() of the cell, and depending on the returned value, will return, or display a generic text editor.

Once the editor is done, it automatically update the cell content and destroys itself, so you don't have to call GuiSpreadsheet::end_edit_cell_content (in case you were wondering)

The update of the cell should fire a EVT_ID_SPREADSHEET_CELL_UPDATED event.

Reimplemented in GuiOfItemSpreadsheet.

Member Data Documentation

CoreVector<unsigned int> GuiSpreadsheet::m_dnd_reparenting_row_candidates
protected

when in DND_MODE_PARENT_INSERT mode, parent row for visual feedback. Can be used in ::on_dnd_release the acceptable parent rows, not fed by GuiSpreadsheet