Commit bbf0a1a3 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

change hyphens to underscores in canvas dialog for consistency

parent e178b2f4
......@@ -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");
}
}
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment