Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
bde41f0f
Commit
bde41f0f
authored
Oct 04, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made spinbox wrap around
parent
7c40093a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
set_gmt_ofs.c
sw/freertos/src/apps/settings/set_gmt_ofs.c
+1
-1
spinbox.c
sw/freertos/src/apps/widgets/spinbox.c
+8
-2
No files found.
sw/freertos/src/apps/settings/set_gmt_ofs.c
View file @
bde41f0f
...
...
@@ -54,7 +54,7 @@ static struct ui_widget set_time_screen = {
#define SPINBOX_NUMBER 4
enum
SPINBOX
{
H1
=
0
,
H2
,
M1
,
M2
};
static
const
char
const
*
hours1
=
"01
2
"
;
static
const
char
const
*
hours1
=
"01"
;
static
const
char
const
*
minutes1
=
"012345"
;
static
const
char
**
char_sets
[
SPINBOX_NUMBER
]
=
{
...
...
sw/freertos/src/apps/widgets/spinbox.c
View file @
bde41f0f
...
...
@@ -26,6 +26,8 @@
#include "spinbox.h"
#include <string.h>
// Default character sets.
const
char
*
char_digits
=
"0123456789\x0"
;
const
char
*
char_letters
=
"abcdefghijklmnopqrstuvwxyz
\0
"
;
...
...
@@ -38,13 +40,17 @@ static void spinbox_event(struct ui_widget *w, const struct event *evt)
if
(
evt
->
data
.
button
==
BUT_BR
)
{
if
(
s
->
chars
[
s
->
value_idx
+
1
]
!=
0
)
{
++
s
->
value_idx
;
w
->
flags
|=
WF_DIRTY
;
}
else
{
s
->
value_idx
=
0
;
}
w
->
flags
|=
WF_DIRTY
;
}
else
if
(
evt
->
data
.
button
==
BUT_BL
)
{
if
(
s
->
value_idx
>
0
)
{
--
s
->
value_idx
;
w
->
flags
|=
WF_DIRTY
;
}
else
{
s
->
value_idx
=
strlen
(
s
->
chars
)
-
1
;
}
w
->
flags
|=
WF_DIRTY
;
}
}
}
...
...
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