Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

Etk_Combobox_Entry


Detailed Description

The Etk_Combobox_Entry widget is made up of a button that shows a popup menu-when it is clicked, allowing the user to choose an item from a list.

combobox_entry.png
Once the combobox_entry is created, at least one column must be added to it with etk_combobox_entry_column_add(). Each column can contain a specific widget type.
Once all the column are created, the combobox_entry has to be built with etk_combobox_entry_build(), in order to be able to add items to it. No item can be added to a combobox_entry if it is not built, and no columns can be added anymore to the combobox_entry once it is built.
Items can be added to the combobox_entry with etk_combobox_entry_item_prepend() and etk_combobox_entry_item_append(). The parameters of those functions depend on the type of widget of the column.

Here is a simple example, where we create a combobox_entry with three columns (one for the icon, one for the label and one with a checkbox), and then, we add two items to it:
 Etk_Combobox_Entry *combobox_entry;

 combobox_entry = ETK_COMBOBOX_ENTRY(etk_combobox_entry_new());
 etk_combobox_entry_column_add(combobox_entry, ETK_COMBOBOX_ENTRY_IMAGE, 24, ETK_COMBOBOX_ENTRY_NONE, 0.0);
 etk_combobox_entry_column_add(combobox_entry, ETK_COMBOBOX_ENTRY_LABEL, 75, ETK_COMBOBOX_ENTRY_EXPAND, 0.0);
 etk_combobox_entry_column_add(combobox_entry, ETK_COMBOBOX_ENTRY_OTHER, 32, ETK_COMBOBOX_ENTRY_NONE, 1.0);
 etk_combobox_entry_build(combobox_entry);

 etk_combobox_entry_item_append(combobox_entry, image1, "item 1", checkbox1);
 etk_combobox_entry_item_append(combobox_entry, image2, "item 2", checkbox1);

Object Hierarchy:
  • Etk_Object
    • Etk_Widget
      • Etk_Combobox_Entry
Signals:
  • "active-item-changed": Emitted when the active item is changed (when the user selects another items)
    • Callback: Etk_Bool callback(Etk_Combobox_Entry *combobox_entry, void *data)
      • combobox_entry: the combobox_entry whose active item has been changed
      • data: the user data set when the callback has been connected to the signal
Properties:
  • "items-height": The height of an item of the combobox_entry (should be > 0)
    • Type: Integer
    • Access: Read/Write
    • Default Value: 24
  • "active-item": The active item of the combobox_entry (the item displayed in the combobox_entry button)
    • Type: Pointer (Etk_Combobox_Entry_Item *)
    • Access: Read/Write
    • Default Value: NULL


Data Structures

struct  Etk_Combobox_Entry_Item
 [Widget] A combobox_entry's item made up of a button that shows a popup-menu when it is clicked, allowing the user to choose an item from a list More...
struct  Etk_Combobox_Entry
 [Widget] A combobox_entry is a widget More...

Defines

#define ETK_COMBOBOX_ENTRY_TYPE   (etk_combobox_entry_type_get())
#define ETK_COMBOBOX_ENTRY(obj)   (ETK_OBJECT_CAST((obj), ETK_COMBOBOX_ENTRY_TYPE, Etk_Combobox_Entry))
#define ETK_IS_COMBOBOX_ENTRY(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_COMBOBOX_ENTRY_TYPE))
#define ETK_COMBOBOX_ENTRY_ITEM_TYPE   (etk_combobox_entry_item_type_get())
#define ETK_COMBOBOX_ENTRY_ITEM(obj)   (ETK_OBJECT_CAST((obj), ETK_COMBOBOX_ENTRY_ITEM_TYPE, Etk_Combobox_Entry_Item))
#define ETK_IS_COMBOBOX_ENTRY_ITEM(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_COMBOBOX_ENTRY_ITEM_TYPE))

Enumerations

enum  Etk_Combobox_Entry_Column_Type {
  ETK_COMBOBOX_ENTRY_LABEL,
  ETK_COMBOBOX_ENTRY_IMAGE,
  ETK_COMBOBOX_ENTRY_OTHER
}
 The different types of widgets that can be contained by a combobox_entry's column. More...
