refactor: fix typos
This commit is contained in:
@@ -17,7 +17,7 @@ class KeyboardEncoder:
|
|||||||
|
|
||||||
cur_drv = cur_drv.get_next()
|
cur_drv = cur_drv.get_next()
|
||||||
|
|
||||||
self.tv = lv.tabview(lv.screen_active(), lv.DIR.TOP, lv.DPI_DEF // 3)
|
self.tv = lv.tabview(lv.screen_active())
|
||||||
|
|
||||||
self.t1 = self.tv.add_tab("Selectors")
|
self.t1 = self.tv.add_tab("Selectors")
|
||||||
self.t2 = self.tv.add_tab("Text input")
|
self.t2 = self.tv.add_tab("Text input")
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ the last (or most recent) child.
|
|||||||
Child Count
|
Child Count
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
Use the function :cpp:expr:`lv_spangroup_get_child_conut(spangroup)` to get back
|
Use the function :cpp:expr:`lv_spangroup_get_child_count(spangroup)` to get back
|
||||||
the number of spans the group is maintaining.
|
the number of spans the group is maintaining.
|
||||||
|
|
||||||
e.g. ``uint32_t size = lv_spangroup_get_child_conut(spangroup)``
|
e.g. ``uint32_t size = lv_spangroup_get_child_count(spangroup)``
|
||||||
|
|
||||||
Text align
|
Text align
|
||||||
----------
|
----------
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ def scroll_event_cb(e):
|
|||||||
|
|
||||||
r = cont.get_height() * 7 // 10
|
r = cont.get_height() * 7 // 10
|
||||||
|
|
||||||
child_cnt = cont.get_child_conut()
|
child_cnt = cont.get_child_count()
|
||||||
for i in range(child_cnt):
|
for i in range(child_cnt):
|
||||||
child = cont.get_child(i)
|
child = cont.get_child(i)
|
||||||
child_a = lv.area_t()
|
child_a = lv.area_t()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ def event_handler(e):
|
|||||||
else:
|
else:
|
||||||
currentButton = obj
|
currentButton = obj
|
||||||
parent = obj.get_parent()
|
parent = obj.get_parent()
|
||||||
for i in range( parent.get_child_conut()):
|
for i in range( parent.get_child_count()):
|
||||||
child = parent.get_child(i)
|
child = parent.get_child(i)
|
||||||
if child == currentButton:
|
if child == currentButton:
|
||||||
child.add_state(lv.STATE.CHECKED)
|
child.add_state(lv.STATE.CHECKED)
|
||||||
@@ -51,7 +51,7 @@ def event_handler_center(e):
|
|||||||
if currentButton == None:
|
if currentButton == None:
|
||||||
return
|
return
|
||||||
parent = currentButton.get_parent()
|
parent = currentButton.get_parent()
|
||||||
pos = parent.get_child_conut() // 2
|
pos = parent.get_child_count() // 2
|
||||||
currentButton.move_to_index(pos)
|
currentButton.move_to_index(pos)
|
||||||
currentButton.scroll_to_view(lv.ANIM.ON)
|
currentButton.scroll_to_view(lv.ANIM.ON)
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ def event_handler_swap(e):
|
|||||||
code = e.get_code()
|
code = e.get_code()
|
||||||
obj = e.get_target_obj()
|
obj = e.get_target_obj()
|
||||||
if code == lv.EVENT.CLICKED:
|
if code == lv.EVENT.CLICKED:
|
||||||
cnt = list1.get_child_conut()
|
cnt = list1.get_child_count()
|
||||||
for i in range(100):
|
for i in range(100):
|
||||||
if cnt > 1:
|
if cnt > 1:
|
||||||
obj = list1.get_child(urandom.getrandbits(32) % cnt )
|
obj = list1.get_child(urandom.getrandbits(32) % cnt )
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Create a Tab view object
|
# Create a Tab view object
|
||||||
tabview = lv.tabview(lv.screen_active(), lv.DIR.TOP, 50)
|
tabview = lv.tabview(lv.screen_active())
|
||||||
|
|
||||||
# Add 3 tabs (the tabs are page (lv_page) and can be scrolled
|
# Add 3 tabs (the tabs are page (lv_page) and can be scrolled
|
||||||
tab1 = tabview.add_tab("Tab 1")
|
tab1 = tabview.add_tab("Tab 1")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
# Create a Tab view object
|
# Create a Tab view object
|
||||||
tabview = lv.tabview(lv.screen_active(), lv.DIR.LEFT, 80)
|
tabview = lv.tabview(lv.screen_active())
|
||||||
|
|
||||||
tabview.set_style_bg_color(lv.palette_lighten(lv.PALETTE.RED, 2), 0)
|
tabview.set_style_bg_color(lv.palette_lighten(lv.PALETTE.RED, 2), 0)
|
||||||
|
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t lv_spangroup_get_child_conut(const lv_obj_t * obj)
|
uint32_t lv_spangroup_get_child_count(const lv_obj_t * obj)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
|
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id);
|
|||||||
* @param obj The spangroup object to get the child count of.
|
* @param obj The spangroup object to get the child count of.
|
||||||
* @return The span count of the spangroup.
|
* @return The span count of the spangroup.
|
||||||
*/
|
*/
|
||||||
uint32_t lv_spangroup_get_child_conut(const lv_obj_t * obj);
|
uint32_t lv_spangroup_get_child_count(const lv_obj_t * obj);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the align of the spangroup.
|
* get the align of the spangroup.
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ void test_spangroup_new_span_with_null_parameter_returns_null_object(void)
|
|||||||
lv_span_t * span = lv_spangroup_new_span(NULL);
|
lv_span_t * span = lv_spangroup_new_span(NULL);
|
||||||
|
|
||||||
TEST_ASSERT(NULL == span);
|
TEST_ASSERT(NULL == span);
|
||||||
TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_conut(spangroup));
|
TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_count(spangroup));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_spangroup_new_span_with_valid_parameter_returns_not_null_object(void)
|
void test_spangroup_new_span_with_valid_parameter_returns_not_null_object(void)
|
||||||
@@ -43,7 +43,7 @@ void test_spangroup_new_span_with_valid_parameter_returns_not_null_object(void)
|
|||||||
lv_span_t * span = lv_spangroup_new_span(spangroup);
|
lv_span_t * span = lv_spangroup_new_span(spangroup);
|
||||||
|
|
||||||
TEST_ASSERT(NULL != span);
|
TEST_ASSERT(NULL != span);
|
||||||
TEST_ASSERT_EQUAL_INT(1, lv_spangroup_get_child_conut(spangroup));
|
TEST_ASSERT_EQUAL_INT(1, lv_spangroup_get_child_count(spangroup));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_spangroup_delete_span_span_is_null(void)
|
void test_spangroup_delete_span_span_is_null(void)
|
||||||
@@ -52,7 +52,7 @@ void test_spangroup_delete_span_span_is_null(void)
|
|||||||
|
|
||||||
lv_spangroup_delete_span(spangroup, span);
|
lv_spangroup_delete_span(spangroup, span);
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_conut(spangroup));
|
TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_count(spangroup));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_span_set_text(void)
|
void test_span_set_text(void)
|
||||||
@@ -249,12 +249,12 @@ void test_spangroup_get_child(void)
|
|||||||
TEST_ASSERT_EQUAL_PTR(span_1, lv_spangroup_get_child(spangroup, span_1_idx));
|
TEST_ASSERT_EQUAL_PTR(span_1, lv_spangroup_get_child(spangroup, span_1_idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_spangroup_get_child_conut(void)
|
void test_spangroup_get_child_count(void)
|
||||||
{
|
{
|
||||||
(void)lv_spangroup_new_span(spangroup);
|
(void)lv_spangroup_new_span(spangroup);
|
||||||
(void)lv_spangroup_new_span(spangroup);
|
(void)lv_spangroup_new_span(spangroup);
|
||||||
|
|
||||||
const uint32_t cnt = lv_spangroup_get_child_conut(spangroup);
|
const uint32_t cnt = lv_spangroup_get_child_count(spangroup);
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL(2, cnt);
|
TEST_ASSERT_EQUAL(2, cnt);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user