From dba79567cca7e81444efa16ee3ee1420fb155061 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 7 Feb 2011 23:52:13 +0000 Subject: buggy working version of a double-click popup buttonbar svn path=/trunk/scripts/guiplugins/buttonpopup-plugin/; revision=14868 --- LICENSE.txt | 78 +++++++++ README.txt | 7 + bng.gif | Bin 0 -> 3853 bytes buttonpopup-plugin.tcl | 97 +++++++++++ floatatom.gif | Bin 0 -> 4321 bytes hi-bit/old.bng.gif | Bin 0 -> 4182 bytes hi-bit/old.hradio.gif | Bin 0 -> 4082 bytes hi-bit/old.hslider.gif | Bin 0 -> 4100 bytes hi-bit/old.msg.gif | Bin 0 -> 4122 bytes hi-bit/old.obj.gif | Bin 0 -> 4094 bytes hi-bit/old.text.gif | Bin 0 -> 4093 bytes hi-bit/old.vradio.gif | Bin 0 -> 4087 bytes hi-bit/old.vslider.gif | Bin 0 -> 4102 bytes hradio.gif | Bin 0 -> 3841 bytes hslider.gif | Bin 0 -> 3853 bytes menuarray.gif | Bin 0 -> 4275 bytes msg.gif | Bin 0 -> 3850 bytes mycnv.gif | Bin 0 -> 4080 bytes numbox.gif | Bin 0 -> 4380 bytes obj.gif | Bin 0 -> 3839 bytes pkgIndex.tcl | 10 ++ symbolatom.gif | Bin 0 -> 4324 bytes text.gif | Bin 0 -> 4093 bytes toggle.gif | Bin 0 -> 4176 bytes tooltip-1.4.2.tcl | 447 +++++++++++++++++++++++++++++++++++++++++++++++++ vradio.gif | Bin 0 -> 3846 bytes vslider.gif | Bin 0 -> 3853 bytes vumeter.gif | Bin 0 -> 4155 bytes 28 files changed, 639 insertions(+) create mode 100644 LICENSE.txt create mode 100644 README.txt create mode 100644 bng.gif create mode 100644 buttonpopup-plugin.tcl create mode 100644 floatatom.gif create mode 100644 hi-bit/old.bng.gif create mode 100644 hi-bit/old.hradio.gif create mode 100644 hi-bit/old.hslider.gif create mode 100644 hi-bit/old.msg.gif create mode 100644 hi-bit/old.obj.gif create mode 100644 hi-bit/old.text.gif create mode 100644 hi-bit/old.vradio.gif create mode 100644 hi-bit/old.vslider.gif create mode 100644 hradio.gif create mode 100644 hslider.gif create mode 100644 menuarray.gif create mode 100644 msg.gif create mode 100644 mycnv.gif create mode 100644 numbox.gif create mode 100644 obj.gif create mode 100644 pkgIndex.tcl create mode 100644 symbolatom.gif create mode 100644 text.gif create mode 100644 toggle.gif create mode 100644 tooltip-1.4.2.tcl create mode 100644 vradio.gif create mode 100644 vslider.gif create mode 100644 vumeter.gif diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..075f39a --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,78 @@ +This software is copyrighted by Miller Puckette and others. The following +terms (the "Standard Improved BSD License") apply to all files associated with +the software unless explicitly disclaimed in individual files: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +3. The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +tooltip-1.4.2.tcl + + +Copyright (c) 1996-2007 Jeffrey Hobbs +Tcl/Tk License + +This software is copyrighted by Ajuba Solutions and other parties. +The following terms apply to all files associated with the software unless +explicitly disclaimed in individual files. + +The authors hereby grant permission to use, copy, modify, distribute, +and license this software and its documentation for any purpose, provided +that existing copyright notices are retained in all copies and that this +notice is included verbatim in any distributions. No written agreement, +license, or royalty fee is required for any of the authorized uses. +Modifications to this software may be copyrighted by their authors +and need not follow the licensing terms described here, provided that +the new terms are clearly indicated on the first page of each file where +they apply. + +IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY +FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY +DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE +IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE +NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR +MODIFICATIONS. + +GOVERNMENT USE: If you are acquiring this software on behalf of the +U.S. government, the Government shall have only "Restricted Rights" +in the software and related documentation as defined in the Federal +Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you +are acquiring the software on behalf of the Department of Defense, the +software shall be classified as "Commercial Computer Software" and the +Government shall have only "Restricted Rights" as defined in Clause +252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the +authors grant the U.S. Government and others acting in its behalf +permission to use and distribute the software in accordance with the +terms specified in this license. + + diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..753d83b --- /dev/null +++ b/README.txt @@ -0,0 +1,7 @@ +This plugin creates a "button bar" of all the commonly used objects and puts it at the top of all patches in Edit Mode. + +This project was started at Eyebeam as part of an X-lab Residency and grew out of the NYC Patching Circle with the support of New Blankets. + +Hans-Christoph Steiner +Joshua Clayton +Sofy Yuditskaya diff --git a/bng.gif b/bng.gif new file mode 100644 index 0000000..c1d880c Binary files /dev/null and b/bng.gif differ diff --git a/buttonpopup-plugin.tcl b/buttonpopup-plugin.tcl new file mode 100644 index 0000000..8a45176 --- /dev/null +++ b/buttonpopup-plugin.tcl @@ -0,0 +1,97 @@ +# this plugin creates a buttonpopup on a patch window when that patch +# window is in Edit Mode + +# this GUI plugin removes the menubars from any patch window that is +# not in Edit Mode. Also, if a patch is switched to Run Mode, the +# menubar will be removed. + +# TODO make it scroll the patch so it acts as an overlay + +lappend ::auto_path $::current_plugin_loadpath + +package require base64 +package require tooltip 1.4.2 + +namespace eval buttonpopup { + namespace export show_buttonpopup + namespace export hide_buttonpopup +} + +proc ::buttonpopup::make_pd_button {tkpathname name description} { + button $tkpathname.$name -image buttonpopup::$name \ + -relief flat -borderwidth 0 -highlightthickness 0 \ + -highlightcolor grey -highlightbackground grey -padx 0 -pady 0 \ + -command "menu_send_float \$::focused_window $name 0" + pack $tkpathname.$name -side left -padx 0 -pady 0 + ::tooltip::tooltip $tkpathname.$name $description +} + +proc ::buttonpopup::make_iemgui_button {tkpathname name description} { + button $tkpathname.$name -image buttonpopup::$name \ + -relief sunken -borderwidth 0 -highlightthickness 0 \ + -highlightcolor grey -highlightbackground grey -padx 0 -pady 0 \ + -command "menu_send \$::focused_window $name" + pack $tkpathname.$name -side left -padx 0 -pady 0 + ::tooltip::tooltip $tkpathname.$name $description +} + +proc ::buttonpopup::hide {w} { + set mytoplevel [winfo toplevel $w] + set tkcanvas [tkcanvas_name $mytoplevel] + $tkcanvas delete buttonpopup_window +} + +proc ::buttonpopup::show {w x y} { + set mytoplevel [winfo toplevel $w] + set tkcanvas [tkcanvas_name $mytoplevel] + set buttonpopup_pathname $tkcanvas.buttonpopup + if { ! [winfo exists $buttonpopup_pathname]} { + frame $buttonpopup_pathname -cursor arrow -background grey \ + -pady 0 + make_pd_button $buttonpopup_pathname obj {Object (obj)} + make_pd_button $buttonpopup_pathname msg {Message (msg)} + make_pd_button $buttonpopup_pathname floatatom {Number (floatatom)} + make_pd_button $buttonpopup_pathname symbolatom {Symbol (symbolatom)} + make_pd_button $buttonpopup_pathname text {Comment} + make_iemgui_button $buttonpopup_pathname bng {Bang Button [bng]} + make_iemgui_button $buttonpopup_pathname toggle {Toggle [tgl]} + make_iemgui_button $buttonpopup_pathname numbox {Number2 [my_numbox]} + make_iemgui_button $buttonpopup_pathname hslider {Horizontal Slider [hslider]} + make_iemgui_button $buttonpopup_pathname vslider {Verical Slider [vslider]} + make_iemgui_button $buttonpopup_pathname hradio {Horizontal Radio Button [hradio]} + make_iemgui_button $buttonpopup_pathname vradio {Vertical Radio Button [vradio]} + make_iemgui_button $buttonpopup_pathname vumeter {VU Meter [vumeter]} + make_iemgui_button $buttonpopup_pathname mycnv {Canvas [mycnv]} + make_iemgui_button $buttonpopup_pathname menuarray {Array (menuarray)} + bind $buttonpopup_pathname {::buttonpopup::hide %W} + } + if {$::editmode($mytoplevel)} { + $tkcanvas create window $x $y -anchor nw -window $buttonpopup_pathname \ + -tags buttonpopup_window + } +} + +proc ::buttonpopup::load_button_images {loadpath} { + image create photo buttonpopup::obj -file $loadpath/obj.gif + image create photo buttonpopup::msg -file $loadpath/msg.gif + image create photo buttonpopup::floatatom -file $loadpath/floatatom.gif + image create photo buttonpopup::symbolatom -file $loadpath/symbolatom.gif + image create photo buttonpopup::text -file $loadpath/text.gif + + image create photo buttonpopup::bng -file $loadpath/bng.gif + image create photo buttonpopup::toggle -file $loadpath/toggle.gif + image create photo buttonpopup::numbox -file $loadpath/numbox.gif + image create photo buttonpopup::hslider -file $loadpath/hslider.gif + image create photo buttonpopup::vslider -file $loadpath/vslider.gif + image create photo buttonpopup::hradio -file $loadpath/hradio.gif + image create photo buttonpopup::vradio -file $loadpath/vradio.gif + image create photo buttonpopup::vumeter -file $loadpath/vumeter.gif + image create photo buttonpopup::mycnv -file $loadpath/mycnv.gif + + image create photo buttonpopup::menuarray -file $loadpath/menuarray.gif +} + +::buttonpopup::load_button_images $::current_plugin_loadpath + +bind all {+::buttonpopup::show %W %x %y} +bind all {+after 100 ::buttonpopup::hide %W} diff --git a/floatatom.gif b/floatatom.gif new file mode 100644 index 0000000..d52d608 Binary files /dev/null and b/floatatom.gif differ diff --git a/hi-bit/old.bng.gif b/hi-bit/old.bng.gif new file mode 100644 index 0000000..9670581 Binary files /dev/null and b/hi-bit/old.bng.gif differ diff --git a/hi-bit/old.hradio.gif b/hi-bit/old.hradio.gif new file mode 100644 index 0000000..4654ba9 Binary files /dev/null and b/hi-bit/old.hradio.gif differ diff --git a/hi-bit/old.hslider.gif b/hi-bit/old.hslider.gif new file mode 100644 index 0000000..f8760fe Binary files /dev/null and b/hi-bit/old.hslider.gif differ diff --git a/hi-bit/old.msg.gif b/hi-bit/old.msg.gif new file mode 100644 index 0000000..a7e4fc3 Binary files /dev/null and b/hi-bit/old.msg.gif differ diff --git a/hi-bit/old.obj.gif b/hi-bit/old.obj.gif new file mode 100644 index 0000000..8be9048 Binary files /dev/null and b/hi-bit/old.obj.gif differ diff --git a/hi-bit/old.text.gif b/hi-bit/old.text.gif new file mode 100644 index 0000000..f5eb519 Binary files /dev/null and b/hi-bit/old.text.gif differ diff --git a/hi-bit/old.vradio.gif b/hi-bit/old.vradio.gif new file mode 100644 index 0000000..17f4347 Binary files /dev/null and b/hi-bit/old.vradio.gif differ diff --git a/hi-bit/old.vslider.gif b/hi-bit/old.vslider.gif new file mode 100644 index 0000000..a194f87 Binary files /dev/null and b/hi-bit/old.vslider.gif differ diff --git a/hradio.gif b/hradio.gif new file mode 100644 index 0000000..c0d8aa8 Binary files /dev/null and b/hradio.gif differ diff --git a/hslider.gif b/hslider.gif new file mode 100644 index 0000000..9fd9a81 Binary files /dev/null and b/hslider.gif differ diff --git a/menuarray.gif b/menuarray.gif new file mode 100644 index 0000000..c446718 Binary files /dev/null and b/menuarray.gif differ diff --git a/msg.gif b/msg.gif new file mode 100644 index 0000000..a337f30 Binary files /dev/null and b/msg.gif differ diff --git a/mycnv.gif b/mycnv.gif new file mode 100644 index 0000000..61c55ae Binary files /dev/null and b/mycnv.gif differ diff --git a/numbox.gif b/numbox.gif new file mode 100644 index 0000000..415fb06 Binary files /dev/null and b/numbox.gif differ diff --git a/obj.gif b/obj.gif new file mode 100644 index 0000000..c5be735 Binary files /dev/null and b/obj.gif differ diff --git a/pkgIndex.tcl b/pkgIndex.tcl new file mode 100644 index 0000000..ff70e2d --- /dev/null +++ b/pkgIndex.tcl @@ -0,0 +1,10 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. +package ifneeded tooltip 1.4.2 [list source [file join $dir tooltip-1.4.2.tcl]] diff --git a/symbolatom.gif b/symbolatom.gif new file mode 100644 index 0000000..4cf64bd Binary files /dev/null and b/symbolatom.gif differ diff --git a/text.gif b/text.gif new file mode 100644 index 0000000..f5eb519 Binary files /dev/null and b/text.gif differ diff --git a/toggle.gif b/toggle.gif new file mode 100644 index 0000000..a5471bf Binary files /dev/null and b/toggle.gif differ diff --git a/tooltip-1.4.2.tcl b/tooltip-1.4.2.tcl new file mode 100644 index 0000000..151583a --- /dev/null +++ b/tooltip-1.4.2.tcl @@ -0,0 +1,447 @@ +# ACTIVESTATE TEAPOT-PKG BEGIN TM -*- tcl -*- +# -- Tcl Module + +# @@ Meta Begin +# Package tooltip 1.4.2 +# Meta as::origin http://sourceforge.net/projects/tcllib +# Meta category Tooltip management +# Meta description Tooltip management +# Meta platform tcl +# Meta require {Tk 8.4} +# Meta require msgcat +# Meta subject hover help balloon tooltip +# Meta summary tooltip +# @@ Meta End + + + +# ACTIVESTATE TEAPOT-PKG BEGIN REQUIREMENTS + +package require Tk 8.4 +package require msgcat + +# ACTIVESTATE TEAPOT-PKG END REQUIREMENTS + +# ACTIVESTATE TEAPOT-PKG BEGIN DECLARE + +package provide tooltip 1.4.2 + +# ACTIVESTATE TEAPOT-PKG END DECLARE +# ACTIVESTATE TEAPOT-PKG END TM +# tooltip.tcl -- +# +# Balloon help +# +# Copyright (c) 1996-2007 Jeffrey Hobbs +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: @(#) $Id: tooltip.tcl,v 1.14 2008/08/08 22:50:13 patthoyts Exp $ +# +# Initiated: 28 October 1996 + + +package require Tk 8.4 +package provide tooltip 1.4.2 +package require msgcat + +#------------------------------------------------------------------------ +# PROCEDURE +# tooltip::tooltip +# +# DESCRIPTION +# Implements a tooltip (balloon help) system +# +# ARGUMENTS +# tooltip