Skip to content

Commit f2f71b1

Browse files
Add increment and decrement controls for numeric display options
Signed-off-by: Ahmed Abouzied <email@aabouzied.com>
1 parent ce27f83 commit f2f71b1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

DisplayOptionsPanel.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ in the source distribution for its full text.
2020
#include "ProvideCurses.h"
2121

2222

23-
static const char* const DisplayOptionsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};
23+
static const char* const DisplayOptionsFunctions[] = {"Select / Deselect ","Increment ", "Decrement ", "Done ", NULL};
24+
static const char* const DisplayOptionsKeys[] = {"Enter","+", "-", "F10", "Esc"};
25+
static const int DisplayOptionsEvents[] = {KEY_ENTER, '+', '-', KEY_F(10), 27};
2426

2527
static void DisplayOptionsPanel_delete(Object* object) {
2628
Panel* super = (Panel*) object;
@@ -90,7 +92,7 @@ const PanelClass DisplayOptionsPanel_class = {
9092
DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr) {
9193
DisplayOptionsPanel* this = AllocThis(DisplayOptionsPanel);
9294
Panel* super = (Panel*) this;
93-
FunctionBar* fuBar = FunctionBar_new(DisplayOptionsFunctions, NULL, NULL);
95+
FunctionBar* fuBar = FunctionBar_new(DisplayOptionsFunctions, DisplayOptionsKeys, DisplayOptionsEvents);
9496
Panel_init(super, 1, 1, 1, 1, Class(OptionItem), true, fuBar);
9597

9698
this->settings = settings;

0 commit comments

Comments
 (0)