enum  Etk_Combobox_Entry_Fill_Policy
 Indicates how a widget of a combobox_entry-column should fill and expand. More...

Functions

Etk_Widget * etk_combobox_entry_new (void)
 Creates a new combobox_entry, with no column.
Etk_Widget * etk_combobox_entry_new_default (void)
 Creates a new combobox_entry, made up of a unique column containing a label, and already built (no need to call etk_combobox_entry_build()).
Etk_Widget * etk_combobox_entry_entry_get (Etk_Combobox_Entry *combobox_entry)
 Gets the combobox_entry's entry widget.
void etk_combobox_entry_items_height_set (Etk_Combobox_Entry *combobox_entry, int items_height)
 Set the height of the combobox_entry's items. The default height is 24, the minimum is 12.
int etk_combobox_entry_items_height_get (Etk_Combobox_Entry *combobox_entry)
 Gets the height of the combobox_entry's items.
void etk_combobox_entry_column_add (Etk_Combobox_Entry *combobox_entry, Etk_Combobox_Entry_Column_Type col_type, int width, Etk_Combobox_Entry_Fill_Policy fill_policy, float align)
 Adds a column to the combobox_entry. The combobox_entry should not be already be built.
void etk_combobox_entry_build (Etk_Combobox_Entry *combobox_entry)
 Builds the combobox_entry: you have to build a combobox_entry after you have added all the columns to it and before you start adding items. Items can not be added if the combobox_entry is not built.
Etk_Combobox_Entry_Item * etk_combobox_entry_item_prepend (Etk_Combobox_Entry *combobox_entry,...)
 Inserts a new item at the start of the combobox_entry.
Etk_Combobox_Entry_Item * etk_combobox_entry_item_prepend_empty (Etk_Combobox_Entry *combobox_entry)
 Inserts a new empty item at the start of the combobox_entry.
Etk_Combobox_Entry_Item * etk_combobox_entry_item_append (Etk_Combobox_Entry *combobox_entry,...)
 Inserts a new item at the end of the combobox_entry.
Etk_Combobox_Entry_Item * etk_combobox_entry_item_append_empty (Etk_Combobox_Entry *combobox_entry)
 Inserts a new empty item at the end of the combobox_entry.
Etk_Combobox_Entry_Item * etk_combobox_entry_item_insert (Etk_Combobox_Entry *combobox_entry, Etk_Combobox_Entry_Item *after,...)
 Inserts a new item after an existing item of the combobox_entry.
Etk_Combobox_Entry_Item * etk_combobox_entry_item_insert_empty (Etk_Combobox_Entry *combobox_entry, Etk_Combobox_Entry_Item *after)
 Inserts a new empty item after an existing item of the combobox_entry.
Etk_Combobox_Entry_Item * etk_combobox_entry_item_insert_valist (Etk_Combobox_Entry *combobox_entry, Etk_Combobox_Entry_Item *after, va_list args)
 Inserts a new item after an existing item of the combobox_entry.
void etk_combobox_entry_item_remove (Etk_Combobox_Entry_Item *item)
 Removes an item from the combobox_entry. The item will be freed and should not be used anymore.
void etk_combobox_entry_clear (Etk_Combobox_Entry *combobox_entry)
 Removes all the items of the combobox_entry. All the items will be freed and should not be used anymore.
void etk_combobox_entry_item_fields_set (Etk_Combobox_Entry_Item *item,...)
 Sets the values of the cells of the combobox_entry item.
void etk_combobox_entry_item_fields_set_valist (Etk_Combobox_Entry_Item *item, va_list args)
 Sets the values of the cells of the combobox_entry item. The current widgets of item will be destroyed.
void etk_combobox_entry_item_field_set (Etk_Combobox_Entry_Item *item, int column, void *value)
 Sets the value of the cell of one column of the combobox_entry item. The current widgets of item will be destroyed.
void etk_combobox_entry_item_fields_get (Etk_Combobox_Entry_Item *item,...)
 Gets the values of the cells of the combobox_entry item.
