ref man pics

This commit is contained in:
kraus 2021-09-21 22:43:01 +02:00
parent 1ba43d1a4d
commit e149ea90e7
4 changed files with 159 additions and 23 deletions

View File

@ -73,9 +73,9 @@
mui_u8g2_[action]_[field_width]_[edit_mode]_[style] mui_u8g2_[action]_[field_width]_[edit_mode]_[style]
mui _label_u8g2 --> mui_u8g2_draw_text mui _label_u8g2 --> mui_u8g2_draw_text
mui _goto_frame_button_invers_select_u8g2 --> mui_u8g2_btn_jmp_wm_fi mui _goto_frame_button_invers_select_u8g2 --> mui_u8g2_btn_goto_wm_fi
mui _goto_half_width_frame_button_invers_select_u8g2 --> mui_u8g2_btn_jmp_w2_fi mui _goto_half_width_frame_button_invers_select_u8g2 --> mui_u8g2_btn_goto_w2_fi
mui _goto_line_button_invers_select_u8g2 --> mui_u8g2_btn_jmp_w1_fi mui _goto_line_button_invers_select_u8g2 --> mui_u8g2_btn_goto_w1_fi
mui _leave_menu_frame_button_invers_select_u8g2 --> mui_u8g2_btn_exit_wm_fi mui _leave_menu_frame_button_invers_select_u8g2 --> mui_u8g2_btn_exit_wm_fi
mui _input_uint8_invers_select_u8g2 --> mui_u8g2_u8_value_0_9_wm_mse_pi mui _input_uint8_invers_select_u8g2 --> mui_u8g2_u8_value_0_9_wm_mse_pi
@ -402,7 +402,7 @@ uint8_t mui_u8g2_draw_text(mui_t *ui, uint8_t msg)
/* /*
uint8_t mui_u8g2_btn_jmp_wm_fi(mui_t *ui, uint8_t msg) uint8_t mui_u8g2_btn_goto_wm_fi(mui_t *ui, uint8_t msg)
Description: Description:
A button with size equal to button text plus one pixel padding A button with size equal to button text plus one pixel padding
@ -425,7 +425,7 @@ uint8_t mui_u8g2_draw_text(mui_t *ui, uint8_t msg)
text: Button label text: Button label
*/ */
uint8_t mui_u8g2_btn_jmp_wm_fi(mui_t *ui, uint8_t msg) uint8_t mui_u8g2_btn_goto_wm_fi(mui_t *ui, uint8_t msg)
{ {
switch(msg) switch(msg)
{ {
@ -437,7 +437,7 @@ uint8_t mui_u8g2_btn_jmp_wm_fi(mui_t *ui, uint8_t msg)
/* /*
uint8_t mui_u8g2_btn_jmp_w2_fi(mui_t *ui, uint8_t msg) uint8_t mui_u8g2_btn_goto_w2_fi(mui_t *ui, uint8_t msg)
Description: Description:
A button with size equal to display width / 2 - 10 pixel A button with size equal to display width / 2 - 10 pixel
@ -460,7 +460,7 @@ uint8_t mui_u8g2_btn_jmp_wm_fi(mui_t *ui, uint8_t msg)
text: Button label text: Button label
*/ */
uint8_t mui_u8g2_btn_jmp_w2_fi(mui_t *ui, uint8_t msg) uint8_t mui_u8g2_btn_goto_w2_fi(mui_t *ui, uint8_t msg)
{ {
switch(msg) switch(msg)
{ {
@ -516,7 +516,7 @@ uint8_t mui_u8g2_btn_exit_wm_fi(mui_t *ui, uint8_t msg)
/* /*
uint8_t mui_u8g2_btn_jmp_w1_pi(mui_t *ui, uint8_t msg) uint8_t mui_u8g2_btn_goto_w1_pi(mui_t *ui, uint8_t msg)
Description: Description:
A full line button (covers complete width of the display). A full line button (covers complete width of the display).
@ -539,7 +539,7 @@ uint8_t mui_u8g2_btn_exit_wm_fi(mui_t *ui, uint8_t msg)
*/ */
uint8_t mui_u8g2_btn_jmp_w1_pi(mui_t *ui, uint8_t msg) uint8_t mui_u8g2_btn_goto_w1_pi(mui_t *ui, uint8_t msg)
{ {
switch(msg) switch(msg)
{ {
@ -919,7 +919,7 @@ uint8_t mui_u8g2_u8_chkbox_wm_pi(mui_t *ui, uint8_t msg)
u8g2_DrawUTF8(u8g2, mui_get_x(ui)+a, mui_get_y(ui), ui->text); u8g2_DrawUTF8(u8g2, mui_get_x(ui)+a, mui_get_y(ui), ui->text);
} }
u8g2_DrawButtonFrame(u8g2, mui_get_x(ui), mui_get_y(ui), flags, w+a, 1, 1); u8g2_DrawButtonFrame(u8g2, mui_get_x(ui), mui_get_y(ui), flags, w+a, 1, MUI_U8G2_V_PADDING);
} }
break; break;
case MUIF_MSG_FORM_START: case MUIF_MSG_FORM_START:
@ -973,7 +973,7 @@ uint8_t mui_u8g2_u8_radio_wm_pi(mui_t *ui, uint8_t msg)
u8g2_DrawUTF8(u8g2, mui_get_x(ui)+a, mui_get_y(ui), ui->text); u8g2_DrawUTF8(u8g2, mui_get_x(ui)+a, mui_get_y(ui), ui->text);
} }
u8g2_DrawButtonFrame(u8g2, mui_get_x(ui), mui_get_y(ui), flags, w+a, 1, 1); u8g2_DrawButtonFrame(u8g2, mui_get_x(ui), mui_get_y(ui), flags, w+a, 1, MUI_U8G2_V_PADDING);
} }
break; break;
case MUIF_MSG_FORM_START: case MUIF_MSG_FORM_START:
@ -1131,7 +1131,7 @@ uint8_t mui_u8g2_u8_opt_radio_child_wm_mse_pi(mui_t *ui, uint8_t msg)
} }
if ( is_focus ) if ( is_focus )
{ {
u8g2_DrawButtonFrame(u8g2, x, y, U8G2_BTN_INV, w+a, 1, 1); u8g2_DrawButtonFrame(u8g2, x, y, U8G2_BTN_INV, w+a, 1, MUI_U8G2_V_PADDING);
} }
} }
break; break;
@ -1177,7 +1177,7 @@ uint8_t mui_u8g2_u8_opt_radio_child_w1_mse_pi(mui_t *ui, uint8_t msg)
} }
if ( is_focus ) if ( is_focus )
{ {
u8g2_DrawButtonFrame(u8g2, 0, y, U8G2_BTN_INV, u8g2_GetDisplayWidth(u8g2), 0, 1); u8g2_DrawButtonFrame(u8g2, 0, y, U8G2_BTN_INV, u8g2_GetDisplayWidth(u8g2), 0, MUI_U8G2_V_PADDING);
} }
} }
break; break;
@ -1431,9 +1431,7 @@ uint8_t mui_u8g2_u16_list_child_w1_mse_pi(mui_t *ui, uint8_t msg)
void *data = mui_u8g2_list_get_data_ptr(list); void *data = mui_u8g2_list_get_data_ptr(list);
mui_u8g2_get_list_element_cb element_cb = mui_u8g2_list_get_element_cb(list); mui_u8g2_get_list_element_cb element_cb = mui_u8g2_list_get_element_cb(list);
mui_u8g2_get_list_count_cb count_cb = mui_u8g2_list_get_count_cb(list); mui_u8g2_get_list_count_cb count_cb = mui_u8g2_list_get_count_cb(list);
uint16_t pos = ui->arg; // remember the arg value, because it might be overwritten uint16_t pos = ui->arg; // remember the arg value, because it might be overwritten
switch(msg) switch(msg)
{ {
case MUIF_MSG_DRAW: case MUIF_MSG_DRAW:
@ -1455,7 +1453,7 @@ uint8_t mui_u8g2_u16_list_child_w1_mse_pi(mui_t *ui, uint8_t msg)
u8g2_DrawUTF8(u8g2, x+a, y, element_cb(data, pos)); u8g2_DrawUTF8(u8g2, x+a, y, element_cb(data, pos));
if ( is_focus ) if ( is_focus )
{ {
u8g2_DrawButtonFrame(u8g2, 0, y, U8G2_BTN_INV, u8g2_GetDisplayWidth(u8g2), 0, 1); u8g2_DrawButtonFrame(u8g2, 0, y, U8G2_BTN_INV, u8g2_GetDisplayWidth(u8g2), 0, MUI_U8G2_V_PADDING);
} }
} }
break; break;
@ -1480,7 +1478,7 @@ uint8_t mui_u8g2_u16_list_goto_w1_mse_pi(mui_t *ui, uint8_t msg)
switch(msg) switch(msg)
{ {
case MUIF_MSG_DRAW: case MUIF_MSG_DRAW:
mui_u8g2_draw_button_utf(ui, mui_u8g2_get_draw_button_pi_flags(ui), u8g2_GetDisplayWidth(u8g2), 1, MUI_U8G2_V_PADDING, element_cb(data, pos)+1); mui_u8g2_draw_button_utf(ui, mui_u8g2_get_draw_button_pi_flags(ui), u8g2_GetDisplayWidth(u8g2)-mui_get_x(ui)*2, mui_get_x(ui), MUI_U8G2_V_PADDING, element_cb(data, pos)+1);
break; break;
case MUIF_MSG_CURSOR_SELECT: case MUIF_MSG_CURSOR_SELECT:
if ( selection != NULL ) if ( selection != NULL )

View File

@ -118,9 +118,9 @@ uint8_t mui_line_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
/* ready to use field functions */ /* ready to use field functions */
uint8_t mui_u8g2_draw_text(mui_t *ui, uint8_t msg); uint8_t mui_u8g2_draw_text(mui_t *ui, uint8_t msg);
uint8_t mui_u8g2_btn_jmp_wm_fi(mui_t *ui, uint8_t msg); uint8_t mui_u8g2_btn_goto_wm_fi(mui_t *ui, uint8_t msg);
uint8_t mui_u8g2_btn_jmp_w2_fi(mui_t *ui, uint8_t msg); uint8_t mui_u8g2_btn_goto_w2_fi(mui_t *ui, uint8_t msg);
uint8_t mui_u8g2_btn_jmp_w1_pi(mui_t *ui, uint8_t msg); uint8_t mui_u8g2_btn_goto_w1_pi(mui_t *ui, uint8_t msg);
uint8_t mui_u8g2_btn_exit_wm_fi(mui_t *ui, uint8_t msg); uint8_t mui_u8g2_btn_exit_wm_fi(mui_t *ui, uint8_t msg);

View File

@ -207,8 +207,8 @@ muif_t muif_list[] MUI_PROGMEM = {
MUIF_RO("HR", mui_hrule), MUIF_RO("HR", mui_hrule),
/* Goto Form Button where the width is equal to the size of the text, spaces can be used to extend the size */ /* Goto Form Button where the width is equal to the size of the text, spaces can be used to extend the size */
//MUIF("G1",MUIF_CFLAG_IS_CURSOR_SELECTABLE,0,mui_u8g2_btn_jmp_wm_fi), //MUIF("G1",MUIF_CFLAG_IS_CURSOR_SELECTABLE,0,mui_u8g2_btn_goto_wm_fi),
MUIF_BUTTON("G1", mui_u8g2_btn_jmp_wm_fi), MUIF_BUTTON("G1", mui_u8g2_btn_goto_wm_fi),
/* input for a number between 0 to 9 */ /* 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("IN",MUIF_CFLAG_IS_CURSOR_SELECTABLE,&number_input,mui_u8g2_u8_value_0_9_wm_mse_pi),
@ -264,7 +264,7 @@ muif_t muif_list[] MUI_PROGMEM = {
MUIF_U8G2_U16_LIST("LG", &list_selection4, NULL, menu_get_str, menu_get_cnt, mui_u8g2_u16_list_goto_w1_mse_pi), MUIF_U8G2_U16_LIST("LG", &list_selection4, NULL, menu_get_str, menu_get_cnt, mui_u8g2_u16_list_goto_w1_mse_pi),
/* MUI_GOTO uses the fixed ".G" id and is intended for goto buttons. This is a full display width style button */ /* MUI_GOTO uses the fixed ".G" id and is intended for goto buttons. This is a full display width style button */
MUIF_GOTO(mui_u8g2_btn_jmp_w1_pi), MUIF_GOTO(mui_u8g2_btn_goto_w1_pi),
/* MUI_LABEL uses the fixed ".L" id and is used to place read only text on a form */ /* 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), //MUIF(".L",0,0,mui_u8g2_draw_text),

View File

@ -656,6 +656,144 @@ int main(void)
u8g2_SetFontPosBaseline(&u8g2); u8g2_SetFontPosBaseline(&u8g2);
tga_save_png("u8g2_button3.png"); tga_save_png("u8g2_button3.png");
/*=========================================*/
/* u8g2_inv_button1.png */
u8x8_ClearDisplay(u8g2_GetU8x8(&desc));
u8g2_SetFont(&u8g2, u8g2_font_helvR08_tr);
{
char *s = "Btn";
u8g2_uint_t w = u8g2_GetStrWidth(&u8g2, s);
u8g2_uint_t h = u8g2_GetAscent(&u8g2)-u8g2_GetDescent(&u8g2);
u8g2_uint_t x = 62;
u8g2_uint_t y = 20;
u8g2_SetFontPosBaseline(&u8g2);
u8g2_FirstPage(&u8g2);
do
{
u8g2_DrawButtonUTF8(&u8g2, x, y, U8G2_BTN_INV, 0, 2, 2, s );
} while( u8g2_NextPage(&u8g2) );
tga_is_transparent = 1;
u8g2_FirstPage(&desc);
do
{
u8g2_SetFont(&desc, u8g2_font_helvB18_tf);
ra(x,y, "x=62, y=20");
u8g2_SetFont(&u8g2, u8g2_font_ncenB18_tf);
/* descent usually is negative */
vm(x-1+w+2+4,y-9+h+2-1+1, h+4);
hm(x-2, y-8+h+2+3, w+4);
//hm(x, y-8+h+2+3, w);
//ra(60,40, "x=60, y=40");
//vm(60+16+2,40+9-1, 9);
//hm(60, 40+9+1, 16);
//vm(62,19-u8g2_GetDescent(&u8g2), -u8g2_GetDescent(&u8g2));
} while( u8g2_NextPage(&desc) );
}
tga_is_transparent = 0;
u8g2_SetFontPosBaseline(&u8g2);
tga_save_png("u8g2_inv_button1.png");
/*=========================================*/
/* u8g2_inv_button2.png */
u8x8_ClearDisplay(u8g2_GetU8x8(&desc));
u8g2_SetFont(&u8g2, u8g2_font_helvR08_tr);
{
char *s = "Btn";
u8g2_uint_t w = u8g2_GetStrWidth(&u8g2, s);
u8g2_uint_t h = u8g2_GetAscent(&u8g2)-u8g2_GetDescent(&u8g2);
u8g2_uint_t x = 62;
u8g2_uint_t y = 20;
u8g2_SetFontPosBaseline(&u8g2);
u8g2_FirstPage(&u8g2);
do
{
u8g2_DrawButtonUTF8(&u8g2, x, y, U8G2_BTN_INV|U8G2_BTN_BW2, 0, 2, 2, s );
} while( u8g2_NextPage(&u8g2) );
tga_is_transparent = 1;
u8g2_FirstPage(&desc);
do
{
u8g2_SetFont(&desc, u8g2_font_helvB18_tf);
ra(x,y, "x=62, y=20");
u8g2_SetFont(&u8g2, u8g2_font_ncenB18_tf);
/* descent usually is negative */
vm(x-1+w+2+4,y-9+h+2-1+1, h+4);
hm(x-2, y-8+h+2+3, w+4);
//hm(x, y-8+h+2+3, w);
//ra(60,40, "x=60, y=40");
//vm(60+16+2,40+9-1, 9);
//hm(60, 40+9+1, 16);
//vm(62,19-u8g2_GetDescent(&u8g2), -u8g2_GetDescent(&u8g2));
} while( u8g2_NextPage(&desc) );
}
tga_is_transparent = 0;
u8g2_SetFontPosBaseline(&u8g2);
tga_save_png("u8g2_inv_button2.png");
/*=========================================*/
/* u8g2_inv_button3.png */
u8x8_ClearDisplay(u8g2_GetU8x8(&desc));
u8g2_SetFont(&u8g2, u8g2_font_helvR08_tr);
{
char *s = "Btn";
u8g2_uint_t w = u8g2_GetStrWidth(&u8g2, s);
u8g2_uint_t h = u8g2_GetAscent(&u8g2)-u8g2_GetDescent(&u8g2);
u8g2_uint_t x = 5;
u8g2_uint_t y = 20;
u8g2_SetFontPosBaseline(&u8g2);
u8g2_FirstPage(&u8g2);
do
{
u8g2_DrawButtonUTF8(&u8g2, x, y, U8G2_BTN_INV, u8g2_GetDisplayWidth(&u8g2)-x*2, x, 2, s );
} while( u8g2_NextPage(&u8g2) );
tga_is_transparent = 1;
u8g2_FirstPage(&desc);
do
{
u8g2_SetFont(&desc, u8g2_font_helvB18_tf);
ra(x,y, "x=5, y=20");
u8g2_SetFont(&u8g2, u8g2_font_ncenB18_tf);
/* descent usually is negative */
vm(x-1+w+2+4,y-9+h+2-1+1, h+4);
//hm(x-2, y-8+h+2+3, w+4);
//hm(x, y-8+h+2+3, w);
//ra(60,40, "x=60, y=40");
//vm(60+16+2,40+9-1, 9);
//hm(60, 40+9+1, 16);
//vm(62,19-u8g2_GetDescent(&u8g2), -u8g2_GetDescent(&u8g2));
} while( u8g2_NextPage(&desc) );
}
tga_is_transparent = 0;
u8g2_SetFontPosBaseline(&u8g2);
tga_save_png("u8g2_inv_button3.png");
/*=========================================*/ /*=========================================*/
/* u8g2_ellipse.png */ /* u8g2_ellipse.png */