This commit is contained in:
kraus 2022-01-07 13:08:33 +01:00
parent 20cff60c05
commit 27bc978e7f
7 changed files with 375 additions and 32 deletions

View File

@ -60,8 +60,8 @@ class MUIU8G2
uint8_t getCurrentCursorFocusPosition(void) { return mui_GetCurrentCursorFocusPosition(&mui); }
void draw(void) { mui_Draw(&mui); }
void getSelectableFieldTextOption(uint8_t form_id, uint8_t cursor_position, uint8_t nth_token)
{ mui_GetSelectableFieldTextOption(&mui, form_id, cursor_position, nth_token); }
//void getSelectableFieldTextOption(fds_t *fds, uint8_t nth_token)
// { mui_GetSelectableFieldTextOption(&mui, fds, nth_token); }
void enterForm(fds_t *fds, uint8_t initial_cursor_position) { mui_EnterForm(&mui, fds, initial_cursor_position); }
void leaveForm(void) { mui_LeaveForm(&mui); }
uint8_t gotoForm(uint8_t form_id, uint8_t initial_cursor_position) { return mui_GotoForm(&mui, form_id, initial_cursor_position); }

View File

@ -596,7 +596,6 @@ uint8_t mui_u8g2_btn_goto_w1_fi(mui_t *ui, uint8_t msg)
/*===============================================================================*/
static void mui_u8g2_u8_vmm_draw_wm_pi(mui_t *ui) MUI_NOINLINE;
static void mui_u8g2_u8_vmm_draw_wm_pi(mui_t *ui)
{
@ -822,6 +821,233 @@ uint8_t mui_u8g2_u8_min_max_wm_mud_pf(mui_t *ui, uint8_t msg)
}
/*===============================================================================*/
static void mui_u8g2_u8_bar_draw_wm(mui_t *ui, uint8_t flags) MUI_NOINLINE;
static void mui_u8g2_u8_bar_draw_wm(mui_t *ui, uint8_t flags)
{
u8g2_t *u8g2 = mui_get_U8g2(ui);
mui_u8g2_u8_min_max_step_t *vmms= (mui_u8g2_u8_min_max_step_t *)muif_get_data(ui->uif);
char *s = "999";
uint8_t *value = mui_u8g2_u8mms_get_valptr(vmms);
uint8_t min = mui_u8g2_u8mms_get_min(vmms);
uint8_t max = mui_u8g2_u8mms_get_max(vmms);
uint8_t scale = 0;
//uint8_t step = mui_u8g2_u8mms_get_step(vmms);
uint8_t mms_flags = mui_u8g2_u8mms_get_flags(vmms);
uint8_t cnt = 3;
uint8_t height = u8g2_GetAscent(u8g2);
int8_t backup_descent;
u8g2_uint_t x = mui_get_x(ui);
u8g2_uint_t w = 0;
if ( mms_flags & MUI_MMS_2X_BAR )
scale |= 1;
if ( mms_flags & MUI_MMS_4X_BAR )
scale |= 2;
if ( *value > max )
*value = max;
if ( *value <= min )
*value = min;
if ( max < 100 )
{
s++;
cnt--;
}
if ( max < 10 )
{
s++;
cnt--;
}
//mui_u8g2_draw_button_utf(ui, mui_u8g2_get_pi_flags(ui), u8g2_GetStrWidth(u8g2, s)+1, 1, MUI_U8G2_V_PADDING, u8x8_u8toa(*value, cnt));
//mui_u8g2_draw_button_pi(ui, u8g2_GetStrWidth(u8g2, s)+1, 1, u8x8_u8toa(*value, cnt));
w += (max<<scale)+2;
u8g2_DrawFrame( u8g2, x, mui_get_y(ui)-height, w, height);
u8g2_DrawBox( u8g2, x+1, mui_get_y(ui)-height+1, (*value)<<scale, height-2);
if ( mms_flags & MUI_MMS_SHOW_VALUE )
{
w += 2;
u8g2_DrawStr(u8g2, x+w, mui_get_y(ui), u8x8_u8toa(*value, cnt) );
w += u8g2_GetStrWidth(u8g2, s);
w += 1;
}
backup_descent = u8g2->font_ref_descent;
u8g2->font_ref_descent = 0; /* hmm... that's a low level hack so that DrawButtonFrame ignores the descent value of the font */
u8g2_DrawButtonFrame(u8g2, x, mui_get_y(ui), flags, w, 1, 1);
u8g2->font_ref_descent = backup_descent;
}
uint8_t mui_u8g2_u8_bar_wm_mse_pi(mui_t *ui, uint8_t msg)
{
mui_u8g2_u8_min_max_step_t *vmms= (mui_u8g2_u8_min_max_step_t *)muif_get_data(ui->uif);
uint8_t *value = mui_u8g2_u8mms_get_valptr(vmms);
uint8_t min = mui_u8g2_u8mms_get_min(vmms);
uint8_t max = mui_u8g2_u8mms_get_max(vmms);
uint8_t step = mui_u8g2_u8mms_get_step(vmms);
switch(msg)
{
case MUIF_MSG_DRAW:
mui_u8g2_u8_bar_draw_wm(ui, mui_u8g2_get_pi_flags(ui));
break;
case MUIF_MSG_FORM_START:
break;
case MUIF_MSG_FORM_END:
break;
case MUIF_MSG_CURSOR_ENTER:
break;
case MUIF_MSG_CURSOR_SELECT:
(*value)+=step;
if ( *value > max ) *value = min;
break;
case MUIF_MSG_CURSOR_LEAVE:
break;
case MUIF_MSG_TOUCH_DOWN:
break;
case MUIF_MSG_TOUCH_UP:
break;
}
return 0;
}
uint8_t mui_u8g2_u8_bar_wm_mud_pi(mui_t *ui, uint8_t msg)
{
mui_u8g2_u8_min_max_step_t *vmms= (mui_u8g2_u8_min_max_step_t *)muif_get_data(ui->uif);
uint8_t *value = mui_u8g2_u8mms_get_valptr(vmms);
uint8_t min = mui_u8g2_u8mms_get_min(vmms);
uint8_t max = mui_u8g2_u8mms_get_max(vmms);
uint8_t step = mui_u8g2_u8mms_get_step(vmms);
switch(msg)
{
case MUIF_MSG_DRAW:
mui_u8g2_u8_bar_draw_wm(ui, mui_u8g2_get_pi_flags(ui));
break;
case MUIF_MSG_FORM_START:
break;
case MUIF_MSG_FORM_END:
break;
case MUIF_MSG_CURSOR_ENTER:
break;
case MUIF_MSG_CURSOR_SELECT:
/* toggle between normal mode and capture next/prev mode */
ui->is_mud = !ui->is_mud;
break;
case MUIF_MSG_CURSOR_LEAVE:
break;
case MUIF_MSG_TOUCH_DOWN:
break;
case MUIF_MSG_TOUCH_UP:
break;
case MUIF_MSG_EVENT_NEXT:
if ( ui->is_mud )
{
(*value)+=step;
if ( *value > max )
*value = min;
return 1;
}
break;
case MUIF_MSG_EVENT_PREV:
if ( ui->is_mud )
{
if ( *value <= min || *value > max)
*value = max;
else
(*value)-=step;
return 1;
}
break;
}
return 0;
}
uint8_t mui_u8g2_u8_bar_wm_mse_pf(mui_t *ui, uint8_t msg)
{
mui_u8g2_u8_min_max_step_t *vmms= (mui_u8g2_u8_min_max_step_t *)muif_get_data(ui->uif);
uint8_t *value = mui_u8g2_u8mms_get_valptr(vmms);
uint8_t min = mui_u8g2_u8mms_get_min(vmms);
uint8_t max = mui_u8g2_u8mms_get_max(vmms);
uint8_t step = mui_u8g2_u8mms_get_step(vmms);
switch(msg)
{
case MUIF_MSG_DRAW:
mui_u8g2_u8_bar_draw_wm(ui, mui_u8g2_get_pf_flags(ui));
break;
case MUIF_MSG_FORM_START:
break;
case MUIF_MSG_FORM_END:
break;
case MUIF_MSG_CURSOR_ENTER:
break;
case MUIF_MSG_CURSOR_SELECT:
(*value)+=step;
if ( *value > max ) *value = min;
break;
case MUIF_MSG_CURSOR_LEAVE:
break;
case MUIF_MSG_TOUCH_DOWN:
break;
case MUIF_MSG_TOUCH_UP:
break;
}
return 0;
}
uint8_t mui_u8g2_u8_bar_wm_mud_pf(mui_t *ui, uint8_t msg)
{
mui_u8g2_u8_min_max_step_t *vmms= (mui_u8g2_u8_min_max_step_t *)muif_get_data(ui->uif);
uint8_t *value = mui_u8g2_u8mms_get_valptr(vmms);
uint8_t min = mui_u8g2_u8mms_get_min(vmms);
uint8_t max = mui_u8g2_u8mms_get_max(vmms);
uint8_t step = mui_u8g2_u8mms_get_step(vmms);
switch(msg)
{
case MUIF_MSG_DRAW:
mui_u8g2_u8_bar_draw_wm(ui, mui_u8g2_get_pf_flags(ui));
break;
case MUIF_MSG_FORM_START:
break;
case MUIF_MSG_FORM_END:
break;
case MUIF_MSG_CURSOR_ENTER:
break;
case MUIF_MSG_CURSOR_SELECT:
/* toggle between normal mode and capture next/prev mode */
ui->is_mud = !ui->is_mud;
break;
case MUIF_MSG_CURSOR_LEAVE:
break;
case MUIF_MSG_TOUCH_DOWN:
break;
case MUIF_MSG_TOUCH_UP:
break;
case MUIF_MSG_EVENT_NEXT:
if ( ui->is_mud )
{
(*value)+=step;
if ( *value > max )
*value = min;
return 1;
}
break;
case MUIF_MSG_EVENT_PREV:
if ( ui->is_mud )
{
if ( *value <= min || *value > max)
*value = max;
else
(*value)-=step;
return 1;
}
break;
}
return 0;
}
/*===============================================================================*/
static uint8_t mui_is_valid_char(uint8_t c) MUI_NOINLINE;

