Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Aayush
purr-data
Commits
fb17c23f
Commit
fb17c23f
authored
Jan 31, 2016
by
Jonathan Wilkes
Browse files
clean up g_radio.c
parent
b009d585
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/nw/pdgui.js
View file @
fb17c23f
...
...
@@ -2067,7 +2067,7 @@ function gui_create_radio(cid,tag,p1,p2,p3,p4,i,basex,basey) {
g
.
appendChild
(
cell
);
}
function
gui_create_radio_buttons
(
cid
,
tag
,
color
,
p1
,
p2
,
p3
,
p4
,
basex
,
basey
,
i
,
state
)
{
function
gui_create_radio_buttons
(
cid
,
tag
,
x_
color
,
p1
,
p2
,
p3
,
p4
,
basex
,
basey
,
i
,
state
)
{
var
g
=
get_gobj
(
cid
,
tag
),
b
;
b
=
create_item
(
cid
,
"
rect
"
,
{
...
...
@@ -2075,8 +2075,8 @@ function gui_create_radio_buttons(cid,tag,color,p1,p2,p3,p4,basex,basey,i,state)
y
:
p2
-
basey
,
width
:
p3
-
p1
,
height
:
p4
-
p2
,
stroke
:
color
,
fill
:
color
,
stroke
:
x2h
(
x_
color
)
,
fill
:
x2h
(
x_
color
)
,
id
:
tag
+
"
button_
"
+
i
,
display
:
state
?
"
inline
"
:
"
none
"
});
...
...
@@ -2104,11 +2104,15 @@ function gui_radio_button_coords(cid, tag, x1, y1, xi, yi, i, s, d, orient) {
});
}
function
gui_radio_update
(
cid
,
tag
,
b
gcolor
,
prev
,
next
)
{
function
gui_radio_update
(
cid
,
tag
,
x_f
gcolor
,
prev
,
next
)
{
var
prev
=
get_item
(
cid
,
tag
+
"
button_
"
+
prev
),
next
=
get_item
(
cid
,
tag
+
"
button_
"
+
next
);
configure_item
(
prev
,
{
display
:
"
none
"
,
fill
:
bgcolor
,
stroke
:
bgcolor
});
configure_item
(
next
,
{
display
:
"
inline
"
,
fill
:
bgcolor
,
stroke
:
bgcolor
});
configure_item
(
prev
,
{
display
:
"
none
"
});
configure_item
(
next
,
{
display
:
"
inline
"
,
fill
:
x2h
(
x_fgcolor
),
stroke
:
x2h
(
x_fgcolor
)
});
}
function
gui_create_vumeter_text
(
cid
,
tag
,
color
,
xpos
,
ypos
,
text
,
index
,
basex
,
basey
)
{
...
...
pd/src/g_radio.c
View file @
fb17c23f
...
...
@@ -26,13 +26,14 @@ t_class *vradio_class, *vradio_old_class;
void
radio_draw_update
(
t_gobj
*
client
,
t_glist
*
glist
)
{
t_radio
*
x
=
(
t_radio
*
)
client
;
if
(
!
glist_isvisible
(
glist
))
return
;
if
(
!
glist_isvisible
(
glist
))
return
;
t_canvas
*
canvas
=
glist_getcanvas
(
glist
);
char
fcol
[
8
],
bcol
[
8
];
sprintf
(
fcol
,
"#%6.6x"
,
x
->
x_gui
.
x_fcol
);
sprintf
(
bcol
,
"#%6.6x"
,
x
->
x_gui
.
x_bcol
);
gui_vmess
(
"gui_radio_update"
,
"xxsii"
,
canvas
,
x
,
fcol
,
x
->
x_drawn
,
x
->
x_on
);
gui_vmess
(
"gui_radio_update"
,
"xxxii"
,
canvas
,
x
,
x
->
x_gui
.
x_fcol
,
x
->
x_drawn
,
x
->
x_on
);
x
->
x_drawn
=
x
->
x_on
;
}
...
...
@@ -44,34 +45,36 @@ void radio_draw_new(t_radio *x, t_glist *glist)
int
y1
=
text_ypix
(
&
x
->
x_gui
.
x_obj
,
glist
),
yi
=
y1
;
iemgui_base_draw_new
(
&
x
->
x_gui
);
for
(
i
=
0
;
i
<
n
;
i
++
)
if
(
x
->
x_orient
)
{
if
(
i
)
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
x
->
x_orient
)
{
gui_vmess
(
"gui_create_radio"
,
"xxiiiiiii"
,
canvas
,
x
,
x1
,
yi
,
x1
+
d
,
yi
,
i
,
x1
,
y1
);
if
(
i
)
{
gui_vmess
(
"gui_create_radio"
,
"xxiiiiiii"
,
canvas
,
x
,
x1
,
yi
,
x1
+
d
,
yi
,
i
,
x1
,
y1
);
}
gui_vmess
(
"gui_create_radio_buttons"
,
"xxxiiiiiiii"
,
canvas
,
x
,
x
->
x_gui
.
x_fcol
,
x1
+
s
,
yi
+
s
,
x1
+
d
-
s
,
yi
+
d
-
s
,
x1
,
y1
,
i
,
x
->
x_on
==
i
);
yi
+=
d
;
x
->
x_drawn
=
x
->
x_on
;
}
char
tagbuf
[
MAXPDSTRING
];
sprintf
(
tagbuf
,
"x%lx"
,
(
long
unsigned
int
)
x
);
char
colorbuf
[
MAXPDSTRING
];
sprintf
(
colorbuf
,
"#%6.6x"
,
x
->
x_gui
.
x_fcol
);
gui_vmess
(
"gui_create_radio_buttons"
,
"xxsiiiiiiii"
,
canvas
,
x
,
colorbuf
,
x1
+
s
,
yi
+
s
,
x1
+
d
-
s
,
yi
+
d
-
s
,
x1
,
y1
,
i
,
x
->
x_on
==
i
);
yi
+=
d
;
x
->
x_drawn
=
x
->
x_on
;
}
else
{
if
(
i
)
else
{
gui_vmess
(
"gui_create_radio"
,
"xxiiiiiii"
,
canvas
,
x
,
xi
,
y1
,
xi
,
y1
+
d
,
i
,
x1
,
y1
);
if
(
i
)
{
gui_vmess
(
"gui_create_radio"
,
"xxiiiiiii"
,
canvas
,
x
,
xi
,
y1
,
xi
,
y1
+
d
,
i
,
x1
,
y1
);
}
gui_vmess
(
"gui_create_radio_buttons"
,
"xxxiiiiiiii"
,
canvas
,
x
,
x
->
x_gui
.
x_fcol
,
xi
+
s
,
y1
+
s
,
xi
+
d
-
s
,
yi
+
d
-
s
,
x1
,
y1
,
i
,
x
->
x_on
==
i
);
xi
+=
d
;
x
->
x_drawn
=
x
->
x_on
;
}
char
colorbuf
[
MAXPDSTRING
];
sprintf
(
colorbuf
,
"#%6.6x"
,
x
->
x_gui
.
x_fcol
);
gui_vmess
(
"gui_create_radio_buttons"
,
"xxsiiiiiiii"
,
canvas
,
x
,
colorbuf
,
xi
+
s
,
y1
+
s
,
xi
+
d
-
s
,
yi
+
d
-
s
,
x1
,
y1
,
i
,
x
->
x_on
==
i
);
xi
+=
d
;
x
->
x_drawn
=
x
->
x_on
;
}
}
...
...
@@ -83,16 +86,19 @@ void radio_draw_move(t_radio *x, t_glist *glist)
int
x1
=
text_xpix
(
&
x
->
x_gui
.
x_obj
,
glist
),
xi
=
0
;
int
y1
=
text_ypix
(
&
x
->
x_gui
.
x_obj
,
glist
),
yi
=
0
;
iemgui_base_draw_move
(
&
x
->
x_gui
);
for
(
i
=
0
;
i
<
n
;
i
++
)
if
(
x
->
x_orient
)
{
gui_vmess
(
"gui_radio_button_coords"
,
"xxiiiiiiii"
,
canvas
,
x
,
x1
,
y1
,
xi
,
yi
,
i
,
s
,
d
,
x
->
x_orient
);
yi
+=
d
;
}
else
{
gui_vmess
(
"gui_radio_button_coords"
,
"xxiiiiiiii"
,
canvas
,
x
,
x1
,
y1
,
xi
,
yi
,
i
,
s
,
d
,
x
->
x_orient
);
xi
+=
d
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
x
->
x_orient
)
{
gui_vmess
(
"gui_radio_button_coords"
,
"xxiiiiiiii"
,
canvas
,
x
,
x1
,
y1
,
xi
,
yi
,
i
,
s
,
d
,
x
->
x_orient
);
yi
+=
d
;
}
else
{
gui_vmess
(
"gui_radio_button_coords"
,
"xxiiiiiiii"
,
canvas
,
x
,
x1
,
y1
,
xi
,
yi
,
i
,
s
,
d
,
x
->
x_orient
);
xi
+=
d
;
}
}
}
...
...
@@ -101,17 +107,15 @@ void radio_draw_config(t_radio *x, t_glist *glist)
t_canvas
*
canvas
=
glist_getcanvas
(
glist
);
int
n
=
x
->
x_number
,
i
;
iemgui_base_draw_config
(
&
x
->
x_gui
);
for
(
i
=
0
;
i
<
n
;
i
++
)
for
(
i
=
0
;
i
<
n
;
i
++
)
{
//sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -stroke #%6.6x\n",
// canvas, x, i,
// (x->x_on==i) ? x->x_gui.x_fcol : x->x_gui.x_bcol,
// (x->x_on==i) ? x->x_gui.x_fcol : x->x_gui.x_bcol);
}
char
col
[
8
];
sprintf
(
col
,
"#%6.6x"
,
x
->
x_gui
.
x_fcol
);
gui_vmess
(
"gui_radio_update"
,
"xxsii"
,
canvas
,
x
,
col
,
0
,
x
->
x_on
);
gui_vmess
(
"gui_radio_update"
,
"xxxii"
,
canvas
,
x
,
x
->
x_gui
.
x_fcol
,
0
,
x
->
x_on
);
}
...
...
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