ui/gtk/list.h

changeset 1245
4163776eef49
parent 1244
a29b53f97d1a
equal deleted inserted replaced
1244:a29b53f97d1a 1245:4163776eef49
113 void *selectiondata; 113 void *selectiondata;
114 char *activate_action; 114 char *activate_action;
115 char *selection_action; 115 char *selection_action;
116 } UiTreeEventData; 116 } UiTreeEventData;
117 117
118 typedef struct UiListBox UiListBox; 118 typedef struct UiListBox UiListBox;
119 typedef struct UiListBox2 UiListBox2;
119 120
120 typedef struct UiListBoxSubList { 121 typedef struct UiListBoxSubList {
121 UiVar *var; 122 UiVar *var;
122 size_t numitems; 123 size_t numitems;
123 char *header; 124 char *header;
142 GtkListBoxRow *first_row; 143 GtkListBoxRow *first_row;
143 UiBool header_is_item; 144 UiBool header_is_item;
144 UiSubListEventData current_eventdata; 145 UiSubListEventData current_eventdata;
145 }; 146 };
146 147
148 struct UiListBox2 {
149 UiObject *obj;
150 GtkListBox *listbox;
151 UiVar *var;
152 CxList *rows;
153 ui_sourcelist_getvalue_func getvalue;
154 void *getvaluedata;
155 ui_tree_getdepthfunc getdepth;
156 void *getdepthdata;
157
158 ui_callback onactivate;
159 void *onactivatedata;
160 char *onactivate_action;
161 ui_callback onbuttonclick;
162 void *onbuttonclickdata;
163 char *onbuttonclick_action;
164 };
165
166 typedef struct UiListBox2Row {
167 UiListBox2 *listbox;
168 CxList *children; // type: int (index)
169 int index;
170 int depth;
171 int expanded;
172 } UiListBox2Row;
173
147 void* ui_null_getvalue(UiList *list, void *elm, int row, int col, void *userdata, UiBool *freeResult); 174 void* ui_null_getvalue(UiList *list, void *elm, int row, int col, void *userdata, UiBool *freeResult);
148 175
149 #if GTK_CHECK_VERSION(4, 10, 0) 176 #if GTK_CHECK_VERSION(4, 10, 0)
150 177
151 void ui_update_liststore(GListStore *liststore, UiList *list); 178 void ui_update_liststore(GListStore *liststore, UiList *list);
179 void ui_update_tree_liststore(GListStore *liststore, UiList *list);
152 void ui_update_liststore_static(GListStore *liststore, char **elm, size_t nelm); 180 void ui_update_liststore_static(GListStore *liststore, char **elm, size_t nelm);
153 181
154 void ui_listview_update_model(UiModel *model, void *userdata, int insert_index, int delete_index); 182 void ui_listview_update_model(UiModel *model, void *userdata, int insert_index, int delete_index);
155 void ui_listview_update2(UiList *list, int i); 183 void ui_listview_update2(UiList *list, int i);
156 UiListSelection ui_listview_getselection2(UiList *list); 184 UiListSelection ui_listview_getselection2(UiList *list);
212 void ui_listbox_list_setselection(UiList *list, UiListSelection sel); 240 void ui_listbox_list_setselection(UiList *list, UiListSelection sel);
213 UiListSelection ui_listbox_list_getselection(UiList *list); 241 UiListSelection ui_listbox_list_getselection(UiList *list);
214 242
215 void ui_listbox_row_activate(GtkListBox *self, GtkListBoxRow *row, gpointer user_data); 243 void ui_listbox_row_activate(GtkListBox *self, GtkListBoxRow *row, gpointer user_data);
216 244
217 #if GTK_CHECK_VERSION(4, 10, 0) 245
218 246 /* ------------------------------ SourceList2 ------------------------------ */
219 typedef struct _ObjWrapper { 247
220 GObject parent_instance; 248 void ui_listbox2_row_activate(GtkListBox *self, GtkListBoxRow *row, gpointer user_data);
221 void *data; 249
222 int i; 250 void ui_listbox2_update(UiList *list, int i);
223 } ObjWrapper; 251 UiListSelection ui_listbox2_getselection(UiList *list);
224 252 void ui_listbox2_setselection(UiList *list, UiListSelection selection);
225 ObjWrapper* ui_gobj_wrapper_new(void* data, int i);
226
227 #endif
228 253
229 #ifdef __cplusplus 254 #ifdef __cplusplus
230 } 255 }
231 #endif 256 #endif
232 257

mercurial