View File

@ -96,6 +96,32 @@ typedef const struct mui_u8g2_u8_min_max_struct mui_u8g2_u8_min_max_t;
#endif
struct mui_u8g2_u8_min_max_step_struct
{
uint8_t *value;
uint8_t min;
uint8_t max;
uint8_t step;
uint8_t flags;
} MUI_PROGMEM;
typedef const struct mui_u8g2_u8_min_max_step_struct mui_u8g2_u8_min_max_step_t;
#if defined(__GNUC__) && defined(__AVR__)
# define mui_u8g2_u8mms_get_step(u8mm) mui_pgm_read(&((u8mm)->step))
# define mui_u8g2_u8mms_get_flags(u8mm) mui_pgm_read(&((u8mm)->flags))
# define mui_u8g2_u8mms_get_min(u8mm) mui_pgm_read(&((u8mm)->min))
# define mui_u8g2_u8mms_get_max(u8mm) mui_pgm_read(&((u8mm)->max))
# define mui_u8g2_u8mms_get_valptr(u8mm) ((uint8_t *)mui_pgm_wread(&((u8mm)->value)))
#else
# define mui_u8g2_u8mms_get_step(u8mm) ((u8mm)->step)
# define mui_u8g2_u8mms_get_flags(u8mm) ((u8mm)->flags)
# define mui_u8g2_u8mms_get_min(u8mm) ((u8mm)->min)
# define mui_u8g2_u8mms_get_max(u8mm) ((u8mm)->max)
# define mui_u8g2_u8mms_get_valptr(u8mm) ((u8mm)->value)
#endif
/* helper functions */
u8g2_uint_t mui_get_x(mui_t *ui);
@ -142,11 +168,11 @@ uint8_t mui_u8g2_u8_opt_child_wm_mse_pi(mui_t *ui, uint8_t msg);
//uint8_t mui_u8g2_goto_parent(mui_t *ui, uint8_t msg); /* MUIF_RO, MUI_DATA (WARNING: Must appear only once per form!!! */
// renamed to
uint8_t mui_u8g2_goto_data(mui_t *ui, uint8_t msg); /* MUIF_RO, MUI_DATA (WARNING: Must appear only once per form!!! */
uint8_t mui_u8g2_goto_data(mui_t *ui, uint8_t msg); /* REF, MUIF_RO, MUI_DATA (WARNING: Must appear only once per form!!! */
//uint8_t mui_u8g2_goto_child_w1_mse_pi(mui_t *ui, uint8_t msg); /* MUIF_BUTTON, MUI_XYA */
// renamed to
uint8_t mui_u8g2_goto_form_w1_mse_pi(mui_t *ui, uint8_t msg); /* MUIF_BUTTON, MUI_XYA */
uint8_t mui_u8g2_goto_form_w1_mse_pf(mui_t *ui, uint8_t msg); /* MUIF_BUTTON, MUI_XYA */
uint8_t mui_u8g2_goto_form_w1_mse_pi(mui_t *ui, uint8_t msg); /* REF, MUIF_BUTTON, MUI_XYA */
uint8_t mui_u8g2_goto_form_w1_mse_pf(mui_t *ui, uint8_t msg); /* REF, MUIF_BUTTON, MUI_XYA */
uint8_t mui_u8g2_u8_char_wm_mud_pi(mui_t *ui, uint8_t msg); /* GIF, MUIF_VARIABLE,MUI_XY, usually requires a monospaced font line profont12 */
@ -166,6 +192,23 @@ uint8_t mui_u8g2_u8_min_max_wm_mud_pi(mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G
uint8_t mui_u8g2_u8_min_max_wm_mse_pf(mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U8_MIN_MAX, MUI_XY */
uint8_t mui_u8g2_u8_min_max_wm_mud_pf(mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U8_MIN_MAX, MUI_XY */
/*===== data = mui_u8g2_u8_min_max_step_t* =====*/
/* gcc note: the macro uses array compound literals to extend the lifetime in C++, see last section in https://gcc.gnu.org/onlinedocs/gcc/Compound-Literals.html */
#define MUIF_U8G2_U8_MIN_MAX_STEP(id, valptr, min, max, step, flags, muif) \
MUIF(id, MUIF_CFLAG_IS_CURSOR_SELECTABLE, \
(void *)((mui_u8g2_u8_min_max_step_t [] ) {{ (valptr) MUI_U8G2_COMMA (min) MUI_U8G2_COMMA (max) MUI_U8G2_COMMA (step) MUI_U8G2_COMMA (flags) }}), \
(muif))
#define MUI_MMS_2X_BAR 0x01
#define MUI_MMS_4X_BAR 0x02
#define MUI_MMS_SHOW_VALUE 0x04
uint8_t mui_u8g2_u8_bar_wm_mse_pi(mui_t *ui, uint8_t msg);
uint8_t mui_u8g2_u8_bar_wm_mud_pi(mui_t *ui, uint8_t msg);
uint8_t mui_u8g2_u8_bar_wm_mse_pf(mui_t *ui, uint8_t msg);
uint8_t mui_u8g2_u8_bar_wm_mud_pf(mui_t *ui, uint8_t msg);
/*===== data = mui_u8g2_list_t* =====*/
/* similar to mui_u8g2_u8_opt_line, but u16 and dynamic list */
@ -175,14 +218,14 @@ uint8_t mui_u8g2_u8_min_max_wm_mud_pf(mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G
(void *)((mui_u8g2_list_t [] ) {{ (valptr) MUI_U8G2_COMMA (dataptr) MUI_U8G2_COMMA (getcb) MUI_U8G2_COMMA (cntcb)}}), \
(muif))
uint8_t mui_u8g2_u16_list_line_wa_mse_pi(mui_t *ui, uint8_t msg); /* MUIF_U8G2_U16_LIST, MUI_XYA, arg=pixel fieldsize */
uint8_t mui_u8g2_u16_list_line_wa_mud_pi(mui_t *ui, uint8_t msg); /* MUIF_U8G2_U16_LIST, MUI_XYA, arg=pixel fieldsize */
uint8_t mui_u8g2_u16_list_line_wa_mse_pi(mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U16_LIST, MUI_XYA, arg=pixel fieldsize */
uint8_t mui_u8g2_u16_list_line_wa_mud_pi(mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U16_LIST, MUI_XYA, arg=pixel fieldsize */
uint8_t mui_u8g2_u16_list_parent_wm_mse_pi(mui_t *ui, uint8_t msg); /* MUIF_U8G2_U16_LIST, MUI_XYA, arg=subform */
uint8_t mui_u8g2_u16_list_child_w1_mse_pi(mui_t *ui, uint8_t msg); /* MUIF_U8G2_U16_LIST, MUI_XYA, arg=sub element number */
uint8_t mui_u8g2_u16_list_parent_wm_mse_pi(mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U16_LIST, MUI_XYA, arg=subform */
uint8_t mui_u8g2_u16_list_child_w1_mse_pi(mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U16_LIST, MUI_XYA, arg=sub element number */
uint8_t mui_u8g2_u16_list_goto_w1_mse_pi(mui_t *ui, uint8_t msg); /* MUIF_U8G2_U16_LIST first char of the string denotes the target form */
uint8_t mui_u8g2_u16_list_goto_w1_mse_pi(mui_t *ui, uint8_t msg); /* REF, MUIF_U8G2_U16_LIST first char of the string denotes the target form */
#ifdef __cplusplus

View File

@ -145,7 +145,7 @@
//U8G2_LD7032_60X32_ALT_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* cs=*/ 9, /* dc=*/ 10, /* reset=*/ 8); // SW SPI Nano Board
//U8G2_LD7032_60X32_ALT_1_4W_SW_I2C u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* reset=*/ U8X8_PIN_NONE); // NOT TESTED!
//U8G2_UC1701_EA_DOGS102_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_UC1701_EA_DOGS102_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
U8G2_UC1701_EA_DOGS102_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_PCD8544_84X48_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display
//U8G2_PCD8544_84X48_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display
//U8G2_PCF8812_96X65_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814
@ -316,7 +316,7 @@ MUIU8G2 mui;
uint8_t number_input = 2; // variable where the user can input a number between 0 and 9
uint8_t exit_code = 0; // return value from the menu system
extern "C" uint8_t mui_style_helv_r_08(mui_t *ui, uint8_t msg)
uint8_t mui_style_helv_r_08(mui_t *ui, uint8_t msg)
{
u8g2_t *u8g2 = mui_get_U8g2(ui);
switch(msg)
@ -348,18 +348,18 @@ extern "C" uint8_t mui_style_helv_r_08(mui_t *ui, uint8_t msg)
*/
muif_t muif_list[] MUI_PROGMEM = {
muif_t muif_list[] = {
/* normal text style */
MUIF("S0",0,0,mui_style_helv_r_08),
MUIF_STYLE(0, mui_style_helv_r_08),
/* Leave the menu system */
MUIF("LV",MUIF_CFLAG_IS_CURSOR_SELECTABLE,&exit_code,mui_u8g2_btn_exit_wm_fi),
MUIF_VARIABLE("LV",&exit_code,mui_u8g2_btn_exit_wm_fi),
/* input for a number between 0 to 9 */
MUIF("IN",MUIF_CFLAG_IS_CURSOR_SELECTABLE,&number_input,mui_u8g2_u8_value_0_9_wm_mse_pi),
MUIF_U8G2_U8_MIN_MAX("IN", &number_input, 0, 9, mui_u8g2_u8_min_max_wm_mse_pi),
/* MUI_LABEL uses the fixed ".L" id and is used to place read only text on a form */
MUIF(".L",0,0,mui_u8g2_draw_text)
/* MUI_LABEL is used to place fixed text on the screeen */
MUIF_LABEL(mui_u8g2_draw_text)
};
/*
@ -371,13 +371,8 @@ muif_t muif_list[] MUI_PROGMEM = {
MUI_XYT(id, x, y, text) Field 'id' with the specified test at position xy
MUI_XYA(id, x, y, a) Field 'id' with argument 'a' at position xy
MUI_XYAT(id, x, y, a, text) Field 'id' with argument and text placed at position xy
MUI_LABEL(x,y,text) Field '.L' (usually some readonly text) placed at position xy
MUI_GOTO(x,y,n,text) Field '.G', usually a button placed at xy, which activates form n
MUI_LABEL(x,y,text) Place "text" on the form. Can be used only if "MUIF_LABEL(mui_u8g2_draw_text)" is available in MUIF table.
Note:
MUI_LABEL(x,y,text) is the same as MUI_XYT(".L", x, y, text)
MUI_GOTO(x,y,text) is the same as MUI_XYAT(".G", x, y, n, text)
*/

View File

@ -147,7 +147,7 @@
//U8G2_LD7032_60X32_ALT_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* cs=*/ 9, /* dc=*/ 10, /* reset=*/ 8); // SW SPI Nano Board
//U8G2_LD7032_60X32_ALT_1_4W_SW_I2C u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* reset=*/ U8X8_PIN_NONE); // NOT TESTED!
//U8G2_UC1701_EA_DOGS102_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_UC1701_EA_DOGS102_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
U8G2_UC1701_EA_DOGS102_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_PCD8544_84X48_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display
//U8G2_PCD8544_84X48_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display
//U8G2_PCF8812_96X65_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814
@ -308,11 +308,11 @@
MUIU8G2 mui;
muif_t muif_list[] MUI_PROGMEM = {
MUIF("BN", MUIF_CFLAG_IS_CURSOR_SELECTABLE, 0, mui_u8g2_btn_exit_wm_fi),
muif_t muif_list[] = {
MUIF_VARIABLE("BN", NULL, mui_u8g2_btn_exit_wm_fi)
};
fds_t fds_data[] MUI_PROGMEM =
fds_t fds_data[] =
MUI_FORM(1)
MUI_XYT("BN",64, 30, " Select Me ")
;

View File

@ -320,6 +320,13 @@ muif_t muif_list[] MUI_PROGMEM = {
MUIF_U8G2_U16_LIST("AP", &list_selection_3, NULL, animals_get_str, animals_get_cnt, mui_u8g2_u16_list_parent_wm_mse_pi),
MUIF_U8G2_U16_LIST("AC", &list_selection_3, NULL, animals_get_str, animals_get_cnt, mui_u8g2_u16_list_child_w1_mse_pi),
/* Form 90: bar */
MUIF_U8G2_U8_MIN_MAX_STEP("B0", &number_input9, 0, 20, 2, MUI_MMS_2X_BAR|MUI_MMS_SHOW_VALUE, mui_u8g2_u8_bar_wm_mse_pi),
MUIF_U8G2_U8_MIN_MAX_STEP("B1", &number_input9, 0, 20, 2, MUI_MMS_2X_BAR|MUI_MMS_SHOW_VALUE, mui_u8g2_u8_bar_wm_mud_pi),
MUIF_U8G2_U8_MIN_MAX_STEP("B2", &number_input9, 0, 20, 2, MUI_MMS_2X_BAR|MUI_MMS_SHOW_VALUE, mui_u8g2_u8_bar_wm_mse_pf),
MUIF_U8G2_U8_MIN_MAX_STEP("B3", &number_input9, 0, 20, 2, MUI_MMS_2X_BAR|MUI_MMS_SHOW_VALUE, mui_u8g2_u8_bar_wm_mud_pf),
};
@ -339,6 +346,7 @@ MUI_DATA("GP",
MUI_60 "uint8 Char/Text Input|"
MUI_70 "uint16 Cycle Options|"
MUI_80 "uint16 ParentChild Select|"
MUI_90 "uint8 Bar Graph|"
MUI_18 "Parent/Child List|"
MUI_20 "Array Edit")
MUI_XYA("GC", 5, 25, 0)
@ -770,7 +778,7 @@ MUI_LABEL(1,25, "Parent: Show selected option")
MUI_XY("HR", 0,26)
MUI_STYLE(0)
MUI_LABEL(5,40, "Animal:")
MUI_XYA("AP",50, 40, 82) /* jump to sub form 19 */
MUI_XYA("AP",50, 40, 82) /* jump to sub form 82 */
MUI_GOTO(64, 59, 80, " Ok ")
MUI_FORM(82)
@ -786,6 +794,70 @@ MUI_XYA("AC", 5, 49, 1)
MUI_XYA("AC", 5, 60, 2)
MUI_FORM(90)
MUI_STYLE(1)
MUI_LABEL(5,10, "uint8 Bar Graph")
MUI_XY("HR", 0,13)
MUI_STYLE(7)
MUI_DATA("GP",
MUI_91 "u8_bar_wm_mse_pi|"
MUI_92 "u8_bar_wm_mud_pi|"
MUI_93 "u8_bar_wm_mse_pf|"
MUI_94 "u8_bar_wm_mud_pf|"
MUI_1 "Back to Main Menu" )
MUI_XYA("GC", 5, 25, 0)
MUI_XYA("GC", 5, 37, 1)
MUI_XYA("GC", 5, 49, 2)
MUI_XYA("GC", 5, 61, 3)
MUI_FORM(91)
MUI_STYLE(2)
MUI_LABEL(1,5, "mui_u8g2_u8_bar_wm_mse_pi")
MUI_LABEL(1,12, "MUIF_U8G2_U8_MIN_MAX_STEP")
MUI_LABEL(1,19, "MUI_XY")
MUI_LABEL(1,25, "uint8_t bar graph input")
MUI_XY("HR", 0,26)
MUI_STYLE(0)
MUI_LABEL(1,40, "Bar: ")
MUI_XY("B0",40, 40)
MUI_GOTO(64, 59, 90, " Ok ")
MUI_FORM(92)
MUI_STYLE(2)
MUI_LABEL(1,5, "mui_u8g2_u8_bar_wm_mud_pi")
MUI_LABEL(1,12, "MUIF_U8G2_U8_MIN_MAX_STEP")
MUI_LABEL(1,19, "MUI_XY")
MUI_LABEL(1,25, "uint8_t bar graph input")
MUI_XY("HR", 0,26)
MUI_STYLE(0)
MUI_LABEL(1,40, "Bar: ")
MUI_XY("B1",40, 40)
MUI_GOTO(64, 59, 90, " Ok ")
MUI_FORM(93)
MUI_STYLE(2)
MUI_LABEL(1,5, "mui_u8g2_u8_bar_wm_mse_pf")
MUI_LABEL(1,12, "MUIF_U8G2_U8_MIN_MAX_STEP")
MUI_LABEL(1,19, "MUI_XY")
MUI_LABEL(1,25, "uint8_t bar graph input")
MUI_XY("HR", 0,26)
MUI_STYLE(0)
MUI_LABEL(1,40, "Bar: ")
MUI_XY("B2",40, 40)
MUI_GOTO(64, 59, 90, " Ok ")
MUI_FORM(94)
MUI_STYLE(2)
MUI_LABEL(1,5, "mui_u8g2_u8_bar_wm_mud_pf")
MUI_LABEL(1,12, "MUIF_U8G2_U8_MIN_MAX_STEP")
MUI_LABEL(1,19, "MUI_XY")
MUI_LABEL(1,25, "uint8_t bar graph input")
MUI_XY("HR", 0,26)
MUI_STYLE(0)
MUI_LABEL(1,40, "Bar: ")
MUI_XY("B3",40, 40)
MUI_GOTO(64, 59, 90, " Ok ")
;
@ -925,7 +997,7 @@ int main(void)
mui_Init(&ui, &u8g2, fds, muif_list, sizeof(muif_list)/sizeof(muif_t));
mui_GotoForm(&ui, 1, 0);
//draw(1, "", ""); return 0;
draw(1, "", ""); return 0;
/*
@ -940,10 +1012,13 @@ int main(void)
draw(40, "asnnssnsnssppsnsnnsnnsssnsnnnssnnsns.q", "mui_u8g2_u8_opt_line_wa.gif");
draw(50, "assnnnnsnnspppsnsnssnnnsnnsnnnnnnnsns.q", "mui_u8g2_u8_opt_parent.gif");
draw(60, "assppppppsnsnnnnnnnnnsnsppppppppppppppppppppsnsnnnsns.q", "mui_u8g2_u8_char_wm_mud_pi.gif");
draw(70, "assssssnsnssnnnnnnsnnspsns.q", "mui_u8g2_u16_list_line.gif");
draw(80, "assnnssnnnssoppppppnsns.q", "mui_u8g2_u16_list_child.gif");
*/
draw(70, "assssssnsnssnnnnnnsnnspsns.q", "mui_u8g2_u16_list_line.gif");
draw(90, "assssnsnssnnpsnsnnsssnnsnsnnnsspppnsns.q", "mui_u8g2_u8_bar.gif");

View File

@ -86,6 +86,10 @@ dseg14cr: bdfconv
emoticons21: bdfconv
./bdfconv -v -f 1 -m '32-64' ../emoticons/emoticons21.bdf -o emoticons21.c -n u8g2_font_emoticons21_tn -d ../bdf/helvB18.bdf
mmmicons: bdfconv
./bdfconv -v -f 1 -m '32-700' mmmicons.bdf -o mmmicons.c -n u8g2_font_mmmicons -d ../bdf/helvB18.bdf
convert bdf.tga -trim mmmicons.png
ded: bdfconv
./bdfconv -v -b 0 -f 1 ./F16_DED.bdf -o ded.c -n ded -d ../bdf/helvB12.bdf