[PD-cvs] SF.net SVN: pure-data:[10722] branches/pd-devel/0.41.4/src
eighthave at users.sourceforge.net
eighthave at users.sourceforge.net
Tue Feb 3 06:40:42 CET 2009
Revision: 10722
http://pure-data.svn.sourceforge.net/pure-data/?rev=10722&view=rev
Author: eighthave
Date: 2009-02-03 05:40:41 +0000 (Tue, 03 Feb 2009)
Log Message:
-----------
- renamed files to the new attempt at a standard for panels
Added Paths:
-----------
branches/pd-devel/0.41.4/src/gatom_panel.tcl
branches/pd-devel/0.41.4/src/iemgui_panel.tcl
Removed Paths:
-------------
branches/pd-devel/0.41.4/src/gatom.tcl
branches/pd-devel/0.41.4/src/pd_iemgui.tcl
Deleted: branches/pd-devel/0.41.4/src/gatom.tcl
===================================================================
--- branches/pd-devel/0.41.4/src/gatom.tcl 2009-02-03 05:34:51 UTC (rev 10721)
+++ branches/pd-devel/0.41.4/src/gatom.tcl 2009-02-03 05:40:41 UTC (rev 10722)
@@ -1,215 +0,0 @@
-
-package provide gatom 0.1
-
-package require wheredoesthisgo
-
-namespace eval ::gatom:: {
- namespace export pdtk_gatom_dialog
-}
-
-# hashtable for communicating the position of the radiobuttons (Tk's
-# radiobutton widget requires this to be global)
-global gatomlabel_position
-
-############ pdtk_gatom_dialog -- run a gatom dialog #########
-
-# dialogs like this one can come up in many copies; but in TK the easiest
-# way to get data from an "entry", etc., is to set an associated variable
-# name. This is especially true for grouped "radio buttons". So we have
-# to synthesize variable names for each instance of the dialog. The dialog
-# gets a TK pathname $id, from which it strips the leading "." to make a
-# variable suffix $vid. Then you can get the actual value out by asking for
-# [eval concat $$variablename]. There should be an easier way but I don't see
-# it yet.
-
-proc ::gatom::escape {sym} {
- if {[string length $sym] == 0} {
- set ret "-"
- } else {
- if {[string equal -length 1 $sym "-"]} {
- set ret [string replace $sym 0 0 "--"]
- } else {
- set ret [string map {"$" "#"} $sym]
- }
- }
- return [unspace_text $ret]
-}
-
-proc ::gatom::unescape {sym} {
- if {[string equal -length 1 $sym "-"]} {
- set ret [string replace $sym 0 0 ""]
- } else {
- set ret [string map {"#" "$"} $sym]
- }
- return $ret
-}
-
-proc gatom_apply {mytoplevel} {
- # TODO kludge!! until a common approach to ::pd_bindings::panel_bindings
- # is sorted out
- ::gatom::apply $mytoplevel
-}
-
-proc ::gatom::apply {mytoplevel} {
- global gatomlabel_position
-
- pdsend "$mytoplevel param \
- [$mytoplevel.width.entry get] \
- [$mytoplevel.limits.lower.entry get] \
- [$mytoplevel.limits.upper.entry get] \
- [::gatom::escape [$mytoplevel.gatomlabel.name.entry get]] \
- $gatomlabel_position($mytoplevel) \
- [::gatom::escape [$mytoplevel.s_r.send.entry get]] \
- [::gatom::escape [$mytoplevel.s_r.receive.entry get]]"
-}
-
-
-proc gatom_cancel {mytoplevel} {
- # TODO kludge!! until a common approach to ::pd_bindings::panel_bindings
- # is sorted out
- ::gatom::cancel $mytoplevel
-}
-proc ::gatom::cancel {mytoplevel} {
- pdsend "$mytoplevel cancel"
-}
-
-
-proc gatom_ok {mytoplevel} {
- # TODO kludge!! until a common approach to ::pd_bindings::panel_bindings
- # is sorted out
- ::gatom::ok $mytoplevel
-}
-proc ::gatom::ok {mytoplevel} {
- ::gatom::apply $mytoplevel
- ::gatom::cancel $mytoplevel
-}
-
-# set up the panel with the info from pd
-proc ::gatom::pdtk_gatom_dialog {mytoplevel initwidth initlower initupper \
- initgatomlabel_position \
- initgatomlabel initsend initreceive} {
- global gatomlabel_position
- set gatomlabel_position($mytoplevel) $initgatomlabel_position
-
- if {[winfo exists $mytoplevel]} {
- wm deiconify $mytoplevel
- raise $mytoplevel
- } else {
- create_panel $mytoplevel
- }
-
- $mytoplevel.width.entry insert 0 $initwidth
- $mytoplevel.limits.lower.entry insert 0 $initlower
- $mytoplevel.limits.upper.entry insert 0 $initupper
- if {$initgatomlabel ne "-"} {
- $mytoplevel.gatomlabel.name.entry insert 0 $initgatomlabel
- }
- set gatomlabel_position($mytoplevel) $initgatomlabel_position
- if {$initsend ne "-"} {
- $mytoplevel.s_r.send.entry insert 0 $initsend
- }
- if {$initreceive ne "-"} {
- $mytoplevel.s_r.receive.entry insert 0 $initreceive
- }
-}
-
-proc ::gatom::create_panel {mytoplevel} {
- global gatomlabel_position
-
- toplevel $mytoplevel -background $::panel_background
- wm title $mytoplevel "atom box properties"
- wm resizable $mytoplevel 0 0
- catch { # not all platforms/Tcls versions have these options
- wm attributes $mytoplevel -topmost 1
- #wm attributes $mytoplevel -transparent 1
- #$mytoplevel configure -highlightthickness 1
- }
- wm protocol $mytoplevel WM_DELETE_WINDOW "::gatom::cancel $mytoplevel"
-
- ::pd_bindings::panel_bindings $mytoplevel "gatom"
-
- frame $mytoplevel.width -height 7 -background $::panel_background
- pack $mytoplevel.width -side top
- label $mytoplevel.width.label -text "width" -background $::panel_background
- entry $mytoplevel.width.entry -width 4 -highlightbackground $::panel_background
- pack $mytoplevel.width.label $mytoplevel.width.entry -side left
-
- labelframe $mytoplevel.limits -text "limits" -padx 15 -pady 4 -borderwidth 1 \
- -font highlight_font -background $::panel_background
- pack $mytoplevel.limits -side top -fill x
- frame $mytoplevel.limits.lower -background $::panel_background
- pack $mytoplevel.limits.lower -side left
- label $mytoplevel.limits.lower.label -text "lower" -background $::panel_background
- entry $mytoplevel.limits.lower.entry -width 8 -highlightbackground $::panel_background
- pack $mytoplevel.limits.lower.label $mytoplevel.limits.lower.entry -side left
- frame $mytoplevel.limits.upper -background $::panel_background
- pack $mytoplevel.limits.upper -side left
- frame $mytoplevel.limits.upper.spacer -width 20 -background $::panel_background
- label $mytoplevel.limits.upper.label -text "upper" -background $::panel_background
- entry $mytoplevel.limits.upper.entry -width 8 -highlightbackground $::panel_background
- pack $mytoplevel.limits.upper.spacer $mytoplevel.limits.upper.label \
- $mytoplevel.limits.upper.entry -side left
-
- frame $mytoplevel.spacer1 -height 7 -background $::panel_background
- pack $mytoplevel.spacer1 -side top
-
- labelframe $mytoplevel.gatomlabel -text "label" -padx 5 -pady 4 -borderwidth 1 \
- -font highlight_font -background $::panel_background
- pack $mytoplevel.gatomlabel -side top -fill x
- frame $mytoplevel.gatomlabel.name -background $::panel_background
- pack $mytoplevel.gatomlabel.name -side top
- entry $mytoplevel.gatomlabel.name.entry -width 33 -highlightbackground $::panel_background
- pack $mytoplevel.gatomlabel.name.entry -side left
- frame $mytoplevel.gatomlabel.radio -background $::panel_background
- pack $mytoplevel.gatomlabel.radio -side top
- radiobutton $mytoplevel.gatomlabel.radio.left -value 0 -text "left " \
- -variable gatomlabel_position($mytoplevel) -background $::panel_background \
- -justify left -takefocus 0
- radiobutton $mytoplevel.gatomlabel.radio.right -value 1 -text "right" \
- -variable gatomlabel_position($mytoplevel) -background $::panel_background \
- -justify left -takefocus 0
- radiobutton $mytoplevel.gatomlabel.radio.top -value 2 -text "top" \
- -variable gatomlabel_position($mytoplevel) -background $::panel_background \
- -justify left -takefocus 0
- radiobutton $mytoplevel.gatomlabel.radio.bottom -value 3 -text "bottom" \
- -variable gatomlabel_position($mytoplevel) -background $::panel_background \
- -justify left -takefocus 0
- pack $mytoplevel.gatomlabel.radio.left -side left -anchor w
- pack $mytoplevel.gatomlabel.radio.right -side right -anchor w
- pack $mytoplevel.gatomlabel.radio.top -side top -anchor w
- pack $mytoplevel.gatomlabel.radio.bottom -side bottom -anchor w
-
- frame $mytoplevel.spacer2 -height 7 -background $::panel_background
- pack $mytoplevel.spacer2 -side top
-
- labelframe $mytoplevel.s_r -text "messages" -padx 5 -pady 4 -borderwidth 1 \
- -font highlight_font -background $::panel_background
- pack $mytoplevel.s_r -side top -fill x
- frame $mytoplevel.s_r.send -background $::panel_background
- pack $mytoplevel.s_r.send -side top -anchor e
- label $mytoplevel.s_r.send.label -text "send symbol" -background $::panel_background
- entry $mytoplevel.s_r.send.entry -width 21 -highlightbackground $::panel_background
- pack $mytoplevel.s_r.send.entry $mytoplevel.s_r.send.label -side right
-
- frame $mytoplevel.s_r.receive -background $::panel_background
- pack $mytoplevel.s_r.receive -side top -anchor e
- label $mytoplevel.s_r.receive.label -text "receive symbol" -background $::panel_background
- entry $mytoplevel.s_r.receive.entry -width 21 -highlightbackground $::panel_background
- pack $mytoplevel.s_r.receive.entry $mytoplevel.s_r.receive.label -side right
-
- frame $mytoplevel.buttonframe -pady 5 -background $::panel_background
- pack $mytoplevel.buttonframe -side top -fill x -pady 2m
- button $mytoplevel.buttonframe.cancel -text {Cancel} \
- -command "::gatom::cancel $mytoplevel" -highlightbackground $::panel_background
- pack $mytoplevel.buttonframe.cancel -side left -expand 1
- button $mytoplevel.buttonframe.apply -text {Apply} \
- -command "::gatom::apply $mytoplevel" -highlightbackground $::panel_background
- pack $mytoplevel.buttonframe.apply -side left -expand 1
- button $mytoplevel.buttonframe.ok -text {OK} \
- -command "::gatom::ok $mytoplevel" -highlightbackground $::panel_background
- pack $mytoplevel.buttonframe.ok -side left -expand 1
-
- $mytoplevel.width.entry select from 0
- $mytoplevel.width.entry select adjust end
- focus $mytoplevel.width.entry
-}
Copied: branches/pd-devel/0.41.4/src/gatom_panel.tcl (from rev 10721, branches/pd-devel/0.41.4/src/gatom.tcl)
===================================================================
--- branches/pd-devel/0.41.4/src/gatom_panel.tcl (rev 0)
+++ branches/pd-devel/0.41.4/src/gatom_panel.tcl 2009-02-03 05:40:41 UTC (rev 10722)
@@ -0,0 +1,215 @@
+
+package provide gatom 0.1
+
+package require wheredoesthisgo
+
+namespace eval ::gatom:: {
+ namespace export pdtk_gatom_dialog
+}
+
+# hashtable for communicating the position of the radiobuttons (Tk's
+# radiobutton widget requires this to be global)
+global gatomlabel_position
+
+############ pdtk_gatom_dialog -- run a gatom dialog #########
+
+# dialogs like this one can come up in many copies; but in TK the easiest
+# way to get data from an "entry", etc., is to set an associated variable
+# name. This is especially true for grouped "radio buttons". So we have
+# to synthesize variable names for each instance of the dialog. The dialog
+# gets a TK pathname $id, from which it strips the leading "." to make a
+# variable suffix $vid. Then you can get the actual value out by asking for
+# [eval concat $$variablename]. There should be an easier way but I don't see
+# it yet.
+
+proc ::gatom::escape {sym} {
+ if {[string length $sym] == 0} {
+ set ret "-"
+ } else {
+ if {[string equal -length 1 $sym "-"]} {
+ set ret [string replace $sym 0 0 "--"]
+ } else {
+ set ret [string map {"$" "#"} $sym]
+ }
+ }
+ return [unspace_text $ret]
+}
+
+proc ::gatom::unescape {sym} {
+ if {[string equal -length 1 $sym "-"]} {
+ set ret [string replace $sym 0 0 ""]
+ } else {
+ set ret [string map {"#" "$"} $sym]
+ }
+ return $ret
+}
+
+proc gatom_apply {mytoplevel} {
+ # TODO kludge!! until a common approach to ::pd_bindings::panel_bindings
+ # is sorted out
+ ::gatom::apply $mytoplevel
+}
+
+proc ::gatom::apply {mytoplevel} {
+ global gatomlabel_position
+
+ pdsend "$mytoplevel param \
+ [$mytoplevel.width.entry get] \
+ [$mytoplevel.limits.lower.entry get] \
+ [$mytoplevel.limits.upper.entry get] \
+ [::gatom::escape [$mytoplevel.gatomlabel.name.entry get]] \
+ $gatomlabel_position($mytoplevel) \
+ [::gatom::escape [$mytoplevel.s_r.send.entry get]] \
+ [::gatom::escape [$mytoplevel.s_r.receive.entry get]]"
+}
+
+
+proc gatom_cancel {mytoplevel} {
+ # TODO kludge!! until a common approach to ::pd_bindings::panel_bindings
+ # is sorted out
+ ::gatom::cancel $mytoplevel
+}
+proc ::gatom::cancel {mytoplevel} {
+ pdsend "$mytoplevel cancel"
+}
+
+
+proc gatom_ok {mytoplevel} {
+ # TODO kludge!! until a common approach to ::pd_bindings::panel_bindings
+ # is sorted out
+ ::gatom::ok $mytoplevel
+}
+proc ::gatom::ok {mytoplevel} {
+ ::gatom::apply $mytoplevel
+ ::gatom::cancel $mytoplevel
+}
+
+# set up the panel with the info from pd
+proc ::gatom::pdtk_gatom_dialog {mytoplevel initwidth initlower initupper \
+ initgatomlabel_position \
+ initgatomlabel initsend initreceive} {
+ global gatomlabel_position
+ set gatomlabel_position($mytoplevel) $initgatomlabel_position
+
+ if {[winfo exists $mytoplevel]} {
+ wm deiconify $mytoplevel
+ raise $mytoplevel
+ } else {
+ create_panel $mytoplevel
+ }
+
+ $mytoplevel.width.entry insert 0 $initwidth
+ $mytoplevel.limits.lower.entry insert 0 $initlower
+ $mytoplevel.limits.upper.entry insert 0 $initupper
+ if {$initgatomlabel ne "-"} {
+ $mytoplevel.gatomlabel.name.entry insert 0 $initgatomlabel
+ }
+ set gatomlabel_position($mytoplevel) $initgatomlabel_position
+ if {$initsend ne "-"} {
+ $mytoplevel.s_r.send.entry insert 0 $initsend
+ }
+ if {$initreceive ne "-"} {
+ $mytoplevel.s_r.receive.entry insert 0 $initreceive
+ }
+}
+
+proc ::gatom::create_panel {mytoplevel} {
+ global gatomlabel_position
+
+ toplevel $mytoplevel -background $::panel_background
+ wm title $mytoplevel "atom box properties"
+ wm resizable $mytoplevel 0 0
+ catch { # not all platforms/Tcls versions have these options
+ wm attributes $mytoplevel -topmost 1
+ #wm attributes $mytoplevel -transparent 1
+ #$mytoplevel configure -highlightthickness 1
+ }
+ wm protocol $mytoplevel WM_DELETE_WINDOW "::gatom::cancel $mytoplevel"
+
+ ::pd_bindings::panel_bindings $mytoplevel "gatom"
+
+ frame $mytoplevel.width -height 7 -background $::panel_background
+ pack $mytoplevel.width -side top
+ label $mytoplevel.width.label -text "width" -background $::panel_background
+ entry $mytoplevel.width.entry -width 4 -highlightbackground $::panel_background
+ pack $mytoplevel.width.label $mytoplevel.width.entry -side left
+
+ labelframe $mytoplevel.limits -text "limits" -padx 15 -pady 4 -borderwidth 1 \
+ -font highlight_font -background $::panel_background
+ pack $mytoplevel.limits -side top -fill x
+ frame $mytoplevel.limits.lower -background $::panel_background
+ pack $mytoplevel.limits.lower -side left
+ label $mytoplevel.limits.lower.label -text "lower" -background $::panel_background
+ entry $mytoplevel.limits.lower.entry -width 8 -highlightbackground $::panel_background
+ pack $mytoplevel.limits.lower.label $mytoplevel.limits.lower.entry -side left
+ frame $mytoplevel.limits.upper -background $::panel_background
+ pack $mytoplevel.limits.upper -side left
+ frame $mytoplevel.limits.upper.spacer -width 20 -background $::panel_background
+ label $mytoplevel.limits.upper.label -text "upper" -background $::panel_background
+ entry $mytoplevel.limits.upper.entry -width 8 -highlightbackground $::panel_background
+ pack $mytoplevel.limits.upper.spacer $mytoplevel.limits.upper.label \
+ $mytoplevel.limits.upper.entry -side left
+
+ frame $mytoplevel.spacer1 -height 7 -background $::panel_background
+ pack $mytoplevel.spacer1 -side top
+
+ labelframe $mytoplevel.gatomlabel -text "label" -padx 5 -pady 4 -borderwidth 1 \
+ -font highlight_font -background $::panel_background
+ pack $mytoplevel.gatomlabel -side top -fill x
+ frame $mytoplevel.gatomlabel.name -background $::panel_background
+ pack $mytoplevel.gatomlabel.name -side top
+ entry $mytoplevel.gatomlabel.name.entry -width 33 -highlightbackground $::panel_background
+ pack $mytoplevel.gatomlabel.name.entry -side left
+ frame $mytoplevel.gatomlabel.radio -background $::panel_background
+ pack $mytoplevel.gatomlabel.radio -side top
+ radiobutton $mytoplevel.gatomlabel.radio.left -value 0 -text "left " \
+ -variable gatomlabel_position($mytoplevel) -background $::panel_background \
+ -justify left -takefocus 0
+ radiobutton $mytoplevel.gatomlabel.radio.right -value 1 -text "right" \
+ -variable gatomlabel_position($mytoplevel) -background $::panel_background \
+ -justify left -takefocus 0
+ radiobutton $mytoplevel.gatomlabel.radio.top -value 2 -text "top" \
+ -variable gatomlabel_position($mytoplevel) -background $::panel_background \
+ -justify left -takefocus 0
+ radiobutton $mytoplevel.gatomlabel.radio.bottom -value 3 -text "bottom" \
+ -variable gatomlabel_position($mytoplevel) -background $::panel_background \
+ -justify left -takefocus 0
+ pack $mytoplevel.gatomlabel.radio.left -side left -anchor w
+ pack $mytoplevel.gatomlabel.radio.right -side right -anchor w
+ pack $mytoplevel.gatomlabel.radio.top -side top -anchor w
+ pack $mytoplevel.gatomlabel.radio.bottom -side bottom -anchor w
+
+ frame $mytoplevel.spacer2 -height 7 -background $::panel_background
+ pack $mytoplevel.spacer2 -side top
+
+ labelframe $mytoplevel.s_r -text "messages" -padx 5 -pady 4 -borderwidth 1 \
+ -font highlight_font -background $::panel_background
+ pack $mytoplevel.s_r -side top -fill x
+ frame $mytoplevel.s_r.send -background $::panel_background
+ pack $mytoplevel.s_r.send -side top -anchor e
+ label $mytoplevel.s_r.send.label -text "send symbol" -background $::panel_background
+ entry $mytoplevel.s_r.send.entry -width 21 -highlightbackground $::panel_background
+ pack $mytoplevel.s_r.send.entry $mytoplevel.s_r.send.label -side right
+
+ frame $mytoplevel.s_r.receive -background $::panel_background
+ pack $mytoplevel.s_r.receive -side top -anchor e
+ label $mytoplevel.s_r.receive.label -text "receive symbol" -background $::panel_background
+ entry $mytoplevel.s_r.receive.entry -width 21 -highlightbackground $::panel_background
+ pack $mytoplevel.s_r.receive.entry $mytoplevel.s_r.receive.label -side right
+
+ frame $mytoplevel.buttonframe -pady 5 -background $::panel_background
+ pack $mytoplevel.buttonframe -side top -fill x -pady 2m
+ button $mytoplevel.buttonframe.cancel -text {Cancel} \
+ -command "::gatom::cancel $mytoplevel" -highlightbackground $::panel_background
+ pack $mytoplevel.buttonframe.cancel -side left -expand 1
+ button $mytoplevel.buttonframe.apply -text {Apply} \
+ -command "::gatom::apply $mytoplevel" -highlightbackground $::panel_background
+ pack $mytoplevel.buttonframe.apply -side left -expand 1
+ button $mytoplevel.buttonframe.ok -text {OK} \
+ -command "::gatom::ok $mytoplevel" -highlightbackground $::panel_background
+ pack $mytoplevel.buttonframe.ok -side left -expand 1
+
+ $mytoplevel.width.entry select from 0
+ $mytoplevel.width.entry select adjust end
+ focus $mytoplevel.width.entry
+}
Copied: branches/pd-devel/0.41.4/src/iemgui_panel.tcl (from rev 10721, branches/pd-devel/0.41.4/src/pd_iemgui.tcl)
===================================================================
--- branches/pd-devel/0.41.4/src/iemgui_panel.tcl (rev 0)
+++ branches/pd-devel/0.41.4/src/iemgui_panel.tcl 2009-02-03 05:40:41 UTC (rev 10722)
@@ -0,0 +1,794 @@
+# For information on usage and redistribution, and for a DISCLAIMER OF ALL
+# WARRANTIES, see the file, "LICENSE.txt," in this distribution.
+# Copyright (c) 1997-2009 Miller Puckette.
+
+package provide pd_iemgui 0.1
+
+namespace eval ::pd_iemgui:: {
+ variable define_min_flashhold 50
+ variable define_min_flashbreak 10
+ variable define_min_fontsize 4
+
+ namespace export pdtk_iemgui_dialog
+}
+
+# TODO rename $id to $mytoplevel
+
+proc ::pd_iemgui::clip_dim {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_wdt [concat iemgui_wdt_$vid]
+ global $var_iemgui_wdt
+ set var_iemgui_min_wdt [concat iemgui_min_wdt_$vid]
+ global $var_iemgui_min_wdt
+ set var_iemgui_hgt [concat iemgui_hgt_$vid]
+ global $var_iemgui_hgt
+ set var_iemgui_min_hgt [concat iemgui_min_hgt_$vid]
+ global $var_iemgui_min_hgt
+
+ if {[eval concat $$var_iemgui_wdt] < [eval concat $$var_iemgui_min_wdt]} {
+ set $var_iemgui_wdt [eval concat $$var_iemgui_min_wdt]
+ $id.dim.w_ent configure -textvariable $var_iemgui_wdt
+ }
+ if {[eval concat $$var_iemgui_hgt] < [eval concat $$var_iemgui_min_hgt]} {
+ set $var_iemgui_hgt [eval concat $$var_iemgui_min_hgt]
+ $id.dim.h_ent configure -textvariable $var_iemgui_hgt
+ }
+}
+
+proc ::pd_iemgui::clip_num {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_num [concat iemgui_num_$vid]
+ global $var_iemgui_num
+
+ if {[eval concat $$var_iemgui_num] > 2000} {
+ set $var_iemgui_num 2000
+ $id.para.num_ent configure -textvariable $var_iemgui_num
+ }
+ if {[eval concat $$var_iemgui_num] < 1} {
+ set $var_iemgui_num 1
+ $id.para.num_ent configure -textvariable $var_iemgui_num
+ }
+}
+
+proc ::pd_iemgui::sched_rng {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_min_rng [concat iemgui_min_rng_$vid]
+ global $var_iemgui_min_rng
+ set var_iemgui_max_rng [concat iemgui_max_rng_$vid]
+ global $var_iemgui_max_rng
+ set var_iemgui_rng_sch [concat iemgui_rng_sch_$vid]
+ global $var_iemgui_rng_sch
+
+ variable define_min_flashhold
+ variable define_min_flashbreak
+
+ if {[eval concat $$var_iemgui_rng_sch] == 2} {
+ if {[eval concat $$var_iemgui_max_rng] < [eval concat $$var_iemgui_min_rng]} {
+ set hhh [eval concat $$var_iemgui_min_rng]
+ set $var_iemgui_min_rng [eval concat $$var_iemgui_max_rng]
+ set $var_iemgui_max_rng $hhh
+ $id.rng.max_ent configure -textvariable $var_iemgui_max_rng
+ $id.rng.min_ent configure -textvariable $var_iemgui_min_rng }
+ if {[eval concat $$var_iemgui_max_rng] < $define_min_flashhold} {
+ set $var_iemgui_max_rng $iemgui_define_min_flashhold
+ $id.rng.max_ent configure -textvariable $var_iemgui_max_rng
+ }
+ if {[eval concat $$var_iemgui_min_rng] < $define_min_flashbreak} {
+ set $var_iemgui_min_rng $define_min_flashbreak
+ $id.rng.min_ent configure -textvariable $var_iemgui_min_rng
+ }
+ }
+ if {[eval concat $$var_iemgui_rng_sch] == 1} {
+ if {[eval concat $$var_iemgui_min_rng] == 0.0} {
+ set $var_iemgui_min_rng 1.0
+ $id.rng.min_ent configure -textvariable $var_iemgui_min_rng
+ }
+ }
+}
+
+proc ::pd_iemgui::verify_rng {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_min_rng [concat iemgui_min_rng_$vid]
+ global $var_iemgui_min_rng
+ set var_iemgui_max_rng [concat iemgui_max_rng_$vid]
+ global $var_iemgui_max_rng
+ set var_iemgui_lin0_log1 [concat iemgui_lin0_log1_$vid]
+ global $var_iemgui_lin0_log1
+
+ if {[eval concat $$var_iemgui_lin0_log1] == 1} {
+ if {[eval concat $$var_iemgui_max_rng] == 0.0 && [eval concat $$var_iemgui_min_rng] == 0.0} {
+ set $var_iemgui_max_rng 1.0
+ $id.rng.max_ent configure -textvariable $var_iemgui_max_rng
+ }
+ if {[eval concat $$var_iemgui_max_rng] > 0} {
+ if {[eval concat $$var_iemgui_min_rng] <= 0} {
+ set $var_iemgui_min_rng [expr [eval concat $$var_iemgui_max_rng] * 0.01]
+ $id.rng.min_ent configure -textvariable $var_iemgui_min_rng
+ }
+ } else {
+ if {[eval concat $$var_iemgui_min_rng] > 0} {
+ set $var_iemgui_max_rng [expr [eval concat $$var_iemgui_min_rng] * 0.01]
+ $id.rng.max_ent configure -textvariable $var_iemgui_max_rng
+ }
+ }
+ }
+}
+
+proc ::pd_iemgui::clip_fontsize {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_gn_fs [concat iemgui_gn_fs_$vid]
+ global $var_iemgui_gn_fs
+
+ variable define_min_fontsize
+
+ if {[eval concat $$var_iemgui_gn_fs] < $define_min_fontsize} {
+ set $var_iemgui_gn_fs $define_min_fontsize
+ $id.label.fs_ent configure -textvariable $var_iemgui_gn_fs
+ }
+}
+
+proc ::pd_iemgui::set_col_example {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_bcol [concat iemgui_bcol_$vid]
+ global $var_iemgui_bcol
+ set var_iemgui_fcol [concat iemgui_fcol_$vid]
+ global $var_iemgui_fcol
+ set var_iemgui_lcol [concat iemgui_lcol_$vid]
+ global $var_iemgui_lcol
+
+ $id.colors.sections.lb_bk configure \
+ -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -foreground [format "#%6.6x" [eval concat $$var_iemgui_lcol]] \
+ -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_lcol]]
+
+ if { [eval concat $$var_iemgui_fcol] >= 0 } {
+ $id.colors.sections.fr_bk configure \
+ -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -foreground [format "#%6.6x" [eval concat $$var_iemgui_fcol]] \
+ -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_fcol]]
+ } else {
+ $id.colors.sections.fr_bk configure \
+ -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -foreground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_bcol]]}
+}
+
+proc ::pd_iemgui::preset_col {id presetcol} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_l2_f1_b0 [concat iemgui_l2_f1_b0_$vid]
+ global $var_iemgui_l2_f1_b0
+ set var_iemgui_bcol [concat iemgui_bcol_$vid]
+ global $var_iemgui_bcol
+ set var_iemgui_fcol [concat iemgui_fcol_$vid]
+ global $var_iemgui_fcol
+ set var_iemgui_lcol [concat iemgui_lcol_$vid]
+ global $var_iemgui_lcol
+
+ if { [eval concat $$var_iemgui_l2_f1_b0] == 0 } { set $var_iemgui_bcol $presetcol }
+ if { [eval concat $$var_iemgui_l2_f1_b0] == 1 } { set $var_iemgui_fcol $presetcol }
+ if { [eval concat $$var_iemgui_l2_f1_b0] == 2 } { set $var_iemgui_lcol $presetcol }
+ ::pd_iemgui::set_col_example $id
+}
+
+proc ::pd_iemgui::choose_col_bkfrlb {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_l2_f1_b0 [concat iemgui_l2_f1_b0_$vid]
+ global $var_iemgui_l2_f1_b0
+ set var_iemgui_bcol [concat iemgui_bcol_$vid]
+ global $var_iemgui_bcol
+ set var_iemgui_fcol [concat iemgui_fcol_$vid]
+ global $var_iemgui_fcol
+ set var_iemgui_lcol [concat iemgui_lcol_$vid]
+ global $var_iemgui_lcol
+
+ if {[eval concat $$var_iemgui_l2_f1_b0] == 0} {
+ set $var_iemgui_bcol [expr [eval concat $$var_iemgui_bcol] & 0xFCFCFC]
+ set helpstring [tk_chooseColor -title "Background-Color" -initialcolor [format "#%6.6x" [eval concat $$var_iemgui_bcol]]]
+ if { $helpstring != "" } {
+ set $var_iemgui_bcol [string replace $helpstring 0 0 "0x"]
+ set $var_iemgui_bcol [expr [eval concat $$var_iemgui_bcol] & 0xFCFCFC] }
+ }
+ if {[eval concat $$var_iemgui_l2_f1_b0] == 1} {
+ set $var_iemgui_fcol [expr [eval concat $$var_iemgui_fcol] & 0xFCFCFC]
+ set helpstring [tk_chooseColor -title "Front-Color" -initialcolor [format "#%6.6x" [eval concat $$var_iemgui_fcol]]]
+ if { $helpstring != "" } {
+ set $var_iemgui_fcol [string replace $helpstring 0 0 "0x"]
+ set $var_iemgui_fcol [expr [eval concat $$var_iemgui_fcol] & 0xFCFCFC] }
+ }
+ if {[eval concat $$var_iemgui_l2_f1_b0] == 2} {
+ set $var_iemgui_lcol [expr [eval concat $$var_iemgui_lcol] & 0xFCFCFC]
+ set helpstring [tk_chooseColor -title "Label-Color" -initialcolor [format "#%6.6x" [eval concat $$var_iemgui_lcol]]]
+ if { $helpstring != "" } {
+ set $var_iemgui_lcol [string replace $helpstring 0 0 "0x"]
+ set $var_iemgui_lcol [expr [eval concat $$var_iemgui_lcol] & 0xFCFCFC] }
+ }
+ ::pd_iemgui::set_col_example $id
+}
+
+proc ::pd_iemgui::lilo {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_lin0_log1 [concat iemgui_lin0_log1_$vid]
+ global $var_iemgui_lin0_log1
+ set var_iemgui_lilo0 [concat iemgui_lilo0_$vid]
+ global $var_iemgui_lilo0
+ set var_iemgui_lilo1 [concat iemgui_lilo1_$vid]
+ global $var_iemgui_lilo1
+
+ ::pd_iemgui::sched_rng $id
+
+ if {[eval concat $$var_iemgui_lin0_log1] == 0} {
+ set $var_iemgui_lin0_log1 1
+ $id.para.lilo configure -text [eval concat $$var_iemgui_lilo1]
+ ::pd_iemgui::verify_rng $id
+ ::pd_iemgui::sched_rng $id
+ } else {
+ set $var_iemgui_lin0_log1 0
+ $id.para.lilo configure -text [eval concat $$var_iemgui_lilo0]
+ }
+}
+
+proc ::pd_iemgui::toggle_font {id gn_f} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_gn_f [concat iemgui_gn_f_$vid]
+ global $var_iemgui_gn_f
+
+ set $var_iemgui_gn_f $gn_f
+
+ switch -- $gn_f {
+ 0 { set current_font $::font_family}
+ 1 { set current_font "Helvetica" }
+ 2 { set current_font "Times" }
+ }
+ set current_font_spec "{$current_font} 12 $::font_weight"
+
+ $id.label.fontpopup_label configure -text $current_font \
+ -font $current_font_spec
+ $id.label.name_entry configure -font $current_font_spec
+ $id.colors.sections.fr_bk configure -font $current_font_spec
+ $id.colors.sections.lb_bk configure -font $current_font_spec
+}
+
+proc ::pd_iemgui::lb {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_loadbang [concat iemgui_loadbang_$vid]
+ global $var_iemgui_loadbang
+
+ if {[eval concat $$var_iemgui_loadbang] == 0} {
+ set $var_iemgui_loadbang 1
+ $id.para.lb configure -text "init"
+ } else {
+ set $var_iemgui_loadbang 0
+ $id.para.lb configure -text "no init"
+ }
+}
+
+proc ::pd_iemgui::stdy_jmp {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_steady [concat iemgui_steady_$vid]
+ global $var_iemgui_steady
+
+ if {[eval concat $$var_iemgui_steady]} {
+ set $var_iemgui_steady 0
+ $id.para.stdy_jmp configure -text "jump on click"
+ } else {
+ set $var_iemgui_steady 1
+ $id.para.stdy_jmp configure -text "steady on click"
+ }
+}
+
+proc ::pd_iemgui::apply {id} {
+ set vid [string trimleft $id .]
+
+ set var_iemgui_wdt [concat iemgui_wdt_$vid]
+ global $var_iemgui_wdt
+ set var_iemgui_min_wdt [concat iemgui_min_wdt_$vid]
+ global $var_iemgui_min_wdt
+ set var_iemgui_hgt [concat iemgui_hgt_$vid]
+ global $var_iemgui_hgt
+ set var_iemgui_min_hgt [concat iemgui_min_hgt_$vid]
+ global $var_iemgui_min_hgt
+ set var_iemgui_min_rng [concat iemgui_min_rng_$vid]
+ global $var_iemgui_min_rng
+ set var_iemgui_max_rng [concat iemgui_max_rng_$vid]
+ global $var_iemgui_max_rng
+ set var_iemgui_lin0_log1 [concat iemgui_lin0_log1_$vid]
+ global $var_iemgui_lin0_log1
+ set var_iemgui_lilo0 [concat iemgui_lilo0_$vid]
+ global $var_iemgui_lilo0
+ set var_iemgui_lilo1 [concat iemgui_lilo1_$vid]
+ global $var_iemgui_lilo1
+ set var_iemgui_loadbang [concat iemgui_loadbang_$vid]
+ global $var_iemgui_loadbang
+ set var_iemgui_num [concat iemgui_num_$vid]
+ global $var_iemgui_num
+ set var_iemgui_steady [concat iemgui_steady_$vid]
+ global $var_iemgui_steady
+ set var_iemgui_snd [concat iemgui_snd_$vid]
+ global $var_iemgui_snd
+ set var_iemgui_rcv [concat iemgui_rcv_$vid]
+ global $var_iemgui_rcv
+ set var_iemgui_gui_nam [concat iemgui_gui_nam_$vid]
+ global $var_iemgui_gui_nam
+ set var_iemgui_gn_dx [concat iemgui_gn_dx_$vid]
+ global $var_iemgui_gn_dx
+ set var_iemgui_gn_dy [concat iemgui_gn_dy_$vid]
+ global $var_iemgui_gn_dy
+ set var_iemgui_gn_f [concat iemgui_gn_f_$vid]
+ global $var_iemgui_gn_f
+ set var_iemgui_gn_fs [concat iemgui_gn_fs_$vid]
+ global $var_iemgui_gn_fs
+ set var_iemgui_bcol [concat iemgui_bcol_$vid]
+ global $var_iemgui_bcol
+ set var_iemgui_fcol [concat iemgui_fcol_$vid]
+ global $var_iemgui_fcol
+ set var_iemgui_lcol [concat iemgui_lcol_$vid]
+ global $var_iemgui_lcol
+
+ ::pd_iemgui::clip_dim $id
+ ::pd_iemgui::clip_num $id
+ ::pd_iemgui::sched_rng $id
+ ::pd_iemgui::verify_rng $id
+ ::pd_iemgui::sched_rng $id
+ ::pd_iemgui::clip_fontsize $id
+
+ if {[eval concat $$var_iemgui_snd] == ""} {set hhhsnd "empty"} else {set hhhsnd [eval concat $$var_iemgui_snd]}
+ if {[eval concat $$var_iemgui_rcv] == ""} {set hhhrcv "empty"} else {set hhhrcv [eval concat $$var_iemgui_rcv]}
+ if {[eval concat $$var_iemgui_gui_nam] == ""} {set hhhgui_nam "empty"
+ } else {
+ set hhhgui_nam [eval concat $$var_iemgui_gui_nam]}
+
+ if {[string index $hhhsnd 0] == "$"} {
+ set hhhsnd [string replace $hhhsnd 0 0 #] }
+ if {[string index $hhhrcv 0] == "$"} {
+ set hhhrcv [string replace $hhhrcv 0 0 #] }
+ if {[string index $hhhgui_nam 0] == "$"} {
+ set hhhgui_nam [string replace $hhhgui_nam 0 0 #] }
+
+ set hhhsnd [unspace_text $hhhsnd]
+ set hhhrcv [unspace_text $hhhrcv]
+ set hhhgui_nam [unspace_text $hhhgui_nam]
+
+ pdsend [concat $id dialog \
+ [eval concat $$var_iemgui_wdt] \
+ [eval concat $$var_iemgui_hgt] \
+ [eval concat $$var_iemgui_min_rng] \
+ [eval concat $$var_iemgui_max_rng] \
+ [eval concat $$var_iemgui_lin0_log1] \
+ [eval concat $$var_iemgui_loadbang] \
+ [eval concat $$var_iemgui_num] \
+ $hhhsnd \
+ $hhhrcv \
+ $hhhgui_nam \
+ [eval concat $$var_iemgui_gn_dx] \
+ [eval concat $$var_iemgui_gn_dy] \
+ [eval concat $$var_iemgui_gn_f] \
+ [eval concat $$var_iemgui_gn_fs] \
+ [eval concat $$var_iemgui_bcol] \
+ [eval concat $$var_iemgui_fcol] \
+ [eval concat $$var_iemgui_lcol] \
+ [eval concat $$var_iemgui_steady]]
+}
+
+
+proc iemgui_cancel {mytoplevel} {
+ # TODO kludge!! until a common approach to ::pd_bindings::panel_bindings
+ # is sorted out
+ ::pd_iemgui::cancel $mytoplevel
+}
+proc ::pd_iemgui::cancel {id} {
+ pdsend "$id cancel"
+}
+
+proc iemgui_ok {mytoplevel} {
+ # TODO kludge!! until a common approach to ::pd_bindings::panel_bindings
+ # is sorted out
+ ::pd_iemgui::ok $mytoplevel
+}
+proc ::pd_iemgui::ok {id} {
+ ::pd_iemgui::apply $id
+ ::pd_iemgui::cancel $id
+}
+
+proc ::pd_iemgui::pdtk_iemgui_dialog {id mainheader dim_header \
+ wdt min_wdt wdt_label \
+ hgt min_hgt hgt_label \
+ rng_header min_rng min_rng_label max_rng \
+ max_rng_label rng_sched \
+ lin0_log1 lilo0_label lilo1_label \
+ loadbang steady num_label num \
+ snd rcv \
+ gui_name \
+ gn_dx gn_dy gn_f gn_fs \
+ bcol fcol lcol} {
+
+ set vid [string trimleft $id .]
+
+ set var_iemgui_wdt [concat iemgui_wdt_$vid]
+ global $var_iemgui_wdt
+ set var_iemgui_min_wdt [concat iemgui_min_wdt_$vid]
+ global $var_iemgui_min_wdt
+ set var_iemgui_hgt [concat iemgui_hgt_$vid]
+ global $var_iemgui_hgt
+ set var_iemgui_min_hgt [concat iemgui_min_hgt_$vid]
+ global $var_iemgui_min_hgt
+ set var_iemgui_min_rng [concat iemgui_min_rng_$vid]
+ global $var_iemgui_min_rng
+ set var_iemgui_max_rng [concat iemgui_max_rng_$vid]
+ global $var_iemgui_max_rng
+ set var_iemgui_rng_sch [concat iemgui_rng_sch_$vid]
+ global $var_iemgui_rng_sch
+ set var_iemgui_lin0_log1 [concat iemgui_lin0_log1_$vid]
+ global $var_iemgui_lin0_log1
+ set var_iemgui_lilo0 [concat iemgui_lilo0_$vid]
+ global $var_iemgui_lilo0
+ set var_iemgui_lilo1 [concat iemgui_lilo1_$vid]
+ global $var_iemgui_lilo1
+ set var_iemgui_loadbang [concat iemgui_loadbang_$vid]
+ global $var_iemgui_loadbang
+ set var_iemgui_num [concat iemgui_num_$vid]
+ global $var_iemgui_num
+ set var_iemgui_steady [concat iemgui_steady_$vid]
+ global $var_iemgui_steady
+ set var_iemgui_snd [concat iemgui_snd_$vid]
+ global $var_iemgui_snd
+ set var_iemgui_rcv [concat iemgui_rcv_$vid]
+ global $var_iemgui_rcv
+ set var_iemgui_gui_nam [concat iemgui_gui_nam_$vid]
+ global $var_iemgui_gui_nam
+ set var_iemgui_gn_dx [concat iemgui_gn_dx_$vid]
+ global $var_iemgui_gn_dx
+ set var_iemgui_gn_dy [concat iemgui_gn_dy_$vid]
+ global $var_iemgui_gn_dy
+ set var_iemgui_gn_f [concat iemgui_gn_f_$vid]
+ global $var_iemgui_gn_f
+ set var_iemgui_gn_fs [concat iemgui_gn_fs_$vid]
+ global $var_iemgui_gn_fs
+ set var_iemgui_l2_f1_b0 [concat iemgui_l2_f1_b0_$vid]
+ global $var_iemgui_l2_f1_b0
+ set var_iemgui_bcol [concat iemgui_bcol_$vid]
+ global $var_iemgui_bcol
+ set var_iemgui_fcol [concat iemgui_fcol_$vid]
+ global $var_iemgui_fcol
+ set var_iemgui_lcol [concat iemgui_lcol_$vid]
+ global $var_iemgui_lcol
+
+ set $var_iemgui_wdt $wdt
+ set $var_iemgui_min_wdt $min_wdt
+ set $var_iemgui_hgt $hgt
+ set $var_iemgui_min_hgt $min_hgt
+ set $var_iemgui_min_rng $min_rng
+ set $var_iemgui_max_rng $max_rng
+ set $var_iemgui_rng_sch $rng_sched
+ set $var_iemgui_lin0_log1 $lin0_log1
+ set $var_iemgui_lilo0 $lilo0_label
+ set $var_iemgui_lilo1 $lilo1_label
+ set $var_iemgui_loadbang $loadbang
+ set $var_iemgui_num $num
+ set $var_iemgui_steady $steady
+ if {$snd == "empty"} {set $var_iemgui_snd [format ""]
+ } else {set $var_iemgui_snd [format "%s" $snd]}
+ if {$rcv == "empty"} {set $var_iemgui_rcv [format ""]
+ } else {set $var_iemgui_rcv [format "%s" $rcv]}
+ if {$gui_name == "empty"} {set $var_iemgui_gui_nam [format ""]
+ } else {set $var_iemgui_gui_nam [format "%s" $gui_name]}
+
+ if {[string index [eval concat $$var_iemgui_snd] 0] == "#"} {
+ set $var_iemgui_snd [string replace [eval concat $$var_iemgui_snd] 0 0 $] }
+ if {[string index [eval concat $$var_iemgui_rcv] 0] == "#"} {
+ set $var_iemgui_rcv [string replace [eval concat $$var_iemgui_rcv] 0 0 $] }
+ if {[string index [eval concat $$var_iemgui_gui_nam] 0] == "#"} {
+ set $var_iemgui_gui_nam [string replace [eval concat $$var_iemgui_gui_nam] 0 0 $] }
+ set $var_iemgui_gn_dx $gn_dx
+ set $var_iemgui_gn_dy $gn_dy
+ set $var_iemgui_gn_f $gn_f
+ set $var_iemgui_gn_fs $gn_fs
+
+ set $var_iemgui_bcol $bcol
+ set $var_iemgui_fcol $fcol
+ set $var_iemgui_lcol $lcol
+
+ set $var_iemgui_l2_f1_b0 0
+
+ toplevel $id -background $::panel_background
+ wm title $id [format "%s Properties" $mainheader]
+ wm resizable $id 0 0
+ wm protocol $id WM_DELETE_WINDOW [concat ::pd_iemgui::cancel $id]
+
+ ::pd_bindings::panel_bindings $id "iemgui"
+
+ frame $id.dim -background $::panel_background
+ pack $id.dim -side top
+ label $id.dim.head -text $dim_header -background $::panel_background
+ label $id.dim.w_lab -text $wdt_label -width 6 -background $::panel_background
+ entry $id.dim.w_ent -textvariable $var_iemgui_wdt -width 5 \
+ -highlightbackground $::panel_background
+ label $id.dim.dummy1 -text " " -width 10 -background $::panel_background
+ label $id.dim.h_lab -text $hgt_label -width 6 -background $::panel_background
+ entry $id.dim.h_ent -textvariable $var_iemgui_hgt -width 5 \
+ -highlightbackground $::panel_background
+ pack $id.dim.head -side top
+ pack $id.dim.w_lab $id.dim.w_ent $id.dim.dummy1 -side left
+ if { $hgt_label != "empty" } {
+ pack $id.dim.h_lab $id.dim.h_ent -side left}
+
+ frame $id.rng -background $::panel_background
+ pack $id.rng -side top
+ label $id.rng.head -text $rng_header -background $::panel_background
+ label $id.rng.min_lab -text $min_rng_label -width 6 -background $::panel_background
+ entry $id.rng.min_ent -textvariable $var_iemgui_min_rng -width 9 \
+ -highlightbackground $::panel_background
+ label $id.rng.dummy1 -text " " -width 1 -background $::panel_background
+ label $id.rng.max_lab -text $max_rng_label -width 8 -background $::panel_background
+ entry $id.rng.max_ent -textvariable $var_iemgui_max_rng -width 9 \
+ -highlightbackground $::panel_background
+ if { $rng_header != "empty" } {
+ pack $id.rng.head -side top
+ if { $min_rng_label != "empty" } {
+ pack $id.rng.min_lab $id.rng.min_ent -side left}
+ if { $max_rng_label != "empty" } {
+ pack $id.rng.dummy1 \
+ $id.rng.max_lab $id.rng.max_ent -side left} }
+
+ if { [eval concat $$var_iemgui_lin0_log1] >= 0 || [eval concat $$var_iemgui_loadbang] >= 0 || [eval concat $$var_iemgui_num] > 0 || [eval concat $$var_iemgui_steady] >= 0 } {
+ label $id.space1 -text "" -background $::panel_background
+ pack $id.space1 -side top }
+
+ frame $id.para -background $::panel_background
+ pack $id.para -side top
+ label $id.para.dummy2 -text "" -width 1 -background $::panel_background
+ label $id.para.dummy3 -text "" -width 1 -background $::panel_background
+ if {[eval concat $$var_iemgui_lin0_log1] == 0} {
+ button $id.para.lilo -text [eval concat $$var_iemgui_lilo0] -width 5 \
+ -command "::pd_iemgui::lilo $id" -highlightbackground $::panel_background }
+ if {[eval concat $$var_iemgui_lin0_log1] == 1} {
+ button $id.para.lilo -text [eval concat $$var_iemgui_lilo1] -width 5 \
+ -command "::pd_iemgui::lilo $id" -highlightbackground $::panel_background }
+ if {[eval concat $$var_iemgui_loadbang] == 0} {
+ button $id.para.lb -text "no init" -width 5 \
+ -command "::pd_iemgui::lb $id" -highlightbackground $::panel_background }
+ if {[eval concat $$var_iemgui_loadbang] == 1} {
+ button $id.para.lb -text "init" -width 5 \
+ -command "::pd_iemgui::lb $id" -highlightbackground $::panel_background }
+ label $id.para.num_lab -text $num_label -width 9 -background $::panel_background
+ entry $id.para.num_ent -textvariable $var_iemgui_num -width 4 \
+ -highlightbackground $::panel_background
+
+ if {[eval concat $$var_iemgui_steady] == 0} {
+ button $id.para.stdy_jmp -command "::pd_iemgui::stdy_jmp $id" \
+ -text "jump on click" -width 11 -highlightbackground $::panel_background }
+ if {[eval concat $$var_iemgui_steady] == 1} {
+ button $id.para.stdy_jmp -command "::pd_iemgui::stdy_jmp $id" \
+ -text "steady on click" -width 11 -highlightbackground $::panel_background }
+ if {[eval concat $$var_iemgui_lin0_log1] >= 0} {
+ pack $id.para.lilo -side left -expand 1}
+ if {[eval concat $$var_iemgui_loadbang] >= 0} {
+ pack $id.para.dummy2 $id.para.lb -side left -expand 1}
+ if {[eval concat $$var_iemgui_num] > 0} {
+ pack $id.para.dummy3 $id.para.num_lab $id.para.num_ent -side left -expand 1}
+ if {[eval concat $$var_iemgui_steady] >= 0} {
+ pack $id.para.dummy3 $id.para.stdy_jmp -side left -expand 1}
+
+ frame $id.spacer0 -height 4 -background $::panel_background
+ pack $id.spacer0 -side top
+
+ labelframe $id.s_r -borderwidth 1 -pady 4 -text "messages" \
+ -font highlight_font -background $::panel_background
+ pack $id.s_r -side top -fill x -ipadx 5
+ frame $id.s_r.send -background $::panel_background
+ pack $id.s_r.send -side top
+ label $id.s_r.send.lab -text " send-symbol:" -width 12 -justify right \
+ -background $::panel_background
+ entry $id.s_r.send.ent -textvariable $var_iemgui_snd -width 22 \
+ -highlightbackground $::panel_background
+ if { $snd != "nosndno" } {
+ pack $id.s_r.send.lab $id.s_r.send.ent -side left}
+
+ frame $id.s_r.receive -background $::panel_background
+ pack $id.s_r.receive -side top
+ label $id.s_r.receive.lab -text "receive-symbol:" -width 12 -justify right \
+ -background $::panel_background
+ entry $id.s_r.receive.ent -textvariable $var_iemgui_rcv -width 22 \
+ -highlightbackground $::panel_background
+ if { $rcv != "norcvno" } {
+ pack $id.s_r.receive.lab $id.s_r.receive.ent -side left}
+
+ # get the current font name from the int given from C-space (gn_f)
+ set current_font $::font_family
+ if {[eval concat $$var_iemgui_gn_f] == 1} \
+ { set current_font "Helvetica" }
+ if {[eval concat $$var_iemgui_gn_f] == 2} \
+ { set current_font "Times" }
+
+ frame $id.spacer1 -height 7 -background $::panel_background
+ pack $id.spacer1 -side top
+
+ labelframe $id.label -borderwidth 1 -text "label" -pady 4 \
+ -font highlight_font -background $::panel_background
+ pack $id.label -side top -fill x
+ entry $id.label.name_entry -textvariable $var_iemgui_gui_nam -width 30 \
+ -font [list $current_font 12 $::font_weight] \
+ -highlightbackground $::panel_background
+ pack $id.label.name_entry -side top -expand yes -fill both -padx 5
+
+ frame $id.label.xy -padx 27 -pady 1 -background $::panel_background
+ pack $id.label.xy -side top
+ label $id.label.xy.x_lab -text "x offset" -width 6 -background $::panel_background
+ entry $id.label.xy.x_entry -textvariable $var_iemgui_gn_dx -width 5 \
+ -highlightbackground $::panel_background
+ label $id.label.xy.dummy1 -text " " -width 2 -background $::panel_background
+ label $id.label.xy.y_lab -text "y offset" -width 6 -background $::panel_background
+ entry $id.label.xy.y_entry -textvariable $var_iemgui_gn_dy -width 5 \
+ -highlightbackground $::panel_background
+ pack $id.label.xy.x_lab $id.label.xy.x_entry $id.label.xy.dummy1 \
+ $id.label.xy.y_lab $id.label.xy.y_entry -side left -anchor e
+
+ label $id.label.fontpopup_label -text $current_font \
+ -relief groove -font [list $current_font 12 $::font_weight] -padx 5
+ pack $id.label.fontpopup_label -side left -anchor w -expand yes -fill x
+ label $id.label.fontsize_label -text "size" -width 4 -background $::panel_background
+ entry $id.label.fontsize_entry -textvariable $var_iemgui_gn_fs -width 5 \
+ -highlightbackground $::panel_background
+ pack $id.label.fontsize_entry $id.label.fontsize_label \
+ -side right -anchor e -padx 5 -pady 5
+ menu $id.popup
+ $id.popup add command \
+ -label $::font_family \
+ -font [format {{%s} 12 %s} $::font_family $::font_weight] \
+ -command "::pd_iemgui::toggle_font $id 0"
+ $id.popup add command \
+ -label "Helvetica" \
+ -font [format {Helvetica 12 %s} $::font_weight] \
+ -command "::pd_iemgui::toggle_font $id 1"
+ $id.popup add command \
+ -label "Times" \
+ -font [format {Times 12 %s} $::font_weight] \
+ -command "::pd_iemgui::toggle_font $id 2"
+ bind $id.label.fontpopup_label <Button> \
+ [list tk_popup $id.popup %X %Y]
+
+ frame $id.spacer2 -height 7 -background $::panel_background
+ pack $id.spacer2 -side top
+
+ labelframe $id.colors -borderwidth 1 -text "colors" -font highlight_font \
+ -background $::panel_background
+ pack $id.colors -fill x -ipadx 5 -ipady 4
+
+ frame $id.colors.select -background $::panel_background
+ pack $id.colors.select -side top
+ radiobutton $id.colors.select.radio0 -value 0 -variable \
+ $var_iemgui_l2_f1_b0 -text "background" -width 10 -justify left \
+ -background $::panel_background
+ radiobutton $id.colors.select.radio1 -value 1 -variable \
+ $var_iemgui_l2_f1_b0 -text "front" -width 5 -justify left \
+ -background $::panel_background
+ radiobutton $id.colors.select.radio2 -value 2 -variable \
+ $var_iemgui_l2_f1_b0 -text "label" -width 5 -justify left \
+ -background $::panel_background
+ if { [eval concat $$var_iemgui_fcol] >= 0 } {
+ pack $id.colors.select.radio0 $id.colors.select.radio1 \
+ $id.colors.select.radio2 -side left
+ } else {
+ pack $id.colors.select.radio0 $id.colors.select.radio2 -side left
+ }
+
+ frame $id.colors.sections -background $::panel_background
+ pack $id.colors.sections -side top
+ button $id.colors.sections.but -command "::pd_iemgui::choose_col_bkfrlb $id" \
+ -text "compose color" -width 12 -highlightbackground $::panel_background
+ pack $id.colors.sections.but -side left -anchor w -padx 10 -pady 5 \
+ -expand yes -fill x
+ if { [eval concat $$var_iemgui_fcol] >= 0 } {
+ label $id.colors.sections.fr_bk -text "o=||=o" -width 6 \
+ -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -foreground [format "#%6.6x" [eval concat $$var_iemgui_fcol]] \
+ -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_fcol]] \
+ -font [list $current_font 12 $::font_weight] -padx 2 -pady 2 -relief ridge
+ } else {
+ label $id.colors.sections.fr_bk -text "o=||=o" -width 6 \
+ -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -foreground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -font [list $current_font 12 $::font_weight] -padx 2 -pady 2 -relief ridge
+ }
+ label $id.colors.sections.lb_bk -text "testlabel" -width 9 \
+ -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
+ -foreground [format "#%6.6x" [eval concat $$var_iemgui_lcol]] \
+ -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_lcol]] \
+ -font [list $current_font 12 $::font_weight] -padx 2 -pady 2 -relief ridge
+ pack $id.colors.sections.lb_bk $id.colors.sections.fr_bk \
+ -side right -anchor e -expand yes -fill both -pady 7
+
+ # color scheme by Mary Ann Benedetto http://piR2.org
+ frame $id.colors.r1 -background $::panel_background
+ pack $id.colors.r1 -side top
+ foreach i { 0 1 2 3 4 5 6 7 8 9} \
+ hexcol { 0xFFFFFF 0xDFDFDF 0xBBBBBB 0xFFC7C6 0xFFE3C6 \
+ 0xFEFFC6 0xC6FFC7 0xc6FEFF 0xC7C6FF 0xE3C6FF } \
+ {
+ label $id.colors.r1.c$i -background [format "#%6.6x" $hexcol] \
+ -activebackground [format "#%6.6x" $hexcol] -relief ridge \
+ -padx 7 -pady 0
+ bind $id.colors.r1.c$i <Button> [format "::pd_iemgui::preset_col %s %d" $id $hexcol]
+ }
+ pack $id.colors.r1.c0 $id.colors.r1.c1 $id.colors.r1.c2 $id.colors.r1.c3 \
+ $id.colors.r1.c4 $id.colors.r1.c5 $id.colors.r1.c6 $id.colors.r1.c7 \
+ $id.colors.r1.c8 $id.colors.r1.c9 -side left
+
+ frame $id.colors.r2 -background $::panel_background
+ pack $id.colors.r2 -side top
+ foreach i { 0 1 2 3 4 5 6 7 8 9 } \
+ hexcol { 0x9F9F9F 0x7C7C7C 0x606060 0xFF0400 0xFF8300 \
+ 0xFAFF00 0x00FF04 0x00FAFF 0x0400FF 0x9C00FF } \
+ {
+ label $id.colors.r2.c$i -background [format "#%6.6x" $hexcol] \
+ -activebackground [format "#%6.6x" $hexcol] -relief ridge \
+ -padx 7 -pady 0
+ bind $id.colors.r2.c$i <Button> \
+ [format "::pd_iemgui::preset_col %s %d" $id $hexcol]
+ }
+ pack $id.colors.r2.c0 $id.colors.r2.c1 $id.colors.r2.c2 $id.colors.r2.c3 \
+ $id.colors.r2.c4 $id.colors.r2.c5 $id.colors.r2.c6 $id.colors.r2.c7 \
+ $id.colors.r2.c8 $id.colors.r2.c9 -side left
+
+ frame $id.colors.r3 -background $::panel_background
+ pack $id.colors.r3 -side top
+ foreach i { 0 1 2 3 4 5 6 7 8 9 } \
+ hexcol { 0x404040 0x202020 0x000000 0x551312 0x553512 \
+ 0x535512 0x0F4710 0x0E4345 0x131255 0x2F004D } \
+ {
+ label $id.colors.r3.c$i -background [format "#%6.6x" $hexcol] \
+ -activebackground [format "#%6.6x" $hexcol] -relief ridge \
+ -padx 7 -pady 0
+ bind $id.colors.r3.c$i <Button> \
+ [format "::pd_iemgui::preset_col %s %d" $id $hexcol]
+ }
+ pack $id.colors.r3.c0 $id.colors.r3.c1 $id.colors.r3.c2 $id.colors.r3.c3 \
+ $id.colors.r3.c4 $id.colors.r3.c5 $id.colors.r3.c6 $id.colors.r3.c7 \
+ $id.colors.r3.c8 $id.colors.r3.c9 -side left
+
+ frame $id.cao -pady 10 -background $::panel_background
+ pack $id.cao -side top
+ button $id.cao.cancel -command "::pd_iemgui::cancel $id" \
+ -text "Cancel" -width 6 -highlightbackground $::panel_background
+ label $id.cao.dummy1 -text "" -width 3 -background $::panel_background
+ button $id.cao.apply -text "Apply" -width 6 -command "::pd_iemgui::apply $id" \
+ -highlightbackground $::panel_background
+ label $id.cao.dummy2 -text "" -width 3 -background $::panel_background
+ button $id.cao.ok -text {OK} -width 6 -command "::pd_iemgui::ok $id" \
+ -highlightbackground $::panel_background
+
+ pack $id.cao.cancel $id.cao.dummy1 -side left
+ pack $id.cao.apply $id.cao.dummy2 -side left
+ pack $id.cao.ok -side left
+
+ if {[info tclversion] < 8.4} {
+ bind $id <Key-Tab> {tkTabToWindow [tk_focusNext %W]}
+ bind $id <<PrevWindow>> {tkTabToWindow [tk_focusPrev %W]}
+ } else {
+ bind $id <Key-Tab> {tk::TabToWindow [tk_focusNext %W]}
+ bind $id <<PrevWindow>> {tk::TabToWindow [tk_focusPrev %W]}
+ }
+
+ $id.dim.w_ent select from 0
+ $id.dim.w_ent select adjust end
+ focus $id.dim.w_ent
+}
+
Deleted: branches/pd-devel/0.41.4/src/pd_iemgui.tcl
===================================================================
--- branches/pd-devel/0.41.4/src/pd_iemgui.tcl 2009-02-03 05:34:51 UTC (rev 10721)
+++ branches/pd-devel/0.41.4/src/pd_iemgui.tcl 2009-02-03 05:40:41 UTC (rev 10722)
@@ -1,794 +0,0 @@
-# For information on usage and redistribution, and for a DISCLAIMER OF ALL
-# WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-# Copyright (c) 1997-2009 Miller Puckette.
-
-package provide pd_iemgui 0.1
-
-namespace eval ::pd_iemgui:: {
- variable define_min_flashhold 50
- variable define_min_flashbreak 10
- variable define_min_fontsize 4
-
- namespace export pdtk_iemgui_dialog
-}
-
-# TODO rename $id to $mytoplevel
-
-proc ::pd_iemgui::clip_dim {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_wdt [concat iemgui_wdt_$vid]
- global $var_iemgui_wdt
- set var_iemgui_min_wdt [concat iemgui_min_wdt_$vid]
- global $var_iemgui_min_wdt
- set var_iemgui_hgt [concat iemgui_hgt_$vid]
- global $var_iemgui_hgt
- set var_iemgui_min_hgt [concat iemgui_min_hgt_$vid]
- global $var_iemgui_min_hgt
-
- if {[eval concat $$var_iemgui_wdt] < [eval concat $$var_iemgui_min_wdt]} {
- set $var_iemgui_wdt [eval concat $$var_iemgui_min_wdt]
- $id.dim.w_ent configure -textvariable $var_iemgui_wdt
- }
- if {[eval concat $$var_iemgui_hgt] < [eval concat $$var_iemgui_min_hgt]} {
- set $var_iemgui_hgt [eval concat $$var_iemgui_min_hgt]
- $id.dim.h_ent configure -textvariable $var_iemgui_hgt
- }
-}
-
-proc ::pd_iemgui::clip_num {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_num [concat iemgui_num_$vid]
- global $var_iemgui_num
-
- if {[eval concat $$var_iemgui_num] > 2000} {
- set $var_iemgui_num 2000
- $id.para.num_ent configure -textvariable $var_iemgui_num
- }
- if {[eval concat $$var_iemgui_num] < 1} {
- set $var_iemgui_num 1
- $id.para.num_ent configure -textvariable $var_iemgui_num
- }
-}
-
-proc ::pd_iemgui::sched_rng {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_min_rng [concat iemgui_min_rng_$vid]
- global $var_iemgui_min_rng
- set var_iemgui_max_rng [concat iemgui_max_rng_$vid]
- global $var_iemgui_max_rng
- set var_iemgui_rng_sch [concat iemgui_rng_sch_$vid]
- global $var_iemgui_rng_sch
-
- variable define_min_flashhold
- variable define_min_flashbreak
-
- if {[eval concat $$var_iemgui_rng_sch] == 2} {
- if {[eval concat $$var_iemgui_max_rng] < [eval concat $$var_iemgui_min_rng]} {
- set hhh [eval concat $$var_iemgui_min_rng]
- set $var_iemgui_min_rng [eval concat $$var_iemgui_max_rng]
- set $var_iemgui_max_rng $hhh
- $id.rng.max_ent configure -textvariable $var_iemgui_max_rng
- $id.rng.min_ent configure -textvariable $var_iemgui_min_rng }
- if {[eval concat $$var_iemgui_max_rng] < $define_min_flashhold} {
- set $var_iemgui_max_rng $iemgui_define_min_flashhold
- $id.rng.max_ent configure -textvariable $var_iemgui_max_rng
- }
- if {[eval concat $$var_iemgui_min_rng] < $define_min_flashbreak} {
- set $var_iemgui_min_rng $define_min_flashbreak
- $id.rng.min_ent configure -textvariable $var_iemgui_min_rng
- }
- }
- if {[eval concat $$var_iemgui_rng_sch] == 1} {
- if {[eval concat $$var_iemgui_min_rng] == 0.0} {
- set $var_iemgui_min_rng 1.0
- $id.rng.min_ent configure -textvariable $var_iemgui_min_rng
- }
- }
-}
-
-proc ::pd_iemgui::verify_rng {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_min_rng [concat iemgui_min_rng_$vid]
- global $var_iemgui_min_rng
- set var_iemgui_max_rng [concat iemgui_max_rng_$vid]
- global $var_iemgui_max_rng
- set var_iemgui_lin0_log1 [concat iemgui_lin0_log1_$vid]
- global $var_iemgui_lin0_log1
-
- if {[eval concat $$var_iemgui_lin0_log1] == 1} {
- if {[eval concat $$var_iemgui_max_rng] == 0.0 && [eval concat $$var_iemgui_min_rng] == 0.0} {
- set $var_iemgui_max_rng 1.0
- $id.rng.max_ent configure -textvariable $var_iemgui_max_rng
- }
- if {[eval concat $$var_iemgui_max_rng] > 0} {
- if {[eval concat $$var_iemgui_min_rng] <= 0} {
- set $var_iemgui_min_rng [expr [eval concat $$var_iemgui_max_rng] * 0.01]
- $id.rng.min_ent configure -textvariable $var_iemgui_min_rng
- }
- } else {
- if {[eval concat $$var_iemgui_min_rng] > 0} {
- set $var_iemgui_max_rng [expr [eval concat $$var_iemgui_min_rng] * 0.01]
- $id.rng.max_ent configure -textvariable $var_iemgui_max_rng
- }
- }
- }
-}
-
-proc ::pd_iemgui::clip_fontsize {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_gn_fs [concat iemgui_gn_fs_$vid]
- global $var_iemgui_gn_fs
-
- variable define_min_fontsize
-
- if {[eval concat $$var_iemgui_gn_fs] < $define_min_fontsize} {
- set $var_iemgui_gn_fs $define_min_fontsize
- $id.label.fs_ent configure -textvariable $var_iemgui_gn_fs
- }
-}
-
-proc ::pd_iemgui::set_col_example {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_bcol [concat iemgui_bcol_$vid]
- global $var_iemgui_bcol
- set var_iemgui_fcol [concat iemgui_fcol_$vid]
- global $var_iemgui_fcol
- set var_iemgui_lcol [concat iemgui_lcol_$vid]
- global $var_iemgui_lcol
-
- $id.colors.sections.lb_bk configure \
- -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -foreground [format "#%6.6x" [eval concat $$var_iemgui_lcol]] \
- -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_lcol]]
-
- if { [eval concat $$var_iemgui_fcol] >= 0 } {
- $id.colors.sections.fr_bk configure \
- -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -foreground [format "#%6.6x" [eval concat $$var_iemgui_fcol]] \
- -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_fcol]]
- } else {
- $id.colors.sections.fr_bk configure \
- -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -foreground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_bcol]]}
-}
-
-proc ::pd_iemgui::preset_col {id presetcol} {
- set vid [string trimleft $id .]
-
- set var_iemgui_l2_f1_b0 [concat iemgui_l2_f1_b0_$vid]
- global $var_iemgui_l2_f1_b0
- set var_iemgui_bcol [concat iemgui_bcol_$vid]
- global $var_iemgui_bcol
- set var_iemgui_fcol [concat iemgui_fcol_$vid]
- global $var_iemgui_fcol
- set var_iemgui_lcol [concat iemgui_lcol_$vid]
- global $var_iemgui_lcol
-
- if { [eval concat $$var_iemgui_l2_f1_b0] == 0 } { set $var_iemgui_bcol $presetcol }
- if { [eval concat $$var_iemgui_l2_f1_b0] == 1 } { set $var_iemgui_fcol $presetcol }
- if { [eval concat $$var_iemgui_l2_f1_b0] == 2 } { set $var_iemgui_lcol $presetcol }
- ::pd_iemgui::set_col_example $id
-}
-
-proc ::pd_iemgui::choose_col_bkfrlb {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_l2_f1_b0 [concat iemgui_l2_f1_b0_$vid]
- global $var_iemgui_l2_f1_b0
- set var_iemgui_bcol [concat iemgui_bcol_$vid]
- global $var_iemgui_bcol
- set var_iemgui_fcol [concat iemgui_fcol_$vid]
- global $var_iemgui_fcol
- set var_iemgui_lcol [concat iemgui_lcol_$vid]
- global $var_iemgui_lcol
-
- if {[eval concat $$var_iemgui_l2_f1_b0] == 0} {
- set $var_iemgui_bcol [expr [eval concat $$var_iemgui_bcol] & 0xFCFCFC]
- set helpstring [tk_chooseColor -title "Background-Color" -initialcolor [format "#%6.6x" [eval concat $$var_iemgui_bcol]]]
- if { $helpstring != "" } {
- set $var_iemgui_bcol [string replace $helpstring 0 0 "0x"]
- set $var_iemgui_bcol [expr [eval concat $$var_iemgui_bcol] & 0xFCFCFC] }
- }
- if {[eval concat $$var_iemgui_l2_f1_b0] == 1} {
- set $var_iemgui_fcol [expr [eval concat $$var_iemgui_fcol] & 0xFCFCFC]
- set helpstring [tk_chooseColor -title "Front-Color" -initialcolor [format "#%6.6x" [eval concat $$var_iemgui_fcol]]]
- if { $helpstring != "" } {
- set $var_iemgui_fcol [string replace $helpstring 0 0 "0x"]
- set $var_iemgui_fcol [expr [eval concat $$var_iemgui_fcol] & 0xFCFCFC] }
- }
- if {[eval concat $$var_iemgui_l2_f1_b0] == 2} {
- set $var_iemgui_lcol [expr [eval concat $$var_iemgui_lcol] & 0xFCFCFC]
- set helpstring [tk_chooseColor -title "Label-Color" -initialcolor [format "#%6.6x" [eval concat $$var_iemgui_lcol]]]
- if { $helpstring != "" } {
- set $var_iemgui_lcol [string replace $helpstring 0 0 "0x"]
- set $var_iemgui_lcol [expr [eval concat $$var_iemgui_lcol] & 0xFCFCFC] }
- }
- ::pd_iemgui::set_col_example $id
-}
-
-proc ::pd_iemgui::lilo {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_lin0_log1 [concat iemgui_lin0_log1_$vid]
- global $var_iemgui_lin0_log1
- set var_iemgui_lilo0 [concat iemgui_lilo0_$vid]
- global $var_iemgui_lilo0
- set var_iemgui_lilo1 [concat iemgui_lilo1_$vid]
- global $var_iemgui_lilo1
-
- ::pd_iemgui::sched_rng $id
-
- if {[eval concat $$var_iemgui_lin0_log1] == 0} {
- set $var_iemgui_lin0_log1 1
- $id.para.lilo configure -text [eval concat $$var_iemgui_lilo1]
- ::pd_iemgui::verify_rng $id
- ::pd_iemgui::sched_rng $id
- } else {
- set $var_iemgui_lin0_log1 0
- $id.para.lilo configure -text [eval concat $$var_iemgui_lilo0]
- }
-}
-
-proc ::pd_iemgui::toggle_font {id gn_f} {
- set vid [string trimleft $id .]
-
- set var_iemgui_gn_f [concat iemgui_gn_f_$vid]
- global $var_iemgui_gn_f
-
- set $var_iemgui_gn_f $gn_f
-
- switch -- $gn_f {
- 0 { set current_font $::font_family}
- 1 { set current_font "Helvetica" }
- 2 { set current_font "Times" }
- }
- set current_font_spec "{$current_font} 12 $::font_weight"
-
- $id.label.fontpopup_label configure -text $current_font \
- -font $current_font_spec
- $id.label.name_entry configure -font $current_font_spec
- $id.colors.sections.fr_bk configure -font $current_font_spec
- $id.colors.sections.lb_bk configure -font $current_font_spec
-}
-
-proc ::pd_iemgui::lb {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_loadbang [concat iemgui_loadbang_$vid]
- global $var_iemgui_loadbang
-
- if {[eval concat $$var_iemgui_loadbang] == 0} {
- set $var_iemgui_loadbang 1
- $id.para.lb configure -text "init"
- } else {
- set $var_iemgui_loadbang 0
- $id.para.lb configure -text "no init"
- }
-}
-
-proc ::pd_iemgui::stdy_jmp {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_steady [concat iemgui_steady_$vid]
- global $var_iemgui_steady
-
- if {[eval concat $$var_iemgui_steady]} {
- set $var_iemgui_steady 0
- $id.para.stdy_jmp configure -text "jump on click"
- } else {
- set $var_iemgui_steady 1
- $id.para.stdy_jmp configure -text "steady on click"
- }
-}
-
-proc ::pd_iemgui::apply {id} {
- set vid [string trimleft $id .]
-
- set var_iemgui_wdt [concat iemgui_wdt_$vid]
- global $var_iemgui_wdt
- set var_iemgui_min_wdt [concat iemgui_min_wdt_$vid]
- global $var_iemgui_min_wdt
- set var_iemgui_hgt [concat iemgui_hgt_$vid]
- global $var_iemgui_hgt
- set var_iemgui_min_hgt [concat iemgui_min_hgt_$vid]
- global $var_iemgui_min_hgt
- set var_iemgui_min_rng [concat iemgui_min_rng_$vid]
- global $var_iemgui_min_rng
- set var_iemgui_max_rng [concat iemgui_max_rng_$vid]
- global $var_iemgui_max_rng
- set var_iemgui_lin0_log1 [concat iemgui_lin0_log1_$vid]
- global $var_iemgui_lin0_log1
- set var_iemgui_lilo0 [concat iemgui_lilo0_$vid]
- global $var_iemgui_lilo0
- set var_iemgui_lilo1 [concat iemgui_lilo1_$vid]
- global $var_iemgui_lilo1
- set var_iemgui_loadbang [concat iemgui_loadbang_$vid]
- global $var_iemgui_loadbang
- set var_iemgui_num [concat iemgui_num_$vid]
- global $var_iemgui_num
- set var_iemgui_steady [concat iemgui_steady_$vid]
- global $var_iemgui_steady
- set var_iemgui_snd [concat iemgui_snd_$vid]
- global $var_iemgui_snd
- set var_iemgui_rcv [concat iemgui_rcv_$vid]
- global $var_iemgui_rcv
- set var_iemgui_gui_nam [concat iemgui_gui_nam_$vid]
- global $var_iemgui_gui_nam
- set var_iemgui_gn_dx [concat iemgui_gn_dx_$vid]
- global $var_iemgui_gn_dx
- set var_iemgui_gn_dy [concat iemgui_gn_dy_$vid]
- global $var_iemgui_gn_dy
- set var_iemgui_gn_f [concat iemgui_gn_f_$vid]
- global $var_iemgui_gn_f
- set var_iemgui_gn_fs [concat iemgui_gn_fs_$vid]
- global $var_iemgui_gn_fs
- set var_iemgui_bcol [concat iemgui_bcol_$vid]
- global $var_iemgui_bcol
- set var_iemgui_fcol [concat iemgui_fcol_$vid]
- global $var_iemgui_fcol
- set var_iemgui_lcol [concat iemgui_lcol_$vid]
- global $var_iemgui_lcol
-
- ::pd_iemgui::clip_dim $id
- ::pd_iemgui::clip_num $id
- ::pd_iemgui::sched_rng $id
- ::pd_iemgui::verify_rng $id
- ::pd_iemgui::sched_rng $id
- ::pd_iemgui::clip_fontsize $id
-
- if {[eval concat $$var_iemgui_snd] == ""} {set hhhsnd "empty"} else {set hhhsnd [eval concat $$var_iemgui_snd]}
- if {[eval concat $$var_iemgui_rcv] == ""} {set hhhrcv "empty"} else {set hhhrcv [eval concat $$var_iemgui_rcv]}
- if {[eval concat $$var_iemgui_gui_nam] == ""} {set hhhgui_nam "empty"
- } else {
- set hhhgui_nam [eval concat $$var_iemgui_gui_nam]}
-
- if {[string index $hhhsnd 0] == "$"} {
- set hhhsnd [string replace $hhhsnd 0 0 #] }
- if {[string index $hhhrcv 0] == "$"} {
- set hhhrcv [string replace $hhhrcv 0 0 #] }
- if {[string index $hhhgui_nam 0] == "$"} {
- set hhhgui_nam [string replace $hhhgui_nam 0 0 #] }
-
- set hhhsnd [unspace_text $hhhsnd]
- set hhhrcv [unspace_text $hhhrcv]
- set hhhgui_nam [unspace_text $hhhgui_nam]
-
- pdsend [concat $id dialog \
- [eval concat $$var_iemgui_wdt] \
- [eval concat $$var_iemgui_hgt] \
- [eval concat $$var_iemgui_min_rng] \
- [eval concat $$var_iemgui_max_rng] \
- [eval concat $$var_iemgui_lin0_log1] \
- [eval concat $$var_iemgui_loadbang] \
- [eval concat $$var_iemgui_num] \
- $hhhsnd \
- $hhhrcv \
- $hhhgui_nam \
- [eval concat $$var_iemgui_gn_dx] \
- [eval concat $$var_iemgui_gn_dy] \
- [eval concat $$var_iemgui_gn_f] \
- [eval concat $$var_iemgui_gn_fs] \
- [eval concat $$var_iemgui_bcol] \
- [eval concat $$var_iemgui_fcol] \
- [eval concat $$var_iemgui_lcol] \
- [eval concat $$var_iemgui_steady]]
-}
-
-
-proc iemgui_cancel {mytoplevel} {
- # TODO kludge!! until a common approach to ::pd_bindings::panel_bindings
- # is sorted out
- ::pd_iemgui::cancel $mytoplevel
-}
-proc ::pd_iemgui::cancel {id} {
- pdsend "$id cancel"
-}
-
-proc iemgui_ok {mytoplevel} {
- # TODO kludge!! until a common approach to ::pd_bindings::panel_bindings
- # is sorted out
- ::pd_iemgui::ok $mytoplevel
-}
-proc ::pd_iemgui::ok {id} {
- ::pd_iemgui::apply $id
- ::pd_iemgui::cancel $id
-}
-
-proc ::pd_iemgui::pdtk_iemgui_dialog {id mainheader dim_header \
- wdt min_wdt wdt_label \
- hgt min_hgt hgt_label \
- rng_header min_rng min_rng_label max_rng \
- max_rng_label rng_sched \
- lin0_log1 lilo0_label lilo1_label \
- loadbang steady num_label num \
- snd rcv \
- gui_name \
- gn_dx gn_dy gn_f gn_fs \
- bcol fcol lcol} {
-
- set vid [string trimleft $id .]
-
- set var_iemgui_wdt [concat iemgui_wdt_$vid]
- global $var_iemgui_wdt
- set var_iemgui_min_wdt [concat iemgui_min_wdt_$vid]
- global $var_iemgui_min_wdt
- set var_iemgui_hgt [concat iemgui_hgt_$vid]
- global $var_iemgui_hgt
- set var_iemgui_min_hgt [concat iemgui_min_hgt_$vid]
- global $var_iemgui_min_hgt
- set var_iemgui_min_rng [concat iemgui_min_rng_$vid]
- global $var_iemgui_min_rng
- set var_iemgui_max_rng [concat iemgui_max_rng_$vid]
- global $var_iemgui_max_rng
- set var_iemgui_rng_sch [concat iemgui_rng_sch_$vid]
- global $var_iemgui_rng_sch
- set var_iemgui_lin0_log1 [concat iemgui_lin0_log1_$vid]
- global $var_iemgui_lin0_log1
- set var_iemgui_lilo0 [concat iemgui_lilo0_$vid]
- global $var_iemgui_lilo0
- set var_iemgui_lilo1 [concat iemgui_lilo1_$vid]
- global $var_iemgui_lilo1
- set var_iemgui_loadbang [concat iemgui_loadbang_$vid]
- global $var_iemgui_loadbang
- set var_iemgui_num [concat iemgui_num_$vid]
- global $var_iemgui_num
- set var_iemgui_steady [concat iemgui_steady_$vid]
- global $var_iemgui_steady
- set var_iemgui_snd [concat iemgui_snd_$vid]
- global $var_iemgui_snd
- set var_iemgui_rcv [concat iemgui_rcv_$vid]
- global $var_iemgui_rcv
- set var_iemgui_gui_nam [concat iemgui_gui_nam_$vid]
- global $var_iemgui_gui_nam
- set var_iemgui_gn_dx [concat iemgui_gn_dx_$vid]
- global $var_iemgui_gn_dx
- set var_iemgui_gn_dy [concat iemgui_gn_dy_$vid]
- global $var_iemgui_gn_dy
- set var_iemgui_gn_f [concat iemgui_gn_f_$vid]
- global $var_iemgui_gn_f
- set var_iemgui_gn_fs [concat iemgui_gn_fs_$vid]
- global $var_iemgui_gn_fs
- set var_iemgui_l2_f1_b0 [concat iemgui_l2_f1_b0_$vid]
- global $var_iemgui_l2_f1_b0
- set var_iemgui_bcol [concat iemgui_bcol_$vid]
- global $var_iemgui_bcol
- set var_iemgui_fcol [concat iemgui_fcol_$vid]
- global $var_iemgui_fcol
- set var_iemgui_lcol [concat iemgui_lcol_$vid]
- global $var_iemgui_lcol
-
- set $var_iemgui_wdt $wdt
- set $var_iemgui_min_wdt $min_wdt
- set $var_iemgui_hgt $hgt
- set $var_iemgui_min_hgt $min_hgt
- set $var_iemgui_min_rng $min_rng
- set $var_iemgui_max_rng $max_rng
- set $var_iemgui_rng_sch $rng_sched
- set $var_iemgui_lin0_log1 $lin0_log1
- set $var_iemgui_lilo0 $lilo0_label
- set $var_iemgui_lilo1 $lilo1_label
- set $var_iemgui_loadbang $loadbang
- set $var_iemgui_num $num
- set $var_iemgui_steady $steady
- if {$snd == "empty"} {set $var_iemgui_snd [format ""]
- } else {set $var_iemgui_snd [format "%s" $snd]}
- if {$rcv == "empty"} {set $var_iemgui_rcv [format ""]
- } else {set $var_iemgui_rcv [format "%s" $rcv]}
- if {$gui_name == "empty"} {set $var_iemgui_gui_nam [format ""]
- } else {set $var_iemgui_gui_nam [format "%s" $gui_name]}
-
- if {[string index [eval concat $$var_iemgui_snd] 0] == "#"} {
- set $var_iemgui_snd [string replace [eval concat $$var_iemgui_snd] 0 0 $] }
- if {[string index [eval concat $$var_iemgui_rcv] 0] == "#"} {
- set $var_iemgui_rcv [string replace [eval concat $$var_iemgui_rcv] 0 0 $] }
- if {[string index [eval concat $$var_iemgui_gui_nam] 0] == "#"} {
- set $var_iemgui_gui_nam [string replace [eval concat $$var_iemgui_gui_nam] 0 0 $] }
- set $var_iemgui_gn_dx $gn_dx
- set $var_iemgui_gn_dy $gn_dy
- set $var_iemgui_gn_f $gn_f
- set $var_iemgui_gn_fs $gn_fs
-
- set $var_iemgui_bcol $bcol
- set $var_iemgui_fcol $fcol
- set $var_iemgui_lcol $lcol
-
- set $var_iemgui_l2_f1_b0 0
-
- toplevel $id -background $::panel_background
- wm title $id [format "%s Properties" $mainheader]
- wm resizable $id 0 0
- wm protocol $id WM_DELETE_WINDOW [concat ::pd_iemgui::cancel $id]
-
- ::pd_bindings::panel_bindings $id "iemgui"
-
- frame $id.dim -background $::panel_background
- pack $id.dim -side top
- label $id.dim.head -text $dim_header -background $::panel_background
- label $id.dim.w_lab -text $wdt_label -width 6 -background $::panel_background
- entry $id.dim.w_ent -textvariable $var_iemgui_wdt -width 5 \
- -highlightbackground $::panel_background
- label $id.dim.dummy1 -text " " -width 10 -background $::panel_background
- label $id.dim.h_lab -text $hgt_label -width 6 -background $::panel_background
- entry $id.dim.h_ent -textvariable $var_iemgui_hgt -width 5 \
- -highlightbackground $::panel_background
- pack $id.dim.head -side top
- pack $id.dim.w_lab $id.dim.w_ent $id.dim.dummy1 -side left
- if { $hgt_label != "empty" } {
- pack $id.dim.h_lab $id.dim.h_ent -side left}
-
- frame $id.rng -background $::panel_background
- pack $id.rng -side top
- label $id.rng.head -text $rng_header -background $::panel_background
- label $id.rng.min_lab -text $min_rng_label -width 6 -background $::panel_background
- entry $id.rng.min_ent -textvariable $var_iemgui_min_rng -width 9 \
- -highlightbackground $::panel_background
- label $id.rng.dummy1 -text " " -width 1 -background $::panel_background
- label $id.rng.max_lab -text $max_rng_label -width 8 -background $::panel_background
- entry $id.rng.max_ent -textvariable $var_iemgui_max_rng -width 9 \
- -highlightbackground $::panel_background
- if { $rng_header != "empty" } {
- pack $id.rng.head -side top
- if { $min_rng_label != "empty" } {
- pack $id.rng.min_lab $id.rng.min_ent -side left}
- if { $max_rng_label != "empty" } {
- pack $id.rng.dummy1 \
- $id.rng.max_lab $id.rng.max_ent -side left} }
-
- if { [eval concat $$var_iemgui_lin0_log1] >= 0 || [eval concat $$var_iemgui_loadbang] >= 0 || [eval concat $$var_iemgui_num] > 0 || [eval concat $$var_iemgui_steady] >= 0 } {
- label $id.space1 -text "" -background $::panel_background
- pack $id.space1 -side top }
-
- frame $id.para -background $::panel_background
- pack $id.para -side top
- label $id.para.dummy2 -text "" -width 1 -background $::panel_background
- label $id.para.dummy3 -text "" -width 1 -background $::panel_background
- if {[eval concat $$var_iemgui_lin0_log1] == 0} {
- button $id.para.lilo -text [eval concat $$var_iemgui_lilo0] -width 5 \
- -command "::pd_iemgui::lilo $id" -highlightbackground $::panel_background }
- if {[eval concat $$var_iemgui_lin0_log1] == 1} {
- button $id.para.lilo -text [eval concat $$var_iemgui_lilo1] -width 5 \
- -command "::pd_iemgui::lilo $id" -highlightbackground $::panel_background }
- if {[eval concat $$var_iemgui_loadbang] == 0} {
- button $id.para.lb -text "no init" -width 5 \
- -command "::pd_iemgui::lb $id" -highlightbackground $::panel_background }
- if {[eval concat $$var_iemgui_loadbang] == 1} {
- button $id.para.lb -text "init" -width 5 \
- -command "::pd_iemgui::lb $id" -highlightbackground $::panel_background }
- label $id.para.num_lab -text $num_label -width 9 -background $::panel_background
- entry $id.para.num_ent -textvariable $var_iemgui_num -width 4 \
- -highlightbackground $::panel_background
-
- if {[eval concat $$var_iemgui_steady] == 0} {
- button $id.para.stdy_jmp -command "::pd_iemgui::stdy_jmp $id" \
- -text "jump on click" -width 11 -highlightbackground $::panel_background }
- if {[eval concat $$var_iemgui_steady] == 1} {
- button $id.para.stdy_jmp -command "::pd_iemgui::stdy_jmp $id" \
- -text "steady on click" -width 11 -highlightbackground $::panel_background }
- if {[eval concat $$var_iemgui_lin0_log1] >= 0} {
- pack $id.para.lilo -side left -expand 1}
- if {[eval concat $$var_iemgui_loadbang] >= 0} {
- pack $id.para.dummy2 $id.para.lb -side left -expand 1}
- if {[eval concat $$var_iemgui_num] > 0} {
- pack $id.para.dummy3 $id.para.num_lab $id.para.num_ent -side left -expand 1}
- if {[eval concat $$var_iemgui_steady] >= 0} {
- pack $id.para.dummy3 $id.para.stdy_jmp -side left -expand 1}
-
- frame $id.spacer0 -height 4 -background $::panel_background
- pack $id.spacer0 -side top
-
- labelframe $id.s_r -borderwidth 1 -pady 4 -text "messages" \
- -font highlight_font -background $::panel_background
- pack $id.s_r -side top -fill x -ipadx 5
- frame $id.s_r.send -background $::panel_background
- pack $id.s_r.send -side top
- label $id.s_r.send.lab -text " send-symbol:" -width 12 -justify right \
- -background $::panel_background
- entry $id.s_r.send.ent -textvariable $var_iemgui_snd -width 22 \
- -highlightbackground $::panel_background
- if { $snd != "nosndno" } {
- pack $id.s_r.send.lab $id.s_r.send.ent -side left}
-
- frame $id.s_r.receive -background $::panel_background
- pack $id.s_r.receive -side top
- label $id.s_r.receive.lab -text "receive-symbol:" -width 12 -justify right \
- -background $::panel_background
- entry $id.s_r.receive.ent -textvariable $var_iemgui_rcv -width 22 \
- -highlightbackground $::panel_background
- if { $rcv != "norcvno" } {
- pack $id.s_r.receive.lab $id.s_r.receive.ent -side left}
-
- # get the current font name from the int given from C-space (gn_f)
- set current_font $::font_family
- if {[eval concat $$var_iemgui_gn_f] == 1} \
- { set current_font "Helvetica" }
- if {[eval concat $$var_iemgui_gn_f] == 2} \
- { set current_font "Times" }
-
- frame $id.spacer1 -height 7 -background $::panel_background
- pack $id.spacer1 -side top
-
- labelframe $id.label -borderwidth 1 -text "label" -pady 4 \
- -font highlight_font -background $::panel_background
- pack $id.label -side top -fill x
- entry $id.label.name_entry -textvariable $var_iemgui_gui_nam -width 30 \
- -font [list $current_font 12 $::font_weight] \
- -highlightbackground $::panel_background
- pack $id.label.name_entry -side top -expand yes -fill both -padx 5
-
- frame $id.label.xy -padx 27 -pady 1 -background $::panel_background
- pack $id.label.xy -side top
- label $id.label.xy.x_lab -text "x offset" -width 6 -background $::panel_background
- entry $id.label.xy.x_entry -textvariable $var_iemgui_gn_dx -width 5 \
- -highlightbackground $::panel_background
- label $id.label.xy.dummy1 -text " " -width 2 -background $::panel_background
- label $id.label.xy.y_lab -text "y offset" -width 6 -background $::panel_background
- entry $id.label.xy.y_entry -textvariable $var_iemgui_gn_dy -width 5 \
- -highlightbackground $::panel_background
- pack $id.label.xy.x_lab $id.label.xy.x_entry $id.label.xy.dummy1 \
- $id.label.xy.y_lab $id.label.xy.y_entry -side left -anchor e
-
- label $id.label.fontpopup_label -text $current_font \
- -relief groove -font [list $current_font 12 $::font_weight] -padx 5
- pack $id.label.fontpopup_label -side left -anchor w -expand yes -fill x
- label $id.label.fontsize_label -text "size" -width 4 -background $::panel_background
- entry $id.label.fontsize_entry -textvariable $var_iemgui_gn_fs -width 5 \
- -highlightbackground $::panel_background
- pack $id.label.fontsize_entry $id.label.fontsize_label \
- -side right -anchor e -padx 5 -pady 5
- menu $id.popup
- $id.popup add command \
- -label $::font_family \
- -font [format {{%s} 12 %s} $::font_family $::font_weight] \
- -command "::pd_iemgui::toggle_font $id 0"
- $id.popup add command \
- -label "Helvetica" \
- -font [format {Helvetica 12 %s} $::font_weight] \
- -command "::pd_iemgui::toggle_font $id 1"
- $id.popup add command \
- -label "Times" \
- -font [format {Times 12 %s} $::font_weight] \
- -command "::pd_iemgui::toggle_font $id 2"
- bind $id.label.fontpopup_label <Button> \
- [list tk_popup $id.popup %X %Y]
-
- frame $id.spacer2 -height 7 -background $::panel_background
- pack $id.spacer2 -side top
-
- labelframe $id.colors -borderwidth 1 -text "colors" -font highlight_font \
- -background $::panel_background
- pack $id.colors -fill x -ipadx 5 -ipady 4
-
- frame $id.colors.select -background $::panel_background
- pack $id.colors.select -side top
- radiobutton $id.colors.select.radio0 -value 0 -variable \
- $var_iemgui_l2_f1_b0 -text "background" -width 10 -justify left \
- -background $::panel_background
- radiobutton $id.colors.select.radio1 -value 1 -variable \
- $var_iemgui_l2_f1_b0 -text "front" -width 5 -justify left \
- -background $::panel_background
- radiobutton $id.colors.select.radio2 -value 2 -variable \
- $var_iemgui_l2_f1_b0 -text "label" -width 5 -justify left \
- -background $::panel_background
- if { [eval concat $$var_iemgui_fcol] >= 0 } {
- pack $id.colors.select.radio0 $id.colors.select.radio1 \
- $id.colors.select.radio2 -side left
- } else {
- pack $id.colors.select.radio0 $id.colors.select.radio2 -side left
- }
-
- frame $id.colors.sections -background $::panel_background
- pack $id.colors.sections -side top
- button $id.colors.sections.but -command "::pd_iemgui::choose_col_bkfrlb $id" \
- -text "compose color" -width 12 -highlightbackground $::panel_background
- pack $id.colors.sections.but -side left -anchor w -padx 10 -pady 5 \
- -expand yes -fill x
- if { [eval concat $$var_iemgui_fcol] >= 0 } {
- label $id.colors.sections.fr_bk -text "o=||=o" -width 6 \
- -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -foreground [format "#%6.6x" [eval concat $$var_iemgui_fcol]] \
- -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_fcol]] \
- -font [list $current_font 12 $::font_weight] -padx 2 -pady 2 -relief ridge
- } else {
- label $id.colors.sections.fr_bk -text "o=||=o" -width 6 \
- -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -foreground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -font [list $current_font 12 $::font_weight] -padx 2 -pady 2 -relief ridge
- }
- label $id.colors.sections.lb_bk -text "testlabel" -width 9 \
- -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \
- -foreground [format "#%6.6x" [eval concat $$var_iemgui_lcol]] \
- -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_lcol]] \
- -font [list $current_font 12 $::font_weight] -padx 2 -pady 2 -relief ridge
- pack $id.colors.sections.lb_bk $id.colors.sections.fr_bk \
- -side right -anchor e -expand yes -fill both -pady 7
-
- # color scheme by Mary Ann Benedetto http://piR2.org
- frame $id.colors.r1 -background $::panel_background
- pack $id.colors.r1 -side top
- foreach i { 0 1 2 3 4 5 6 7 8 9} \
- hexcol { 0xFFFFFF 0xDFDFDF 0xBBBBBB 0xFFC7C6 0xFFE3C6 \
- 0xFEFFC6 0xC6FFC7 0xc6FEFF 0xC7C6FF 0xE3C6FF } \
- {
- label $id.colors.r1.c$i -background [format "#%6.6x" $hexcol] \
- -activebackground [format "#%6.6x" $hexcol] -relief ridge \
- -padx 7 -pady 0
- bind $id.colors.r1.c$i <Button> [format "::pd_iemgui::preset_col %s %d" $id $hexcol]
- }
- pack $id.colors.r1.c0 $id.colors.r1.c1 $id.colors.r1.c2 $id.colors.r1.c3 \
- $id.colors.r1.c4 $id.colors.r1.c5 $id.colors.r1.c6 $id.colors.r1.c7 \
- $id.colors.r1.c8 $id.colors.r1.c9 -side left
-
- frame $id.colors.r2 -background $::panel_background
- pack $id.colors.r2 -side top
- foreach i { 0 1 2 3 4 5 6 7 8 9 } \
- hexcol { 0x9F9F9F 0x7C7C7C 0x606060 0xFF0400 0xFF8300 \
- 0xFAFF00 0x00FF04 0x00FAFF 0x0400FF 0x9C00FF } \
- {
- label $id.colors.r2.c$i -background [format "#%6.6x" $hexcol] \
- -activebackground [format "#%6.6x" $hexcol] -relief ridge \
- -padx 7 -pady 0
- bind $id.colors.r2.c$i <Button> \
- [format "::pd_iemgui::preset_col %s %d" $id $hexcol]
- }
- pack $id.colors.r2.c0 $id.colors.r2.c1 $id.colors.r2.c2 $id.colors.r2.c3 \
- $id.colors.r2.c4 $id.colors.r2.c5 $id.colors.r2.c6 $id.colors.r2.c7 \
- $id.colors.r2.c8 $id.colors.r2.c9 -side left
-
- frame $id.colors.r3 -background $::panel_background
- pack $id.colors.r3 -side top
- foreach i { 0 1 2 3 4 5 6 7 8 9 } \
- hexcol { 0x404040 0x202020 0x000000 0x551312 0x553512 \
- 0x535512 0x0F4710 0x0E4345 0x131255 0x2F004D } \
- {
- label $id.colors.r3.c$i -background [format "#%6.6x" $hexcol] \
- -activebackground [format "#%6.6x" $hexcol] -relief ridge \
- -padx 7 -pady 0
- bind $id.colors.r3.c$i <Button> \
- [format "::pd_iemgui::preset_col %s %d" $id $hexcol]
- }
- pack $id.colors.r3.c0 $id.colors.r3.c1 $id.colors.r3.c2 $id.colors.r3.c3 \
- $id.colors.r3.c4 $id.colors.r3.c5 $id.colors.r3.c6 $id.colors.r3.c7 \
- $id.colors.r3.c8 $id.colors.r3.c9 -side left
-
- frame $id.cao -pady 10 -background $::panel_background
- pack $id.cao -side top
- button $id.cao.cancel -command "::pd_iemgui::cancel $id" \
- -text "Cancel" -width 6 -highlightbackground $::panel_background
- label $id.cao.dummy1 -text "" -width 3 -background $::panel_background
- button $id.cao.apply -text "Apply" -width 6 -command "::pd_iemgui::apply $id" \
- -highlightbackground $::panel_background
- label $id.cao.dummy2 -text "" -width 3 -background $::panel_background
- button $id.cao.ok -text {OK} -width 6 -command "::pd_iemgui::ok $id" \
- -highlightbackground $::panel_background
-
- pack $id.cao.cancel $id.cao.dummy1 -side left
- pack $id.cao.apply $id.cao.dummy2 -side left
- pack $id.cao.ok -side left
-
- if {[info tclversion] < 8.4} {
- bind $id <Key-Tab> {tkTabToWindow [tk_focusNext %W]}
- bind $id <<PrevWindow>> {tkTabToWindow [tk_focusPrev %W]}
- } else {
- bind $id <Key-Tab> {tk::TabToWindow [tk_focusNext %W]}
- bind $id <<PrevWindow>> {tk::TabToWindow [tk_focusPrev %W]}
- }
-
- $id.dim.w_ent select from 0
- $id.dim.w_ent select adjust end
- focus $id.dim.w_ent
-}
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Pd-cvs
mailing list