diff options
Diffstat (limited to 'AffinityPanel.c')
-rw-r--r-- | AffinityPanel.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/AffinityPanel.c b/AffinityPanel.c index 007b0590..bfd10e28 100644 --- a/AffinityPanel.c +++ b/AffinityPanel.c @@ -7,6 +7,23 @@ #include "debug.h" #include <assert.h> +static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) { + HandlerResult result = IGNORED; + CheckItem* selected = (CheckItem*) Panel_getSelected(this); + switch(ch) { + case ' ': + CheckItem_set(selected, ! (CheckItem_get(selected)) ); + result = HANDLED; + break; + case 0x0a: + case 0x0d: + case KEY_ENTER: + result = BREAK_LOOP; + break; + } + return result; +} + Panel* AffinityPanel_new(int processorCount, unsigned long mask) { Panel* this = Panel_new(1, 1, 1, 1, CHECKITEM_CLASS, true, ListItem_compare); this->eventHandler = AffinityPanel_eventHandler; @@ -29,20 +46,3 @@ unsigned long AffinityPanel_getAffinity(Panel* this) { } return mask; } - -HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) { - HandlerResult result = IGNORED; - CheckItem* selected = (CheckItem*) Panel_getSelected(this); - switch(ch) { - case ' ': - CheckItem_set(selected, ! (CheckItem_get(selected)) ); - result = HANDLED; - break; - case 0x0a: - case 0x0d: - case KEY_ENTER: - result = BREAK_LOOP; - break; - } - return result; -} |