diff options
author | Bartosz Fenski <fenio@debian.org> | 2005-12-29 13:22:07 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:19 +0200 |
commit | 73c04eaf1f6f01d0f8c15e8b70f68eda70bebc37 (patch) | |
tree | 054866c7de4fa4511c30658857f820724d686ec5 /ListBox.c | |
parent | 55a3aa9e6a59c1bf0248869d9f08e31ec4057c61 (diff) | |
parent | 266ab52b3a741a58fb17c48b0f7939d7c5d266de (diff) | |
download | debian_htop-73c04eaf1f6f01d0f8c15e8b70f68eda70bebc37.tar.gz debian_htop-73c04eaf1f6f01d0f8c15e8b70f68eda70bebc37.tar.bz2 debian_htop-73c04eaf1f6f01d0f8c15e8b70f68eda70bebc37.zip |
Imported Debian patch 0.6-1debian/0.6-1
Diffstat (limited to 'ListBox.c')
-rw-r--r-- | ListBox.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -30,7 +30,7 @@ typedef enum HandlerResult_ { BREAK_LOOP } HandlerResult; -typedef HandlerResult(*ListBox_eventHandler)(ListBox*, int); +typedef HandlerResult(*ListBox_EventHandler)(ListBox*, int); struct ListBox_ { Object super; @@ -42,7 +42,7 @@ struct ListBox_ { int oldSelected; bool needsRedraw; RichString header; - ListBox_eventHandler eventHandler; + ListBox_EventHandler eventHandler; }; extern char* LISTBOX_CLASS; @@ -96,7 +96,7 @@ void ListBox_done(ListBox* this) { TypedVector_delete(this->items); } -void ListBox_setHeader(ListBox* this, RichString header) { +inline void ListBox_setRichHeader(ListBox* this, RichString header) { assert (this != NULL); if (this->header.len > 0) { @@ -106,6 +106,14 @@ void ListBox_setHeader(ListBox* this, RichString header) { this->needsRedraw = true; } +inline void ListBox_setHeader(ListBox* this, char* header) { + ListBox_setRichHeader(this, RichString_quickString(CRT_colors[PANEL_HEADER_FOCUS], header)); +} + +void ListBox_setEventHandler(ListBox* this, ListBox_EventHandler eh) { + this->eventHandler = eh; +} + void ListBox_move(ListBox* this, int x, int y) { assert (this != NULL); @@ -141,6 +149,13 @@ void ListBox_add(ListBox* this, Object* o) { this->needsRedraw = true; } +void ListBox_insert(ListBox* this, int i, Object* o) { + assert (this != NULL); + + TypedVector_insert(this->items, i, o); + this->needsRedraw = true; +} + void ListBox_set(ListBox* this, int i, Object* o) { assert (this != NULL); |