Commit fbf33670 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

Implemented dynamic cord color and width for msg and signal cords and introduced K-12 module

parent cafd5a38
......@@ -916,10 +916,10 @@ static void canvas_drawlines(t_canvas *x)
while (oc = linetraverser_next(&t))
{
issignal = (outlet_getsymbol(t.tr_outlet) == &s_signal ? 1 : 0);
sys_vgui(".x%lx.c create line %d %d %d %d -width %d -fill %s \
sys_vgui(".x%lx.c create line %d %d %d %d -width %s -fill %s \
-tags {l%lx all_cords}\n",
glist_getcanvas(x), t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2,
(issignal ? 2:1), (issignal ? "$signal_cord" : "$msg_cord"),
(issignal ? "$signal_cord_width" : "$msg_cord_width"), (issignal ? "$signal_cord" : "$msg_cord"),
oc);
}
}
......
......@@ -2578,9 +2578,10 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
x->gl_editor->e_xwas = xpos;
x->gl_editor->e_ywas = ypos;
sys_vgui(
".x%lx.c create line %d %d %d %d -width %d -tags x\n",
".x%lx.c create line %d %d %d %d -fill %s -width %s -tags x\n",
x, xpos, ypos, xpos, ypos,
(issignal ? 2 : 1));
(issignal ? "$signal_cord" : "$msg_cord"),
(issignal ? "$signal_cord_width" : "$msg_cord_width"));
}
else
// jsarlo
......@@ -2995,11 +2996,11 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit)
((x22-x21-IOWIDTH) * closest2)/(ninlet2-1) : 0)
+ IOMIDDLE;
ly2 = y21;
sys_vgui(".x%lx.c create line %d %d %d %d -fill %s -width %d -tags {l%lx all_cords}\n",
sys_vgui(".x%lx.c create line %d %d %d %d -fill %s -width %s -tags {l%lx all_cords}\n",
glist_getcanvas(x),
lx1, ly1, lx2, ly2,
(issignal ? "$signal_cord" : "$msg_cord"),
(issignal ? 2 : 1),
(issignal ? "$signal_cord_width" : "$msg_cord_width"),
oc);
if (canvas_cnct_inlet_tag[0] != 0)
{
......@@ -4534,9 +4535,9 @@ void canvas_connect(t_canvas *x, t_floatarg fwhoout, t_floatarg foutno,
if (!(oc = obj_connect(objsrc, outno, objsink, inno))) goto bad;
if (glist_isvisible(x))
{
sys_vgui(".x%lx.c create line %d %d %d %d -width %d -fill %s -tags {l%lx all_cords}\n",
sys_vgui(".x%lx.c create line %d %d %d %d -width %s -fill %s -tags {l%lx all_cords}\n",
glist_getcanvas(x), 0, 0, 0, 0,
(obj_issignaloutlet(objsrc, outno) ? 2 : 1),
(obj_issignaloutlet(objsrc, outno) ? "$signal_cord_width" : "$msg_cord_width"),
(obj_issignaloutlet(objsrc, outno) ? "$signal_cord" : "$msg_cord"), oc);
canvas_fixlinesfor(x, objsrc);
}
......@@ -4906,6 +4907,13 @@ static void canvas_tip(t_canvas *x, t_symbol *s, int argc, t_atom *argv)
}
}
static void canvas_undo_add_from_tcl(t_canvas *x) {
canvas_editmode(x, 1.);
canvas_undo_add(glist_getcanvas(x), 9, "create",
(void *)canvas_undo_set_create(glist_getcanvas(x)));
}
void g_editor_setup(void)
{
/* ------------------------ events ---------------------------------- */
......@@ -4978,6 +4986,8 @@ void g_editor_setup(void)
gensym("copyfromexternalbuffer"), A_GIMME, A_NULL);
class_addmethod(canvas_class, (t_method)canvas_reset_copyfromexternalbuffer,
gensym("reset_copyfromexternalbuffer"), A_NULL);
class_addmethod(canvas_class, (t_method)canvas_undo_add_from_tcl,
gensym("undo_add"), A_NULL);
/* -------------- connect method used in reading files ------------------ */
class_addmethod(canvas_class, (t_method)canvas_connect,
......
......@@ -309,6 +309,43 @@ font create highlight_font -family $defaultFontFamily -size 9 -weight bold
# end Pd-extended font hacks -----------------------------
# K-12 version global variable (enabled through -k12, disabled by default)
set k12_mode 0
# Only can be enabled at startup (cannot be toggled afterwards)
proc pdtk_enable_k12_mode {extra_dir} {
global k12_mode
global signal_cord_width
global autotips
global signal_cord_highlight
global signal_cord
set k12_mode 1
set signal_cord_width 4
set autotips 1
set signal_cord_highlight "#474"
set signal_cord "#2ca7d4"
image create photo i.connect -file $extra_dir/K12/buttons/connect-on.png
image create photo i.add -file $extra_dir/K12/buttons/add.png
image create photo i.buttons -file $extra_dir/K12/buttons/buttons.png
image create photo i.delay -file $extra_dir/K12/buttons/delay.png
image create photo i.filter -file $extra_dir/K12/buttons/filter.png
image create photo i.hit -file $extra_dir/K12/buttons/hit.png
image create photo i.mapper -file $extra_dir/K12/buttons/mapper.png
image create photo i.multiply -file $extra_dir/K12/buttons/multiply.png
image create photo i.output -file $extra_dir/K12/buttons/audio-on.png
image create photo i.pitch -file $extra_dir/K12/buttons/pitch.png
image create photo i.reverb -file $extra_dir/K12/buttons/reverb.png
image create photo i.short1 -file $extra_dir/K12/buttons/short1.png
image create photo i.short2 -file $extra_dir/K12/buttons/short2.png
image create photo i.sustained1 -file $extra_dir/K12/buttons/sustained1.png
image create photo i.sustained2 -file $extra_dir/K12/buttons/sustained2.png
image create photo i.speed -file $extra_dir/K12/buttons/speed.png
image create photo i.edit -file $extra_dir/K12/buttons/edit.png
image create photo i.perform -file $extra_dir/K12/buttons/perform.png
}
# calculate offset on a movable canvas
set tmp_xpix 0
set tmp_ypix 0
......@@ -411,10 +448,12 @@ set obj_box_fill "#f6f8f8"
set signal_cord_highlight "#58a"
set signal_cord "#808095"
set signal_nlet $signal_cord
set signal_cord_width 2
set msg_cord_highlight "#474"
set msg_cord "#565"
set msg_nlet "white"
set mixed_nlet "#88aaff"
set msg_cord_width 1
#nlet highlighting stuff
set select_nlet_color $select_color
......@@ -488,6 +527,7 @@ set auto_path [linsert $auto_path 0 [file dirname [info script]]]
# the pd-gui-rewrite-0.43 help browser is backported to Pd-extended 0.42
package require helpbrowser
package require msgcat
package require tkpng
# official GNU gettext msgcat shortcut
proc _ {s} {return [::msgcat::mc $s]}
......@@ -899,28 +939,30 @@ proc pdtk_canvas_menuclose {window reply} {
set menu_windowlist {}
proc pdtk_fixwindowmenu {} {
global menu_windowlist pd_nt
.mbar.windows delete 0 end
if {$pd_nt == 2} {
.mbar.windows add command -label {Minimize} -command {menu_minimize .} \
-accelerator [accel_munge "Ctrl+m"]
.mbar.windows add command -label {Zoom} -command {menu_zoom .}
} else {
.mbar.windows add command -label "Next Window" -command {menu_raisenextwindow} \
-accelerator "Ctrl+PageDown"
#.mbar.windows add command -label "Previous Window" -command {menu_raisepreviouswindow} \
# -accelerator "Ctrl+PageUp"
global menu_windowlist pd_nt k12_mode
if { $k12_mode == 0 } {
.mbar.windows delete 0 end
if {$pd_nt == 2} {
.mbar.windows add command -label {Minimize} -command {menu_minimize .} \
-accelerator [accel_munge "Ctrl+m"]
.mbar.windows add command -label {Zoom} -command {menu_zoom .}
} else {
.mbar.windows add command -label "Next Window" -command {menu_raisenextwindow} \
-accelerator "Ctrl+PageDown"
#.mbar.windows add command -label "Previous Window" -command {menu_raisepreviouswindow} \
# -accelerator "Ctrl+PageUp"
}
.mbar.windows add separator
.mbar.windows add command -label {parent window} -state disabled
.mbar.windows add command -label {Pd & Console} -command menu_raise_console \
-accelerator [accel_munge "Ctrl+;"] -state disabled
.mbar.windows add separator
foreach i $menu_windowlist {
.mbar.windows add command -label [lindex $i 0] \
-command [concat menu_domenuwindow [lindex $i 1]]
menu_fixwindowmenu [lindex $i 1]
}
}
.mbar.windows add separator
.mbar.windows add command -label {parent window} -state disabled
.mbar.windows add command -label {Pd & Console} -command menu_raise_console \
-accelerator [accel_munge "Ctrl+;"] -state disabled
.mbar.windows add separator
foreach i $menu_windowlist {
.mbar.windows add command -label [lindex $i 0] \
-command [concat menu_domenuwindow [lindex $i 1]]
menu_fixwindowmenu [lindex $i 1]
}
}
####### Odd little function to make better Mac accelerators #####
......@@ -1707,6 +1749,8 @@ proc menu_magicglass {name} {
## end jsarlo
proc menu_editmode {name} {
global k12_mode
if { $k12_mode == 1 } { menu_tooltips $name }
pd [concat $name editmode 0 \;]
}
......@@ -2000,6 +2044,72 @@ proc pdtk_canvas_set_font {name size} {
}
}
proc setTooltip {widget text} {
if { $text != "" } {
# 2) Adjusted timings and added key and button bindings. These seem to
# make artifacts tolerably rare.
bind $widget <Any-Enter> [list after 500 [list showTooltip %W $text]]
bind $widget <Any-Leave> [list after 500 [list destroy %W.tooltip]]
bind $widget <Any-KeyPress> [list after 500 [list destroy %W.tooltip]]
bind $widget <Any-Button> [list after 500 [list destroy %W.tooltip]]
}
}
proc showTooltip {widget text} {
global tcl_platform
if { [string match $widget* [winfo containing [winfo pointerx .] [winfo pointery .]] ] == 0 } {
return
}
catch { destroy $widget.tooltip }
set scrh [winfo screenheight $widget] ; # 1) flashing window fix
set scrw [winfo screenwidth $widget] ; # 1) flashing window fix
set tooltip [toplevel $widget.tooltip -bd 1 -bg black]
wm geometry $tooltip +$scrh+$scrw ; # 1) flashing window fix
wm overrideredirect $tooltip 1
if {$tcl_platform(platform) == {windows}} { ; # 3) wm attributes...
wm attributes $tooltip -topmost 1 ; # 3) assumes...
} ; # 3) Windows
pack [label $tooltip.label -bg lightyellow -fg black -text $text -justify left]
set width [winfo reqwidth $tooltip.label]
set height [winfo reqheight $tooltip.label]
set pointer_below_midline [expr [winfo pointery .] > [expr [winfo screenheight .] / 2.0]] ; # b.) Is the pointer in the bottom half of the screen?
set positionX [expr [winfo pointerx .] - round($width / 2.0)] ; # c.) Tooltip is centred horizontally on pointer.
set positionY [expr [winfo pointery .] + 35 * ($pointer_below_midline * -2 + 1) - round($height / 2.0)] ; # b.) Tooltip is displayed above or below depending on pointer Y position.
# a.) Ad-hockery: Set positionX so the entire tooltip widget will be displayed.
# c.) Simplified slightly and modified to handle horizontally-centred tooltips and the left screen edge.
if {[expr $positionX + $width] > [winfo screenwidth .]} {
set positionX [expr [winfo screenwidth .] - $width]
} elseif {$positionX < 0} {
set positionX 0
}
wm geometry $tooltip [join "$width x $height + $positionX + $positionY" {}]
raise $tooltip
# 2) Kludge: defeat rare artifact by passing mouse over a tooltip to destroy it.
bind $widget.tooltip <Any-Enter> {destroy %W}
bind $widget.tooltip <Any-Leave> {destroy %W}
}
proc put_K12_objects {name object} {
global k12_mode
global pointer_x_local
global pointer_y_local
if { $k12_mode == 1 } {
pd [concat $name dirty 1 \;]
pd [concat $name obj $pointer_x_local $pointer_y_local K12/$object \;]
pd [concat $name undo_add\;]
}
}
############# pdtk_canvas_new -- create a new canvas ###############
proc pdtk_canvas_new {name width height geometry editable} {
global pd_tearoff put_tearoff
......@@ -2009,6 +2119,7 @@ proc pdtk_canvas_new {name width height geometry editable} {
global colors
global global_clipboard
global global_selection
global k12_mode
#retaining window-specific preferences
global window_prefs
......@@ -2079,7 +2190,6 @@ proc pdtk_canvas_new {name width height geometry editable} {
}
set geometry [join $geometry +]
}
wm geometry $name $geometry
#apply window properties
wm resizable $name $::resize($name) $::resize($name)
......@@ -2090,6 +2200,104 @@ proc pdtk_canvas_new {name width height geometry editable} {
ttk::separator $name.eyecandy
}
}
if { $k12_mode == 1 } {
# K-12 menu
match_linux_wm [list frame $name.k12frame]
pack $name.k12frame -side left -fill y
match_linux_wm [list frame $name.k12frame.edit -relief flat]
if {$editable==1} {
match_linux_wm [list button $name.k12frame.edit.b -image i.edit \
-command [concat menu_editmode $name]]
} else {
match_linux_wm [list button $name.k12frame.edit.b -image i.perform \
-command [concat menu_editmode $name]]
}
pack $name.k12frame.edit.b -side left -expand 1 -padx 2 -pady 2
setTooltip $name.k12frame.edit.b "Toggle between editing and performing"
match_linux_wm [list frame $name.k12frame.msgs -relief flat]
label $name.k12frame.msgs.label -relief ridge -text "MESSAGES"
pack $name.k12frame.msgs.label -fill x -pady 2 -padx 2
match_linux_wm [list frame $name.k12frame.sound -relief flat]
label $name.k12frame.sound.label -relief ridge -text "SOUND"
pack $name.k12frame.sound.label -fill x -pady 2 -padx 2
match_linux_wm [list frame $name.k12frame.5 -relief flat]
match_linux_wm [list button $name.k12frame.5.b_wii_connect -image i.connect \
-command [concat put_K12_objects $name wii_connect]]
pack $name.k12frame.5.b_wii_connect -side left -expand 0 -padx 2 -pady 2
setTooltip $name.k12frame.5.b_wii_connect "Wiimote: Use this to connect wiimote to the computer"
match_linux_wm [list frame $name.k12frame.1 -relief flat]
match_linux_wm [list button $name.k12frame.1.b_add -image i.add \
-command [concat put_K12_objects $name math_add]]
match_linux_wm [list button $name.k12frame.1.b_multiply -image i.multiply \
-command [concat put_K12_objects $name math_multiply]]
match_linux_wm [list button $name.k12frame.1.b_mapper -image i.mapper \
-command [concat put_K12_objects $name mapper]]
pack $name.k12frame.1.b_add $name.k12frame.1.b_multiply $name.k12frame.1.b_mapper -side left -expand 0 -padx 2 -pady 2
setTooltip $name.k12frame.1.b_add "Add: Use this to add two values together"
setTooltip $name.k12frame.1.b_multiply "Multiply: Use this to multiply two values"
setTooltip $name.k12frame.1.b_mapper "Mapper: Use this to control two objects in different fashion"
match_linux_wm [list frame $name.k12frame.2 -relief flat]
match_linux_wm [list button $name.k12frame.2.b_buttons -image i.buttons \
-command [concat put_K12_objects $name wii_buttons]]
match_linux_wm [list button $name.k12frame.2.b_hit -image i.hit \
-command [concat put_K12_objects $name wii_hit]]
match_linux_wm [list button $name.k12frame.2.b_wii_speed -image i.speed \
-command [concat put_K12_objects $name wii_speed]]
pack $name.k12frame.2.b_buttons $name.k12frame.2.b_hit $name.k12frame.2.b_wii_speed -side left -expand 0 -padx 2 -pady 2
setTooltip $name.k12frame.2.b_buttons "Wiimote Buttons: Use this to select which Wiimote button should activate objects connected to this object"
setTooltip $name.k12frame.2.b_hit "Wiimote Hit: Use this to detect when the wiimote has been shaken"
setTooltip $name.k12frame.2.b_wii_speed "Wiimote Speed: Use this to detect how quickly is Wiimote moving"
match_linux_wm [list frame $name.k12frame.3 -relief flat]
match_linux_wm [list button $name.k12frame.3.b_reverb -image i.reverb \
-command [concat put_K12_objects $name reverb]]
match_linux_wm [list button $name.k12frame.3.b_delay -image i.delay \
-command [concat put_K12_objects $name multitap]]
match_linux_wm [list button $name.k12frame.3.b_filter -image i.filter \
-command [concat put_K12_objects $name filter]]
pack $name.k12frame.3.b_reverb $name.k12frame.3.b_delay $name.k12frame.3.b_filter -side left -expand 0 -padx 2 -pady 2
setTooltip $name.k12frame.3.b_reverb "Reverb: Use this to make sound appear as if it is being played in a large space"
setTooltip $name.k12frame.3.b_delay "Echo: Use this to make sound echo"
setTooltip $name.k12frame.3.b_filter "Filter: Use this to make sound appear muffled or brighter"
match_linux_wm [list frame $name.k12frame.4 -relief flat]
match_linux_wm [list button $name.k12frame.4.b_sustained1 -image i.sustained1 \
-command [concat put_K12_objects $name instr_sustained]]
match_linux_wm [list button $name.k12frame.4.b_sustained2 -image i.sustained2 \
-command [concat put_K12_objects $name instr_sustained2]]
match_linux_wm [list button $name.k12frame.4.b_pitch -image i.pitch \
-command [concat put_K12_objects $name autopitch]]
pack $name.k12frame.4.b_sustained1 $name.k12frame.4.b_sustained2 $name.k12frame.4.b_pitch -side left -expand 0 -padx 2 -pady 2
setTooltip $name.k12frame.4.b_sustained1 "Sustained Sound: Use this to produce long sustained sound like a sound of a woodwind instrument"
setTooltip $name.k12frame.4.b_sustained2 "Sustained Sound: Use this to produce long sustained sound like a sound of a violin"
setTooltip $name.k12frame.4.b_pitch "Autopitch: Use this to make your sounds automatically change pitch"
match_linux_wm [list frame $name.k12frame.short -relief flat]
match_linux_wm [list button $name.k12frame.short.b_short1 -image i.short1 \
-command [concat put_K12_objects $name instr_short2]]
match_linux_wm [list button $name.k12frame.short.b_short2 -image i.short2 \
-command [concat put_K12_objects $name instr_short]]
pack $name.k12frame.short.b_short1 $name.k12frame.short.b_short2 -side left -expand 0 -padx 2 -pady 2
setTooltip $name.k12frame.short.b_short1 "Short Sound: Use this to produce short sounds like a single snare drum beat"
setTooltip $name.k12frame.short.b_short2 "Short Sound: Use this to produce short sounds like a single bass drum beat"
match_linux_wm [list frame $name.k12frame.6 -relief flat]
match_linux_wm [list button $name.k12frame.6.b_output -image i.output \
-command [concat put_K12_objects $name output]]
pack $name.k12frame.6.b_output -side left -expand 0 -padx 2 -pady 2
setTooltip $name.k12frame.6.b_output "Output: Use this to send audio from computer into speakers"
pack $name.k12frame.edit $name.k12frame.msgs $name.k12frame.5 $name.k12frame.2 $name.k12frame.1 $name.k12frame.sound $name.k12frame.4 $name.k12frame.short $name.k12frame.3 $name.k12frame.6 -side top -expand 0 -fill x
}
canvas $name.c -width $width -height $height -background $::canvas_color($name) \
-highlightthickness 0 -bd 0 \
-yscrollcommand "$name.scrollvert set" \
......@@ -2112,7 +2320,11 @@ proc pdtk_canvas_new {name width height geometry editable} {
#pack $name.scrollhort -side bottom -fill x
#pack $name.scrollvert -side right -fill y
pack $name.c -side left -expand 1 -fill both
wm minsize $name 50 20
if { $k12_mode == 0 } {
wm minsize $name 50 20
} else {
wm minsize $name 580 532
}
wm geometry $name $geometry
# the file menu
......@@ -2140,29 +2352,31 @@ proc pdtk_canvas_new {name width height geometry editable} {
$name.m.file add command -label "Save as..." \
-command [concat menu_saveas $name] \
-accelerator [accel_munge "Ctrl+S"]
$name.m.file add separator
# arrange menus according to Apple HIG
if {$pd_nt != 2 } {
$name.m.file add command -label "Message..." -command {menu_send} \
-accelerator [accel_munge "Ctrl+m"]
# these are now part of Preferences... on Mac OS X
$name.m.file add command -label Path... \
-command {pd pd start-path-dialog \;}
$name.m.file add command -label Startup... \
-command {pd pd start-startup-dialog \;}
} else {
# Cmd-m is minimize window on Mac OS X
$name.m.file add command -label "Message..." -command {menu_send}
if { $k12_mode == 0 } {
$name.m.file add separator
$name.m.file add command -label "Make app from patch..." \
-command {menu_makeapp 0}
$name.m.file add command -label "Make app from folder..." \
-command {menu_makeapp 1}
# arrange menus according to Apple HIG
if {$pd_nt != 2 } {
$name.m.file add command -label "Message..." -command {menu_send} \
-accelerator [accel_munge "Ctrl+m"]
# these are now part of Preferences... on Mac OS X
$name.m.file add command -label Path... \
-command {pd pd start-path-dialog \;}
$name.m.file add command -label Startup... \
-command {pd pd start-startup-dialog \;}
} else {
# Cmd-m is minimize window on Mac OS X
$name.m.file add command -label "Message..." -command {menu_send}
$name.m.file add separator
$name.m.file add command -label "Make app from patch..." \
-command {menu_makeapp 0}
$name.m.file add command -label "Make app from folder..." \
-command {menu_makeapp 1}
}
$name.m.file add separator
$name.m.file add command -label "Print..." -command [concat menu_print $name] \
-accelerator [accel_munge "Ctrl+p"]
}
$name.m.file add separator
$name.m.file add command -label "Print..." -command [concat menu_print $name] \
-accelerator [accel_munge "Ctrl+p"]
if {$pd_nt != 2} {
# Mac OS X doesn't put Quit on the File menu
$name.m.file add separator
......@@ -2212,37 +2426,42 @@ proc pdtk_canvas_new {name width height geometry editable} {
-command [concat menu_selectall $name] \
-accelerator [accel_munge "Ctrl+a"]
$name.m.edit add command -label {Reselect} \
-command [concat menu_reselect $name] \
-accelerator "Ctrl+Enter" -state disabled
if { $k12_mode == 0 } {
$name.m.edit add command -label {Reselect} \
-command [concat menu_reselect $name] \
-accelerator "Ctrl+Enter" -state disabled
}
$name.m.edit add separator
$name.m.edit add command -label {Tidy Up} \
-command [concat menu_tidyup $name] \
-accelerator [accel_munge "Ctrl+y"] -state disabled
if { $k12_mode == 0 } {
$name.m.edit add command -label {Bring To Front} \
-command [concat popup_action $name 3] \
-accelerator [accel_munge "Ctrl+Up"] -state disabled
$name.m.edit add command -label {Tidy Up} \
-command [concat menu_tidyup $name] \
-accelerator [accel_munge "Ctrl+y"] -state disabled
$name.m.edit add command -label {Send To Back} \
-command [concat popup_action $name 4] \
-accelerator [accel_munge "Ctrl+Down"] -state disabled
$name.m.edit add command -label {Bring To Front} \
-command [concat popup_action $name 3] \
-accelerator [accel_munge "Ctrl+Up"] -state disabled
$name.m.edit add separator
$name.m.edit add command -label {Send To Back} \
-command [concat popup_action $name 4] \
-accelerator [accel_munge "Ctrl+Down"] -state disabled
if {$pd_nt == 2} { # no key command on Mac OS X, conflicts with standard
$name.m.edit add command -label {Text Editor} \
-command [concat menu_texteditor $name]
} else {
$name.m.edit add command -label {Text Editor} \
-accelerator [accel_munge "Ctrl+t"] \
-command [concat menu_texteditor $name]
}
$name.m.edit add separator
$name.m.edit add command -label Font \
-command [concat menu_font $name]
if {$pd_nt == 2} { # no key command on Mac OS X, conflicts with standard
$name.m.edit add command -label {Text Editor} \
-command [concat menu_texteditor $name]
} else {
$name.m.edit add command -label {Text Editor} \
-accelerator [accel_munge "Ctrl+t"] \
-command [concat menu_texteditor $name]
}
$name.m.edit add command -label Font \
-command [concat menu_font $name]
}
## jsarlo
$name.m.edit add checkbutton -label "Cord Inspector" \
......@@ -2256,36 +2475,38 @@ proc pdtk_canvas_new {name width height geometry editable} {
$name.m.edit add separator
## end jsarlo
$name.m.edit add command -label "Toggle console" \
-accelerator [accel_munge "Ctrl+R"] \
-command [concat .controls.switches.console invoke]
if { $k12_mode == 0 } {
$name.m.edit add command -label "Toggle console" \
-accelerator [accel_munge "Ctrl+R"] \
-command [concat .controls.switches.console invoke]
$name.m.edit add command -label "Clear console" \
-accelerator [accel_munge "Ctrl+L"] \
-command [concat menu_clear_console]
$name.m.edit add command -label "Clear console" \
-accelerator [accel_munge "Ctrl+L"] \
-command [concat menu_clear_console]
$name.m.edit add separator
$name.m.edit add separator
# Apple, Microsoft, and others put find functions in the Edit menu.
$name.m.edit add command -label {Find...} \
-accelerator [accel_munge "Ctrl+f"] \
-command [concat menu_findobject $name]
$name.m.edit add command -label {Find Again} \
-accelerator [accel_munge "Ctrl+g"] \
-command [concat menu_findagain $name]
$name.m.edit add command -label {Find last error} \
-command [concat menu_finderror]
$name.m.edit add separator
############iemlib##################
# instead of "red = #BC3C60" we take "grey85", so there is no difference,
# if widget is selected or not.
$name.m.edit add checkbutton -label "Autotips" \
-indicatoron false -selectcolor black \
-command [concat menu_tooltips $name] \
-accelerator [accel_munge "Ctrl+E"]
# Apple, Microsoft, and others put find functions in the Edit menu.
$name.m.edit add command -label {Find...} \
-accelerator [accel_munge "Ctrl+f"] \
-command [concat menu_findobject $name]
$name.m.edit add command -label {Find Again} \
-accelerator [accel_munge "Ctrl+g"] \
-command [concat menu_findagain $name]
$name.m.edit add command -label {Find last error} \
-command [concat menu_finderror]
$name.m.edit add separator
############iemlib##################
# instead of "red = #BC3C60" we take "grey85", so there is no difference,
# if widget is selected or not.
$name.m.edit add checkbutton -label "Autotips" \
-indicatoron false -selectcolor black \
-command [concat menu_tooltips $name] \
-accelerator [accel_munge "Ctrl+E"]
}
$name.m.edit add checkbutton -label "Edit mode" \
-indicatoron false -selectcolor black \
......@@ -2307,154 +2528,170 @@ proc pdtk_canvas_new {name width height geometry editable} {
############iemlib##################
if { $k12_mode == 0 } {
# the put menu
match_linux_wm [list menu $name.m.put -tearoff $put_tearoff]
$name.m add cascade -label Put -menu $name.m.put
$name.m.put add command -label Object \
-command [concat menu_object $name 0] \
-accelerator [accel_munge "Ctrl+1"]
$name.m.put add command -label Message \
-command [concat menu_message $name 0] \
-accelerator [accel_munge "Ctrl+2"]
$name.m.put add command -label Number \
-command [concat menu_floatatom $name 0] \
-accelerator [accel_munge "Ctrl+3"]
# the put menu
match_linux_wm [list menu $name.m.put -tearoff $put_tearoff]
$name.m add cascade -label Put -menu $name.m.put
$name.m.put add command -label Symbol \
-command [concat menu_symbolatom $name 0] \
-accelerator [accel_munge "Ctrl+4"]
$name.m.put add command -label Object \
-command [concat menu_object $name 0] \
-accelerator [accel_munge "Ctrl+1"]
$name.m.put add command -label Comment \
-command [concat menu_comment $name 0] \
-accelerator [accel_munge "Ctrl+5"]