void etk_combobox_entry_item_fields_get_valist (Etk_Combobox_Entry_Item *item, va_list args)
 Gets the values of the cells of the combobox_entry item.
void * etk_combobox_entry_item_field_get (Etk_Combobox_Entry_Item *item, int column)
 Gets the value of the cell of a column of the combobox_entry item.
void etk_combobox_entry_item_data_set (Etk_Combobox_Entry_Item *item, void *data)
 Sets the data associated to the combobox_entry item.
void etk_combobox_entry_item_data_set_full (Etk_Combobox_Entry_Item *item, void *data, void(*free_cb)(void *data))
 Sets the data associated to the combobox_entry item.
void * etk_combobox_entry_item_data_get (Etk_Combobox_Entry_Item *item)
 Gets the data associated to the combobox_entry item.
void etk_combobox_entry_active_item_set (Etk_Combobox_Entry *combobox_entry, Etk_Combobox_Entry_Item *item)
 Sets the active item of the combobox_entry.
Etk_Combobox_Entry_Item * etk_combobox_entry_active_item_get (Etk_Combobox_Entry *combobox_entry)
 Gets the active item of the combobox_entry.
int etk_combobox_entry_active_item_num_get (Etk_Combobox_Entry *combobox_entry)
 Gets the index of the current active item of the combobox_entry.
Etk_Combobox_Entry_Item * etk_combobox_entry_first_item_get (Etk_Combobox_Entry *combobox_entry)
 Gets the first item of a combobox_entry.
Etk_Combobox_Entry_Item * etk_combobox_entry_last_item_get (Etk_Combobox_Entry *combobox_entry)
 Gets the last item of a combobox_entry.
Etk_Combobox_Entry_Item * etk_combobox_entry_item_prev_get (Etk_Combobox_Entry_Item *item)
 Gets the item previous to the given combobox_entry item.
Etk_Combobox_Entry_Item * etk_combobox_entry_item_next_get (Etk_Combobox_Entry_Item *item)
 Gets the item next to the given combobox_entry item.
Etk_Combobox_Entry_Item * etk_combobox_entry_nth_item_get (Etk_Combobox_Entry *combobox_entry, int index)
 Gets the nth item of the combobox_entry.
Etk_Combobox_Entry * etk_combobox_entry_item_combobox_entry_get (Etk_Combobox_Entry_Item *item)
 Gets the combobox_entry containing the given item.
Etk_Bool etk_combobox_entry_is_popped_up (Etk_Combobox_Entry *combobox_entry)
 Checks if the combobox_entry is open / popped up.
void etk_combobox_entry_pop_up (Etk_Combobox_Entry *combobox_entry)
 Pops up the combobox's menu / window.
void etk_combobox_entry_pop_down (Etk_Combobox_Entry *combobox_entry)
 Pops down the combobox's menu / window.


Define Documentation

#define ETK_COMBOBOX_ENTRY_TYPE   (etk_combobox_entry_type_get())

Gets the type of a combobox_entry

Referenced by etk_combobox_entry_new().

#define ETK_COMBOBOX_ENTRY ( obj   )     (ETK_OBJECT_CAST((obj), ETK_COMBOBOX_ENTRY_TYPE, Etk_Combobox_Entry))

Casts the object to an Etk_Combobox_Entry

Referenced by etk_combobox_entry_new_default().

#define ETK_IS_COMBOBOX_ENTRY ( obj   )     (ETK_OBJECT_CHECK_TYPE((obj), ETK_COMBOBOX_ENTRY_TYPE))

Check if the object is an Etk_Combobox_Entry

#define ETK_COMBOBOX_ENTRY_ITEM_TYPE   (etk_combobox_entry_item_type_get())

Gets the type of a combobox_entry item

Referenced by etk_combobox_entry_item_insert_empty().

#define ETK_COMBOBOX_ENTRY_ITEM ( obj   )     (ETK_OBJECT_CAST((obj), ETK_COMBOBOX_ENTRY_ITEM_TYPE, Etk_Combobox_Entry_Item))

Casts the object to an Etk_Combobox_Entry_Item

