249 lines
9.9 KiB
C
249 lines
9.9 KiB
C
// This file was generated by SquareLine Studio
|
|
// SquareLine Studio version: SquareLine Studio 1.2.3
|
|
// LVGL version: 8.3.4
|
|
// Project name: LvglWiFiConnect
|
|
|
|
#include "ui.h"
|
|
#include "ui_helpers.h"
|
|
|
|
///////////////////// VARIABLES ////////////////////
|
|
lv_obj_t *ui_Screen1;
|
|
lv_obj_t *ui_Panel1;
|
|
lv_obj_t *ui_Label1;
|
|
lv_obj_t *ui_RollerWiFiAP;
|
|
lv_obj_t *ui_Label2;
|
|
lv_obj_t *ui_TextWiFiPassword;
|
|
lv_obj_t *ui_ButtonWiFiConnect;
|
|
lv_obj_t *ui_Label3;
|
|
lv_obj_t *ui_Screen2;
|
|
lv_obj_t *ui_Panel2;
|
|
lv_obj_t *ui_Spinner1;
|
|
lv_obj_t *ui_Label4;
|
|
lv_obj_t *ui_Screen3;
|
|
lv_obj_t *ui_Panel3;
|
|
lv_obj_t *ui_Label5;
|
|
lv_obj_t *ui_TextVNCHost;
|
|
lv_obj_t *ui_Label6;
|
|
lv_obj_t *ui_TextVNCPort;
|
|
lv_obj_t *ui_Label7;
|
|
lv_obj_t *ui_TextVNCPassword;
|
|
lv_obj_t *ui_ButtonVNCConnect;
|
|
lv_obj_t *ui_Label8;
|
|
lv_obj_t *ui____initial_actions0;
|
|
|
|
///////////////////// TEST LVGL SETTINGS ////////////////////
|
|
#if LV_COLOR_DEPTH != 16
|
|
#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings"
|
|
#endif
|
|
#if LV_COLOR_16_SWAP !=1
|
|
#error "LV_COLOR_16_SWAP should be 1 to match SquareLine Studio's settings"
|
|
#endif
|
|
|
|
///////////////////// ANIMATIONS ////////////////////
|
|
|
|
///////////////////// FUNCTIONS ////////////////////
|
|
|
|
///////////////////// SCREENS ////////////////////
|
|
void ui_Screen1_screen_init(void)
|
|
{
|
|
ui_Screen1 = lv_obj_create(NULL);
|
|
lv_obj_clear_flag( ui_Screen1, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
|
|
|
ui_Panel1 = lv_obj_create(ui_Screen1);
|
|
lv_obj_set_width( ui_Panel1, 280);
|
|
lv_obj_set_height( ui_Panel1, 200);
|
|
lv_obj_set_align( ui_Panel1, LV_ALIGN_CENTER );
|
|
lv_obj_clear_flag( ui_Panel1, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
|
lv_obj_set_style_bg_color(ui_Panel1, lv_color_hex(0xF2F2F2), LV_PART_MAIN | LV_STATE_DEFAULT );
|
|
lv_obj_set_style_bg_opa(ui_Panel1, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
|
|
|
ui_Label1 = lv_label_create(ui_Panel1);
|
|
lv_obj_set_width( ui_Label1, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height( ui_Label1, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x( ui_Label1, -10 );
|
|
lv_obj_set_y( ui_Label1, -85 );
|
|
lv_obj_set_align( ui_Label1, LV_ALIGN_LEFT_MID );
|
|
lv_label_set_text(ui_Label1,"WiFi Network");
|
|
|
|
ui_RollerWiFiAP = lv_roller_create(ui_Panel1);
|
|
lv_roller_set_options( ui_RollerWiFiAP, "WiFi Scanning...", LV_ROLLER_MODE_NORMAL );
|
|
lv_obj_set_width( ui_RollerWiFiAP, 260);
|
|
lv_obj_set_height( ui_RollerWiFiAP, 112);
|
|
lv_obj_set_x( ui_RollerWiFiAP, 0 );
|
|
lv_obj_set_y( ui_RollerWiFiAP, -20 );
|
|
lv_obj_set_align( ui_RollerWiFiAP, LV_ALIGN_CENTER );
|
|
lv_obj_set_style_text_letter_space(ui_RollerWiFiAP, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_line_space(ui_RollerWiFiAP, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(ui_RollerWiFiAP, &ui_font_Cubic11, LV_PART_MAIN| LV_STATE_DEFAULT);
|
|
|
|
lv_obj_set_style_text_letter_space(ui_RollerWiFiAP, 0, LV_PART_SELECTED| LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_line_space(ui_RollerWiFiAP, 0, LV_PART_SELECTED| LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(ui_RollerWiFiAP, &ui_font_Cubic11, LV_PART_SELECTED| LV_STATE_DEFAULT);
|
|
|
|
ui_Label2 = lv_label_create(ui_Panel1);
|
|
lv_obj_set_width( ui_Label2, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height( ui_Label2, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x( ui_Label2, -10 );
|
|
lv_obj_set_y( ui_Label2, 46 );
|
|
lv_obj_set_align( ui_Label2, LV_ALIGN_LEFT_MID );
|
|
lv_label_set_text(ui_Label2,"Password");
|
|
|
|
ui_TextWiFiPassword = lv_textarea_create(ui_Panel1);
|
|
lv_obj_set_width( ui_TextWiFiPassword, 160);
|
|
lv_obj_set_height( ui_TextWiFiPassword, LV_SIZE_CONTENT); /// 30
|
|
lv_obj_set_x( ui_TextWiFiPassword, -50 );
|
|
lv_obj_set_y( ui_TextWiFiPassword, 72 );
|
|
lv_obj_set_align( ui_TextWiFiPassword, LV_ALIGN_CENTER );
|
|
lv_textarea_set_text(ui_TextWiFiPassword,"PleaseInputYourPasswordHere");
|
|
lv_textarea_set_placeholder_text(ui_TextWiFiPassword,"Placeholder...");
|
|
lv_textarea_set_one_line(ui_TextWiFiPassword,true);
|
|
lv_textarea_set_password_mode(ui_TextWiFiPassword, true);
|
|
|
|
ui_ButtonWiFiConnect = lv_btn_create(ui_Panel1);
|
|
lv_obj_set_width( ui_ButtonWiFiConnect, 90);
|
|
lv_obj_set_height( ui_ButtonWiFiConnect, 32);
|
|
lv_obj_set_x( ui_ButtonWiFiConnect, 85 );
|
|
lv_obj_set_y( ui_ButtonWiFiConnect, 72 );
|
|
lv_obj_set_align( ui_ButtonWiFiConnect, LV_ALIGN_CENTER );
|
|
lv_obj_add_flag( ui_ButtonWiFiConnect, LV_OBJ_FLAG_SCROLL_ON_FOCUS ); /// Flags
|
|
lv_obj_clear_flag( ui_ButtonWiFiConnect, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
|
|
|
ui_Label3 = lv_label_create(ui_Panel1);
|
|
lv_obj_set_width( ui_Label3, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height( ui_Label3, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x( ui_Label3, 85 );
|
|
lv_obj_set_y( ui_Label3, 72 );
|
|
lv_obj_set_align( ui_Label3, LV_ALIGN_CENTER );
|
|
lv_label_set_text(ui_Label3,"Connect");
|
|
lv_obj_set_style_text_color(ui_Label3, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
|
lv_obj_set_style_text_opa(ui_Label3, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
|
|
|
}
|
|
void ui_Screen2_screen_init(void)
|
|
{
|
|
ui_Screen2 = lv_obj_create(NULL);
|
|
lv_obj_clear_flag( ui_Screen2, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
|
|
|
ui_Panel2 = lv_obj_create(ui_Screen2);
|
|
lv_obj_set_width( ui_Panel2, 280);
|
|
lv_obj_set_height( ui_Panel2, 200);
|
|
lv_obj_set_align( ui_Panel2, LV_ALIGN_CENTER );
|
|
lv_obj_clear_flag( ui_Panel2, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
|
lv_obj_set_style_bg_color(ui_Panel2, lv_color_hex(0xF2F2F2), LV_PART_MAIN | LV_STATE_DEFAULT );
|
|
lv_obj_set_style_bg_opa(ui_Panel2, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
|
|
|
ui_Spinner1 = lv_spinner_create(ui_Panel2,1000,90);
|
|
lv_obj_set_width( ui_Spinner1, 140);
|
|
lv_obj_set_height( ui_Spinner1, 140);
|
|
lv_obj_set_align( ui_Spinner1, LV_ALIGN_CENTER );
|
|
lv_obj_clear_flag( ui_Spinner1, LV_OBJ_FLAG_CLICKABLE ); /// Flags
|
|
|
|
ui_Label4 = lv_label_create(ui_Panel2);
|
|
lv_obj_set_width( ui_Label4, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height( ui_Label4, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_align( ui_Label4, LV_ALIGN_CENTER );
|
|
lv_label_set_text(ui_Label4,"Connecting...");
|
|
lv_obj_set_style_text_font(ui_Label4, &lv_font_montserrat_14, LV_PART_MAIN| LV_STATE_DEFAULT);
|
|
|
|
}
|
|
void ui_Screen3_screen_init(void)
|
|
{
|
|
ui_Screen3 = lv_obj_create(NULL);
|
|
lv_obj_clear_flag( ui_Screen3, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
|
|
|
ui_Panel3 = lv_obj_create(ui_Screen3);
|
|
lv_obj_set_width( ui_Panel3, 280);
|
|
lv_obj_set_height( ui_Panel3, 200);
|
|
lv_obj_set_align( ui_Panel3, LV_ALIGN_CENTER );
|
|
lv_obj_clear_flag( ui_Panel3, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
|
lv_obj_set_style_bg_color(ui_Panel3, lv_color_hex(0xF2F2F2), LV_PART_MAIN | LV_STATE_DEFAULT );
|
|
lv_obj_set_style_bg_opa(ui_Panel3, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
|
|
|
ui_Label5 = lv_label_create(ui_Panel3);
|
|
lv_obj_set_width( ui_Label5, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height( ui_Label5, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x( ui_Label5, -10 );
|
|
lv_obj_set_y( ui_Label5, -85 );
|
|
lv_obj_set_align( ui_Label5, LV_ALIGN_LEFT_MID );
|
|
lv_label_set_text(ui_Label5,"VNC Host");
|
|
|
|
ui_TextVNCHost = lv_textarea_create(ui_Panel3);
|
|
lv_obj_set_width( ui_TextVNCHost, 260);
|
|
lv_obj_set_height( ui_TextVNCHost, LV_SIZE_CONTENT); /// 70
|
|
lv_obj_set_x( ui_TextVNCHost, 0 );
|
|
lv_obj_set_y( ui_TextVNCHost, -55 );
|
|
lv_obj_set_align( ui_TextVNCHost, LV_ALIGN_CENTER );
|
|
lv_textarea_set_text(ui_TextVNCHost,"192.168.1.4");
|
|
lv_textarea_set_placeholder_text(ui_TextVNCHost,"Placeholder...");
|
|
lv_textarea_set_one_line(ui_TextVNCHost,true);
|
|
|
|
ui_Label6 = lv_label_create(ui_Panel3);
|
|
lv_obj_set_width( ui_Label6, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height( ui_Label6, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x( ui_Label6, -10 );
|
|
lv_obj_set_y( ui_Label6, -20 );
|
|
lv_obj_set_align( ui_Label6, LV_ALIGN_LEFT_MID );
|
|
lv_label_set_text(ui_Label6,"VNC Port");
|
|
|
|
ui_TextVNCPort = lv_textarea_create(ui_Panel3);
|
|
lv_obj_set_width( ui_TextVNCPort, 260);
|
|
lv_obj_set_height( ui_TextVNCPort, LV_SIZE_CONTENT); /// 70
|
|
lv_obj_set_x( ui_TextVNCPort, 0 );
|
|
lv_obj_set_y( ui_TextVNCPort, 10 );
|
|
lv_obj_set_align( ui_TextVNCPort, LV_ALIGN_CENTER );
|
|
lv_textarea_set_text(ui_TextVNCPort,"5901");
|
|
lv_textarea_set_placeholder_text(ui_TextVNCPort,"Placeholder...");
|
|
lv_textarea_set_one_line(ui_TextVNCPort,true);
|
|
|
|
ui_Label7 = lv_label_create(ui_Panel3);
|
|
lv_obj_set_width( ui_Label7, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height( ui_Label7, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x( ui_Label7, -10 );
|
|
lv_obj_set_y( ui_Label7, 40 );
|
|
lv_obj_set_align( ui_Label7, LV_ALIGN_LEFT_MID );
|
|
lv_label_set_text(ui_Label7,"VNC Password");
|
|
|
|
ui_TextVNCPassword = lv_textarea_create(ui_Panel3);
|
|
lv_obj_set_width( ui_TextVNCPassword, 160);
|
|
lv_obj_set_height( ui_TextVNCPassword, LV_SIZE_CONTENT); /// 70
|
|
lv_obj_set_x( ui_TextVNCPassword, -50 );
|
|
lv_obj_set_y( ui_TextVNCPassword, 72 );
|
|
lv_obj_set_align( ui_TextVNCPassword, LV_ALIGN_CENTER );
|
|
lv_textarea_set_text(ui_TextVNCPassword,"vncpassword");
|
|
lv_textarea_set_placeholder_text(ui_TextVNCPassword,"Placeholder...");
|
|
lv_textarea_set_one_line(ui_TextVNCPassword,true);
|
|
lv_textarea_set_password_mode(ui_TextVNCPassword, true);
|
|
|
|
ui_ButtonVNCConnect = lv_btn_create(ui_Panel3);
|
|
lv_obj_set_width( ui_ButtonVNCConnect, 90);
|
|
lv_obj_set_height( ui_ButtonVNCConnect, 32);
|
|
lv_obj_set_x( ui_ButtonVNCConnect, 85 );
|
|
lv_obj_set_y( ui_ButtonVNCConnect, 72 );
|
|
lv_obj_set_align( ui_ButtonVNCConnect, LV_ALIGN_CENTER );
|
|
lv_obj_add_flag( ui_ButtonVNCConnect, LV_OBJ_FLAG_SCROLL_ON_FOCUS ); /// Flags
|
|
lv_obj_clear_flag( ui_ButtonVNCConnect, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
|
|
|
ui_Label8 = lv_label_create(ui_Panel3);
|
|
lv_obj_set_width( ui_Label8, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height( ui_Label8, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x( ui_Label8, 85 );
|
|
lv_obj_set_y( ui_Label8, 72 );
|
|
lv_obj_set_align( ui_Label8, LV_ALIGN_CENTER );
|
|
lv_label_set_text(ui_Label8,"Connect");
|
|
lv_obj_set_style_text_color(ui_Label8, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
|
lv_obj_set_style_text_opa(ui_Label8, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
|
|
|
}
|
|
|
|
void ui_init( void )
|
|
{
|
|
lv_disp_t *dispp = lv_disp_get_default();
|
|
lv_theme_t *theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), false, LV_FONT_DEFAULT);
|
|
lv_disp_set_theme(dispp, theme);
|
|
ui_Screen1_screen_init();
|
|
ui_Screen2_screen_init();
|
|
ui_Screen3_screen_init();
|
|
ui____initial_actions0 = lv_obj_create(NULL);
|
|
lv_disp_load_scr( ui_Screen1);
|
|
}
|