fixed #20, user interface pictures

This commit is contained in:
olikraus 2016-06-19 15:08:41 +02:00
parent 6eb867aa6d
commit e42da7623d
6 changed files with 102 additions and 5 deletions

View File

@ -110,6 +110,9 @@ uint8_t u8g2_UserInterfaceInputValue(u8g2_t *u8g2, const char *title, const char
u8g2_DrawUTF8(u8g2, xx, yy, post);
} while( u8g2_NextPage(u8g2) );
#ifdef U8G2_REF_MAN_PIC
return 0;
#endif
for(;;)
{

View File

@ -164,6 +164,9 @@ uint8_t u8g2_UserInterfaceMessage(u8g2_t *u8g2, const char *title1, const char *
} while( u8g2_NextPage(u8g2) );
#ifdef U8G2_REF_MAN_PIC
return 0;
#endif
for(;;)
{

View File

@ -252,6 +252,10 @@ uint8_t u8g2_UserInterfaceSelectionList(u8g2_t *u8g2, const char *title, uint8_t
}
u8g2_DrawSelectionList(u8g2, &u8sl, yy, sl);
} while( u8g2_NextPage(u8g2) );
#ifdef U8G2_REF_MAN_PIC
return 0;
#endif
for(;;)

View File

@ -312,11 +312,8 @@ static const u8x8_display_info_t u8x8_tga_lcd_info =
/* write_pulse_width_ns = */ 0,
/* tile_width = */ (DEFAULT_WIDTH)/FACTOR/8,
/* tile_hight = */ (DEFAULT_HEIGHT)/FACTOR/8,
#if U8X8_DEFAULT_FLIP_MODE == 0
/* default_x_offset = */ 0,
#else
/* default_x_offset = */ 0,
#endif
/* flipmode_x_offset = */ 0,
/* pixel_width = */ (DEFAULT_WIDTH)/FACTOR,
/* pixel_height = */ (DEFAULT_HEIGHT)/FACTOR
};

View File

@ -1,4 +1,5 @@
CFLAGS = -g -Wall -I../../../csrc/. `sdl-config --cflags` -DU8G2_16BIT
CFLAGS = -g -Wall -I../../../csrc/. `sdl-config --cflags` -DU8G2_16BIT -DU8G2_REF_MAN_PIC
SRC = $(shell ls ../../../csrc/*.c) $(shell ls ../common/*.c ) main.c

View File

@ -644,6 +644,95 @@ int main(void)
tga_save_png("u8g2_fontmode.png");
/*=========================================*/
/* u8g2_message.png */
u8x8_ClearDisplay(u8g2_GetU8x8(&desc));
u8g2_SetFontPosBaseline(&u8g2);
u8g2_SetFont(&u8g2, u8g2_font_6x10_tf);
u8g2_SetFontRefHeightAll(&u8g2); /* this will add some extra space for the text inside the buttons */
u8g2_UserInterfaceMessage(&u8g2, "Title1", "Title2", "Title3", " Ok \n Cancel ");
tga_is_transparent = 1;
u8g2_FirstPage(&desc);
do
{
/*
u8g2_SetFont(&desc, u8g2_font_helvB18_tf);
ra(20,5, "x=20, y=5");
ra(27,50, "x=27, y=50");
ra(5,32, "x=5, y=32");
*/
} while( u8g2_NextPage(&desc) );
tga_is_transparent = 0;
u8g2_SetFontPosBaseline(&u8g2);
u8g2_SetFontRefHeightText(&u8g2);
tga_save_png("u8g2_message.png");
/*=========================================*/
/* u8g2_selection_list.png */
u8x8_ClearDisplay(u8g2_GetU8x8(&desc));
u8g2_SetFontPosBaseline(&u8g2);
u8g2_SetFont(&u8g2, u8g2_font_6x10_tf);
u8g2_SetFontRefHeightAll(&u8g2); /* this will add some extra space for the text inside the buttons */
u8g2_UserInterfaceSelectionList(&u8g2, "Title", 1, "abcdef\nghijkl\nmnopqr");
tga_is_transparent = 1;
u8g2_FirstPage(&desc);
do
{
/*
u8g2_SetFont(&desc, u8g2_font_helvB18_tf);
ra(20,5, "x=20, y=5");
ra(27,50, "x=27, y=50");
ra(5,32, "x=5, y=32");
*/
} while( u8g2_NextPage(&desc) );
tga_is_transparent = 0;
u8g2_SetFontPosBaseline(&u8g2);
u8g2_SetFontRefHeightText(&u8g2);
tga_save_png("u8g2_selection_list.png");
/*=========================================*/
/* u8g2_input_value.png */
u8x8_ClearDisplay(u8g2_GetU8x8(&desc));
u8g2_SetFontPosBaseline(&u8g2);
u8g2_SetFont(&u8g2, u8g2_font_6x10_tf);
u8g2_SetFontRefHeightAll(&u8g2); /* this will add some extra space for the text inside the buttons */
{
uint8_t v = 4;
u8g2_UserInterfaceInputValue(&u8g2, "Select Voltage", "DAC= ", &v, 0, 5, 1, " V");
}
tga_is_transparent = 1;
u8g2_FirstPage(&desc);
do
{
/*
u8g2_SetFont(&desc, u8g2_font_helvB18_tf);
ra(20,5, "x=20, y=5");
ra(27,50, "x=27, y=50");
ra(5,32, "x=5, y=32");
*/
} while( u8g2_NextPage(&desc) );
tga_is_transparent = 0;
u8g2_SetFontPosBaseline(&u8g2);
u8g2_SetFontRefHeightText(&u8g2);
tga_save_png("u8g2_input_value.png");
/*=========================================*/
u8x8_ClearDisplay(u8g2_GetU8x8(&desc));