Referenced by etk_combobox_entry_item_insert_empty().

#define ETK_IS_COMBOBOX_ENTRY_ITEM ( obj   )     (ETK_OBJECT_CHECK_TYPE((obj), ETK_COMBOBOX_ENTRY_ITEM_TYPE))

Check if the object is an Etk_Combobox_Entry_Item


Enumeration Type Documentation

enum Etk_Combobox_Entry_Column_Type

The different types of widgets that can be contained by a combobox_entry's column.

Enumerator:
ETK_COMBOBOX_ENTRY_LABEL  The column's widget is a label
ETK_COMBOBOX_ENTRY_IMAGE  The column's widget is an image
ETK_COMBOBOX_ENTRY_OTHER  The column's widget is any other type of widget

enum Etk_Combobox_Entry_Fill_Policy

Indicates how a widget of a combobox_entry-column should fill and expand.


Function Documentation

Etk_Widget * etk_combobox_entry_new ( void   ) 

Creates a new combobox_entry, with no column.

Returns:
Returns the new combobox_entry widget

References ETK_COMBOBOX_ENTRY_TYPE, and etk_widget_new().

Referenced by etk_combobox_entry_new_default().

Etk_Widget * etk_combobox_entry_new_default ( void   ) 

Creates a new combobox_entry, made up of a unique column containing a label, and already built (no need to call etk_combobox_entry_build()).

Returns:
Returns the new combobox_entry widget

References ETK_COMBOBOX_ENTRY, etk_combobox_entry_build(), etk_combobox_entry_column_add(), ETK_COMBOBOX_ENTRY_LABEL, and etk_combobox_entry_new().

Etk_Widget * etk_combobox_entry_entry_get ( Etk_Combobox_Entry *  combobox_entry  ) 

Gets the combobox_entry's entry widget.

Parameters:
item a combobox_entry item
Returns:
Returns the combobox_entry's entry widget

References entry.

void etk_combobox_entry_items_height_set ( Etk_Combobox_Entry *  combobox_entry,
int  items_height 
)

Set the height of the combobox_entry's items. The default height is 24, the minimum is 12.

Parameters:
combobox_entry a combobox_entry
items_height the height that the combobox_entry's items should have

References ETK_MAX, ETK_OBJECT, etk_object_notify(), ETK_WIDGET, etk_widget_size_recalc_queue(), hbox, items_height, and window.

int etk_combobox_entry_items_height_get ( Etk_Combobox_Entry *  combobox_entry  ) 

Gets the height of the combobox_entry's items.

Parameters:
combobox_entry a combobox_entry
Returns:
Returns the height of the combobox_entry's items

References items_height.

void etk_combobox_entry_column_add ( Etk_Combobox_Entry *  combobox_entry,
Etk_Combobox_Entry_Column_Type  col_type,
int  width,
Etk_Combobox_Entry_Fill_Policy  fill_policy,
float  align 
)

Adds a column to the combobox_entry. The combobox_entry should not be already be built.

Parameters:
combobox_entry a combobox_entry
col_type the type of widget that will be packed in the column
width the width of the column. If expand is ETK_TRUE, the column may be bigger if it expands
fill_policy the fill-policy of the widget of the column, it indicates how it should fill the column
align the horizontal alignment of the widget of the column, from 0.0 (left) to 1.0 (right)

References built, cols, ETK_CLAMP, ETK_WARNING, and num_cols.

Referenced by etk_combobox_entry_new_default().

void etk_combobox_entry_build ( Etk_Combobox_Entry *  combobox_entry  ) 

Builds the combobox_entry: you have to build a combobox_entry after you have added all the columns to it and before you start adding items. Items can not be added if the combobox_entry is not built.

Parameters:
combobox_entry the combobox_entry to build

References active_item, built, and etk_combobox_entry_active_item_set().

Referenced by etk_combobox_entry_new_default().

Etk_Combobox_Entry_Item * etk_combobox_entry_item_prepend ( Etk_Combobox_Entry *  combobox_entry,
  ... 
)

