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
e96df9e9
Commit
e96df9e9
authored
Aug 14, 2015
by
Jonathan Wilkes
Browse files
ported: "*fixed copying dialog text and pasting it onto a canvas crasher"
from pd-l2ork: 96e2fa5605a2d87ab99c5c2c8df9bca53c23c401
parent
d0bab533
Changes
4
Hide whitespace changes
Inline
Side-by-side
pd/nw/todo.txt
View file @
e96df9e9
...
...
@@ -253,6 +253,8 @@ Everything else: (A [x] means we've fixed it)
will not get ported.
[ ] same for "*fixed font positioning on 14.04+ releases"
9edc6ca98e141174b86ebe5cdf406fe7e47845d5
NB: this commit affects the old GUI. Need to revisit it with the new
one to see whether it's still necessary.
[ ] same for "*fixed copying dialog text and pasting it onto a canvas crasher"
96e2fa5605a2d87ab99c5c2c8df9bca53c23c401
[ ] same for "*revamped arduino connectivity to use Firmata firmware and allow for"
...
...
pd/src/g_editor.c
View file @
e96df9e9
...
...
@@ -5972,6 +5972,11 @@ static void canvas_copyfromexternalbuffer(t_canvas *x, t_symbol *s,
}
}
void
glob_clipboard_text
(
t_pd
*
dummy
,
float
f
)
{
clipboard_istext
=
(
int
)
f
;
}
static
void
canvas_copy
(
t_canvas
*
x
)
{
if
(
!
x
->
gl_editor
||
!
x
->
gl_editor
->
e_selection
)
...
...
pd/src/m_glob.c
View file @
e96df9e9
...
...
@@ -71,6 +71,9 @@ static void glob_perf(t_pd *dummy, float f)
sys_perf
=
(
f
!=
0
);
}
// ths one lives inside g_editor so that it can access the clipboard
extern
void
glob_clipboard_text
(
t_pd
*
dummy
,
float
f
);
void
max_default
(
t_pd
*
x
,
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
{
int
i
;
...
...
@@ -142,6 +145,8 @@ void glob_init(void)
gensym
(
"version"
),
A_FLOAT
,
0
);
class_addmethod
(
glob_pdobject
,
(
t_method
)
glob_perf
,
gensym
(
"perf"
),
A_FLOAT
,
0
);
class_addmethod
(
glob_pdobject
,
(
t_method
)
glob_clipboard_text
,
gensym
(
"clipboardtext"
),
A_FLOAT
,
0
);
#ifdef UNIX
class_addmethod
(
glob_pdobject
,
(
t_method
)
glob_watchdog
,
gensym
(
"watchdog"
),
0
);
...
...
pd/src/pd.tk
View file @
e96df9e9
...
...
@@ -1022,6 +1022,8 @@ proc pdtk_panelkeybindings {id panelname} {
bind $id <KeyPress-Escape> [format "%s_cancel %s" $panelname $id]
bind $id <KeyPress-Return> [format "%s_ok %s" $panelname $id]
bind $id <$ctrl_key-Key-w> [format "%s_cancel %s" $panelname $id]
bind $id <$ctrl_key-Key-x> [format "menu_cut %s" $id]
bind $id <$ctrl_key-Key-c> [format "menu_copy %s" $id]
}
pdtk_standardkeybindings .
...
...
@@ -2021,6 +2023,7 @@ proc menu_redo {name} {
}
proc
menu_cut
{
name
}
{
#
puts
stderr
"menu_cut $name"
global
copytexttocanvas
if
{
![string match .gfxstub* $name] && ![string match .printout* $name] && ![string match *entry $name]} {
pd
[
concat
$
name
cut
\;]
...
...
@@ -2029,12 +2032,13 @@ proc menu_cut {name} {
clipboard
clear
}
else
{
set
copytexttocanvas
1
pd
[
concat
pd
clipboardtext
1
\;]
}
pdtk_canvas_update_paste_menu
1
}
proc
menu_copy
{
name
}
{
#
pdtk_post
menu_copy
#
puts
stderr
menu_copy
global
copytexttocanvas
if
{
![string match .gfxstub* $name] && ![string match .printout* $name] && ![string match *entry $name]} {
pd
[
concat
$
name
copy
\;]
...
...
@@ -2042,7 +2046,8 @@ proc menu_copy {name} {
clipboard
clear
}
else
{
#
pdtk_post
"this_is_text
\n
"
set
copytexttocanvas
1
set
clipboardtext
1
pd
[
concat
pd
clipboardtext
1
\;]
}
pdtk_canvas_update_paste_menu
1
}
...
...
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