simplify code

This commit is contained in:
Hisham Muhammad 2011-11-05 04:42:15 +00:00
parent 9f29e92777
commit 539b32dc31
1 changed files with 3 additions and 6 deletions

View File

@ -8,21 +8,18 @@
#include <assert.h> #include <assert.h>
static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) { static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) {
HandlerResult result = IGNORED;
CheckItem* selected = (CheckItem*) Panel_getSelected(this); CheckItem* selected = (CheckItem*) Panel_getSelected(this);
switch(ch) { switch(ch) {
case KEY_MOUSE: case KEY_MOUSE:
case ' ': case ' ':
CheckItem_set(selected, ! (CheckItem_get(selected)) ); CheckItem_set(selected, ! (CheckItem_get(selected)) );
result = HANDLED; return HANDLED;
break;
case 0x0a: case 0x0a:
case 0x0d: case 0x0d:
case KEY_ENTER: case KEY_ENTER:
result = BREAK_LOOP; return BREAK_LOOP;
break;
} }
return result; return IGNORED;
} }
Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity) { Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity) {