Inserts a new item at the start of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
... the different widgets to attach to the columns of the item: there must be as many arguments as the number of columns in the combobox_entry, one for each column.
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_LABEL, the argument must be a "const char *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_IMAGE, the argument must be an "Etk_Image *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_OTHER, the argument must be an "Etk_Widget *"
Returns:
Returns the new item
Note:
Unlike other widgets, the new item and its children will be automatically shown, so you won't have to call etk_widget_show()

References etk_combobox_entry_item_insert_valist().

Etk_Combobox_Entry_Item * etk_combobox_entry_item_prepend_empty ( Etk_Combobox_Entry *  combobox_entry  )  [inline]

Inserts a new empty item at the start of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
Returns:
Returns the new item
Note:
Unlike other widgets, the new item and its children will be automatically shown, so you won't have to call etk_widget_show()

References etk_combobox_entry_item_insert_empty().

Etk_Combobox_Entry_Item * etk_combobox_entry_item_append ( Etk_Combobox_Entry *  combobox_entry,
  ... 
)

Inserts a new item at the end of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
... the different widgets to attach to the columns of the item: there must be as many arguments as the number of columns in the combobox_entry, one for each column.
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_LABEL, the argument must be a "const char *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_IMAGE, the argument must be an "Etk_Image *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_OTHER, the argument must be an "Etk_Widget *"
Returns:
Returns the new item
Note:
Unlike other widgets, the new item and its children will be automatically shown, so you won't have to call etk_widget_show()

References etk_combobox_entry_item_insert_valist(), and last_item.

Etk_Combobox_Entry_Item * etk_combobox_entry_item_append_empty ( Etk_Combobox_Entry *  combobox_entry  )  [inline]

Inserts a new empty item at the end of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
Returns:
Returns the new item
Note:
Unlike other widgets, the new item and its children will be automatically shown, so you won't have to call etk_widget_show()

References etk_combobox_entry_item_insert_empty(), and last_item.

Etk_Combobox_Entry_Item * etk_combobox_entry_item_insert ( Etk_Combobox_Entry *  combobox_entry,
Etk_Combobox_Entry_Item *  after,
  ... 
)

Inserts a new item after an existing item of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
after the item after which the new item should be inserted. If after is NULL, the new item will be inserted at the start of the combobox_entry
... the different widgets to attach to the columns of the item: there must be as many arguments as the number of columns in the combobox_entry, one for each column.
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_LABEL, the argument must be a "const char *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_IMAGE, the argument must be an "Etk_Image *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_OTHER, the argument must be an "Etk_Widget *"
Returns:
Returns the new item
Note:
Unlike other widgets, the new item and its children will be automatically shown, so you won't have to call etk_widget_show()

References etk_combobox_entry_item_insert_valist().

Etk_Combobox_Entry_Item * etk_combobox_entry_item_insert_empty ( Etk_Combobox_Entry *  combobox_entry,
Etk_Combobox_Entry_Item *  after 
)

Inserts a new empty item after an existing item of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
after the item after which the new item should be inserted. If after is NULL, the new item will be inserted at the start of the combobox_entry
Returns:
Returns the new item
Note:
Unlike other widgets, the new item and its children will be automatically shown, so you won't have to call etk_widget_show()

References active_item, built, Etk_Combobox_Entry_Item::combobox_entry, ETK_CALLBACK, etk_combobox_entry_active_item_set(), ETK_COMBOBOX_ENTRY_ITEM, ETK_COMBOBOX_ENTRY_ITEM_TYPE, ETK_OBJECT, ETK_WARNING, ETK_WIDGET, etk_widget_new(), etk_widget_parent_set(), first_item, last_item, Etk_Combobox_Entry_Item::next, num_cols, Etk_Combobox_Entry_Item::prev, Etk_Combobox_Entry_Item::widgets, and window.

Referenced by etk_combobox_entry_item_append_empty(), etk_combobox_entry_item_insert_valist(), and etk_combobox_entry_item_prepend_empty().

Etk_Combobox_Entry_Item * etk_combobox_entry_item_insert_valist ( Etk_Combobox_Entry *  combobox_entry,
Etk_Combobox_Entry_Item *  after,
va_list  args 
)

