Commit 0b6f60c5 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

add cord inspector menu item, port remaining sys_vgui calls in g_editor.c

parent 8fd60b7f
......@@ -794,6 +794,10 @@ function register_window_id(cid, attr_array) {
canvas_events.normal();
pdgui.canvas_map(cid); // side-effect: triggers gui_canvas_getscroll from Pd
set_editmode_checkbox(attr_array.editmode !== 0 ? true : false);
// For now, there is no way for the cord inspector to be turned on by
// default. But if this changes we need to set its menu item checkbox
// accordingly here
//set_cord_inspector_checkbox();
}
function create_popup_menu(name) {
......@@ -875,6 +879,10 @@ function set_editmode_checkbox(state) {
canvas_menu.edit.editmode.checked = state;
}
function set_cord_inspector_checkbox(state) {
canvas_menu.edit.cordinspector.checked = state;
}
// stop-gap
function menu_generic () {
alert("Please implement this");
......
......@@ -186,6 +186,7 @@ function create_menu(gui, type) {
tooltip: l("menu.font_tt")
}));
editMenu.append(m.edit.cordinspector = new gui.MenuItem({
type: "checkbox",
label: l("menu.cordinspector"),
key: "r",
modifiers: cmd_or_ctrl,
......
......@@ -340,6 +340,15 @@ function pd_geo_string(w, h, x, y) {
return [w,"x",h,"+",x,"+",y].join("");
}
// quick hack so that we can paste pd code from clipboard and
// have it affect an empty canvas' geometry
function gui_change_patch_window_geometry(cid, w, h, x, y) {
patchwin[cid].width = w;
patchwin[cid].height = h + 23; // 23 is a kludge to account for menubar
patchwin[cid].x = x;
patchwin[cid].y = y;
}
// In tcl/tk, this function had some checks to apparently
// keep from sending a "relocate" message to Pd, but I'm
// not exactly clear on how it works. If this ends up being
......@@ -583,6 +592,10 @@ function gui_set_editmode(cid, state) {
patchwin[cid].window.set_editmode_checkbox(state !== 0 ? true : false);
}
function gui_set_cordinspector(cid, state) {
patchwin[cid].window.set_cord_inspector_checkbox(state !== 0 ? true : false);
}
exports.menu_send = menu_send;
function gui_set_toplevel_window_list(dummy, attr_array) {
......
......@@ -6455,10 +6455,16 @@ static void canvas_dopaste(t_canvas *x, t_binbuf *b)
x->gl_screeny2 = screeny1 + screeny2;
//canvas_setbounds(x, screenx1, screeny1,
// screenx1+screenx2, screeny1+screeny2);
sys_vgui("wm geometry .x%lx =%dx%d+%d+%d\n", x,
//sys_vgui("wm geometry .x%lx =%dx%d+%d+%d\n", x,
// (int)(x->gl_screenx2 - x->gl_screenx1),
// (int)(x->gl_screeny2 - x->gl_screeny1),
// (int)(x->gl_screenx1), (int)(x->gl_screeny1));
gui_vmess("gui_change_patch_window_geometry", "xiiii",
x,
(int)(x->gl_screenx2 - x->gl_screenx1),
(int)(x->gl_screeny2 - x->gl_screeny1),
(int)(x->gl_screenx1), (int)(x->gl_screeny1));
(int)(x->gl_screenx1),
(int)(x->gl_screeny1));
// hardwired stretchval and whichstretch
// until we figure out proper resizing
canvas_dofont(x, copiedfont, 1, 1);
......@@ -7581,7 +7587,9 @@ void canvas_editmode(t_canvas *x, t_floatarg fyesplease)
if (glist_isvisible(x) && glist_istoplevel(x))
{
canvas_setcursor(x, CURSOR_RUNMODE_NOTHING);
sys_vgui(".x%lx.c delete commentbar\n", glist_getcanvas(x));
/* Don't need this anymore, as we can control comment appearance
with CSS. */
//sys_vgui(".x%lx.c delete commentbar\n", glist_getcanvas(x));
// jsarlo
if (x->gl_editor->canvas_cnct_inlet_tag[0] != 0)
{
......@@ -7643,8 +7651,11 @@ void canvas_magicglass(t_canvas *x, t_floatarg fyesplease)
magicGlass_setOn(x->gl_editor->gl_magic_glass, 0);
magicGlass_hide(x->gl_editor->gl_magic_glass);
}
sys_vgui("pdtk_canvas_magicglassval .x%x %d\n",
glist_getcanvas(x), magicGlass_isOn(x->gl_editor->gl_magic_glass));
//sys_vgui("pdtk_canvas_magicglassval .x%x %d\n",
// glist_getcanvas(x), magicGlass_isOn(x->gl_editor->gl_magic_glass));
gui_vmess("gui_set_cordinspector", "xi",
glist_getcanvas(x),
magicGlass_isOn(x->gl_editor->gl_magic_glass));
}
// end jsarlo
......
Supports Markdown
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