Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
8f50b77e
Commit
8f50b77e
authored
May 04, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make label clickable (the user has to ask for it, it's non-clickable by default)
parent
d4a4bba3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
common/utils/T/tracer/gui/gui.h
common/utils/T/tracer/gui/gui.h
+4
-0
common/utils/T/tracer/gui/label.c
common/utils/T/tracer/gui/label.c
+34
-0
No files found.
common/utils/T/tracer/gui/gui.h
View file @
8f50b77e
...
@@ -26,6 +26,8 @@ widget *new_xy_plot(gui *gui, int width, int height, char *label,
...
@@ -26,6 +26,8 @@ widget *new_xy_plot(gui *gui, int width, int height, char *label,
int
vruler_width
);
int
vruler_width
);
widget
*
new_textlist
(
gui
*
_gui
,
int
width
,
int
nlines
,
int
background_color
);
widget
*
new_textlist
(
gui
*
_gui
,
int
width
,
int
nlines
,
int
background_color
);
void
label_set_clickable
(
gui
*
gui
,
widget
*
label
,
int
clickable
);
void
container_set_child_growable
(
gui
*
_gui
,
widget
*
_this
,
void
container_set_child_growable
(
gui
*
_gui
,
widget
*
_this
,
widget
*
child
,
int
growable
);
widget
*
child
,
int
growable
);
...
@@ -60,6 +62,8 @@ int new_color(gui *gui, char *color);
...
@@ -60,6 +62,8 @@ int new_color(gui *gui, char *color);
* - scrollup { void *: NULL }
* - scrollup { void *: NULL }
* - scrolldown { void *: NULL }
* - scrolldown { void *: NULL }
* - click { int [2]: line, button }
* - click { int [2]: line, button }
* - label:
* - click { int: button } (if enabled)
*/
*/
/* same type as in gui_defs.h */
/* same type as in gui_defs.h */
...
...
common/utils/T/tracer/gui/label.c
View file @
8f50b77e
...
@@ -44,3 +44,37 @@ widget *new_label(gui *_gui, const char *label)
...
@@ -44,3 +44,37 @@ widget *new_label(gui *_gui, const char *label)
return
w
;
return
w
;
}
}
static
void
button
(
gui
*
gui
,
widget
*
_this
,
int
x
,
int
y
,
int
button
,
int
up
)
{
LOGD
(
"BUTTON label %p xy %d %d button %d up %d
\n
"
,
_this
,
x
,
y
,
button
,
up
);
if
(
up
!=
0
)
return
;
gui_notify
(
gui
,
"click"
,
_this
,
&
button
);
}
/* we could use default_button, but it's in widget.c, so, well... */
static
void
no_button
(
gui
*
gui
,
widget
*
_this
,
int
x
,
int
y
,
int
button
,
int
up
)
{
/* do nothing */
}
/*************************************************************************/
/* public functions */
/*************************************************************************/
void
label_set_clickable
(
gui
*
_g
,
widget
*
_this
,
int
clickable
)
{
struct
gui
*
g
=
_g
;
struct
label_widget
*
this
=
_this
;
glock
(
g
);
if
(
clickable
)
this
->
common
.
button
=
button
;
else
this
->
common
.
button
=
no_button
;
gunlock
(
g
);
}
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