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
e27c50b2
Commit
e27c50b2
authored
Feb 08, 2016
by
Jonathan Wilkes
Browse files
some more work toward arbitrary-sized object box content from GUI->Pd
* simplify GUI API * get rid of canvas_createobj
parent
761cd972
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/nw/pd_canvas.js
View file @
e27c50b2
...
...
@@ -402,12 +402,6 @@ var canvas_events = (function() {
text_keyup
:
function
(
evt
)
{
evt
.
stopPropagation
();
//evt.preventDefault();
// ctrl-Enter to instantiate object
// if (evt.keyCode === 13 && cmd_or_ctrl_key(evt)) {
// canvas_events.text(); // anchor the object
// canvas_events.set_obj();
// pdgui.pdsend(name, "reselect");
// }
return
false
;
},
text_keypress
:
function
(
evt
)
{
...
...
@@ -506,7 +500,7 @@ var canvas_events = (function() {
}
},
utils
=
{
set
_obj
:
function
()
{
create
_obj
:
function
()
{
var
fudi_msg
=
text_to_fudi
(
textbox
().
innerText
),
fudi_array
=
string_to_array_of_chunks
(
fudi_msg
),
i
;
...
...
@@ -514,10 +508,6 @@ var canvas_events = (function() {
pdgui
.
pdsend
(
name
,
"
obj_addtobuf
"
,
fudi_array
[
i
].
join
(
"
"
));
}
pdgui
.
pdsend
(
name
,
"
obj_buftotext
"
);
},
create_obj
:
function
()
{
canvas_events
.
set_obj
();
pdgui
.
pdsend
(
name
,
"
obj_createobj
"
);
}
}
;
...
...
@@ -775,9 +765,6 @@ var canvas_events = (function() {
get_previous_state
:
function
()
{
return
previous_state
;
},
set_obj
:
function
()
{
utils
.
set_obj
();
},
create_obj
:
function
()
{
utils
.
create_obj
();
},
...
...
@@ -905,7 +892,7 @@ function have_live_box() {
// If there's a box being edited, send the box's text to Pd
function
update_live_box
()
{
if
(
have_live_box
())
{
canvas_events
.
set
_obj
();
canvas_events
.
create
_obj
();
}
}
...
...
@@ -1076,7 +1063,7 @@ function nw_create_patch_window_menus(gui, w, name) {
if
(
canvas_events
.
get_state
()
===
"
floating_text
"
||
canvas_events
.
get_state
()
===
"
text
"
)
{
canvas_events
.
text
();
// anchor the object
canvas_events
.
set
_obj
();
canvas_events
.
create
_obj
();
}
pdgui
.
pdsend
(
name
,
"
reselect
"
);
}
...
...
pd/src/g_editor.c
View file @
e27c50b2
...
...
@@ -7377,7 +7377,6 @@ static void canvas_buftotext(t_canvas *x, t_symbol *s, int argc, t_atom *argv)
automatically, so we don't need to free the "buf" here. */
rtext_settext
(
rtext
,
buf
,
length
);
binbuf_free
(
b
);
binbuf_clear
(
newobjbuf
);
// Set the dirty flag since we've changed the rtext content...
canvas_dirty
(
x
,
1
);
x
->
gl_editor
->
e_textdirty
=
1
;
...
...
@@ -7385,18 +7384,8 @@ static void canvas_buftotext(t_canvas *x, t_symbol *s, int argc, t_atom *argv)
break
;
}
}
}
static
void
canvas_createobj
(
t_canvas
*
x
)
{
t_gobj
*
y
;
t_rtext
*
rtext
;
if
(
!
x
->
gl_editor
)
return
;
for
(
y
=
x
->
gl_list
;
y
;
y
=
y
->
g_next
)
{
if
(
glist_isselected
(
x
,
y
)
&&
(
rtext
=
glist_findrtext
(
x
,
(
t_text
*
)
y
)))
glist_deselect
(
x
,
y
);
// instantiate
}
/* Clear the buffer */
binbuf_clear
(
newobjbuf
);
}
void
g_editor_setup
(
void
)
...
...
@@ -7424,8 +7413,6 @@ void g_editor_setup(void)
gensym
(
"obj_addtobuf"
),
A_GIMME
,
A_NULL
);
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_buftotext
,
gensym
(
"obj_buftotext"
),
A_NULL
);
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_createobj
,
gensym
(
"obj_createobj"
),
A_NULL
);
/* ------------------------ menu actions ---------------------------- */
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_menuclose
,
gensym
(
"menuclose"
),
A_DEFFLOAT
,
0
);
...
...
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