Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
purr-data
Commits
673407ab
Commit
673407ab
authored
Jan 03, 2016
by
Jonathan Wilkes
Browse files
port dialog window callbacks for 0.13, change register_canvas_id to register_window_id
parent
6639cbc1
Changes
8
Hide whitespace changes
Inline
Side-by-side
pd/nw/dialog_canvas.html
View file @
673407ab
...
...
@@ -632,7 +632,7 @@ function init_arrays(attr_objects) {
// This gets called from the nw_create_window function in index.html
// It provides us with our window id from the C side. Once we have it
// we can create the menu and register event callbacks
function
register_
canvas
_id
(
gfxstub
,
attr_objects
)
{
function
register_
window
_id
(
gfxstub
,
attr_objects
)
{
pd_object_callback
=
gfxstub
;
var
canvas_fieldsets
,
i
,
prop
;
// attr_objects[0]: canvas properties
...
...
pd/nw/dialog_font.html
View file @
673407ab
...
...
@@ -135,7 +135,7 @@ function cancel() {
// This gets called from the nw_create_window function in index.html
// It provides us with our window id from the C side. Once we have it
// we can create the menu and register event callbacks
function
register_
canvas
_id
(
gfxstub
,
attrs
)
{
function
register_
window
_id
(
gfxstub
,
attrs
)
{
pd_object_callback
=
gfxstub
;
console
.
log
(
"
attrs are
"
+
attrs
.
toString
());
add_events
(
gfxstub
);
...
...
pd/nw/dialog_gatom.html
View file @
673407ab
...
...
@@ -206,7 +206,7 @@ function cancel() {
// This gets called from the nw_create_window function in index.html
// It provides us with our window id from the C side. Once we have it
// we can create the menu and register event callbacks
function
register_
canvas
_id
(
gfxstub
,
attributes
)
{
function
register_
window
_id
(
gfxstub
,
attributes
)
{
pd_object_callback
=
gfxstub
;
add_events
(
gfxstub
);
translate_form
();
...
...
pd/nw/dialog_iemgui.html
View file @
673407ab
...
...
@@ -480,9 +480,8 @@ function cancel() {
// This gets called from the nw_create_window function in index.html
// It provides us with our window id from the C side. Once we have it
// we can create the menu and register event callbacks
function
register_
canvas
_id
(
gfxstub
,
attr_object
)
{
function
register_
window
_id
(
gfxstub
,
attr_object
)
{
pd_object_callback
=
gfxstub
;
console
.
log
(
"
attr object is
"
+
attr_object
.
toString
());
add_events
(
gfxstub
);
translate_form
();
...
...
pd/nw/dialog_prefs.html
View file @
673407ab
...
...
@@ -562,7 +562,7 @@ function midi_prefs_callback(attrs) {
// This gets called from the nw_create_window function in index.html
// It provides us with our window id from the C side. Once we have it
// we can create the menu and register event callbacks
function
register_
canvas
_id
(
gfxstub
,
attr_arrays
)
{
function
register_
window
_id
(
gfxstub
,
attr_arrays
)
{
pd_object_callback
=
gfxstub
;
add_events
(
gfxstub
);
translate_form
();
...
...
pd/nw/index.js
View file @
673407ab
...
...
@@ -302,7 +302,7 @@ function nw_create_window(cid, type, width, height, xpos, ypos, attr_array) {
var
my_file
=
type
===
"
pd_canvas
"
?
"
pd_canvas.html
"
:
"
dialog_
"
+
type
+
"
.html
"
;
var
eval_string
=
"
register_
canvas
_id(
"
+
var
eval_string
=
"
register_
window
_id(
"
+
JSON
.
stringify
(
cid
)
+
"
,
"
+
JSON
.
stringify
(
attr_array
)
+
"
);
"
;
gui
.
Window
.
open
(
my_file
,
{
...
...
@@ -318,7 +318,11 @@ function nw_create_window(cid, type, width, height, xpos, ypos, attr_array) {
x
:
xpos
,
y
:
ypos
},
function
(
new_win
)
{
pdgui
.
set_patchwin
(
cid
,
new_win
);
if
(
type
===
"
pd_canvas
"
)
{
pdgui
.
set_patchwin
(
cid
,
new_win
);
}
else
{
pdgui
.
set_dialogwin
(
cid
,
new_win
);
}
new_win
.
on
(
"
loaded
"
,
function
()
{
new_win
.
eval
(
null
,
eval_string
);
});
...
...
pd/nw/pd_canvas.js
View file @
673407ab
...
...
@@ -652,7 +652,7 @@ var canvas_events = (function() {
// This gets called from the nw_create_window function in index.html
// It provides us with our canvas id from the C side. Once we have it
// we can create the menu and register event callbacks
function
register_
canvas
_id
(
cid
,
attr_array
)
{
function
register_
window
_id
(
cid
,
attr_array
)
{
name
=
cid
;
// hack
// We create the window menus and popup menu before doing anything else
// to ensure that we don't try to set the svg size before these are done.
...
...
pd/nw/pdgui.js
View file @
673407ab
...
...
@@ -812,6 +812,10 @@ exports.get_dialogwin = function(name) {
return
dialogwin
[
name
];
}
exports
.
set_dialogwin
=
function
(
did
,
win
)
{
dialogwin
[
did
]
=
win
;
}
exports
.
remove_dialogwin
=
function
(
name
)
{
dialogwin
[
name
]
=
null
;
}
...
...
@@ -3171,7 +3175,7 @@ function gui_iemgui_dialog(did, attr_array) {
//for (var i = 0; i < attr_array.length; i++) {
// attr_array[i] = '"' + attr_array[i] + '"';
//}
dialogwin
[
did
]
=
nw_create_window
(
did
,
"
iemgui
"
,
265
,
450
,
20
,
20
,
nw_create_window
(
did
,
"
iemgui
"
,
265
,
450
,
20
,
20
,
attr_array_to_object
(
attr_array
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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