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
bbf0a1a3
Commit
bbf0a1a3
authored
Dec 07, 2016
by
Jonathan Wilkes
Browse files
change hyphens to underscores in canvas dialog for consistency
parent
e178b2f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
pd/nw/dialog_canvas.html
View file @
bbf0a1a3
...
...
@@ -13,7 +13,7 @@
<legend
data-i18n=
"canvas.prop.heading.gop"
></legend>
<table
class=
"pairs"
>
<tr
class=
"display
-
flags prop hidden"
data-i18n=
"[title]canvas.prop.gop_tt"
>
<tr
class=
"display
_
flags prop hidden"
data-i18n=
"[title]canvas.prop.gop_tt"
>
<td>
<input
type=
"checkbox"
name=
"gop"
value=
"on"
>
</td>
...
...
@@ -21,7 +21,7 @@
<span
id=
"gop_label"
data-i18n=
"canvas.prop.gop"
></span>
</td>
</tr>
<tr
class=
"x
-
pix prop hidden"
>
<tr
class=
"x
_
pix prop hidden"
>
<td>
</td>
<td>
...
...
@@ -33,7 +33,7 @@
</label>
</td>
<td
data-i18n=
"[title]canvas.prop.x_pix_tt"
>
<input
class=
"gop_opt"
type=
"text"
name=
"x
-
pix"
>
<input
class=
"gop_opt"
type=
"text"
name=
"x
_
pix"
>
</td>
<td>
<label
class=
"gop_opt"
data-i18n=
"[title]canvas.prop.y_pix_tt"
>
...
...
@@ -41,17 +41,17 @@
</label>
</td>
<td
data-i18n=
"[title]canvas.prop.y_pix_tt"
>
<input
class=
"gop_opt"
type=
"text"
name=
"y
-
pix"
>
<input
class=
"gop_opt"
type=
"text"
name=
"y
_
pix"
>
</td>
</tr>
<tr
class=
"x
-
margin prop hidden"
>
<tr
class=
"x
_
margin prop hidden"
>
<td>
<label
class=
"gop_opt"
data-i18n=
"[title]canvas.prop.x_margin_tt"
>
<span
data-i18n=
"canvas.prop.x_margin"
></span>
</label>
</td>
<td
data-i18n=
"[title]canvas.prop.x_margin_tt"
>
<input
class=
"gop_opt"
type=
"text"
name=
"x
-
margin"
>
<input
class=
"gop_opt"
type=
"text"
name=
"x
_
margin"
>
</td>
<td>
<label
class=
"gop_opt"
data-i18n=
"[title]canvas.prop.y_margin_tt"
>
...
...
@@ -59,18 +59,18 @@
</label>
</td>
<td
data-i18n=
"[title]canvas.prop.y_margin_tt"
>
<input
class=
"gop_opt"
type=
"text"
name=
"y
-
margin"
>
<input
class=
"gop_opt"
type=
"text"
name=
"y
_
margin"
>
</td>
</tr>
</table>
</td>
</tr>
<tr
class=
"display
-
flags prop hide
-
name
-
row"
>
<tr
class=
"display
_
flags prop hide
_
name
_
row"
>
<td>
</td>
<td>
<label
class=
"gop_opt"
data-i18n=
"[title]canvas.prop.hide_name_tt"
>
<input
class=
"gop_opt"
type=
"checkbox"
name=
"hide
-
name"
value=
"on"
>
<input
class=
"gop_opt"
type=
"checkbox"
name=
"hide
_
name"
value=
"on"
>
<span
data-i18n=
"canvas.prop.hide_name"
></span>
</label>
</td>
...
...
@@ -81,15 +81,15 @@
<fieldset
class=
"canvas"
>
<legend
data-i18n=
"canvas.prop.heading.data_scaling"
></legend>
<div
style=
"display: inline-block; align: left;"
>
<div
class=
"x
-
scale prop hidden"
>
<div
class=
"x
_
scale prop hidden"
>
<nobr>
<label
class=
"no_gop_opt"
data-i18n=
"[title]canvas.prop.x_scale_tt"
>
<span
data-i18n=
"canvas.prop.x_scale"
></span>
<input
class=
"no_gop_opt"
type=
"text"
name=
"x
-
scale"
>
<input
class=
"no_gop_opt"
type=
"text"
name=
"x
_
scale"
>
</label>
<label
class=
"no_gop_opt"
data-i18n=
"[title]canvas.prop.y_scale_tt"
>
<span
data-i18n=
"canvas.prop.y_scale"
></span>
<input
class=
"no_gop_opt"
type=
"text"
name=
"y
-
scale"
>
<input
class=
"no_gop_opt"
type=
"text"
name=
"y
_
scale"
>
</label>
</nobr>
</div>
...
...
@@ -473,10 +473,10 @@ var gop_click_count = 0;
function
show_sane_defaults
()
{
var
w
,
h
,
xoff
,
yoff
;
w
=
document
.
getElementsByName
(
"
x
-
pix
"
)[
0
];
h
=
document
.
getElementsByName
(
"
y
-
pix
"
)[
0
];
xoff
=
document
.
getElementsByName
(
"
x
-
margin
"
)[
0
];
yoff
=
document
.
getElementsByName
(
"
y
-
margin
"
)[
0
];
w
=
document
.
getElementsByName
(
"
x
_
pix
"
)[
0
];
h
=
document
.
getElementsByName
(
"
y
_
pix
"
)[
0
];
xoff
=
document
.
getElementsByName
(
"
x
_
margin
"
)[
0
];
yoff
=
document
.
getElementsByName
(
"
y
_
margin
"
)[
0
];
if
(
w
.
value
===
"
0
"
&&
h
.
value
===
"
0
"
)
{
w
.
value
=
85
;
h
.
value
=
60
;
...
...
@@ -487,7 +487,7 @@ function show_sane_defaults() {
}
function
show_gop_name_and_args_checkbutton
(
flag
)
{
var
row
=
document
.
getElementsByClassName
(
"
hide
-
name
-
row
"
)[
0
];
var
row
=
document
.
getElementsByClassName
(
"
hide
_
name
_
row
"
)[
0
];
row
.
style
.
setProperty
(
"
visibility
"
,
flag
?
"
visible
"
:
"
hidden
"
);
}
...
...
@@ -500,7 +500,7 @@ function set_gop(state) {
no_gop_opts
=
document
.
getElementsByClassName
(
"
no_gop_opt
"
);
update_gop_form
(
gop_opts
,
state
);
update_gop_form
(
no_gop_opts
,
state
===
false
);
// Hide or show the "hide
-
name" row
// Hide or show the "hide
_
name" row
show_gop_name_and_args_checkbutton
(
state
);
}
...
...
@@ -545,20 +545,20 @@ function apply() {
if
(
!
new_array_dialog
)
{
// Note: the "+" casts Boolean to Number
gop
=
+
document
.
getElementsByName
(
"
gop
"
)[
0
].
checked
;
hide_name
=
+
document
.
getElementsByName
(
"
hide
-
name
"
)[
0
].
checked
;
hide_name
=
+
document
.
getElementsByName
(
"
hide
_
name
"
)[
0
].
checked
;
pdgui
.
pdsend
(
pd_object_callback
,
"
donecanvasdialog
"
,
+
get_input
(
"
x
-
scale
"
),
+
get_input
(
"
y
-
scale
"
),
+
get_input
(
"
x
_
scale
"
),
+
get_input
(
"
y
_
scale
"
),
(
gop
?
gop
+
2
*
hide_name
:
0
),
// No hide_name bit if gop is off
+
get_input
(
"
x1
"
),
+
get_input
(
"
y1
"
),
+
get_input
(
"
x2
"
),
+
get_input
(
"
y2
"
),
+
get_input
(
"
x
-
pix
"
),
+
get_input
(
"
y
-
pix
"
),
+
get_input
(
"
x
-
margin
"
),
+
get_input
(
"
y
-
margin
"
)
+
get_input
(
"
x
_
pix
"
),
+
get_input
(
"
y
_
pix
"
),
+
get_input
(
"
x
_
margin
"
),
+
get_input
(
"
y
_
margin
"
)
);
}
...
...
@@ -710,12 +710,12 @@ function populate_form(attr_object) {
if
(
prop_group
!==
undefined
)
{
prop_group
.
classList
.
remove
(
"
hidden
"
);
}
if
(
prop
===
"
display
-
flags
"
)
{
if
(
prop
===
"
display
_
flags
"
)
{
// reminder: "!!" forces Boolean, "+" forces Number type
var
flag
=
+
attr_object
[
prop
];
document
.
getElementsByName
(
"
gop
"
)[
0
].
checked
=
!!
flag
;
document
.
getElementsByName
(
"
hide
-
name
"
)[
0
].
checked
=
!!
(
flag
&
2
);
// set visibility of the "hide
-
name" checkbox based on
document
.
getElementsByName
(
"
hide
_
name
"
)[
0
].
checked
=
!!
(
flag
&
2
);
// set visibility of the "hide
_
name" checkbox based on
// the gop flag. This way users don't get the idea that it
// can be set independently of gop.
show_gop_name_and_args_checkbutton
(
!!
flag
);
...
...
@@ -743,16 +743,16 @@ function populate_form(attr_object) {
// Some special cases for hiding options for garray dialogs
if
(
pd_garray_attrs
.
length
>
0
)
{
// Graph-on-parent toggle
document
.
getElementsByClassName
(
"
display
-
flags
"
)[
0
]
document
.
getElementsByClassName
(
"
display
_
flags
"
)[
0
]
.
classList
.
add
(
"
hidden
"
);
// Graph-on-parent flag for hiding object name/args
document
.
getElementsByClassName
(
"
display
-
flags
"
)[
1
]
document
.
getElementsByClassName
(
"
display
_
flags
"
)[
1
]
.
classList
.
add
(
"
hidden
"
);
// GOP-rect margins don't make sense for garrays, so hide them
document
.
getElementsByClassName
(
"
x
-
margin
"
)[
0
]
document
.
getElementsByClassName
(
"
x
_
margin
"
)[
0
]
.
classList
.
add
(
"
hidden
"
);
// X/Y scaling-- garray is always in a gop so not needed
document
.
getElementsByClassName
(
"
x
-
scale
"
)[
0
]
document
.
getElementsByClassName
(
"
x
_
scale
"
)[
0
]
.
classList
.
add
(
"
hidden
"
);
}
}
...
...
pd/src/g_canvas.c
View file @
bbf0a1a3
...
...
@@ -2210,7 +2210,10 @@ void canvasgop_checksize(t_canvas *x)
if
(
dirty
)
{
post
(
"Adjusting canvas graph-on-parent area to accomodate its name. If you want to have a smaller graph-on-parent window, please hide graph text."
);
post
(
"Warning: "
"Adjusting canvas graph-on-parent area to accomodate "
"its name. If you want to have a smaller graph-on-parent "
"window, please hide graph text."
);
canvas_dirty
(
x
,
1
);
canvasgop_draw_move
(
x
,
1
);
canvas_fixlinesfor
(
x
,
(
t_text
*
)
x
);
...
...
@@ -2257,8 +2260,8 @@ void canvasgop__clickhook(t_scalehandle *sh, int newstate)
int
properties
=
gfxstub_haveproperties
((
void
*
)
x
);
if
(
properties
)
{
properties_set_field_int
(
properties
,
"x
-
pix"
,
x
->
gl_pixwidth
);
properties_set_field_int
(
properties
,
"y
-
pix"
,
x
->
gl_pixheight
);
properties_set_field_int
(
properties
,
"x
_
pix"
,
x
->
gl_pixwidth
);
properties_set_field_int
(
properties
,
"y
_
pix"
,
x
->
gl_pixheight
);
}
if
(
glist_isvisible
(
x
))
...
...
@@ -2351,9 +2354,9 @@ void canvasgop__motionhook(t_scalehandle *sh, t_floatarg mouse_x,
if
(
properties
)
{
properties_set_field_int
(
properties
,
"x
-
pix"
,
x
->
gl_pixwidth
+
sh
->
h_dragx
);
"x
_
pix"
,
x
->
gl_pixwidth
+
sh
->
h_dragx
);
properties_set_field_int
(
properties
,
"y
-
pix"
,
x
->
gl_pixheight
+
sh
->
h_dragy
);
"y
_
pix"
,
x
->
gl_pixheight
+
sh
->
h_dragy
);
}
}
else
//enter if move_gop hook
...
...
@@ -2362,9 +2365,9 @@ void canvasgop__motionhook(t_scalehandle *sh, t_floatarg mouse_x,
if
(
properties
)
{
properties_set_field_int
(
properties
,
"x
-
margin"
,
x
->
gl_xmargin
+
dx
);
"x
_
margin"
,
x
->
gl_xmargin
+
dx
);
properties_set_field_int
(
properties
,
"y
-
margin"
,
x
->
gl_ymargin
+
dy
);
"y
_
margin"
,
x
->
gl_ymargin
+
dy
);
}
x
->
gl_xmargin
+=
dx
;
x
->
gl_ymargin
+=
dy
;
...
...
pd/src/g_editor.c
View file @
bbf0a1a3
...
...
@@ -2673,17 +2673,17 @@ void canvas_properties(t_glist *x)
// x->gl_x1, x->gl_y1, x->gl_x2, x->gl_y2,
// (int)x->gl_pixwidth, (int)x->gl_pixheight,
// (int)x->gl_xmargin, (int)x->gl_ymargin);
gui_s
(
"x
-
scale"
);
gui_f
(
0
.);
gui_s
(
"y
-
scale"
);
gui_f
(
0
.);
gui_s
(
"display
-
flags"
);
gui_i
(
glist_isgraph
(
x
));
gui_s
(
"x
_
scale"
);
gui_f
(
0
.);
gui_s
(
"y
_
scale"
);
gui_f
(
0
.);
gui_s
(
"display
_
flags"
);
gui_i
(
glist_isgraph
(
x
));
gui_s
(
"x1"
);
gui_f
(
x
->
gl_x1
);
gui_s
(
"y1"
);
gui_f
(
x
->
gl_y1
);
gui_s
(
"x2"
);
gui_f
(
x
->
gl_x2
);
gui_s
(
"y2"
);
gui_f
(
x
->
gl_y2
);
gui_s
(
"x
-
pix"
);
gui_i
((
int
)
x
->
gl_pixwidth
);
gui_s
(
"y
-
pix"
);
gui_i
((
int
)
x
->
gl_pixheight
);
gui_s
(
"x
-
margin"
);
gui_i
((
int
)
x
->
gl_xmargin
);
gui_s
(
"y
-
margin"
);
gui_i
((
int
)
x
->
gl_ymargin
);
gui_s
(
"x
_
pix"
);
gui_i
((
int
)
x
->
gl_pixwidth
);
gui_s
(
"y
_
pix"
);
gui_i
((
int
)
x
->
gl_pixheight
);
gui_s
(
"x
_
margin"
);
gui_i
((
int
)
x
->
gl_xmargin
);
gui_s
(
"y
_
margin"
);
gui_i
((
int
)
x
->
gl_ymargin
);
}
else
{
...
...
@@ -2694,17 +2694,17 @@ void canvas_properties(t_glist *x)
// 0., -1., 1., 1.,
// (int)x->gl_pixwidth, (int)x->gl_pixheight,
// (int)x->gl_xmargin, (int)x->gl_ymargin);
gui_s
(
"x
-
scale"
);
gui_f
(
glist_dpixtodx
(
x
,
1
));
gui_s
(
"y
-
scale"
);
gui_f
(
-
glist_dpixtody
(
x
,
1
));
gui_s
(
"display
-
flags"
);
gui_i
(
0
);
gui_s
(
"x
_
scale"
);
gui_f
(
glist_dpixtodx
(
x
,
1
));
gui_s
(
"y
_
scale"
);
gui_f
(
-
glist_dpixtody
(
x
,
1
));
gui_s
(
"display
_
flags"
);
gui_i
(
0
);
gui_s
(
"x1"
);
gui_f
(
0
.);
gui_s
(
"y1"
);
gui_f
(
-
1
.);
gui_s
(
"x2"
);
gui_f
(
1
.);
gui_s
(
"y2"
);
gui_f
(
1
.);
gui_s
(
"x
-
pix"
);
gui_i
((
int
)
x
->
gl_pixwidth
);
gui_s
(
"y
-
pix"
);
gui_i
((
int
)
x
->
gl_pixheight
);
gui_s
(
"x
-
margin"
);
gui_i
((
int
)
x
->
gl_xmargin
);
gui_s
(
"y
-
margin"
);
gui_i
((
int
)
x
->
gl_ymargin
);
gui_s
(
"x
_
pix"
);
gui_i
((
int
)
x
->
gl_pixwidth
);
gui_s
(
"y
_
pix"
);
gui_i
((
int
)
x
->
gl_pixheight
);
gui_s
(
"x
_
margin"
);
gui_i
((
int
)
x
->
gl_xmargin
);
gui_s
(
"y
_
margin"
);
gui_i
((
int
)
x
->
gl_ymargin
);
}
//gfxstub_new(&x->gl_pd, x, graphbuf);
...
...
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