refactoring

This commit is contained in:
Gabor Kiss-Vamosi
2021-02-07 22:39:54 +01:00
parent c43259814a
commit 956a367dbc
184 changed files with 207 additions and 4551 deletions

View File

@@ -1,37 +0,0 @@
/**
* @file lv_ex_grid.h
*
*/
#ifndef LV_EX_GRID_H
#define LV_EX_GRID_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_EX_GRID_H*/

View File

@@ -1,39 +0,0 @@
//#include "../../lv_examples.h"
//
///**
// * A simple grid
// */
//void lv_ex_grid_1(void)
//{
// static lv_coord_t col_dsc[3] = {80, 80, 80};
// static lv_coord_t row_dsc[3] = {60, 60, 60};
//
// static lv_grid_t grid;
// lv_grid_init(&grid);
// lv_grid_set_template(&grid, col_dsc, 3, row_dsc, 3);
//
// /*Create a container with grid*/
// lv_obj_t * cont = lv_obj_create(lv_scr_act(), NULL);
// lv_obj_set_size(cont, 300, 220);
// lv_obj_align(cont, NULL, LV_ALIGN_CENTER, 0, 0);
// lv_obj_set_grid(cont, &grid);
//
// lv_obj_t * label;
// lv_obj_t * obj;
//
// uint32_t i;
// for(i = 0; i < 9; i++) {
// uint8_t col = i % 3;
// uint8_t row = i / 3;
//
// obj = lv_obj_create(cont, NULL);
// /* Stretch the cell horizontally and vertically too
// * Set span to 1 to make the cell 1 column/row sized */
// lv_obj_set_grid_cell(obj, LV_GRID_CELL_STRETCH(col, 1), LV_GRID_CELL_STRETCH(row, 1));
//
// label = lv_label_create(obj, NULL);
// lv_label_set_text_fmt(label, "c%d, r%d", col, row);
// lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
// }
//}
//

View File

@@ -1,59 +0,0 @@
//#include "../../lv_examples.h"
//
///**
// * Demonstrate cell placement and span
// */
//void lv_ex_grid_2(void)
//{
// static lv_coord_t col_dsc[3] = {80, 80, 80};
// static lv_coord_t row_dsc[3] = {60, 60, 60};
//
// static lv_grid_t grid;
// lv_grid_init(&grid);
// lv_grid_set_template(&grid, col_dsc, 3, row_dsc, 3);
//
// /*Create a container with grid*/
// lv_obj_t * cont = lv_obj_create(lv_scr_act(), NULL);
// lv_obj_set_size(cont, 300, 220);
// lv_obj_align(cont, NULL, LV_ALIGN_CENTER, 0, 0);
// lv_obj_set_grid(cont, &grid);
//
// lv_obj_t * label;
// lv_obj_t * obj;
//
// /*Cell to 0;0 and align to to the start (left/top) horizontally and vertically too */
// obj = lv_obj_create(cont, NULL);
// lv_obj_set_size(obj, LV_SIZE_AUTO, LV_SIZE_AUTO);
// lv_obj_set_grid_cell(obj, LV_GRID_CELL_START(0, 1), LV_GRID_CELL_START(0, 1));
// label = lv_label_create(obj, NULL);
// lv_label_set_text(label, "c0, r0");
//
// /*Cell to 1;0 and align to to the start (left) horizontally and center vertically too */
// obj = lv_obj_create(cont, NULL);
// lv_obj_set_size(obj, LV_SIZE_AUTO, LV_SIZE_AUTO);
// lv_obj_set_grid_cell(obj, LV_GRID_CELL_START(1, 1), LV_GRID_CELL_CENTER(0, 1));
// label = lv_label_create(obj, NULL);
// lv_label_set_text(label, "c1, r0");
//
// /*Cell to 2;0 and align to to the start (left) horizontally and end (bottom) vertically too */
// obj = lv_obj_create(cont, NULL);
// lv_obj_set_size(obj, LV_SIZE_AUTO, LV_SIZE_AUTO);
// lv_obj_set_grid_cell(obj, LV_GRID_CELL_START(2, 1), LV_GRID_CELL_END(0, 1));
// label = lv_label_create(obj, NULL);
// lv_label_set_text(label, "c2, r0");
//
// /*Cell to 1;1 but 2 column wide (span = 2).Set width and height to stretched. */
// obj = lv_obj_create(cont, NULL);
// lv_obj_set_size(obj, LV_SIZE_AUTO, LV_SIZE_AUTO);
// lv_obj_set_grid_cell(obj, LV_GRID_CELL_STRETCH(1, 2), LV_GRID_CELL_STRETCH(1, 1));
// label = lv_label_create(obj, NULL);
// lv_label_set_text(label, "c1-2, r1");
//
// /*Cell to 0;1 but 2 rows tall (span = 2).Set width and height to stretched. */
// obj = lv_obj_create(cont, NULL);
// lv_obj_set_size(obj, LV_SIZE_AUTO, LV_SIZE_AUTO);
// lv_obj_set_grid_cell(obj, LV_GRID_CELL_STRETCH(0, 1), LV_GRID_CELL_STRETCH(1, 2));
// label = lv_label_create(obj, NULL);
// lv_label_set_text(label, "c0\nr1-2");
//}
//