Inserts a new item after an existing item of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
after the item after which the new item should be inserted. If after is NULL, the new item will be inserted at the start of the combobox_entry
args the different widgets to attach to the columns of the item: there must be as many arguments as the number of columns in the combobox_entry, one for each column.
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_LABEL, the argument must be a "const char *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_IMAGE, the argument must be an "Etk_Image *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_OTHER, the argument must be an "Etk_Widget *"
Returns:
Returns the new item
Note:
Unlike other widgets, the new item and its children will be automatically shown, so you won't have to call etk_widget_show()

References etk_combobox_entry_item_fields_set_valist(), and etk_combobox_entry_item_insert_empty().

Referenced by etk_combobox_entry_item_append(), etk_combobox_entry_item_insert(), and etk_combobox_entry_item_prepend().

void etk_combobox_entry_item_remove ( Etk_Combobox_Entry_Item *  item  ) 

Removes an item from the combobox_entry. The item will be freed and should not be used anymore.

Parameters:
item the item to remove from its combobox_entry
Note:
You can also call etk_object_destroy() to remove an item from a combobox_entry, it has the same effect

References ETK_OBJECT, and etk_object_destroy().

Referenced by etk_combobox_entry_clear().

void etk_combobox_entry_clear ( Etk_Combobox_Entry *  combobox_entry  ) 

Removes all the items of the combobox_entry. All the items will be freed and should not be used anymore.

Parameters:
combobox_entry a combobox_entry

References etk_combobox_entry_item_remove(), and first_item.

void etk_combobox_entry_item_fields_set ( Etk_Combobox_Entry_Item *  item,
  ... 
)

Sets the values of the cells of the combobox_entry item.

Parameters:
item a combobox_entry item
... the different widgets to attach to the columns of the item: there must be as many arguments as the number of columns in the combobox_entry, one for each column.
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_LABEL, the argument must be a "const char *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_IMAGE, the argument must be an "Etk_Image *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_OTHER, the argument must be an "Etk_Widget *"
Note:
The new widgets of the item will be automatically shown

References etk_combobox_entry_item_fields_set_valist().

void etk_combobox_entry_item_fields_set_valist ( Etk_Combobox_Entry_Item *  item,
va_list  args 
)

Sets the values of the cells of the combobox_entry item. The current widgets of item will be destroyed.

Parameters:
item a combobox_entry item
args the different widgets to attach to the columns of the item: there must be as many arguments as the number of columns in the combobox_entry, one for each column.
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_LABEL, the argument must be a "const char *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_IMAGE, the argument must be an "Etk_Image *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_OTHER, the argument must be an "Etk_Widget *"
Note:
The new widgets of the item will be automatically shown

References active_item, cols, Etk_Combobox_Entry_Item::combobox_entry, etk_combobox_entry_active_item_set(), ETK_COMBOBOX_ENTRY_IMAGE, ETK_COMBOBOX_ENTRY_LABEL, ETK_COMBOBOX_ENTRY_OTHER, etk_label_new(), ETK_OBJECT, etk_object_destroy(), ETK_WIDGET, etk_widget_parent_set(), etk_widget_pass_mouse_events_set(), etk_widget_show(), num_cols, and Etk_Combobox_Entry_Item::widgets.

Referenced by etk_combobox_entry_item_fields_set(), and etk_combobox_entry_item_insert_valist().

void etk_combobox_entry_item_field_set ( Etk_Combobox_Entry_Item *  item,
int  column,
void *  value 
)

Sets the value of the cell of one column of the combobox_entry item. The current widgets of item will be destroyed.

Parameters:
item a combobox_entry item
column the column to set the value of
data the value of the column to set:
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_LABEL, the argument must be a "const char *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_IMAGE, the argument must be an "Etk_Image *"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_OTHER, the argument must be an "Etk_Widget *"
Note:
The new widgets of the item will be automatically shown

