This radically slows down auto-incrementing (when the change button is kept pressed) of values when user reaches the maximum (last) allowed option. The scrollbar thumb is blinking to indicate to the user that the next keypress will wraparound (unless this value was already active prior to entering menu). Fixes #536.
35 lines
813 B
C++
35 lines
813 B
C++
/*
|
|
* gui.h
|
|
*
|
|
* Created on: 3Sep.,2017
|
|
* Author: Ben V. Brown
|
|
*/
|
|
|
|
#ifndef GUI_HPP_
|
|
#define GUI_HPP_
|
|
#include "Translation.h"
|
|
#include "Settings.h"
|
|
#include "BSP.h"
|
|
|
|
#define PRESS_ACCEL_STEP 30
|
|
#define PRESS_ACCEL_INTERVAL_MIN 100
|
|
#define PRESS_ACCEL_INTERVAL_MAX 300
|
|
|
|
//GUI holds the menu structure and all its methods for the menu itself
|
|
|
|
//Declarations for all the methods for the settings menu (at end of this file)
|
|
|
|
//Struct for holding the function pointers and descriptions
|
|
typedef struct {
|
|
const char *description;
|
|
// return true if increment reached the maximum value
|
|
bool (* const incrementHandler)(void);
|
|
void (* const draw)(void);
|
|
} menuitem;
|
|
|
|
void enterSettingsMenu();
|
|
void GUIDelay();
|
|
extern const menuitem rootSettingsMenu[];
|
|
|
|
#endif /* GUI_HPP_ */
|