Commit 332cb289 authored by Jonathan Wilkes's avatar Jonathan Wilkes

hook in the functionality to suppress scrolling.

However, we still need to figure out if we want to supress gui_canvas_getscroll
when suppressing the scrollbars. Currently it still gets called, which will
adjust the viewport to make objects at negative indices visible. I think
instead we want to anchor the viewport to 0,0 at top left and supress those
calls to get a nice speedup in the GUI.
parent 11b70d6c
......@@ -1030,9 +1030,11 @@ function register_window_id(cid, attr_array) {
// 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();
// set_cord_inspector_checkbox();
// One final kludge-- because window creation is asyncronous, we may
// Set scroll bars
pdgui.canvas_set_scrollbars(cid, !attr_array.hide_scroll);
// One final kludge-- because window creation is asynchronous, we may
// have gotten a dirty flag before the window was created. In that case
// we check the title_queue to see if our title now contains an asterisk
// (which is the visual cue for "dirty")
......
......@@ -976,6 +976,17 @@ function gui_canvas_set_cordinspector(cid, state) {
patchwin[cid].window.set_cord_inspector_checkbox(state !== 0 ? true : false);
}
function canvas_set_scrollbars(cid, scroll) {
patchwin[cid].window.document.body.style.
overflow = scroll ? "visible" : "hidden";
}
exports.canvas_set_scrollbars = canvas_set_scrollbars;
function gui_canvas_set_scrollbars(cid, no_scrollbars) {
canvas_set_scrollbars(cid, no_scrollbars === 0);
}
exports.menu_send = menu_send;
function gui_set_toplevel_window_list(dummy, attr_array) {
......@@ -1417,7 +1428,8 @@ function gui_canvas_new(cid, width, height, geometry, zoom, editmode, name, dir,
dirty: dirty_flag,
args: cargs,
zoom: zoom,
editmode: editmode
editmode: editmode,
hide_scroll: hide_scroll
});
}
......
......@@ -744,8 +744,8 @@ void canvas_scalar_event(t_canvas *x, t_symbol *s, int argc, t_atom *argv)
void canvas_show_scrollbars(t_canvas *x, t_floatarg f)
{
post("setting noscroll to %d", f);
x->gl_noscroll = (int)f;
gui_vmess("gui_canvas_set_scrollbars", "xi", x, (int)f);
}
void canvas_show_menu(t_canvas *x, t_floatarg f)
......
......@@ -2767,7 +2767,8 @@ static void canvas_donecanvasdialog(t_glist *x,
xmargin = atom_getfloatarg(9, argc, argv);
ymargin = atom_getfloatarg(10, argc, argv);
x->gl_noscroll = atom_getintarg(11, argc, argv);
pd_vmess(&x->gl_pd, gensym("scroll"), "f",
atom_getfloatarg(11, argc, argv));
x->gl_nomenu = atom_getintarg(12, argc, argv);
/* parent windows are treated differently than applies to
......
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