diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-05-18 09:47:19 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-05-18 11:07:27 +0200 |
commit | 2a15531bb9df283060e0eb0e7e93ecf33e494b4d (patch) | |
tree | c2bfb323789bf43123e70ec209cb18533914e4ad /src/calcurse.h | |
parent | a5f3e53ce3b1e99058bf75d6dfddfec3c9c95768 (diff) | |
download | calcurse-2a15531bb9df283060e0eb0e7e93ecf33e494b4d.zip |
Add support for caption rows in list boxes
This adds support for rows that cannot be selected. Such rows can be
used for section headings and the like.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/calcurse.h')
-rw-r--r-- | src/calcurse.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/calcurse.h b/src/calcurse.h index 07f6b78..8072304 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -511,13 +511,21 @@ struct scrollwin { }; /* Generic list box structure. */ +enum listbox_row_type { + LISTBOX_ROW_TEXT, + LISTBOX_ROW_CAPTION +}; + +typedef enum listbox_row_type (*listbox_fn_item_type_t) (int, void *); typedef int (*listbox_fn_item_height_t) (int, void *); typedef void (*listbox_fn_draw_item_t) (int, WINDOW *, int, int, void *); struct listbox { struct scrollwin sw; unsigned item_count; - unsigned item_sel; + int item_sel; + listbox_fn_item_type_t fn_type; + enum listbox_row_type *type; listbox_fn_item_height_t fn_height; unsigned *ch; listbox_fn_draw_item_t fn_draw; @@ -793,7 +801,9 @@ int keys_check_missing_bindings(void); void keys_fill_missing(void); /* listbox.c */ -void listbox_init(struct listbox *, int, int, int, int, const char *, listbox_fn_item_height_t, listbox_fn_draw_item_t); +void listbox_init(struct listbox *, int, int, int, int, const char *, + listbox_fn_item_type_t, listbox_fn_item_height_t, + listbox_fn_draw_item_t); void listbox_delete(struct listbox *); void listbox_resize(struct listbox *, int, int, int, int); void listbox_set_cb_data(struct listbox *, void *); @@ -951,6 +961,7 @@ void ui_day_load_items(void); void ui_day_sel_reset(void); void ui_day_sel_move(int); void ui_day_draw(int, WINDOW *, int, int, void *); +enum listbox_row_type ui_day_row_type(int, void *); int ui_day_height(int, void *); void ui_day_update_panel(int); void ui_day_popup_item(void); @@ -964,6 +975,7 @@ void ui_todo_delete(void); void ui_todo_edit(void); void ui_todo_pipe(void); void ui_todo_draw(int, WINDOW *, int, int, void *); +enum listbox_row_type ui_todo_row_type(int, void *); int ui_todo_height(int, void *); void ui_todo_load_items(void); void ui_todo_sel_move(int); |