diff --git a/Documentation/Help-files/knob-help.pd b/Documentation/Help-files/knob-help.pd index a0f558e41..4e571bf7e 100644 --- a/Documentation/Help-files/knob-help.pd +++ b/Documentation/Help-files/knob-help.pd @@ -1,4 +1,4 @@ -#N canvas 518 57 564 788 10; +#N canvas 477 53 564 788 10; #X obj 2 4 cnv 15 301 42 empty empty knob 20 20 2 37 #e0e0e0 #000000 0; #N canvas 0 22 450 278 (subpatch) 0; #X coords 0 1 100 -1 302 42 1; @@ -322,7 +322,7 @@ #X text 200 345 - sets number font size (default: 12), f 58; #X text 93 359 numberpos ; #X text 200 359 - sets coordinates relative to object (default: 6 \, -15), f 58; -#N canvas 404 131 860 581 activity/number 1; +#N canvas 404 131 860 581 activity/number 0; #X msg 193 315 number \$1; #X floatatom 193 290 3 0 0 0 - - - 0; #X obj 193 216 vradio 16 1 0 4 empty empty empty 0 -8 0 10 #dfdfdf #000000 #000000 0; @@ -333,10 +333,10 @@ #X obj 483 171 knob 65 0 100 0 0 \$0-knob-% empty #dfdfdf #7c7c7c black 0 0 0 0 1 320 0 0 0 empty empty 0 0 0 0 0 0 0; #X obj 484 244 note 54 14 Menlo \$0-set-note-% 0 0 0 0 0 255 255 255 0 1 0.00 %; #X obj 599 171 knob 65 -12 12 0 0 \$0-knob-st empty #000000 #7c7c7c #ffffff 0 0 25 1 0 320 0 0 0 empty empty 0 0 0 0 0 0 0; -#X obj 580 244 note 117 13 Menlo \$0-set-note-st 0 0 0 0 0 255 255 255 0 1 +03 semitones; +#X obj 580 244 note 117 13 Menlo \$0-set-note-st 0 0 0 0 0 255 255 255 0 1 0 semitones; #X obj 731 171 knob 65 -100 100 0 0 \$0-knob-pan empty #000000 #202020 #ff0400 0 0 0 0 1 320 0 0 0 empty empty 0 0 0 0 0 0 0; -#X obj 731 244 note 64 14 Menlo \$0-set-note-pan 0 0 0 0 0 255 255 255 0 1 69.2 L; -#N canvas 802 477 668 447 guts 1; +#X obj 731 244 note 64 14 Menlo \$0-set-note-pan 0 0 0 0 0 255 255 255 0 1 Center; +#N canvas 684 392 668 447 guts 0; #X obj 269 139 makefilename %.3#g; #X obj 152 157 moses; #X obj 269 196 s \$0-set-note-pan; diff --git a/Source/Control/knob.c b/Source/Control/knob.c index c0f761588..210580378 100755 --- a/Source/Control/knob.c +++ b/Source/Control/knob.c @@ -126,6 +126,25 @@ typedef struct _knob{ }t_knob; // ---------------------- Helper functions ---------------------- + +static void knob_update_number(t_knob *x){ +/* post("x->x_fval = %f", x->x_fval); + post("(int)x->x_fval = %d", (int)rint(x->x_fval)); + int val = (int)x->x_fval; + post("val = %d", val); + float dif = x->x_fval - (float)val; + post("dif = %f", dif);*/ + char nbuf[32]; + if(x->x_fval > -1 && x->x_fval < 1) + sprintf(nbuf, "%.5f", x->x_fval); +// else if(x->x_fval == (int)x->x_fval) +// sprintf(nbuf, "%.d", (int)x->x_fval); + else + sprintf(nbuf, "%#.5g", x->x_fval); + pdgui_vmess(0, "crs rs", glist_getcanvas(x->x_glist), + "itemconfigure", x->x_tag_number, "-text", nbuf); +} + // get value from motion/position static t_float knob_getfval(t_knob *x){ double fval; @@ -227,17 +246,16 @@ static void knob_config_number(t_knob *x){ // show or hide number value (x->x_obj.te_ypix + x->x_ypos)*x->x_zoom); } -static void show_number(t_knob *x){ // show or hide number value +static void show_number(t_knob *x, int force){ // show or hide number value if(x->x_number == 1 || (x->x_number == 2 && x->x_clicked)) x->x_shownumber = 1; // mode 1 or mode 2 and clicked else if(x->x_number == 3 && x->x_typing) x->x_shownumber = 1; // mode 3 and typing else x->x_shownumber = 0; - if(glist_isvisible(x->x_glist) && gobj_shouldvis((t_gobj *)x, x->x_glist)){ + if((glist_isvisible(x->x_glist) && gobj_shouldvis((t_gobj *)x, x->x_glist)) || force) pdgui_vmess(0, "crs rs", x->x_cv, "itemconfigure", x->x_tag_number, - "-state", x->x_shownumber ? "normal" : "hidden"); - } + "-state", x->x_shownumber ? "normal" : "hidden"); } static void knob_config_bg(t_knob *x){ @@ -494,13 +512,8 @@ char *tags_center[] = {x->x_tag_center_circle, x->x_tag_obj}; knob_config_wcenter(x); knob_config_number(x); knob_update(x); - if(x->x_shownumber){ - char buf[32]; // number buffer - sprintf(buf, "%#.5g", x->x_fval); - pdgui_vmess(0, "crs rs", glist_getcanvas(x->x_glist), - "itemconfigure", x->x_tag_number, "-text", buf); - } - show_number(x); + knob_update_number(x); + show_number(x, 1); pdgui_vmess(0, "crs rs", x->x_cv, "itemconfigure", x->x_tag_sel, "-outline", x->x_sel ? "blue" : "black"); // ?????? pdgui_vmess(0, "crs rs", x->x_cv, "itemconfigure", x->x_tag_number, @@ -704,16 +717,7 @@ static void knob_set(t_knob *x, t_floatarg f){ if(x->x_pos != old){ if(glist_isvisible(x->x_glist) && gobj_shouldvis((t_gobj *)x, x->x_glist)) knob_update(x); - } -} - -static void knob_update_number(t_knob *x){ - if(x->x_shownumber){ - char buf[32]; - sprintf(buf, "%#.5g", x->x_fval); - pdgui_vmess(0, "crs rs", glist_getcanvas(x->x_glist), - "itemconfigure", x->x_tag_number, "-text", buf); - post(buf, "number: %f / %g", x->x_fval, x->x_fval); + knob_update_number(x); } } @@ -737,7 +741,6 @@ static void knob_bang(t_knob *x){ empty: if(x->x_var != gensym("empty")) value_setfloat(x->x_var, x->x_fval); - knob_update_number(x); } static void knob_float(t_knob *x, t_floatarg f){ @@ -1053,7 +1056,7 @@ static void knob_lb(t_knob *x, t_floatarg f){ static void knob_number(t_knob *x, t_floatarg f){ x->x_number = f < 0 ? 0 : f > 3 ? 3 : (int)f; - show_number(x); + show_number(x, 0); } static void knob_numbersize(t_knob *x, t_floatarg f){ @@ -1093,19 +1096,20 @@ static void knob_properties(t_gobj *z, t_glist *owner){ knob_get_var(x); knob_get_rcv(x); pdgui_stub_vnew(&x->x_obj.ob_pd, "knob_dialog", - owner, "ffffi ss ifi sss iiiiii fss iii", + owner, "ffffi ss ifi sss iiiiii fss iii iiii", (float)(x->x_size / x->x_zoom), x->x_lower, x->x_upper, x->x_load, x->x_circular, x->x_snd_raw->s_name, x->x_rcv_raw->s_name, x->x_expmode, x->x_exp, x->x_jump, x->x_bg->s_name, x->x_fg->s_name, x->x_mg->s_name, x->x_discrete, x->x_steps, x->x_arc, x->x_range, x->x_offset, x->x_square, x->x_start, x->x_param->s_name, x->x_var_raw->s_name, - x->x_savestate, x->x_loadbang, x->x_showticks); + x->x_savestate, x->x_loadbang, x->x_showticks, + x->x_fontsize, x->x_xpos, x->x_ypos, x->x_shownumber); } static void knob_apply(t_knob *x, t_symbol *s, int ac, t_atom *av){ x->x_ignore = s; - t_atom undo[25]; + t_atom undo[29]; SETFLOAT(undo+0, x->x_size); SETFLOAT(undo+1, x->x_lower); SETFLOAT(undo+2, x->x_upper); @@ -1131,14 +1135,18 @@ static void knob_apply(t_knob *x, t_symbol *s, int ac, t_atom *av){ SETFLOAT(undo+22, x->x_savestate); SETFLOAT(undo+23, x->x_loadbang); SETFLOAT(undo+24, x->x_showticks); - pd_undo_set_objectstate(x->x_glist, (t_pd*)x, gensym("dialog"), 25, undo, ac, av); + SETFLOAT(undo+25, x->x_fontsize); + SETFLOAT(undo+26, x->x_xpos); + SETFLOAT(undo+27, x->x_ypos); + SETFLOAT(undo+28, x->x_shownumber); + pd_undo_set_objectstate(x->x_glist, (t_pd*)x, gensym("dialog"), 29, undo, ac, av); int size = (int)atom_getintarg(0, ac, av); float min = atom_getfloatarg(1, ac, av); float max = atom_getfloatarg(2, ac, av); double load = atom_getfloatarg(3, ac, av); t_symbol* snd = atom_getsymbolarg(4, ac, av); t_symbol* rcv = atom_getsymbolarg(5, ac, av); - x->x_square = atom_getintarg(6, ac, av); + int square = atom_getintarg(6, ac, av); float exp = atom_getfloatarg(7, ac, av); int expmode = atom_getintarg(8, ac, av); x->x_jump = atom_getintarg(9, ac, av); @@ -1157,6 +1165,10 @@ static void knob_apply(t_knob *x, t_symbol *s, int ac, t_atom *av){ x->x_savestate = atom_getintarg(22, ac, av); x->x_loadbang = atom_getintarg(23, ac, av); int ticks = atom_getintarg(24, ac, av); + int fontsize = atom_getintarg(25, ac, av); + int xpos = atom_getintarg(26, ac, av); + int ypos = atom_getintarg(27, ac, av); + int shownumber = atom_getintarg(28, ac, av); knob_config_io(x); // for outline/square if(expmode == 0){ knob_log(x, 0); @@ -1183,6 +1195,7 @@ static void knob_apply(t_knob *x, t_symbol *s, int ac, t_atom *av){ knob_size(x, (float)size); knob_send(x, snd); knob_receive(x, rcv); + knob_square(x, square); if(x->x_load != load){ SETFLOAT(at, load); knob_load(x, NULL, 1, at); @@ -1193,6 +1206,9 @@ static void knob_apply(t_knob *x, t_symbol *s, int ac, t_atom *av){ } knob_param(x, param); knob_var(x, var); + knob_numbersize(x, fontsize); + knob_numberpos(x, xpos, ypos); + knob_number(x, shownumber); } // --------------- click + motion stuff -------------------- @@ -1224,43 +1240,16 @@ static void knob_arrow_motion(t_knob *x, t_floatarg dir){ x->x_pos = pos; t_float fval = x->x_fval; x->x_fval = knob_getfval(x); - if(fval != x->x_fval) + if(fval != x->x_fval){ knob_bang(x); + knob_update_number(x); + } if(old != x->x_pos){ if(glist_isvisible(x->x_glist) && gobj_shouldvis((t_gobj *)x, x->x_glist)) knob_update(x); } } -static void knob_list(t_knob *x, t_symbol *sym, int ac, t_atom *av){ // get key events - if(!ac){ - knob_bang(x); - return; - } - if(ac == 1 && av->a_type == A_FLOAT){ - knob_float(x, atom_getfloat(av)); - return; - } - if(ac != 2 || x->x_edit) - return; - int flag = (int)atom_getfloat(av); // 1 for press, 0 for release - sym = atom_getsymbol(av+1); // get key name - if(sym == gensym("Meta_L")){ - x->x_ctrl = flag; - return; - } - if(!x->x_clicked) - return; - int dir = 0; - if(flag && (sym == gensym("Up") || (sym == gensym("Right")))) - dir = 1; - else if(flag && (sym == gensym("Down") || (sym == gensym("Left")))) - dir = -1; - else - return; - knob_arrow_motion(x, dir); -} - static void knob_motion(t_knob *x, t_floatarg dx, t_floatarg dy){ if(dx == 0 && dy == 0) return; @@ -1286,14 +1275,45 @@ static void knob_motion(t_knob *x, t_floatarg dx, t_floatarg dy){ x->x_pos = pos > 1 ? 1 : pos < 0 ? 0 : pos; // should go up in non circular (to do) t_float fval = x->x_fval; x->x_fval = knob_getfval(x); - if(fval != x->x_fval) + if(fval != x->x_fval){ knob_bang(x); + knob_update_number(x); + } if(old != x->x_pos){ if(glist_isvisible(x->x_glist) && gobj_shouldvis((t_gobj *)x, x->x_glist)) knob_update(x); } } +static void knob_list(t_knob *x, t_symbol *sym, int ac, t_atom *av){ // get key events + if(!ac){ + knob_bang(x); + return; + } + if(ac == 1 && av->a_type == A_FLOAT){ + knob_float(x, atom_getfloat(av)); + return; + } + if(ac != 2 || x->x_edit) + return; + int flag = (int)atom_getfloat(av); // 1 for press, 0 for release + sym = atom_getsymbol(av+1); // get key name + if(sym == gensym("Meta_L")){ + x->x_ctrl = flag; + return; + } + if(!x->x_clicked) + return; + int dir = 0; + if(flag && (sym == gensym("Up") || (sym == gensym("Right")))) + dir = 1; + else if(flag && (sym == gensym("Down") || (sym == gensym("Left")))) + dir = -1; + else + return; + knob_arrow_motion(x, dir); +} + static void knob_key(void *z, t_symbol *keysym, t_floatarg fkey){ t_knob *x = z; x->x_ignore = keysym; @@ -1314,7 +1334,7 @@ static void knob_key(void *z, t_symbol *keysym, t_floatarg fkey){ knob_float(x, x->x_buf[0] == 0 ? x->x_fval : atof(x->x_buf)); x->x_buf[0] = 0; x->x_typing = 0; - show_number(x); + show_number(x, 0); return; } else if(((c >= '0') && (c <= '9')) || (c == '.') || (c == '-') || @@ -1334,7 +1354,7 @@ static void knob_key(void *z, t_symbol *keysym, t_floatarg fkey){ goto update_number; } update_number:{ - show_number(x); + show_number(x, 0); char *cp = x->x_buf; int sl = (int)strlen(x->x_buf); x->x_buf[sl] = '|'; @@ -1395,7 +1415,7 @@ static int knob_click(t_gobj *z, struct _glist *glist, int xpix, int ypix, int s x->x_buf[0] = 0; // pd_bind(&x->x_obj.ob_pd, gensym("#keyname")); // listen to key events x->x_clicked = 1; - show_number(x); + show_number(x, 0); knob_config_wcenter(x); x->x_shift = shift; if(x->x_circular){ diff --git a/Source/Control/note.c b/Source/Control/note.c index 066b3b1cc..9058f191a 100644 --- a/Source/Control/note.c +++ b/Source/Control/note.c @@ -1648,7 +1648,7 @@ void note_setup(void){ " label $id.justification.oll -text \"Outline:\"\n" " tk_optionMenu $id.justification.just $var_just Left Center Right\n" " label $id.justification.lbj -text \"Justification:\"\n" - " pack $id.justification.oll $id.justification.ol $id.justification.lbj $id.justification.just $id.justification.lbj $id.justification.just -side left\n" + " pack $id.justification.oll $id.justification.ol $id.justification.lbj $id.justification.just -side left\n" "\n" " frame $id.ul_bg\n" " pack $id.ul_bg -side top\n" diff --git a/Source/Extra/knob_dialog.h b/Source/Extra/knob_dialog.h index 632d86ca6..c4498e3fa 100644 --- a/Source/Extra/knob_dialog.h +++ b/Source/Extra/knob_dialog.h @@ -1,86 +1,92 @@ -// Based on dialogs from iemguis in Pd Vanilla (Tim Schoen & Porres) +// Based on dialogs from elseguis in Pd Vanilla (Tim Schoen & Porres) sys_gui("\n" "\n" -"namespace eval ::dialog_knob:: {\n" +"namespace eval ::dialog_elsegui:: {\n" "}\n" -// arrays to store per-dialog values "\n" -"array set ::dialog_knob::var_size {} ;\n" +// arrays to store per-dialog values +"array set ::dialog_elsegui::var_size {} ;\n" "\n" -"array set ::dialog_knob::var_range_max {} ;\n" -"array set ::dialog_knob::var_range_min {} ;\n" +"array set ::dialog_elsegui::var_range_max {} ;\n" +"array set ::dialog_elsegui::var_range_min {} ;\n" "\n" -"array set ::dialog_knob::var_initial {} ;\n" -"array set ::dialog_knob::var_circular {} ;\n" +"array set ::dialog_elsegui::var_initial {} ;\n" +"array set ::dialog_elsegui::var_circular {} ;\n" "\n" -"array set ::dialog_knob::var_steps {} ;\n" -"array set ::dialog_knob::var_arc_shown {} ;\n" -"array set ::dialog_knob::var_outline_shown {} ;\n" -"array set ::dialog_knob::var_savestate {} ;\n" -"array set ::dialog_knob::var_loadbang {} ;\n" -"array set ::dialog_knob::var_showticks {} ;\n" -"array set ::dialog_knob::var_angle_width {} ;\n" -"array set ::dialog_knob::var_angle_offset {} ;\n" -"array set ::dialog_knob::var_discrete {} ;\n" +"array set ::dialog_elsegui::var_steps {} ;\n" +"array set ::dialog_elsegui::var_arc_shown {} ;\n" +"array set ::dialog_elsegui::var_outline_shown {} ;\n" +"array set ::dialog_elsegui::var_angle_width {} ;\n" +"array set ::dialog_elsegui::var_angle_offset {} ;\n" +"array set ::dialog_elsegui::var_discrete {} ;\n" + +"array set ::dialog_elsegui::var_savestate {} ;\n" +"array set ::dialog_elsegui::var_loadbang {} ;\n" +"array set ::dialog_elsegui::var_showticks {} ;\n" + +"array set ::dialog_elsegui::var_n_size {} ;\n" +"array set ::dialog_elsegui::var_xpos {} ;\n" +"array set ::dialog_elsegui::var_ypos {} ;\n" +"array set ::dialog_elsegui::var_n_mode {} ;\n" -"array set ::dialog_knob::var_exp {} ;\n" -"array set ::dialog_knob::var_expmode {} ;\n" -"array set ::dialog_knob::var_jump {} ;\n" +"array set ::dialog_elsegui::var_exp {} ;\n" +"array set ::dialog_elsegui::var_expmode {} ;\n" +"array set ::dialog_elsegui::var_jump {} ;\n" "\n" -"array set ::dialog_knob::var_snd {} ;\n" -"array set ::dialog_knob::var_prm {} ;\n" -"array set ::dialog_knob::var_var {} ;\n" -"array set ::dialog_knob::var_rcv {} ;\n" +"array set ::dialog_elsegui::var_snd {} ;\n" +"array set ::dialog_elsegui::var_prm {} ;\n" +"array set ::dialog_elsegui::var_var {} ;\n" +"array set ::dialog_elsegui::var_rcv {} ;\n" "\n" -"array set ::dialog_knob::var_color_background {} ;\n" -"array set ::dialog_knob::var_color_foreground {} ;\n" -"array set ::dialog_knob::var_color_arc {} ;\n" -"array set ::dialog_knob::var_colortype {} ;\n" -"array set ::dialog_knob::var_arcstart {} ;\n" +"array set ::dialog_elsegui::var_color_background {} ;\n" +"array set ::dialog_elsegui::var_color_foreground {} ;\n" +"array set ::dialog_elsegui::var_color_arc {} ;\n" +"array set ::dialog_elsegui::var_colortype {} ;\n" +"array set ::dialog_elsegui::var_arcstart {} ;\n" "\n" -// When we click one of the preset colorsc -"proc ::dialog_knob::preset_col {mytoplevel presetcol} {\n" -" set vid [string trimleft $mytoplevel .]\n" +// When we click one of the preset colors +"proc ::dialog_elsegui::preset_col {id presetcol} {\n" +" set vid [string trimleft $id .]\n" "\n" -" switch -- $::dialog_knob::var_colortype($vid) {\n" -" 0 { set ::dialog_knob::var_color_background($vid) $presetcol }\n" -" 1 { set ::dialog_knob::var_color_arc($vid) $presetcol }\n" -" 2 { set ::dialog_knob::var_color_foreground($vid) $presetcol }\n" +" switch -- $::dialog_elsegui::var_colortype($vid) {\n" +" 0 { set ::dialog_elsegui::var_color_background($vid) $presetcol }\n" +" 1 { set ::dialog_elsegui::var_color_arc($vid) $presetcol }\n" +" 2 { set ::dialog_elsegui::var_color_foreground($vid) $presetcol }\n" " }\n" " if {$::windowingsystem eq \"aqua\"} {\n" -" ::dialog_knob::apply_and_rebind_return $mytoplevel \n" +" ::dialog_elsegui::apply_and_rebind_return $id \n" " }\n" "}\n" "\n" // When we click compose color: -"proc ::dialog_knob::compose_color {mytoplevel} {\n" -" set vid [string trimleft $mytoplevel .]\n" +"proc ::dialog_elsegui::compose_color {id} {\n" +" set vid [string trimleft $id .]\n" "\n" // Check which color field is currently active -" switch -- $::dialog_knob::var_colortype($vid) {\n" +" switch -- $::dialog_elsegui::var_colortype($vid) {\n" " 0 {\n" " set title [_ \"Background color\" ]\n" -" set color $::dialog_knob::var_color_background($vid)\n" +" set color $::dialog_elsegui::var_color_background($vid)\n" " }\n" " 1 {\n" " set title [_ \"Foreground color\" ]\n" -" set color $::dialog_knob::var_color_foreground($vid)\n" +" set color $::dialog_elsegui::var_color_foreground($vid)\n" " }\n" " 2 {\n" " set title [_ \"Arc color\" ]\n" -" set color $::dialog_knob::var_color_arc($vid)\n" +" set color $::dialog_elsegui::var_color_arc($vid)\n" " }\n" " }\n" " set color [tk_chooseColor -title $title -initialcolor $color]\n" "\n" " if { $color ne \"\" } {\n" -" ::dialog_knob::preset_col $mytoplevel $color\n" +" ::dialog_elsegui::preset_col $id $color\n" " }\n" "}\n" "\n" -"proc ::dialog_knob::clip {val min {max {}}} {\n" +"proc ::dialog_elsegui::clip {val min {max {}}} {\n" " if {$min ne {} && $val < $min} {return $min}\n" " if {$max ne {} && $val > $max} {return $max}\n" " return $val\n" @@ -88,8 +94,8 @@ sys_gui("\n" "\n" // Send current values to Pd when "apply" -"proc ::dialog_knob::apply {mytoplevel} {\n" -" set vid [string trimleft $mytoplevel .]\n" +"proc ::dialog_elsegui::apply {id} {\n" +" set vid [string trimleft $id .]\n" "\n" " set sendname empty\n" " set paramname empty\n" @@ -97,56 +103,60 @@ sys_gui("\n" " set receivename empty\n" "\n" // Set send, param, var and receive if not empty -" if {$::dialog_knob::var_snd($vid) ne \"\"} {set sendname $::dialog_knob::var_snd($vid)}\n" -" if {$::dialog_knob::var_prm($vid) ne \"\"} {set paramname $::dialog_knob::var_prm($vid)}\n" -" if {$::dialog_knob::var_var($vid) ne \"\"} {set varname $::dialog_knob::var_var($vid)}\n" -" if {$::dialog_knob::var_rcv($vid) ne \"\"} {set receivename $::dialog_knob::var_rcv($vid)}\n" +" if {$::dialog_elsegui::var_snd($vid) ne \"\"} {set sendname $::dialog_elsegui::var_snd($vid)}\n" +" if {$::dialog_elsegui::var_prm($vid) ne \"\"} {set paramname $::dialog_elsegui::var_prm($vid)}\n" +" if {$::dialog_elsegui::var_var($vid) ne \"\"} {set varname $::dialog_elsegui::var_var($vid)}\n" +" if {$::dialog_elsegui::var_rcv($vid) ne \"\"} {set receivename $::dialog_elsegui::var_rcv($vid)}\n" "\n" // Clip number if steps -" set ::dialog_knob::var_steps($vid) [::dialog_knob::clip $::dialog_knob::var_steps($vid) 0 360]\n" +" set ::dialog_elsegui::var_steps($vid) [::dialog_elsegui::clip $::dialog_elsegui::var_steps($vid) 0 360]\n" "\n" // Send to the object -" pdsend [concat $mytoplevel dialog \\\n" -" $::dialog_knob::var_size($vid) \\\n" -" $::dialog_knob::var_range_min($vid) \\\n" -" $::dialog_knob::var_range_max($vid) \\\n" -" $::dialog_knob::var_initial($vid) \\\n" +" pdsend [concat $id dialog \\\n" +" $::dialog_elsegui::var_size($vid) \\\n" +" $::dialog_elsegui::var_range_min($vid) \\\n" +" $::dialog_elsegui::var_range_max($vid) \\\n" +" $::dialog_elsegui::var_initial($vid) \\\n" " [string map {\"$\" {\\$}} [unspace_text $sendname]] \\\n" " [string map {\"$\" {\\$}} [unspace_text $receivename]] \\\n" -" $::dialog_knob::var_outline_shown($vid) \\\n" -" $::dialog_knob::var_exp($vid) \\\n" -" $::dialog_knob::var_expmode($vid) \\\n" -" $::dialog_knob::var_jump($vid) \\\n" -" [string tolower $::dialog_knob::var_color_background($vid)] \\\n" -" [string tolower $::dialog_knob::var_color_arc($vid)] \\\n" -" [string tolower $::dialog_knob::var_color_foreground($vid)] \\\n" -" $::dialog_knob::var_circular($vid) \\\n" -" $::dialog_knob::var_steps($vid) \\\n" -" $::dialog_knob::var_discrete($vid) \\\n" -" $::dialog_knob::var_arc_shown($vid) \\\n" -" $::dialog_knob::var_angle_width($vid) \\\n" -" $::dialog_knob::var_angle_offset($vid) \\\n" -" $::dialog_knob::var_arcstart($vid) \\\n" +" $::dialog_elsegui::var_outline_shown($vid) \\\n" +" $::dialog_elsegui::var_exp($vid) \\\n" +" $::dialog_elsegui::var_expmode($vid) \\\n" +" $::dialog_elsegui::var_jump($vid) \\\n" +" [string tolower $::dialog_elsegui::var_color_background($vid)] \\\n" +" [string tolower $::dialog_elsegui::var_color_arc($vid)] \\\n" +" [string tolower $::dialog_elsegui::var_color_foreground($vid)] \\\n" +" $::dialog_elsegui::var_circular($vid) \\\n" +" $::dialog_elsegui::var_steps($vid) \\\n" +" $::dialog_elsegui::var_discrete($vid) \\\n" +" $::dialog_elsegui::var_arc_shown($vid) \\\n" +" $::dialog_elsegui::var_angle_width($vid) \\\n" +" $::dialog_elsegui::var_angle_offset($vid) \\\n" +" $::dialog_elsegui::var_arcstart($vid) \\\n" " [string map {\"$\" {\\$}} [unspace_text $paramname]] \\\n" // clean " [string map {\"$\" {\\$}} [unspace_text $varname]] \\\n" // clean -" $::dialog_knob::var_savestate($vid) \\\n" -" $::dialog_knob::var_loadbang($vid) \\\n" -" $::dialog_knob::var_showticks($vid) \\\n" +" $::dialog_elsegui::var_savestate($vid) \\\n" +" $::dialog_elsegui::var_loadbang($vid) \\\n" +" $::dialog_elsegui::var_showticks($vid) \\\n" +" $::dialog_elsegui::var_n_size($vid) \\\n" +" $::dialog_elsegui::var_xpos($vid) \\\n" +" $::dialog_elsegui::var_ypos($vid) \\\n" +" $::dialog_elsegui::var_n_mode($vid) \\\n" " ]\n" "}\n" // On cancel clicked -"proc ::dialog_knob::cancel {mytoplevel} {\n" -" pdsend \"$mytoplevel cancel\"\n" +"proc ::dialog_elsegui::cancel {id} {\n" +" pdsend \"$id cancel\"\n" "}\n" "\n" // On okay clicked -"proc ::dialog_knob::ok {mytoplevel} {\n" -" ::dialog_knob::apply $mytoplevel\n" -" ::dialog_knob::cancel $mytoplevel\n" +"proc ::dialog_elsegui::ok {id} {\n" +" ::dialog_elsegui::apply $id\n" +" ::dialog_elsegui::cancel $id\n" "}\n" // tcl/tk entry function called from Pd when asking for properties! -"proc knob_dialog {mytoplevel \\\n" +"proc knob_dialog {id \\\n" " wdt \\\n" " min_rng max_rng \\\n" " initial circular \\\n" @@ -157,15 +167,16 @@ sys_gui("\n" " arc_width \\\n" " angle_range angle_offset \\\n" " outline arcstart prm var \\\n" -" savestate loadbang showticks} {\n" +" savestate loadbang showticks \\\n" +" n_size xpos ypos n_mode} {\n" // The vid indicates the instance ID of this dialog -" set vid [string trimleft $mytoplevel .]\n" +" set vid [string trimleft $id .]\n" " set snd [::pdtk_text::unescape $snd]\n" " set prm [::pdtk_text::unescape $prm]\n" " set var [::pdtk_text::unescape $var]\n" " set rcv [::pdtk_text::unescape $rcv]\n" // initialize the array with received values for this dialog instance -" set ::dialog_knob::var_size($vid) $wdt\n" +" set ::dialog_elsegui::var_size($vid) $wdt\n" "\n" " if {$rcv==\"empty\"} {\n" " set rcv \"\"\n" @@ -179,357 +190,430 @@ sys_gui("\n" " if {$var==\"empty\"} {\n" " set var \"\"\n" " }\n" -" set ::dialog_knob::var_range_max($vid) $max_rng\n" -" set ::dialog_knob::var_range_min($vid) $min_rng\n" +" set ::dialog_elsegui::var_range_max($vid) $max_rng\n" +" set ::dialog_elsegui::var_range_min($vid) $min_rng\n" +"\n" +" set ::dialog_elsegui::var_initial($vid) $initial\n" +" set ::dialog_elsegui::var_circular($vid) $circular\n" +" set ::dialog_elsegui::var_expmode($vid) $expmode\n" +" set ::dialog_elsegui::var_exp($vid) $exp\n" +" set ::dialog_elsegui::var_jump($vid) $jump\n" +" set ::dialog_elsegui::var_outline_shown($vid) $outline\n" +"\n" +" set ::dialog_elsegui::var_snd($vid) [string map {{\\ } \" \"} $snd]\n" +" set ::dialog_elsegui::var_prm($vid) [string map {{\\ } \" \"} $prm]\n" +" set ::dialog_elsegui::var_var($vid) [string map {{\\ } \" \"} $var]\n" +" set ::dialog_elsegui::var_rcv($vid) [string map {{\\ } \" \"} $rcv]\n" "\n" -" set ::dialog_knob::var_initial($vid) $initial\n" -" set ::dialog_knob::var_circular($vid) $circular\n" -" set ::dialog_knob::var_expmode($vid) $expmode\n" -" set ::dialog_knob::var_exp($vid) $exp\n" -" set ::dialog_knob::var_jump($vid) $jump\n" -" set ::dialog_knob::var_outline_shown($vid) $outline\n" -" set ::dialog_knob::var_savestate($vid) $savestate\n" -" set ::dialog_knob::var_loadbang($vid) $loadbang\n" -" set ::dialog_knob::var_showticks($vid) $showticks\n" +" set ::dialog_elsegui::var_color_background($vid) $bcol\n" +" set ::dialog_elsegui::var_color_foreground($vid) $fcol\n" +" set ::dialog_elsegui::var_color_arc($vid) $acol\n" +" set ::dialog_elsegui::var_colortype($vid) 0\n" "\n" -" set ::dialog_knob::var_snd($vid) [string map {{\\ } \" \"} $snd]\n" -" set ::dialog_knob::var_prm($vid) [string map {{\\ } \" \"} $prm]\n" -" set ::dialog_knob::var_var($vid) [string map {{\\ } \" \"} $var]\n" -" set ::dialog_knob::var_rcv($vid) [string map {{\\ } \" \"} $rcv]\n" +" set ::dialog_elsegui::var_discrete($vid) $discrete\n" +" set ::dialog_elsegui::var_steps($vid) $steps\n" +" set ::dialog_elsegui::var_arc_shown($vid) $arc_width\n" +" set ::dialog_elsegui::var_angle_width($vid) $angle_range\n" +" set ::dialog_elsegui::var_angle_offset($vid) $angle_offset\n" +" set ::dialog_elsegui::var_arcstart($vid) $arcstart\n" "\n" -" set ::dialog_knob::var_color_background($vid) $bcol\n" -" set ::dialog_knob::var_color_foreground($vid) $fcol\n" -" set ::dialog_knob::var_color_arc($vid) $acol\n" -" set ::dialog_knob::var_colortype($vid) 0\n" +" set ::dialog_elsegui::var_savestate($vid) $savestate\n" +" set ::dialog_elsegui::var_loadbang($vid) $loadbang\n" +" set ::dialog_elsegui::var_showticks($vid) $showticks\n" "\n" -" set ::dialog_knob::var_discrete($vid) $discrete\n" -" set ::dialog_knob::var_steps($vid) $steps\n" -" set ::dialog_knob::var_arc_shown($vid) $arc_width\n" -" set ::dialog_knob::var_angle_width($vid) $angle_range\n" -" set ::dialog_knob::var_angle_offset($vid) $angle_offset\n" -" set ::dialog_knob::var_arcstart($vid) $arcstart\n" +" set ::dialog_elsegui::var_n_size($vid) $n_size\n" +" set ::dialog_elsegui::var_xpos($vid) $xpos\n" +" set ::dialog_elsegui::var_ypos($vid) $ypos\n" +" set ::dialog_elsegui::var_n_mode($vid) $n_mode\n" +// " set ::dialog_elsegui::var_n_mode($vid) [lindex {Never Always Active Typing} $n_mode]\n" "\n" // Initialize creation/drawing of properties window -" toplevel $mytoplevel -class DialogWindow\n" -" wm title $mytoplevel \"knob properties\"\n" -" wm group $mytoplevel .\n" -" wm resizable $mytoplevel 0 0\n" -" wm transient $mytoplevel $::focused_window\n" -" $mytoplevel configure -menu $::dialog_menubar\n" -" $mytoplevel configure -padx 0 -pady 0\n" -" ::pd_bindings::dialog_bindings $mytoplevel \"iemgui\"\n" +" toplevel $id -class DialogWindow\n" +" wm title $id \"knob properties\"\n" +" wm group $id .\n" +" wm resizable $id 0 0\n" +" wm transient $id $::focused_window\n" +" $id configure -menu $::dialog_menubar\n" +" $id configure -padx 0 -pady 0\n" +" ::pd_bindings::dialog_bindings $id \"elsegui\"\n" "\n" + // Create frame for parameters -" frame $mytoplevel.para -padx 5 -pady 5 \n" -" pack $mytoplevel.para -side top -fill x -pady 5\n" "\n" " set applycmd \"\"\n" " if {$::windowingsystem eq \"aqua\"} {\n" -" set applycmd \"::dialog_knob::apply $mytoplevel\"\n" +" set applycmd \"::dialog_elsegui::apply $id\"\n" " }\n" "\n" -// knobstyle 1st top entries -" frame $mytoplevel.para.knobstyle -padx 20 -pady 1\n" +// PROPERTIES' WINDOW: frame for knobstyle, the first top entry +" frame $id.knobstyle -padx 20 -pady 1\n" "\n" -// Entry for size -" frame $mytoplevel.para.knobstyle.dim \n" -" label $mytoplevel.para.knobstyle.dim.w_lab -text \"Size:\"\n" -" entry $mytoplevel.para.knobstyle.dim.w_ent -textvariable ::dialog_knob::var_size($vid) -width 4\n" -" label $mytoplevel.para.knobstyle.dim.dummy1 -text \"\" -width 1\n" -" pack $mytoplevel.para.knobstyle.dim.w_lab $mytoplevel.para.knobstyle.dim.w_ent -side left\n" -// Entry for initial value -" frame $mytoplevel.para.knobstyle.initial \n" -" label $mytoplevel.para.knobstyle.initial.lab -text [_ \"Load Value\"]\n" -" entry $mytoplevel.para.knobstyle.initial.ent -textvariable ::dialog_knob::var_initial($vid) -width 4\n" -" pack $mytoplevel.para.knobstyle.initial.lab -side left -expand 0 -ipadx 4\n" -" pack $mytoplevel.para.knobstyle.initial.ent -side left -expand 0 -ipadx 10\n" -// Entry for arc start -" frame $mytoplevel.para.knobstyle.arcstart \n" -" label $mytoplevel.para.knobstyle.arcstart.lab -text [_ \"Arc Start Value\"]\n" -" entry $mytoplevel.para.knobstyle.arcstart.ent -textvariable ::dialog_knob::var_arcstart($vid) -width 4\n" -" pack $mytoplevel.para.knobstyle.arcstart.lab -side left -expand 0 -ipadx 4\n" -" pack $mytoplevel.para.knobstyle.arcstart.ent -side left -expand 0 -ipadx 10\n" -// Entry for Arc (Checkbox) -" frame $mytoplevel.para.knobstyle.arc\n" -" label $mytoplevel.para.knobstyle.arc.lab -text [_ \"Show Arc: \"]\n" -" checkbutton $mytoplevel.para.knobstyle.arc.ent -variable ::dialog_knob::var_arc_shown($vid) -width 5\n" -" pack $mytoplevel.para.knobstyle.arc.ent $mytoplevel.para.knobstyle.arc.lab -side right -anchor e\n" -// Entry for Circular Drag (Checkbox) -" frame $mytoplevel.para.knobstyle.move \n" -" label $mytoplevel.para.knobstyle.move.lab -text [_ \"Circular Drag:\"]\n" -" checkbutton $mytoplevel.para.knobstyle.move.mode -variable ::dialog_knob::var_circular($vid) -width 5\n" -" pack $mytoplevel.para.knobstyle.move.mode $mytoplevel.para.knobstyle.move.lab -side right -anchor e\n" -// Entry for Jump on Click(Checkbox) -" frame $mytoplevel.para.knobstyle.jump\n" -" label $mytoplevel.para.knobstyle.jump.lab -text [_ \"Jump on Click: \"]\n" -" checkbutton $mytoplevel.para.knobstyle.jump.ent -variable ::dialog_knob::var_jump($vid) -width 5\n" -" pack $mytoplevel.para.knobstyle.jump.ent $mytoplevel.para.knobstyle.jump.lab -side right -anchor e\n" -// Entry for Outline (Checkbox) -" frame $mytoplevel.para.knobstyle.outline\n" -" label $mytoplevel.para.knobstyle.outline.lab -text [_ \"Show Outline: \"]\n" -" checkbutton $mytoplevel.para.knobstyle.outline.ent -variable ::dialog_knob::var_outline_shown($vid) -width 5\n" -" pack $mytoplevel.para.knobstyle.outline.ent $mytoplevel.para.knobstyle.outline.lab -side right -anchor e\n" -// Entry for Savestate (Checkbox) -" frame $mytoplevel.para.knobstyle.savestate\n" -" label $mytoplevel.para.knobstyle.savestate.lab -text [_ \"Savestate: \"]\n" -" checkbutton $mytoplevel.para.knobstyle.savestate.ent -variable ::dialog_knob::var_savestate($vid) -width 5\n" -" pack $mytoplevel.para.knobstyle.savestate.ent $mytoplevel.para.knobstyle.savestate.lab -side right -anchor e\n" -// Entry for Loadbang (Checkbox) -" frame $mytoplevel.para.knobstyle.loadbang\n" -" label $mytoplevel.para.knobstyle.loadbang.lab -text [_ \"Loadbang: \"]\n" -" checkbutton $mytoplevel.para.knobstyle.loadbang.ent -variable ::dialog_knob::var_loadbang($vid) -width 5\n" -" pack $mytoplevel.para.knobstyle.loadbang.ent $mytoplevel.para.knobstyle.loadbang.lab -side right -anchor e\n" +// Size +" frame $id.knobstyle.dim \n" +" label $id.knobstyle.dim.w_lab -text \"Size:\"\n" +" entry $id.knobstyle.dim.w_ent -textvariable ::dialog_elsegui::var_size($vid) -width 4\n" +" pack $id.knobstyle.dim.w_lab $id.knobstyle.dim.w_ent -side left\n" +// Squared Outline (Checkbox) +" frame $id.knobstyle.outline\n" +" label $id.knobstyle.outline.lab -text [_ \"Squared Mode: \"]\n" +" checkbutton $id.knobstyle.outline.ent -variable ::dialog_elsegui::var_outline_shown($vid) -width 5\n" +" pack $id.knobstyle.outline.ent $id.knobstyle.outline.lab -side right -anchor e\n" // Align items to grid -" pack $mytoplevel.para.knobstyle -side top -fill x\n" +" pack $id.knobstyle -side top -fill x\n" // column 0 -" grid $mytoplevel.para.knobstyle.dim -row 0 -column 0 -sticky e -padx {5 0}\n" -" grid $mytoplevel.para.knobstyle.arcstart -row 1 -column 0 -sticky e -padx {5 0}\n" -" grid $mytoplevel.para.knobstyle.initial -row 2 -column 0 -sticky e -padx {5 0}\n" -" grid $mytoplevel.para.knobstyle.savestate -row 3 -column 0 -sticky e -padx {5 0}\n" -" grid $mytoplevel.para.knobstyle.loadbang -row 4 -column 0 -sticky e -padx {5 0}\n" +" grid $id.knobstyle.dim -row 0 -column 0 -sticky e -padx {60 0}\n" // column 1 -" grid $mytoplevel.para.knobstyle.outline -row 0 -column 1 -sticky e -padx {5 0}\n" -" grid $mytoplevel.para.knobstyle.arc -row 1 -column 1 -sticky e -padx {5 0}\n" -" grid $mytoplevel.para.knobstyle.move -row 2 -column 1 -sticky e -padx {5 0} \n" -" grid $mytoplevel.para.knobstyle.jump -row 3 -column 1 -sticky e -padx {5 0}\n" +" grid $id.knobstyle.outline -row 0 -column 1 -sticky e -padx {60 0}\n" + +// Frame for Arc settings +" labelframe $id.arcsettings\n" +" pack $id.arcsettings -side top -fill x\n" +" $id.arcsettings config -borderwidth 1 -pady 4 -text \"Arc settings:\"\n" +// Checkbox for Arc +" frame $id.arcsettings.arc\n" +" label $id.arcsettings.arc.lab -text [_ \"Show Arc: \"]\n" +" checkbutton $id.arcsettings.arc.ent -variable ::dialog_elsegui::var_arc_shown($vid) -width 5\n" +" pack $id.arcsettings.arc.ent $id.arcsettings.arc.lab -side right -anchor e\n" +// Entry for Arc initial value +" frame $id.arcsettings.arcstart \n" +" label $id.arcsettings.arcstart.lab -text [_ \"Start Value: \"]\n" +" entry $id.arcsettings.arcstart.ent -textvariable ::dialog_elsegui::var_arcstart($vid) -width 6\n" +" pack $id.arcsettings.arcstart.ent $id.arcsettings.arcstart.lab -side right -anchor e\n" +// Position of items +" pack $id.arcsettings.arc $id.arcsettings.arcstart -side left -anchor center\n" +" $id.arcsettings config -padx 60\n" + +// Frame for Mouse behaviour (Jump on click / Circular motion) +" labelframe $id.mouse\n" +" pack $id.mouse -side top -fill x\n" +" $id.mouse config -borderwidth 1 -pady 4 -text \"Mouse behaviour:\"\n" +// Checkbox for Jump on Click +" frame $id.mouse.jump\n" +" label $id.mouse.jump.lab -text [_ \"Jump on Click: \"]\n" +" checkbutton $id.mouse.jump.ent -variable ::dialog_elsegui::var_jump($vid) -width 5\n" +" pack $id.mouse.jump.ent $id.mouse.jump.lab -side right -anchor e\n" +// Checkbox for Circular +" frame $id.mouse.move\n" +" label $id.mouse.move.lab -text [_ \"Circular Drag: \"]\n" +" checkbutton $id.mouse.move.ent -variable ::dialog_elsegui::var_circular($vid) -width 5\n" +" pack $id.mouse.move.ent $id.mouse.move.lab -side right -anchor e\n" +// Position of items +" pack $id.mouse.jump $id.mouse.move -side left -anchor center\n" +" $id.mouse config -padx 60\n" + +// Frame for Load settings +" labelframe $id.load\n" +" pack $id.load -side top -fill x\n" +" $id.load config -borderwidth 1 -pady 4 -text \"Load settings:\"\n" +// Checkbox for Loadbang +" frame $id.load.loadbang\n" +" label $id.load.loadbang.lab -text [_ \"Loadbang: \"]\n" +" checkbutton $id.load.loadbang.ent -variable ::dialog_elsegui::var_loadbang($vid) -width 5\n" +" pack $id.load.loadbang.ent $id.load.loadbang.lab -side right -anchor e\n" +// Checkbox for Savestate +" frame $id.load.savestate\n" +" label $id.load.savestate.lab -text [_ \"Savestate: \"]\n" +" checkbutton $id.load.savestate.ent -variable ::dialog_elsegui::var_savestate($vid) -width 5\n" +" pack $id.load.savestate.ent $id.load.savestate.lab -side right -anchor e\n" +// Entry for initial value +" frame $id.load.initial \n" +" label $id.load.initial.lab -text [_ \"Load Value\"]\n" +" entry $id.load.initial.ent -textvariable ::dialog_elsegui::var_initial($vid) -width 7\n" +" pack $id.load.initial.ent $id.load.initial.lab -side right -anchor e\n" +// Position of items +" pack $id.load.loadbang $id.load.savestate $id.load.initial -side left -anchor center\n" +" $id.load config -padx 20\n" // Frame for discrete section -" labelframe $mytoplevel.discrete\n" -" pack $mytoplevel.discrete -side top -fill x\n" -" $mytoplevel.discrete config -borderwidth 1 -pady 4 -text \"Discrete Mode / Show Ticks:\"\n" +" labelframe $id.discrete\n" +" pack $id.discrete -side top -fill x\n" +" $id.discrete config -borderwidth 1 -pady 4 -text \"Discrete settings:\"\n" // Checkbox for discrete mode -" frame $mytoplevel.discrete.mode\n" -" label $mytoplevel.discrete.mode.lab -text [_ \"Discrete mode: \"]\n" -" checkbutton $mytoplevel.discrete.mode.ent -variable ::dialog_knob::var_discrete($vid) -width 5\n" -" pack $mytoplevel.discrete.mode.ent $mytoplevel.discrete.mode.lab -side right -anchor e\n" +" frame $id.discrete.mode\n" +" label $id.discrete.mode.lab -text [_ \"Discrete mode: \"]\n" +" checkbutton $id.discrete.mode.ent -variable ::dialog_elsegui::var_discrete($vid) -width 5\n" +" pack $id.discrete.mode.ent $id.discrete.mode.lab -side right -anchor e\n" // Checkbox for show ticks -" frame $mytoplevel.discrete.ticks\n" -" label $mytoplevel.discrete.ticks.lab -text [_ \"Show ticks: \"]\n" -" checkbutton $mytoplevel.discrete.ticks.ent -variable ::dialog_knob::var_showticks($vid) -width 5\n" -" pack $mytoplevel.discrete.ticks.ent $mytoplevel.discrete.ticks.lab -side right -anchor e\n" +" frame $id.discrete.ticks\n" +" label $id.discrete.ticks.lab -text [_ \"Show ticks: \"]\n" +" checkbutton $id.discrete.ticks.ent -variable ::dialog_elsegui::var_showticks($vid) -width 5\n" +" pack $id.discrete.ticks.ent $id.discrete.ticks.lab -side right -anchor e\n" // Entry for number of steps -" frame $mytoplevel.discrete.steps\n" -" label $mytoplevel.discrete.steps.lab -text [_ \"Steps: \"]\n" -" entry $mytoplevel.discrete.steps.ent -textvariable ::dialog_knob::var_steps($vid) -width 5\n" -" pack $mytoplevel.discrete.steps.ent $mytoplevel.discrete.steps.lab -side right -anchor e\n" +" frame $id.discrete.steps\n" +" label $id.discrete.steps.lab -text [_ \"Steps: \"]\n" +" entry $id.discrete.steps.ent -textvariable ::dialog_elsegui::var_steps($vid) -width 3\n" +" pack $id.discrete.steps.ent $id.discrete.steps.lab -side right -anchor e\n" // Position of items -" pack $mytoplevel.discrete.mode $mytoplevel.discrete.ticks -side left\n" -" pack $mytoplevel.discrete.steps -side right\n" - +" pack $id.discrete.mode $id.discrete.ticks $id.discrete.steps -side left -anchor center\n" +" $id.discrete config -padx 10\n" + // Frame for range section -" labelframe $mytoplevel.rng\n" -" pack $mytoplevel.rng -side top -fill x\n" -" $mytoplevel.rng config -borderwidth 1 -pady 4 -text \"Range:\"\n" +" labelframe $id.rng\n" +" pack $id.rng -side top -fill x\n" +" $id.rng config -borderwidth 1 -pady 4 -text \"Range settings:\"\n" // Range minimum entry -" frame $mytoplevel.rng.range \n" -" frame $mytoplevel.rng.range.min\n" -" label $mytoplevel.rng.range.min.lab -text \"Lower:\"\n" -" entry $mytoplevel.rng.range.min.ent -textvariable ::dialog_knob::var_range_min($vid) -width 7\n" -" label $mytoplevel.rng.range.dummy1 -text \"\" -width 1\n" +" frame $id.rng.range \n" +" frame $id.rng.range.min\n" +" label $id.rng.range.min.lab -text \"Lower:\"\n" +" entry $id.rng.range.min.ent -textvariable ::dialog_elsegui::var_range_min($vid) -width 7\n" +" label $id.rng.range.dummy1 -text \"\" -width 1\n" // Range maximum entry -" label $mytoplevel.rng.range.max_lab -text \"Upper:\"\n" -" entry $mytoplevel.rng.range.max_ent -textvariable ::dialog_knob::var_range_max($vid) -width 7\n" -" pack $mytoplevel.rng.range.min\n" -" pack $mytoplevel.rng.range.min.lab $mytoplevel.rng.range.min.ent -side left \n" -" $mytoplevel.rng config -padx 26\n" -" pack configure $mytoplevel.rng.range.min -side left\n" -" pack $mytoplevel.rng.range.dummy1 $mytoplevel.rng.range.max_lab $mytoplevel.rng.range.max_ent -side left\n" +" label $id.rng.range.max_lab -text \"Upper:\"\n" +" entry $id.rng.range.max_ent -textvariable ::dialog_elsegui::var_range_max($vid) -width 7\n" +" pack $id.rng.range.min\n" +" pack $id.rng.range.min.lab $id.rng.range.min.ent -side left \n" +" $id.rng config -padx 26\n" +" pack configure $id.rng.range.min -side left\n" +" pack $id.rng.range.dummy1 $id.rng.range.max_lab $id.rng.range.max_ent -side left\n" // Logmode radiobuttons -" frame $mytoplevel.rng.logmode\n" -" radiobutton $mytoplevel.rng.logmode.radio1 -value 0 \\\n" +" frame $id.rng.logmode\n" +" radiobutton $id.rng.logmode.radio1 -value 0 \\\n" " -text [_ \"linear\" ] \\\n" -" -variable ::dialog_knob::var_expmode($vid) \\\n" -" -command \"$mytoplevel.rng.logmode.expmode_entry configure -state disabled\"\n" -" radiobutton $mytoplevel.rng.logmode.radio2 -value 1 \\\n" +" -variable ::dialog_elsegui::var_expmode($vid) \\\n" +" -command \"$id.rng.logmode.expmode_entry configure -state disabled\"\n" +" radiobutton $id.rng.logmode.radio2 -value 1 \\\n" " -text [_ \"log\" ] \\\n" -" -variable ::dialog_knob::var_expmode($vid) \\\n" -" -command \"$mytoplevel.rng.logmode.expmode_entry configure -state disabled\"\n" -" radiobutton $mytoplevel.rng.logmode.radio3 -value 2 \\\n" +" -variable ::dialog_elsegui::var_expmode($vid) \\\n" +" -command \"$id.rng.logmode.expmode_entry configure -state disabled\"\n" +" radiobutton $id.rng.logmode.radio3 -value 2 \\\n" " -text [_ \"exp:\" ] \\\n" -" -variable ::dialog_knob::var_expmode($vid) \\\n" -" -command \"$mytoplevel.rng.logmode.expmode_entry configure -state normal\"\n" -" entry $mytoplevel.rng.logmode.expmode_entry -width 3 -textvariable ::dialog_knob::var_exp($vid) \n" +" -variable ::dialog_elsegui::var_expmode($vid) \\\n" +" -command \"$id.rng.logmode.expmode_entry configure -state normal\"\n" +" entry $id.rng.logmode.expmode_entry -width 3 -textvariable ::dialog_elsegui::var_exp($vid) \n" // When exp is selected, enable text box -" if { $::dialog_knob::var_expmode($vid) != 2 } {\n" -" $mytoplevel.rng.logmode.expmode_entry configure -state disabled\n" +" if { $::dialog_elsegui::var_expmode($vid) != 2 } {\n" +" $id.rng.logmode.expmode_entry configure -state disabled\n" " }\n" -" pack $mytoplevel.rng.logmode.expmode_entry $mytoplevel.rng.logmode.radio3 $mytoplevel.rng.logmode.radio2 $mytoplevel.rng.logmode.radio1 -side right \n" -" pack $mytoplevel.rng.range $mytoplevel.rng.logmode -side top\n" - +" pack $id.rng.logmode.expmode_entry $id.rng.logmode.radio3 $id.rng.logmode.radio2 $id.rng.logmode.radio1 -side right \n" +" pack $id.rng.range $id.rng.logmode -side top\n" + // Frame for Angle entry -" labelframe $mytoplevel.angle\n" -" pack $mytoplevel.angle -side top -fill x\n" -" $mytoplevel.angle config -borderwidth 1 -pady 4 -text \"Angle:\"\n" +" labelframe $id.angle\n" +" pack $id.angle -side top -fill x\n" +" $id.angle config -borderwidth 1 -pady 4 -text \"Angle settings:\"\n" // Range entry -" frame $mytoplevel.angle.range\n" -" label $mytoplevel.angle.range.lab -text [_ \"Range: \"]\n" -" entry $mytoplevel.angle.range.ent -textvariable ::dialog_knob::var_angle_width($vid) -width 5\n" -" pack $mytoplevel.angle.range.ent $mytoplevel.angle.range.lab -side right -anchor e\n" +" frame $id.angle.range\n" +" label $id.angle.range.lab -text [_ \"Range: \"]\n" +" entry $id.angle.range.ent -textvariable ::dialog_elsegui::var_angle_width($vid) -width 5\n" +" pack $id.angle.range.ent $id.angle.range.lab -side right -anchor e\n" // Offset entry -" frame $mytoplevel.angle.offset\n" -" label $mytoplevel.angle.offset.lab -text [_ \"Offset: \"]\n" -" entry $mytoplevel.angle.offset.ent -textvariable ::dialog_knob::var_angle_offset($vid) -width 5\n" -" pack $mytoplevel.angle.offset.ent $mytoplevel.angle.offset.lab -side right -anchor w\n" +" frame $id.angle.offset\n" +" label $id.angle.offset.lab -text [_ \"Offset: \"]\n" +" entry $id.angle.offset.ent -textvariable ::dialog_elsegui::var_angle_offset($vid) -width 5\n" +" pack $id.angle.offset.ent $id.angle.offset.lab -side right -anchor w\n" +// +" pack $id.angle.range $id.angle.offset -side left -anchor center\n" +" $id.angle config -padx 60\n" + +// Frame for Number settings +" labelframe $id.num\n" +" pack $id.num -side top -fill x\n" +" $id.num config -borderwidth 1 -pady 4 -text \"Number settings:\"\n" +// Number Mode: +" frame $id.num.shownum\n" +" label $id.num.shownum.lab -text [_ \"Mode: \"]\n" +" entry $id.num.shownum.ent -textvariable ::dialog_elsegui::var_n_mode($vid) -width 2\n" +" pack $id.num.shownum.ent $id.num.shownum.lab -side right -anchor e\n" // -" pack $mytoplevel.angle.range $mytoplevel.angle.offset -side left -anchor center\n" -" $mytoplevel.angle config -padx 60\n" + +/* " tk_optionMenu $id.num.shownum ::dialog_elsegui::var_n_mode($vid) Never Always Active Typing\n" + " label $id.num.shownum.lab -text [_ \"Mode: \"]\n" + " pack $id.num.shownum.lab $id.num.shownum -side left\n"*/ + + +// Number Size: +" frame $id.num.size\n" +" label $id.num.size.lab -text [_ \"Size: \"]\n" +" entry $id.num.size.ent -textvariable ::dialog_elsegui::var_n_size($vid) -width 3\n" +" pack $id.num.size.ent $id.num.size.lab -side right -anchor w\n" +// Number xpos: +" frame $id.num.xpos\n" +" label $id.num.xpos.lab -text [_ \"Xpos: \"]\n" +" entry $id.num.xpos.ent -textvariable ::dialog_elsegui::var_xpos($vid) -width 5\n" +" pack $id.num.xpos.ent $id.num.xpos.lab -side right -anchor e\n" +// Number ypos: +" frame $id.num.ypos\n" +" label $id.num.ypos.lab -text [_ \"Ypos: \"]\n" +" entry $id.num.ypos.ent -textvariable ::dialog_elsegui::var_ypos($vid) -width 5\n" +" pack $id.num.ypos.ent $id.num.ypos.lab -side right -anchor w\n" +// +" pack $id.num.shownum $id.num.size -side left -anchor center\n" +//" pack $id.num.size -side left -anchor center\n" +" pack $id.num.xpos $id.num.ypos -side left -anchor center\n" +" $id.num config -padx 25\n" // Send/param/var/receive entry -" labelframe $mytoplevel.s_r -borderwidth 1 -padx 5 -pady 5 -text [_ \"Receive/Send/Param/Variable\"]\n" -" pack $mytoplevel.s_r -side top -fill x\n" - // receive -" frame $mytoplevel.s_r.receive\n" -" pack $mytoplevel.s_r.receive -side top -anchor e -padx 5\n" -" label $mytoplevel.s_r.receive.lab -text [_ \"Receive symbol:\"]\n" -" entry $mytoplevel.s_r.receive.ent -textvariable ::dialog_knob::var_rcv($vid) -width 21\n" +" labelframe $id.syms -borderwidth 1 -padx 5 -pady 5 -text [_ \"Attached symbols: \"]\n" +" pack $id.syms -side top -fill x\n" +// Receive +" frame $id.syms.receive \n" +" label $id.syms.receive.w_lab -text \"Receive:\"\n" +" entry $id.syms.receive.w_ent -textvariable ::dialog_elsegui::var_rcv($vid) -width 15\n" " if { $rcv ne \"norcvno\" } {\n" -" pack $mytoplevel.s_r.receive.lab $mytoplevel.s_r.receive.ent -side left \\\n" +" pack $id.syms.receive.w_lab $id.syms.receive.w_ent -side left\\\n" " -fill x -expand 1\n" " }\n" - // send -" frame $mytoplevel.s_r.send\n" -" pack $mytoplevel.s_r.send -side top -anchor e -padx 5\n" -" label $mytoplevel.s_r.send.lab -text [_ \"Send symbol:\"]\n" -" entry $mytoplevel.s_r.send.ent -textvariable ::dialog_knob::var_snd($vid) -width 21\n" +// Send +" frame $id.syms.send \n" +" label $id.syms.send.w_lab -text \"Send:\"\n" +" entry $id.syms.send.w_ent -textvariable ::dialog_elsegui::var_snd($vid) -width 15\n" " if { $snd ne \"nosndno\" } {\n" -" pack $mytoplevel.s_r.send.lab $mytoplevel.s_r.send.ent -side left \\\n" +" pack $id.syms.send.w_lab $id.syms.send.w_ent -side left\\\n" " -fill x -expand 1\n" " }\n" - // param -" frame $mytoplevel.s_r.param\n" -" pack $mytoplevel.s_r.param -side top -anchor e -padx 5\n" -" label $mytoplevel.s_r.param.lab -text [_ \"Param symbol:\"]\n" -" entry $mytoplevel.s_r.param.ent -textvariable ::dialog_knob::var_prm($vid) -width 21\n" +// Param +" frame $id.syms.param \n" +" label $id.syms.param.w_lab -text \"Param:\"\n" +" entry $id.syms.param.w_ent -textvariable ::dialog_elsegui::var_prm($vid) -width 15\n" " if { $prm ne \"noprmno\" } {\n" -" pack $mytoplevel.s_r.param.lab $mytoplevel.s_r.param.ent -side left \\\n" +" pack $id.syms.param.w_lab $id.syms.param.w_ent -side left\\\n" " -fill x -expand 1\n" " }\n" - // var -" frame $mytoplevel.s_r.var\n" -" pack $mytoplevel.s_r.var -side top -anchor e -padx 5\n" -" label $mytoplevel.s_r.var.lab -text [_ \"Variable symbol:\"]\n" -" entry $mytoplevel.s_r.var.ent -textvariable ::dialog_knob::var_var($vid) -width 21\n" +// Var +" frame $id.syms.var \n" +" label $id.syms.var.w_lab -text \"Variable:\"\n" +" entry $id.syms.var.w_ent -textvariable ::dialog_elsegui::var_var($vid) -width 15\n" " if { $var ne \"novarno\" } {\n" -" pack $mytoplevel.s_r.var.lab $mytoplevel.s_r.var.ent -side left \\\n" +" pack $id.syms.var.w_lab $id.syms.var.w_ent -side left\\\n" " -fill x -expand 1\n" " }\n" - + +// Align items to grid +" pack $id.syms -side top -fill x\n" +// column 0 +" grid $id.syms.receive -row 0 -column 0 -sticky e -padx {10 0}\n" +" grid $id.syms.send -row 1 -column 0 -sticky e -padx {10 0}\n" +// column 1 +" grid $id.syms.param -row 0 -column 1 -sticky e -padx {5 0}\n" +" grid $id.syms.var -row 1 -column 1 -sticky e -padx {5 0}\n" + // Frame for colors section -" labelframe $mytoplevel.colors -borderwidth 1 -text [_ \"Colors\"] -padx 5 -pady 5\n" -" pack $mytoplevel.colors -fill x\n" +" labelframe $id.colors -borderwidth 1 -text [_ \"Color settings:\"] -padx 5 -pady 5\n" +" pack $id.colors -fill x\n" // Radiobuttons for foreground or background color -" frame $mytoplevel.colors.select\n" -" pack $mytoplevel.colors.select -side top\n" -" radiobutton $mytoplevel.colors.select.radio0 \\\n" -" -value 0 -variable ::dialog_knob::var_colortype($vid) \\\n" +" frame $id.colors.select\n" +" pack $id.colors.select -side top\n" +" radiobutton $id.colors.select.radio0 \\\n" +" -value 0 -variable ::dialog_elsegui::var_colortype($vid) \\\n" " -text [_ \"Background\"] -justify left\n" -" radiobutton $mytoplevel.colors.select.radio1 \\\n" -" -value 1 -variable ::dialog_knob::var_colortype($vid) \\\n" +" radiobutton $id.colors.select.radio1 \\\n" +" -value 1 -variable ::dialog_elsegui::var_colortype($vid) \\\n" " -text [_ \"Arc Background\"] -justify left\n" -" radiobutton $mytoplevel.colors.select.radio2 \\\n" -" -value 2 -variable ::dialog_knob::var_colortype($vid) \\\n" +" radiobutton $id.colors.select.radio2 \\\n" +" -value 2 -variable ::dialog_elsegui::var_colortype($vid) \\\n" " -text [_ \"Front\"] -justify left\n" -" pack $mytoplevel.colors.select.radio0 $mytoplevel.colors.select.radio1 $mytoplevel.colors.select.radio2 -side left\n" -" frame $mytoplevel.colors.sections\n" -" pack $mytoplevel.colors.sections -side top\n" -" button $mytoplevel.colors.sections.but -text [_ \"Compose color\"] \\\n" -" -command \"::dialog_knob::compose_color $mytoplevel\"\n" -" pack $mytoplevel.colors.sections.but -side left -anchor w -pady 5 \\\n" +" pack $id.colors.select.radio0 $id.colors.select.radio1 $id.colors.select.radio2 -side left\n" +" frame $id.colors.sections\n" +" pack $id.colors.sections -side top\n" +" button $id.colors.sections.but -text [_ \"Compose color\"] \\\n" +" -command \"::dialog_elsegui::compose_color $id\"\n" +" pack $id.colors.sections.but -side left -anchor w -pady 5 \\\n" " -expand yes -fill x\n" -" frame $mytoplevel.colors.sections.exp\n" +" frame $id.colors.sections.exp\n" // Preset colors, color scheme by Mary Ann Benedetto http://piR2.org " foreach r {r1 r2 r3} hexcols {\n" " { \"#FFFFFF\" \"#DFDFDF\" \"#BBBBBB\" \"#FFC7C6\" \"#FFE3C6\" \"#FEFFC6\" \"#C6FFC7\" \"#C6FEFF\" \"#C7C6FF\" \"#E3C6FF\" }\n" " { \"#9F9F9F\" \"#7C7C7C\" \"#606060\" \"#FF0400\" \"#FF8300\" \"#FAFF00\" \"#00FF04\" \"#00FAFF\" \"#0400FF\" \"#9C00FF\" }\n" " { \"#404040\" \"#202020\" \"#000000\" \"#551312\" \"#553512\" \"#535512\" \"#0F4710\" \"#0E4345\" \"#131255\" \"#2F004D\" } } \\\n" " {\n" -" frame $mytoplevel.colors.$r\n" -" pack $mytoplevel.colors.$r -side top\n" +" frame $id.colors.$r\n" +" pack $id.colors.$r -side top\n" " foreach i { 0 1 2 3 4 5 6 7 8 9} hexcol $hexcols \\\n" " {\n" -" label $mytoplevel.colors.$r.c$i -background $hexcol -activebackground $hexcol -relief ridge -padx 7 -pady 0 -width 1\n" -" bind $mytoplevel.colors.$r.c$i