View File

@@ -1,45 +0,0 @@
//#include "../../lv_examples.h"
//
///**
// * Demonstrate grid's "free unit"
// */
//void lv_ex_grid_3(void)
//{
// /* Column 1: fix width 60 px
// * Column 2: 1 unit from the remaining free space
// * Column 3: 2 unit from the remaining free space */
// static lv_coord_t col_dsc[3] = {60, LV_GRID_FR(1), LV_GRID_FR(2)};
//
// /* Row 1: fix width 60 px
// * Row 2: 1 unit from the remaining free space
// * Row 3: fix width 60 px */
// static lv_coord_t row_dsc[3] = {60, LV_GRID_FR(1), 60};
//
// static lv_grid_t grid;
// lv_grid_init(&grid);
// lv_grid_set_template(&grid, col_dsc, 3, row_dsc, 3);
//
// /*Create a container with grid*/
// lv_obj_t * cont = lv_obj_create(lv_scr_act(), NULL);
// lv_obj_set_size(cont, 300, 220);
// lv_obj_align(cont, NULL, LV_ALIGN_CENTER, 0, 0);
// lv_obj_set_grid(cont, &grid);
//
// lv_obj_t * label;
// lv_obj_t * obj;
// uint32_t i;
// for(i = 0; i < 9; i++) {
// uint8_t col = i % 3;
// uint8_t row = i / 3;
//
// obj = lv_obj_create(cont, NULL);
// /* Stretch the cell horizontally and vertically too
// * Set span to 1 to make the cell 1 column/row sized */
// lv_obj_set_grid_cell(obj, LV_GRID_CELL_STRETCH(col, 1), LV_GRID_CELL_STRETCH(row, 1));
//
// label = lv_label_create(obj, NULL);
// lv_label_set_text_fmt(label, "%d,%d", col, row);
// lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
// }
//}
//

View File

@@ -1,41 +0,0 @@
//#include "../../lv_examples.h"
//
///**
// * Demonstrate track placement
// */
//void lv_ex_grid_4(void)
//{
// static lv_coord_t col_dsc[3] = {60, 60, 60};
// static lv_coord_t row_dsc[3] = {50, 50, 50};
//
// static lv_grid_t grid;
// lv_grid_init(&grid);
// lv_grid_set_template(&grid, col_dsc, 3, row_dsc, 3);
//
// /*Add space between the columns and move the rows to the bottom (end)*/
// lv_grid_set_place(&grid, LV_GRID_SPACE_BETWEEN, LV_GRID_END);
//
// /*Create a container with grid*/
// lv_obj_t * cont = lv_obj_create(lv_scr_act(), NULL);
// lv_obj_set_size(cont, 300, 220);
// lv_obj_align(cont, NULL, LV_ALIGN_CENTER, 0, 0);
// lv_obj_set_grid(cont, &grid);
//
// lv_obj_t * label;
// lv_obj_t * obj;
// uint32_t i;
// for(i = 0; i < 9; i++) {
// uint8_t col = i % 3;
// uint8_t row = i / 3;
//
// obj = lv_obj_create(cont, NULL);
// /* Stretch the cell horizontally and vertically too
// * Set span to 1 to make the cell 1 column/row sized */
// lv_obj_set_grid_cell(obj, LV_GRID_CELL_STRETCH(col, 1), LV_GRID_CELL_STRETCH(row, 1));
//
// label = lv_label_create(obj, NULL);
// lv_label_set_text_fmt(label, "%d,%d", col, row);
// lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
// }
//}
//