References cols, Etk_Combobox_Entry_Item::combobox_entry, ETK_COMBOBOX_ENTRY_IMAGE, ETK_COMBOBOX_ENTRY_LABEL, ETK_COMBOBOX_ENTRY_OTHER, etk_label_new(), ETK_OBJECT, etk_object_destroy(), ETK_WIDGET, etk_widget_parent_set(), etk_widget_pass_mouse_events_set(), etk_widget_show(), num_cols, and Etk_Combobox_Entry_Item::widgets.

void etk_combobox_entry_item_fields_get ( Etk_Combobox_Entry_Item *  item,
  ... 
)

Gets the values of the cells of the combobox_entry item.

Parameters:
item a combobox_entry item
... the location where to store the different values of the cells of the item: there must be as many arguments as the number of columns in the combobox_entry, one for each column.
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_LABEL, the argument must be a "const char **"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_IMAGE, the argument must be an "Etk_Image **"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_OTHER, the argument must be an "Etk_Widget **"

References etk_combobox_entry_item_fields_get_valist().

void etk_combobox_entry_item_fields_get_valist ( Etk_Combobox_Entry_Item *  item,
va_list  args 
)

Gets the values of the cells of the combobox_entry item.

Parameters:
item a combobox_entry item
args the location where to store the different values of the cells of the item: there must be as many arguments as the number of columns in the combobox_entry, one for each column.
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_LABEL, the argument must be a "const char **"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_IMAGE, the argument must be an "Etk_Image **"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_OTHER, the argument must be an "Etk_Widget **"

References cols, Etk_Combobox_Entry_Item::combobox_entry, ETK_COMBOBOX_ENTRY_IMAGE, ETK_COMBOBOX_ENTRY_LABEL, ETK_COMBOBOX_ENTRY_OTHER, ETK_LABEL, etk_label_get(), ETK_WIDGET, etk_widget_parent_set(), etk_widget_show(), num_cols, and Etk_Combobox_Entry_Item::widgets.

Referenced by etk_combobox_entry_item_fields_get().

void * etk_combobox_entry_item_field_get ( Etk_Combobox_Entry_Item *  item,
int  column 
)

Gets the value of the cell of a column of the combobox_entry item.

Parameters:
item a combobox_entry item
column the column to get the value of
Returns:
the value of the column as a void pointer that must be cast to the correct type:
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_LABEL, the argument must be a "const char **"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_IMAGE, the argument must be an "Etk_Image **"
  • If the type of the corresponding column is ETK_COMBOBOX_ENTRY_OTHER, the argument must be an "Etk_Widget **"

References cols, Etk_Combobox_Entry_Item::combobox_entry, ETK_COMBOBOX_ENTRY_IMAGE, ETK_COMBOBOX_ENTRY_LABEL, ETK_COMBOBOX_ENTRY_OTHER, ETK_LABEL, etk_label_get(), num_cols, and Etk_Combobox_Entry_Item::widgets.

void etk_combobox_entry_item_data_set ( Etk_Combobox_Entry_Item *  item,
void *  data 
)

Sets the data associated to the combobox_entry item.

Parameters:
item a combobox_entry item
data the data to associate to the combobox_entry item

References etk_combobox_entry_item_data_set_full().

void etk_combobox_entry_item_data_set_full ( Etk_Combobox_Entry_Item *  item,
void *  data,
void(*)(void *data)  free_cb 
)

Sets the data associated to the combobox_entry item.

Parameters:
item a combobox_entry item
data the data to associate to the combobox_entry item
free_cb a function to call to free the data when the item is destroyed or when the data is changed

References Etk_Combobox_Entry_Item::data, and Etk_Combobox_Entry_Item::data_free_cb.

Referenced by etk_combobox_entry_item_data_set().

void * etk_combobox_entry_item_data_get ( Etk_Combobox_Entry_Item *  item  ) 

Gets the data associated to the combobox_entry item.

Parameters:
item a combobox_entry item
Returns:
Returns the data associated to the combobox_entry item

References Etk_Combobox_Entry_Item::data.

void etk_combobox_entry_active_item_set ( Etk_Combobox_Entry *  combobox_entry,
Etk_Combobox_Entry_Item *  item 
)

