aboutsummaryrefslogtreecommitdiffstats
path: root/CategoriesPanel.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:33 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:33 +0200
commitf75ab6d2c11e8a8e18191b087564aedebbeb96c5 (patch)
tree2a046e11678e798f3f9c7f7af4f9ac205c8d2731 /CategoriesPanel.c
parent2004bbc3ef28ada3acca05f5d5fa9108121a6784 (diff)
downloaddebian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.tar.gz
debian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.tar.bz2
debian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.zip
Imported Upstream version 1.0.3upstream/1.0.3
Diffstat (limited to 'CategoriesPanel.c')
-rw-r--r--CategoriesPanel.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/CategoriesPanel.c b/CategoriesPanel.c
index 0114ae4..bf6ee54 100644
--- a/CategoriesPanel.c
+++ b/CategoriesPanel.c
@@ -101,6 +101,12 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
result = HANDLED;
break;
}
+ default:
+ if (isalpha(ch))
+ result = Panel_selectByTyping(super, ch);
+ if (result == BREAK_LOOP)
+ result = IGNORED;
+ break;
}
if (result == HANDLED) {
@@ -126,15 +132,21 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
return result;
}
+PanelClass CategoriesPanel_class = {
+ .super = {
+ .extends = Class(Panel),
+ .delete = CategoriesPanel_delete
+ },
+ .eventHandler = CategoriesPanel_eventHandler
+};
+
CategoriesPanel* CategoriesPanel_new(Settings* settings, ScreenManager* scr) {
- CategoriesPanel* this = (CategoriesPanel*) malloc(sizeof(CategoriesPanel));
+ CategoriesPanel* this = AllocThis(CategoriesPanel);
Panel* super = (Panel*) this;
- Panel_init(super, 1, 1, 1, 1, LISTITEM_CLASS, true);
- ((Object*)this)->delete = CategoriesPanel_delete;
+ Panel_init(super, 1, 1, 1, 1, Class(ListItem), true);
this->settings = settings;
this->scr = scr;
- super->eventHandler = CategoriesPanel_eventHandler;
Panel_setHeader(super, "Setup");
Panel_add(super, (Object*) ListItem_new("Meters", 0));
Panel_add(super, (Object*) ListItem_new("Display options", 0));

© 2014-2024 Faster IT GmbH | imprint | privacy policy