View File

@@ -1,41 +0,0 @@
//#include "../../lv_examples.h"
//
///**
// * Demonstrate margin in grid
// */
//void lv_ex_grid_5(void)
//{
//
// /*60x60 cells*/
// static lv_coord_t col_dsc[3] = {100, 60, 60};
// static lv_coord_t row_dsc[3] = {60, 60, 60};
//
// static lv_grid_t grid;
// lv_grid_init(&grid);
// lv_grid_set_template(&grid, col_dsc, 3, row_dsc, 3);
//
// /*Create a container with grid*/
// lv_obj_t * cont = lv_obj_create(lv_scr_act(), NULL);
// lv_obj_set_size(cont, 300, 220);
// lv_obj_align(cont, NULL, LV_ALIGN_CENTER, 0, 0);
// lv_obj_set_grid(cont, &grid);
//
// lv_obj_t * label;
// lv_obj_t * obj;
// uint32_t i;
// for(i = 0; i < 9; i++) {
// uint8_t col = i % 3;
// uint8_t row = i / 3;
//
// obj = lv_obj_create(cont, NULL);
// lv_obj_set_grid_cell(obj, LV_GRID_CELL_START(col, 1), LV_GRID_CELL_START(row, 1));
// lv_obj_set_size(obj, 55, 55);
// if(i == 1) {
// lv_obj_set_style_local_margin_all(obj, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 5);
// }
// label = lv_label_create(obj, NULL);
// lv_label_set_text_fmt(label, "%d,%d", col, row);
// lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
// }
//}
//

View File

@@ -1,43 +0,0 @@
//#include "../../lv_examples.h"
//
///**
// * Demonstrate RTL direction on grid
// */
//void lv_ex_grid_6(void)
//{
//
// static lv_coord_t col_dsc[3] = {100, 60, 60};
// static lv_coord_t row_dsc[3] = {60, 60, 60};
//
// static lv_grid_t grid;
// lv_grid_init(&grid);
// lv_grid_set_template(&grid, col_dsc, 3, row_dsc, 3);
//
// /*Add space between the columns and move the rows to the bottom (end)*/
//
// /*Create a container with grid*/
// lv_obj_t * cont = lv_obj_create(lv_scr_act(), NULL);
// lv_obj_set_size(cont, 300, 220);
// lv_obj_align(cont, NULL, LV_ALIGN_CENTER, 0, 0);
// lv_obj_set_base_dir(cont, LV_BIDI_DIR_RTL);
// lv_obj_set_grid(cont, &grid);
//
// lv_obj_t * label;
// lv_obj_t * obj;
// uint32_t i;
// for(i = 0; i < 3; i++) {
// uint8_t col = i % 3;
// uint8_t row = i / 3;
//
// obj = lv_obj_create(cont, NULL);
// /* Stretch the cell horizontally and vertically too
// * Set span to 1 to make the cell 1 column/row sized */
// lv_obj_set_grid_cell(obj, LV_GRID_CELL_STRETCH(col, 1), LV_GRID_CELL_START(row, 1));
// lv_obj_set_size(obj, 55, 55);
//
// label = lv_label_create(obj, NULL);
// lv_label_set_text_fmt(label, "%d,%d", col, row);
// lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
// }
//}
//