Sets the active item of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
item the item to set as active

References active_item, built, Etk_Combobox_Entry_Item::combobox_entry, ETK_OBJECT, etk_object_notify(), etk_signal_emit(), and ETK_WARNING.

Referenced by etk_combobox_entry_build(), etk_combobox_entry_item_fields_set_valist(), and etk_combobox_entry_item_insert_empty().

Etk_Combobox_Entry_Item * etk_combobox_entry_active_item_get ( Etk_Combobox_Entry *  combobox_entry  ) 

Gets the active item of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
Returns:
Returns the active item of combobox_entry (NULL if none)

References active_item.

int etk_combobox_entry_active_item_num_get ( Etk_Combobox_Entry *  combobox_entry  ) 

Gets the index of the current active item of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
Returns:
Returns the index of the current active item, or -1 if there is no active item

References active_item, first_item, and Etk_Combobox_Entry_Item::next.

Etk_Combobox_Entry_Item * etk_combobox_entry_first_item_get ( Etk_Combobox_Entry *  combobox_entry  ) 

Gets the first item of a combobox_entry.

Parameters:
combobox_entry a combobox_entry
Returns:
Returns the first item of a combobox_entry

References first_item.

Etk_Combobox_Entry_Item * etk_combobox_entry_last_item_get ( Etk_Combobox_Entry *  combobox_entry  ) 

Gets the last item of a combobox_entry.

Parameters:
combobox_entry a combobox_entry
Returns:
Returns the last item of a combobox_entry

References last_item.

Etk_Combobox_Entry_Item * etk_combobox_entry_item_prev_get ( Etk_Combobox_Entry_Item *  item  ) 

Gets the item previous to the given combobox_entry item.

Parameters:
item a combobox_entry item
Returns:
Returns the item previous to item, or NULL if the given item is the first one

References Etk_Combobox_Entry_Item::prev.

Etk_Combobox_Entry_Item * etk_combobox_entry_item_next_get ( Etk_Combobox_Entry_Item *  item  ) 

Gets the item next to the given combobox_entry item.

Parameters:
item a combobox_entry item
Returns:
Returns the item next to item, or NULL if the given item is the last one

References Etk_Combobox_Entry_Item::next.

Etk_Combobox_Entry_Item * etk_combobox_entry_nth_item_get ( Etk_Combobox_Entry *  combobox_entry,
int  index 
)

Gets the nth item of the combobox_entry.

Parameters:
combobox_entry a combobox_entry
index the index of the item to get, starting from 0. If index is < 0 or if index is greater than the current number of items of the combobox_entry, the function will return NULL
Returns:
Returns the nth item of the combobox_entry, or NULL on failure

References first_item.

Etk_Combobox_Entry * etk_combobox_entry_item_combobox_entry_get ( Etk_Combobox_Entry_Item *  item  ) 

Gets the combobox_entry containing the given item.

Parameters:
item a combobox_entry item
Returns:
Returns the combobox_entry containing the given item

References Etk_Combobox_Entry_Item::combobox_entry.

Etk_Bool etk_combobox_entry_is_popped_up ( Etk_Combobox_Entry *  combobox_entry  ) 

Checks if the combobox_entry is open / popped up.

Parameters:
combobox_entry a combobox_entry
Returns:
Returns true if the combobox is popped up, false otherwise.

References button, ETK_TOGGLE_BUTTON, and etk_toggle_button_active_get().

void etk_combobox_entry_pop_up ( Etk_Combobox_Entry *  combobox_entry  ) 

Pops up the combobox's menu / window.

Parameters:
combobox_entry a combobox_entry
Returns:
Returns true if the combobox is popped up, false otherwise.

References built, button, ETK_TOGGLE_BUTTON, and etk_toggle_button_active_set().

void etk_combobox_entry_pop_down ( Etk_Combobox_Entry *  combobox_entry  ) 

Pops down the combobox's menu / window.

Parameters:
combobox_entry a combobox_entry
Returns:
Returns true if the combobox is popped up, false otherwise.

References built, button, ETK_TOGGLE_BUTTON, and etk_toggle_button_active_set().