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
nerrons
purr-data
Commits
f88c9709
Commit
f88c9709
authored
Aug 22, 2015
by
Jonathan Wilkes
Browse files
open canvas field when popup menu is selected on a scalar
parent
710d3e63
Changes
3
Hide whitespace changes
Inline
Side-by-side
pd/src/g_editor.c
View file @
f88c9709
...
...
@@ -2307,7 +2307,7 @@ t_gobj *canvas_findhitbox(t_canvas *x, int xpos, int ypos,
return
(
rval
);
}
extern
int
scalar_
has
canvasfield
(
t_scalar
*
x
);
extern
int
scalar_
get
canvasfield
(
t_scalar
*
x
);
/* right-clicking on a canvas object pops up a menu. */
static
void
canvas_rightclick
(
t_canvas
*
x
,
int
xpos
,
int
ypos
,
t_gobj
*
y_sel
)
...
...
@@ -2350,7 +2350,7 @@ static void canvas_rightclick(t_canvas *x, int xpos, int ypos, t_gobj *y_sel)
if they happen to have a canvas field inside them. */
if
(
pd_class
(
&
y
->
g_pd
)
==
scalar_class
)
{
if
(
scalar_
has
canvasfield
((
t_scalar
*
)
y
))
if
(
scalar_
get
canvasfield
((
t_scalar
*
)
y
))
scalar_has_canvas
=
1
;
canopen
=
scalar_has_canvas
;
}
...
...
pd/src/g_scalar.c
View file @
f88c9709
...
...
@@ -255,7 +255,8 @@ int template_cancreate(t_template *template)
return
(
template_check_array_fields
(
0
,
template
)
==
1
);
}
int
scalar_hascanvasfield
(
t_scalar
*
x
)
/* get the first canvas field for a scalar */
t_canvas
*
scalar_getcanvasfield
(
t_scalar
*
x
)
{
t_template
*
template
=
template_findbyname
(
x
->
sc_template
);
if
(
template
)
...
...
@@ -265,7 +266,7 @@ int scalar_hascanvasfield(t_scalar *x)
for
(
i
=
0
;
i
<
nitems
;
i
++
,
datatypes
++
)
{
if
(
datatypes
->
ds_type
==
DT_LIST
)
return
1
;
return
x
->
sc_vec
[
i
].
w_list
;
}
}
return
0
;
...
...
@@ -1227,7 +1228,8 @@ static void scalar_save(t_gobj *z, t_binbuf *b)
static
void
scalar_menuopen
(
t_scalar
*
x
)
{
post
(
"tried to open a thing"
);
t_canvas
*
c
=
scalar_getcanvasfield
(
x
);
canvas_vis
(
c
,
1
);
}
static
void
scalar_properties
(
t_gobj
*
z
,
struct
_glist
*
owner
)
...
...
pd/src/g_traversal.c
View file @
f88c9709
...
...
@@ -1336,7 +1336,6 @@ static void field_set(t_field *x, t_symbol *s)
static
void
field_bang
(
t_field
*
x
)
{
post
(
"sanity is %d"
,
x
->
x_canvas
->
sanity
);
t_word
*
vec
=
x
->
x_canvas
->
gl_vec
;
t_template
*
template
=
x
->
x_template
;
t_symbol
*
fieldsym
=
x
->
x_s
;
...
...
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