BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
6b344427
Commit
6b344427
authored
Jul 27, 2017
by
Gabor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_group: focus_freeze added
parent
78c5ad0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
lv_group.c
lv_obj/lv_group.c
+24
-0
lv_group.h
lv_obj/lv_group.h
+2
-0
No files found.
lv_obj/lv_group.c
View file @
6b344427
...
...
@@ -46,6 +46,7 @@ lv_group_t * lv_group_create(void)
group
->
style_mod
=
style_mod_def
;
group
->
obj_focus
=
NULL
;
group
->
frozen
=
0
;
return
group
;
}
...
...
@@ -84,6 +85,11 @@ void lv_group_rem_obj(lv_obj_t * obj)
break
;
}
}
if
(
*
g
->
obj_focus
==
obj
)
{
g
->
obj_focus
=
NULL
;
lv_group_focus_next
(
g
);
}
}
...
...
@@ -95,6 +101,9 @@ void lv_group_focus_obj(lv_obj_t * obj)
{
lv_group_t
*
g
=
obj
->
group_p
;
if
(
g
==
NULL
)
return
;
if
(
g
->
frozen
!=
0
)
return
;
lv_obj_t
**
i
;
LL_READ
(
g
->
obj_ll
,
i
)
{
...
...
@@ -121,6 +130,8 @@ void lv_group_focus_obj(lv_obj_t * obj)
*/
void
lv_group_focus_next
(
lv_group_t
*
group
)
{
if
(
group
->
frozen
!=
0
)
return
;
if
(
group
->
obj_focus
!=
NULL
)
{
(
*
group
->
obj_focus
)
->
signal_f
(
*
group
->
obj_focus
,
LV_SIGNAL_DEFOCUS
,
NULL
);
lv_obj_inv
(
*
group
->
obj_focus
);
...
...
@@ -145,6 +156,8 @@ void lv_group_focus_next(lv_group_t * group)
*/
void
lv_group_focus_prev
(
lv_group_t
*
group
)
{
if
(
group
->
frozen
!=
0
)
return
;
if
(
group
->
obj_focus
!=
NULL
)
{
(
*
group
->
obj_focus
)
->
signal_f
(
*
group
->
obj_focus
,
LV_SIGNAL_DEFOCUS
,
NULL
);
lv_obj_inv
(
*
group
->
obj_focus
);
...
...
@@ -165,6 +178,17 @@ void lv_group_focus_prev(lv_group_t * group)
}
/**
* Do not let to change the focus from the current object
* @param group pointer to a group
* @param en true: freeze, false: release freezing (normal mode)
*/
void
lv_group_focus_freeze
(
lv_group_t
*
group
,
bool
en
)
{
if
(
en
==
false
)
group
->
frozen
=
0
;
else
group
->
frozen
=
1
;
}
/**
* Send a control character to the focuses object of a group
* @param group pointer to a group
* @param c a control character (use LV_GROUP_KEY_.. to navigate)
...
...
lv_obj/lv_group.h
View file @
6b344427
...
...
@@ -38,6 +38,7 @@ typedef struct
lv_obj_t
**
obj_focus
;
void
(
*
style_mod
)(
lv_style_t
*
style
);
lv_style_t
style_tmp
;
uint8_t
frozen
:
1
;
}
lv_group_t
;
/**********************
...
...
@@ -49,6 +50,7 @@ void lv_group_rem_obj(lv_obj_t * obj);
void
lv_group_focus_obj
(
lv_obj_t
*
obj
);
void
lv_group_focus_next
(
lv_group_t
*
group
);
void
lv_group_focus_prev
(
lv_group_t
*
group
);
void
lv_group_focus_freeze
(
lv_group_t
*
group
,
bool
en
);
void
lv_group_send
(
lv_group_t
*
group
,
char
c
);
lv_style_t
*
lv_group_mod_style
(
lv_group_t
*
group
,
const
lv_style_t
*
style
);
lv_obj_t
*
lv_group_get_focused
(
lv_group_t
*
group
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment