/home/lnzliplg/public_html/tcl8.6.tar
Tix8.4.3/FileBox.tcl 0000644 00000034000 15173441414 0007740 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: FileBox.tcl,v 1.5 2004/03/28 02:44:57 hobbs Exp $
#
# FileBox.tcl --
#
# Implements the File Selection Box widget.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# ToDo
# (1) If user has entered an invalid directory, give an error dialog
#
tixWidgetClass tixFileSelectBox {
-superclass tixPrimitive
-classname TixFileSelectBox
-method {
filter invoke
}
-flag {
-browsecmd -command -dir -directory -disablecallback
-grab -pattern -selection -value
}
-configspec {
{-browsecmd browseCmd BrowseCmd ""}
{-command command Command ""}
{-directory directory Directory ""}
{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
{-grab grab Grab global}
{-pattern pattern Pattern *}
{-value value Value ""}
}
-alias {
{-selection -value}
{-dir -directory}
}
-forcecall {
-value
}
-default {
{.relief raised}
{*filelist*Listbox.takeFocus true}
{.borderWidth 1}
{*Label.anchor w}
{*Label.borderWidth 0}
{*TixComboBox*scrollbar auto}
{*TixComboBox*Label.anchor w}
{*TixScrolledListBox.scrollbar auto}
{*Listbox.exportSelection false}
{*directory*Label.text "Directories:"}
{*directory*Label.underline 0}
{*file*Label.text "Files:"}
{*file*Label.underline 2}
{*filter.label "Filter:"}
{*filter*label.underline 3}
{*filter.labelSide top}
{*selection.label "Selection:"}
{*selection*label.underline 0}
{*selection.labelSide top}
}
}
proc tixFileSelectBox:InitWidgetRec {w} {
upvar #0 $w data
global env
tixChainMethod $w InitWidgetRec
if {$data(-directory) eq ""} {
set data(-directory) [pwd]
}
if {$data(-pattern) eq ""} {
set data(-pattern) "*"
}
tixFileSelectBox:SetPat $w $data(-pattern)
tixFileSelectBox:SetDir $w [tixFSNormalize $data(-directory)]
set data(flag) 0
set data(fakeDir) 0
}
#----------------------------------------------------------------------
# Construct widget
#----------------------------------------------------------------------
proc tixFileSelectBox:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set frame1 [tixFileSelectBox:CreateFrame1 $w]
set frame2 [tixFileSelectBox:CreateFrame2 $w]
set frame3 [tixFileSelectBox:CreateFrame3 $w]
pack $frame1 -in $w -side top -fill x
pack $frame3 -in $w -side bottom -fill x
pack $frame2 -in $w -side top -fill both -expand yes
}
proc tixFileSelectBox:CreateFrame1 {w} {
upvar #0 $w data
frame $w.f1 -border 10
tixComboBox $w.f1.filter -editable 1\
-command [list $w filter] -anchor e \
-options {
slistbox.scrollbar auto
listbox.height 5
label.anchor w
}
set data(w:filter) $w.f1.filter
pack $data(w:filter) -side top -expand yes -fill both
return $w.f1
}
proc tixFileSelectBox:CreateFrame2 {w} {
upvar #0 $w data
tixPanedWindow $w.f2 -orientation horizontal
# THE LEFT FRAME
#-----------------------
set dir [$w.f2 add directory -size 120]
$dir config -relief flat
label $dir.lab
set data(w:dirlist) [tixScrolledListBox $dir.dirlist\
-scrollbar auto\
-options {listbox.width 4 listbox.height 6}]
pack $dir.lab -side top -fill x -padx 10
pack $data(w:dirlist) -side bottom -expand yes -fill both -padx 10
# THE RIGHT FRAME
#-----------------------
set file [$w.f2 add file -size 160]
$file config -relief flat
label $file.lab
set data(w:filelist) [tixScrolledListBox $file.filelist \
-scrollbar auto\
-options {listbox.width 4 listbox.height 6}]
pack $file.lab -side top -fill x -padx 10
pack $data(w:filelist) -side bottom -expand yes -fill both -padx 10
return $w.f2
}
proc tixFileSelectBox:CreateFrame3 {w} {
upvar #0 $w data
frame $w.f3 -border 10
tixComboBox $w.f3.selection -editable 1\
-command [list tixFileSelectBox:SelInvoke $w] \
-anchor e \
-options {
slistbox.scrollbar auto
listbox.height 5
label.anchor w
}
set data(w:selection) $w.f3.selection
pack $data(w:selection) -side top -fill both
return $w.f3
}
proc tixFileSelectBox:SelInvoke {w args} {
upvar #0 $w data
set event [tixEvent type]
if {$event ne "<FocusOut>" && $event ne "<Tab>"} {
$w invoke
}
}
proc tixFileSelectBox:SetValue {w value} {
upvar #0 $w data
set data(i-value) $value
set data(-value) [tixFSNative $value]
}
proc tixFileSelectBox:SetDir {w value} {
upvar #0 $w data
set data(i-directory) $value
set data(-directory) [tixFSNative $value]
}
proc tixFileSelectBox:SetPat {w value} {
upvar #0 $w data
set data(i-pattern) $value
set data(-pattern) [tixFSNative $value]
}
#----------------------------------------------------------------------
# BINDINGS
#----------------------------------------------------------------------
proc tixFileSelectBox:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
tixDoWhenMapped $w [list tixFileSelectBox:FirstMapped $w]
$data(w:dirlist) config \
-browsecmd [list tixFileSelectBox:SelectDir $w] \
-command [list tixFileSelectBox:InvokeDir $w]
$data(w:filelist) config \
-browsecmd [list tixFileSelectBox:SelectFile $w] \
-command [list tixFileSelectBox:InvokeFile $w]
}
#----------------------------------------------------------------------
# CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixFileSelectBox:config-directory {w value} {
upvar #0 $w data
if {$value eq ""} {
set value [pwd]
}
tixFileSelectBox:SetDir $w [tixFSNormalize $value]
tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)
$w filter
return $data(-directory)
}
proc tixFileSelectBox:config-pattern {w value} {
upvar #0 $w data
if {$value eq ""} {
set value "*"
}
tixFileSelectBox:SetPat $w $value
tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)
# Returning a value means we have overridden the value and updated
# the widget record ourselves.
#
return $data(-pattern)
}
proc tixFileSelectBox:config-value {w value} {
upvar #0 $w data
tixFileSelectBox:SetValue $w [tixFSNormalize $value]
tixSetSilent $data(w:selection) $value
return $data(-value)
}
#----------------------------------------------------------------------
# PUBLIC METHODS
#----------------------------------------------------------------------
proc tixFileSelectBox:filter {w args} {
upvar #0 $w data
$data(w:filter) popdown
tixFileSelectBox:InterpFilter $w
tixFileSelectBox:LoadDir $w
}
proc tixFileSelectBox:invoke {w args} {
upvar #0 $w data
if {[$data(w:selection) cget -value] ne
[$data(w:selection) cget -selection]} {
# this will in turn call "invoke" again ...
#
$data(w:selection) invoke
return
}
# record the filter
#
set filter [tixFileSelectBox:InterpFilter $w]
$data(w:filter) addhistory $filter
# record the selection
#
set userInput [string trim [$data(w:selection) cget -value]]
tixFileSelectBox:SetValue $w \
[tixFSNormalize [file join $data(i-directory) $userInput]]
$data(w:selection) addhistory $data(-value)
$data(w:filter) align
$data(w:selection) align
if {[llength $data(-command)] && !$data(-disablecallback)} {
set bind(specs) "%V"
set bind(%V) $data(-value)
tixEvalCmdBinding $w $data(-command) bind $data(-value)
}
}
#----------------------------------------------------------------------
# INTERNAL METHODS
#----------------------------------------------------------------------
# InterpFilter:
# Interprets the value of the w:filter widget.
#
# Side effects:
# Changes the fields data(-directory) and data(-pattenn)
#
proc tixFileSelectBox:InterpFilter {w {filter ""}} {
upvar #0 $w data
if {$filter == ""} {
set filter [$data(w:filter) cget -selection]
if {$filter == ""} {
set filter [$data(w:filter) cget -value]
}
}
set i_filter [tixFSNormalize $filter]
if {[file isdirectory $filter]} {
tixFileSelectBox:SetDir $w $i_filter
tixFileSelectBox:SetPat $w "*"
} else {
set nDir [file dirname $filter]
if {$nDir eq "" || $nDir eq "."} {
tixFileSelectBox:SetDir $w [tixFSNormalize $data(i-directory)]
} else {
tixFileSelectBox:SetDir $w [tixFSNormalize $nDir]
}
tixFileSelectBox:SetPat $w [file tail $filter]
}
tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)
return $data(filter)
}
proc tixFileSelectBox:SetFilter {w dir pattern} {
upvar #0 $w data
set data(filter) [file join $dir $pattern]
tixSetSilent $data(w:filter) $data(filter)
}
proc tixFileSelectBox:LoadDirIntoLists {w} {
upvar #0 $w data
$data(w:dirlist) subwidget listbox delete 0 end
$data(w:filelist) subwidget listbox delete 0 end
set dir $data(i-directory)
# (1) List the directories
#
set isDrive [expr {[llength [file split $dir]] == 1}]
foreach name [tixFSListDir $dir 1 0 1 1] {
if {".." eq $name && $isDrive} { continue }
$data(w:dirlist) subwidget listbox insert end $name
}
# (2) List the files
#
# %% UNIX'ISM:
# If the pattern is "*" force glob to list the .* files.
# However, since the user might not
# be interested in them, shift the listbox so that the "normal" files
# are seen first
#
# NOTE: if we pass $pat == "" but with $showHidden set to true,
# tixFSListDir will list "* .*" in Unix. See the comment on top of
# the tixFSListDir code.
#
if {$data(i-pattern) eq "*"} {
set pat ""
} else {
set pat $data(i-pattern)
}
set top 0
foreach name [tixFSListDir $dir 0 1 0 0 $pat] {
$data(w:filelist) subwidget listbox insert end $name
if {[string match .* $name]} {
incr top
}
}
$data(w:filelist) subwidget listbox yview $top
}
proc tixFileSelectBox:LoadDir {w} {
upvar #0 $w data
tixBusy $w on [$data(w:dirlist) subwidget listbox]
tixFileSelectBox:LoadDirIntoLists $w
if {[$data(w:dirlist) subwidget listbox size] == 0} {
# fail safe, just in case the user has inputed an errnoeuos
# directory
$data(w:dirlist) subwidget listbox insert 0 ".."
}
tixWidgetDoWhenIdle tixBusy $w off [$data(w:dirlist) subwidget listbox]
}
# User single clicks on the directory listbox
#
proc tixFileSelectBox:SelectDir {w} {
upvar #0 $w data
if {$data(fakeDir) > 0} {
incr data(fakeDir) -1
$data(w:dirlist) subwidget listbox select clear 0 end
$data(w:dirlist) subwidget listbox activate -1
return
}
if {$data(flag)} {
return
}
set data(flag) 1
set subdir [tixListboxGetCurrent [$data(w:dirlist) subwidget listbox]]
if {$subdir == ""} {
set subdir "."
}
tixFileSelectBox:SetFilter $w \
[tixFSNormalize [file join $data(i-directory) $subdir]] \
$data(i-pattern)
set data(flag) 0
}
proc tixFileSelectBox:InvokeDir {w} {
upvar #0 $w data
set theDir [$data(w:dirlist) subwidget listbox get active]
tixFileSelectBox:SetDir $w \
[tixFSNormalize [file join $data(i-directory) $theDir]]
$data(w:dirlist) subwidget listbox select clear 0 end
tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)
tixFileSelectBox:InterpFilter $w [tixFSNativeNorm $data(filter)]
tixFileSelectBox:LoadDir $w
if {![tixEvent match <Return>]} {
incr data(fakeDir) 1
}
}
proc tixFileSelectBox:SelectFile {w} {
upvar #0 $w data
if {$data(flag)} {
return
}
set data(flag) 1
# Reset the "Filter:" box to the current directory:
#
$data(w:dirlist) subwidget listbox select clear 0 end
tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)
# Now select the file
#
set selected [tixListboxGetCurrent [$data(w:filelist) subwidget listbox]]
if {$selected != ""} {
# Make sure that the selection is not empty!
#
tixFileSelectBox:SetValue $w \
[tixFSNormalize [file join $data(i-directory) $selected]]
tixSetSilent $data(w:selection) $data(-value)
if {[llength $data(-browsecmd)]} {
tixEvalCmdBinding $w $data(-browsecmd) "" $data(-value)
}
}
set data(flag) 0
}
proc tixFileSelectBox:InvokeFile {w} {
upvar #0 $w data
set selected [tixListboxGetCurrent [$data(w:filelist) subwidget listbox]]
if {$selected != ""} {
$w invoke
}
}
# This is only called the first this fileBox is mapped -- load the directory
#
proc tixFileSelectBox:FirstMapped {w} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)
tixFileSelectBox:LoadDir $w
$data(w:filter) align
}
#----------------------------------------------------------------------
#
#
# C O N V E N I E N C E R O U T I N E S
#
#
#----------------------------------------------------------------------
# This is obsolete. Use the widget tixFileSelectDialog instead
#
#
proc tixMkFileDialog {w args} {
set option(-okcmd) ""
set option(-helpcmd) ""
tixHandleOptions option {-okcmd -helpcmd} $args
toplevel $w
wm minsize $w 10 10
tixStdDlgBtns $w.btns
if {$option(-okcmd) != ""} {
tixFileSelectBox $w.fsb \
-command "[list wm withdraw $w]; $option(-okcmd)"
} else {
tixFileSelectBox $w.fsb -command [list wm withdraw $w]
}
$w.btns button ok config -command [list $w.fsb invoke]
$w.btns button apply config -command [list $w.fsb filter] -text Filter
$w.btns button cancel config -command [list wm withdraw $w]
if {$option(-helpcmd) == ""} {
$w.btns button help config -state disabled
} else {
$w.btns button help config -command $option(-helpcmd)
}
wm protocol $w WM_DELETE_WINDOW [list wm withdraw $w]
pack $w.btns -side bottom -fill both
pack $w.fsb -fill both -expand yes
return $w.fsb
}
Tix8.4.3/Shell.tcl 0000644 00000002072 15173441414 0007463 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Shell.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# Shell.tcl --
#
# This is the base class to all shell widget
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
# type : normal, transient, overrideredirect
#
tixWidgetClass tixShell {
-superclass tixPrimitive
-classname TixShell
-flag {
-title
}
-configspec {
{-title title Title ""}
}
-forcecall {
-title
}
}
#----------------------------------------------------------------------
# ClassInitialization:
#----------------------------------------------------------------------
proc tixShell:CreateRootWidget {w args} {
upvar #0 $w data
upvar #0 $data(className) classRec
toplevel $w -class $data(ClassName)
wm transient $w ""
wm withdraw $w
}
proc tixShell:config-title {w value} {
wm title $w $value
}
Tix8.4.3/BtnBox.tcl 0000644 00000005157 15173441414 0007617 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: BtnBox.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# BtnBox.tcl --
#
# Implements the tixButtonBox widget
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixButtonBox {
-superclass tixPrimitive
-classname TixButtonBox
-method {
add invoke button buttons
}
-flag {
-orientation -orient -padx -pady -state
}
-static {
-orientation
}
-configspec {
{-orientation orientation Orientation horizontal}
{-padx padX Pad 0}
{-pady padY Pad 0}
{-state state State normal}
}
-alias {
{-orient -orientation}
}
-default {
{.borderWidth 1}
{.relief raised}
{.padX 5}
{.padY 10}
{*Button.anchor c}
{*Button.padX 5}
}
}
proc tixButtonBox:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(g:buttons) ""
}
#----------------------------------------------------------------------
# CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixButtonBox:config-padx {w arg} {
upvar #0 $w data
foreach item $data(g:buttons) {
pack configure $w.$item -padx $arg
}
}
proc tixButtonBox:config-pady {w arg} {
upvar #0 $w data
foreach item $data(g:buttons) {
pack configure $w.$item -pady $arg
}
}
proc tixButtonBox:config-state {w arg} {
upvar #0 $w data
foreach item $data(g:buttons) {
$w.$item config -state $arg
}
}
#----------------------------------------------------------------------
# Methods
# WIDGET COMMANDS
#----------------------------------------------------------------------
proc tixButtonBox:add {w name args} {
upvar #0 $w data
eval button $w.$name $args
if {$data(-orientation) == "horizontal"} {
pack $w.$name -side left -expand yes -fill y\
-padx $data(-padx) -pady $data(-pady)
} else {
pack $w.$name -side top -expand yes -fill x\
-padx $data(-padx) -pady $data(-pady)
}
# allow for subwidget access
#
lappend data(g:buttons) $name
set data(w:$name) $w.$name
return $w.$name
}
proc tixButtonBox:button {w name args} {
return [eval tixCallMethod $w subwidget $name $args]
}
proc tixButtonBox:buttons {w args} {
return [eval tixCallMethod $w subwidgets -group buttons $args]
}
#
# call the command
proc tixButtonBox:invoke {w name} {
upvar #0 $w data
$w.$name invoke
}
Tix8.4.3/MultView.tcl 0000644 00000007170 15173441414 0010174 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: MultView.tcl,v 1.3 2001/12/09 05:04:02 idiscovery Exp $
#
# MultView.tcl --
#
# Implements the multi-view widget
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixMultiView {
-classname TixMultiView
-superclass tixPrimitive
-method {
add
}
-flag {
-browsecmd -command -view
}
-forcecall {
-view
}
-configspec {
{-browsecmd browseCmd BrowseCmd ""}
{-command command Command ""}
{-view view View icon tixMultiView:VerifyView}
}
-alias {
}
-default {
}
}
proc tixMultiView:InitWidgetRec {w} {
upvar #0 $w data
global env
tixChainMethod $w InitWidgetRec
}
#----------------------------------------------------------------------
# Construct widget
#----------------------------------------------------------------------
proc tixMultiView:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:stlist) [tixScrolledTList $w.stlist]
set data(w:sgrid) [tixScrolledGrid $w.sgrid]
set data(w:icon) [tixIconView $w.icon]
set data(w:tlist) [$data(w:stlist) subwidget tlist]
set data(w:grid) [$data(w:sgrid) subwidget grid]
$data(w:grid) config -formatcmd [list tixMultiView:GridFormat $w] \
-leftmargin 0 -topmargin 1
}
proc tixMultiView:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
}
proc tixMultiView:GetWid {w which} {
upvar #0 $w data
case $which {
list {
return $data(w:stlist)
}
icon {
return $data(w:icon)
}
detail {
return $data(w:sgrid)
}
}
}
#----------------------------------------------------------------------
# Configuration
#----------------------------------------------------------------------
proc tixMultiView:config-view {w value} {
upvar #0 $w data
if {$data(-view) != ""} {
pack forget [tixMultiView:GetWid $w $data(-view)]
}
pack [tixMultiView:GetWid $w $value] -expand yes -fill both
}
#----------------------------------------------------------------------
# Private methods
#----------------------------------------------------------------------
proc tixMultiView:GridFormat {w area x1 y1 x2 y2} {
upvar #0 $w data
case $area {
main {
}
{x-margin y-margin s-margin} {
# cborder specifies consecutive 3d borders
#
$data(w:grid) format cborder $x1 $y1 $x2 $y2 \
-fill 1 -relief raised -bd 2 -bg gray60 \
-selectbackground gray80
}
}
}
#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
# Return value is the index of "$name" in the grid subwidget
#
#
proc tixMultiView:add {w name args} {
upvar #0 $w data
set validOptions {-image -text}
set opt(-image) ""
set opt(-text) ""
tixHandleOptions -nounknown opt $validOptions $args
$data(w:icon) add $name $opt(-image) $opt(-text)
$data(w:tlist) insert end -itemtype imagetext \
-image $opt(-image) -text $opt(-text)
$data(w:grid) set 0 end -itemtype imagetext \
-image $opt(-image) -text $opt(-text)
return max
}
#----------------------------------------------------------------------
# checker
#----------------------------------------------------------------------
proc tixMultiView:VerifyView {value} {
case $value {
{icon list detail} {
return $value
}
}
error "bad view \"$value\", must be detail, icon or list"
}
Tix8.4.3/SimpDlg.tcl 0000644 00000002205 15173441414 0007751 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: SimpDlg.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# SimpDlg.tcl --
#
# This file implements Simple Dialog widgets
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixSimpleDialog {
-classname TixSimpleDialog
-superclass tixDialogShell
-method {}
-flag {
-buttons -message -type
}
-configspec {
{-buttons buttons Buttons ""}
{-message message Message ""}
{-type type Type info}
}
}
proc tixSimpleDialog:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
frame $w.top
label $w.top.icon -image [tix getimage $data(-type)]
label $w.top.message -text $data(-message)
pack $w.top.icon -side left -padx 20 -pady 50 -anchor c
pack $w.top.message -side left -padx 10 -pady 50 -anchor c
frame $w.bot
pack $w.bot -side bottom -fill x
pack $w.top -side top -expand yes -fill both
}
Tix8.4.3/Meter.tcl 0000644 00000006052 15173441414 0007472 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Meter.tcl,v 1.3 2001/12/09 05:04:02 idiscovery Exp $
#
# Meter.tcl --
#
# Implements the tixMeter widget
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixMeter {
-classname TixMeter
-superclass tixPrimitive
-method {
}
-flag {
-foreground -text -value
}
-configspec {
{-fillcolor fillColor FillColor #8080ff}
{-foreground foreground Foreground black}
{-text text Text ""}
{-value value Value 0}
}
-default {
{.relief sunken}
{.borderWidth 2}
{.width 150}
}
}
proc tixMeter:InitWidgetRec {w} {
upvar #0 $w data
global env
tixChainMethod $w InitWidgetRec
}
#----------------------------------------------------------------------
# Construct widget
#----------------------------------------------------------------------
proc tixMeter:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:canvas) [canvas $w.canvas]
pack $data(w:canvas) -expand yes -fill both
tixMeter:Update $w
}
proc tixMeter:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
}
proc tixMeter:Update {w} {
upvar #0 $w data
# set the width of the canvas
set W [expr $data(-width)-\
([$data(w:root) cget -bd]+[$data(w:root) cget -highlightthickness]*2)]
$data(w:canvas) config -width $W
if {$data(-text) == ""} {
set text [format "%d%%" [expr int($data(-value)*100)]]
} else {
set text $data(-text)
}
# (Create/Modify) the text item.
#
if {![info exists data(text)]} {
set data(text) [$data(w:canvas) create text 0 0 -text $text]
} else {
$data(w:canvas) itemconfig $data(text) -text $text
}
set bbox [$data(w:canvas) bbox $data(text)]
set itemW [expr [lindex $bbox 2]-[lindex $bbox 0]]
set itemH [expr [lindex $bbox 3]-[lindex $bbox 1]]
$data(w:canvas) coord $data(text) [expr $W/2] [expr $itemH/2+4]
set H [expr $itemH + 4]
$data(w:canvas) config -height [expr $H]
set rectW [expr int($W*$data(-value))]
if {![info exists data(rect)]} {
set data(rect) [$data(w:canvas) create rectangle 0 0 $rectW 1000]
} else {
$data(w:canvas) coord $data(rect) 0 0 $rectW 1000
}
$data(w:canvas) itemconfig $data(rect) \
-fill $data(-fillcolor) -outline $data(-fillcolor)
$data(w:canvas) raise $data(text)
}
#----------------------------------------------------------------------
# Configuration
#----------------------------------------------------------------------
proc tixMeter:config-value {w value} {
upvar #0 $w data
set data(-value) $value
tixMeter:Update $w
}
proc tixMeter:config-text {w value} {
upvar #0 $w data
set data(-text) $value
tixMeter:Update $w
}
proc tixMeter:config-fillcolor {w value} {
upvar #0 $w data
set data(-fillcolor) $value
tixMeter:Update $w
}
Tix8.4.3/StackWin.tcl 0000644 00000003710 15173441414 0010137 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: StackWin.tcl,v 1.3 2004/03/28 02:44:57 hobbs Exp $
#
# StackWin.tcl --
#
# Similar to NoteBook but uses a Select widget to represent the pages.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixStackWindow {
-classname TixStackWindow
-superclass tixVStack
-method {
}
-flag {
}
-configspec {
}
}
proc tixStackWindow:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:tabs) [tixSelect $w.tabs]
# We can't use the packer because it will conflict with the
# geometry management of the VStack widget.
#
tixManageGeometry $data(w:tabs) [list tixVStack:ClientGeomProc $w]
}
proc tixStackWindow:add {w child args} {
upvar #0 $w data
set ret [eval [list tixChainMethod $w add $child] $args]
# Find out the -label option
#
foreach {flag value} $args {
if {$flag eq "-label"} {
set label $value
}
}
$data(w:tabs) add $child -command [list $w raise $child] -text $label
return $ret
}
proc tixStackWindow:raise {w child} {
upvar #0 $w data
$data(w:tabs) config -value $child
tixChainMethod $w raise $child
}
proc tixStackWindow:Resize {w} {
upvar #0 $w data
# We have to take care of the size of the tabs so that
#
set tW [winfo reqwidth $data(w:tabs)]
set tH [winfo reqheight $data(w:tabs)]
tixMoveResizeWindow $data(w:tabs) $data(-ipadx) $data(-ipady) $tW $tH
tixMapWindow $data(w:tabs)
set data(pad-y1) [expr $tH + $data(-ipadx)]
set data(minW) [expr $tW + 2 * $data(-ipadx)]
set data(minH) [expr $tH + 2 * $data(-ipady)]
# Now that we know data(pad-y1), we can chain the call
#
tixChainMethod $w Resize
}
Tix8.4.3/bitmaps/plus.xpm 0000644 00000000310 15173441414 0011051 0 ustar 00 /* XPM */
static char * plus_xpm[] = {
"9 9 2 1",
". s None c None",
" c black",
" ",
" ....... ",
" ... ... ",
" ... ... ",
" . . ",
" ... ... ",
" ... ... ",
" ....... ",
" "};
Tix8.4.3/bitmaps/plus.xbm 0000644 00000000303 15173441414 0011035 0 ustar 00 #define plus_width 9
#define plus_height 9
static unsigned char plus_bits[] = {
0xff, 0x01, 0x01, 0x01, 0x11, 0x01, 0x11, 0x01, 0x7d, 0x01, 0x11, 0x01,
0x11, 0x01, 0x01, 0x01, 0xff, 0x01};
Tix8.4.3/bitmaps/harddisk.xbm 0000644 00000001600 15173441414 0011644 0 ustar 00 #define harddisk_width 32
#define harddisk_height 32
static unsigned char harddisk_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf8, 0xff, 0xff, 0x1f, 0x08, 0x00, 0x00, 0x18, 0xa8, 0xaa, 0xaa, 0x1a,
0x48, 0x55, 0xd5, 0x1d, 0xa8, 0xaa, 0xaa, 0x1b, 0x48, 0x55, 0x55, 0x1d,
0xa8, 0xfa, 0xaf, 0x1a, 0xc8, 0xff, 0xff, 0x1d, 0xa8, 0xfa, 0xaf, 0x1a,
0x48, 0x55, 0x55, 0x1d, 0xa8, 0xaa, 0xaa, 0x1a, 0x48, 0x55, 0x55, 0x1d,
0xa8, 0xaa, 0xaa, 0x1a, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
Tix8.4.3/bitmaps/textfile.gif 0000644 00000000117 15173441414 0011660 0 ustar 00 GIF89a � ��� ��� !� , D�k�X{� ��Ɔx\Wq ��䇝�^g ; Tix8.4.3/bitmaps/act_fold.xpm 0000644 00000000664 15173441414 0011655 0 ustar 00 /* XPM */
static char * act_fold_xpm[] = {
/* width height num_colors chars_per_pixel */
"16 12 4 1",
/* colors */
" s None c None",
". c black",
"X c yellow",
"o c #5B5B57574646",
/* pixels */
" .... ",
" .XXXX. ",
" .XXXXXX. ",
"............. ",
".oXoXoXoXoXo. ",
".XoX............",
".oX.XXXXXXXXXXX.",
".Xo.XXXXXXXXXX. ",
".o.XXXXXXXXXXX. ",
".X.XXXXXXXXXXX. ",
"..XXXXXXXXXX.. ",
"............. "};
Tix8.4.3/bitmaps/balarrow.xbm 0000644 00000000173 15173441414 0011670 0 ustar 00 #define balarrow_width 6
#define balarrow_height 6
static char balarrow_bits[] = {
0x1f, 0x07, 0x07, 0x09, 0x11, 0x20};
Tix8.4.3/bitmaps/mktransgif.tcl 0000644 00000000371 15173441414 0012220 0 ustar 00 #
# $Id: mktransgif.tcl,v 1.1.1.1 2000/05/17 11:08:46 idiscovery Exp $
#
#!/usr/local/bin/tclsh
set dont(plusarm.gif) 1
set dont(minusarm.gif) 1
foreach file [glob *.gif] {
if ![info exists dont($file)] {
puts "giftool -1 -B $file"
}
}
Tix8.4.3/bitmaps/hourglas.xbm 0000644 00000001654 15173441414 0011710 0 ustar 00 #define hourglass_width 32
#define hourglas_height 32
#define hourglas_x_hot 16
#define hourglas_y_hot 15
static char hourglas_bits[] = {
0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff,
0x7c, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x7c,
0xfc, 0x00, 0x00, 0x7e, 0xfc, 0x00, 0x00, 0x7e, 0xfc, 0x00, 0x00, 0x7e,
0xbc, 0x01, 0x00, 0x7b, 0xbc, 0xfd, 0x7e, 0x7b, 0x3c, 0xfb, 0xbf, 0x79,
0x3c, 0xe6, 0xcf, 0x78, 0x3c, 0xdc, 0x77, 0x78, 0x3c, 0x38, 0x39, 0x78,
0x3c, 0x60, 0x0d, 0x78, 0x3c, 0x38, 0x38, 0x78, 0x3c, 0x1c, 0x71, 0x78,
0x3c, 0x06, 0xc1, 0x78, 0x3c, 0x03, 0x80, 0x79, 0xbc, 0x01, 0x00, 0x7b,
0xbc, 0x01, 0x00, 0x7b, 0xfc, 0x00, 0x01, 0x7e, 0xfc, 0x00, 0x01, 0x7e,
0xfc, 0x80, 0x03, 0x7e, 0x7c, 0xc0, 0x07, 0x7c, 0x7c, 0xf0, 0x1f, 0x7c,
0x7c, 0xfe, 0xff, 0x7c, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff,
0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff};
Tix8.4.3/bitmaps/ck_off.xbm 0000644 00000000376 15173441414 0011313 0 ustar 00 #define ck_off_width 13
#define ck_off_height 13
static unsigned char ck_off_bits[] = {
0xff, 0x1f, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10,
0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10,
0xff, 0x1f};
Tix8.4.3/bitmaps/minus.xpm 0000644 00000000311 15173441414 0011222 0 ustar 00 /* XPM */
static char * minus_xpm[] = {
"9 9 2 1",
". s None c None",
" c black",
" ",
" ....... ",
" ....... ",
" ....... ",
" . . ",
" ....... ",
" ....... ",
" ....... ",
" "};
Tix8.4.3/bitmaps/openfold.xpm 0000644 00000000642 15173441414 0011704 0 ustar 00 /* XPM */
static char * openfolder_xpm[] = {
/* width height num_colors chars_per_pixel */
"16 12 3 1",
/* colors */
" s None c None",
". c black",
"X c #f0ff80",
/* pixels */
" .... ",
" .XXXX. ",
" .XXXXXX. ",
"............. ",
".XXXXXXXXXXX. ",
".XXX............",
".XX.XXXXXXXXXXX.",
".XX.XXXXXXXXXX. ",
".X.XXXXXXXXXXX. ",
".X.XXXXXXXXXXX. ",
"..XXXXXXXXXX.. ",
"............. "};
Tix8.4.3/bitmaps/plus.gif 0000644 00000000072 15173441414 0011017 0 ustar 00 GIF89a � ��� !� , �����
"Ks�,�S ; Tix8.4.3/bitmaps/minus.xbm 0000644 00000000306 15173441414 0011210 0 ustar 00 #define minus_width 9
#define minus_height 9
static unsigned char minus_bits[] = {
0xff, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x7d, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0xff, 0x01};
Tix8.4.3/bitmaps/srcfile.xbm 0000644 00000000362 15173441414 0011506 0 ustar 00 #define srcfile_width 12
#define srcfile_height 12
static unsigned char srcfile_bits[] = {
0xfe, 0x01, 0x02, 0x01, 0x02, 0x07, 0x02, 0x04, 0x72, 0x04, 0x8a, 0x04,
0x0a, 0x04, 0x0a, 0x04, 0x8a, 0x04, 0x72, 0x04, 0x02, 0x04, 0xfe, 0x07};
Tix8.4.3/bitmaps/file.xpm 0000644 00000000452 15173441414 0011014 0 ustar 00 /* XPM */
static char * file_xpm[] = {
"12 12 3 1",
" s None c None",
". c black",
"X c #FFFFFFFFF3CE",
" ........ ",
" .XXXXXX. ",
" .XXXXXX... ",
" .XXXXXXXX. ",
" .XXXXXXXX. ",
" .XXXXXXXX. ",
" .XXXXXXXX. ",
" .XXXXXXXX. ",
" .XXXXXXXX. ",
" .XXXXXXXX. ",
" .XXXXXXXX. ",
" .......... "};
Tix8.4.3/bitmaps/ck_def.xbm 0000644 00000000376 15173441414 0011277 0 ustar 00 #define ck_def_width 13
#define ck_def_height 13
static unsigned char ck_def_bits[] = {
0xff, 0x1f, 0x01, 0x10, 0x55, 0x15, 0x01, 0x10, 0x55, 0x15, 0x01, 0x10,
0x55, 0x15, 0x01, 0x10, 0x55, 0x15, 0x01, 0x10, 0x55, 0x15, 0x01, 0x10,
0xff, 0x1f};
Tix8.4.3/bitmaps/restore.xbm 0000644 00000000431 15173441414 0011537 0 ustar 00 #define restore_width 15
#define restore_height 15
static unsigned char restore_bits[] = {
0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f,
0xfc, 0x1f, 0x00, 0x00, 0xfc, 0x1f, 0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x03,
0xc0, 0x01, 0x80, 0x00, 0x00, 0x00};
Tix8.4.3/bitmaps/plusarm.gif 0000644 00000000074 15173441414 0011521 0 ustar 00 GIF87a � �� lhh , �����`@(g(t�^�DL� ; Tix8.4.3/bitmaps/tick.xbm 0000644 00000000373 15173441414 0011013 0 ustar 00 #define tick_width 14
#define tick_height 14
static char tick_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x38, 0x00, 0x1c, 0x00, 0x0e,
0x00, 0x07, 0x80, 0x03, 0xc2, 0x01, 0xe7, 0x00, 0x7f, 0x00, 0x3e, 0x00,
0x1c, 0x00, 0x08, 0x00};
Tix8.4.3/bitmaps/minusarm.gif 0000644 00000000073 15173441414 0011670 0 ustar 00 GIF87a � �� ��� , ����넔
qD�S���� ; Tix8.4.3/bitmaps/resize1.xbm 0000644 00000000461 15173441414 0011441 0 ustar 00 #define resize1_width 13
#define resize1_height 13
#define resize1_x_hot 6
#define resize1_y_hot 6
static unsigned char resize1_bits[] = {
0x7f, 0x00, 0x21, 0x00, 0x11, 0x00, 0x31, 0x00, 0x6d, 0x00, 0xdb, 0x00,
0xb1, 0x11, 0x60, 0x1b, 0xc0, 0x16, 0x80, 0x11, 0x00, 0x11, 0x80, 0x10,
0xc0, 0x1f};
Tix8.4.3/bitmaps/act_fold.gif 0000644 00000000132 15173441414 0011604 0 ustar 00 GIF89a � �� �� [WF!� , +��a�'/T[Bْ�8� ؍�U�U��>��P���q�,
; Tix8.4.3/bitmaps/plusarm.xpm 0000644 00000000324 15173441414 0011556 0 ustar 00 /* XPM */
static char * plusarm_xpm[] = {
"9 9 3 1",
" c black",
". c yellow",
"X c gray40",
" ",
" ....... ",
" ... ... ",
" ..X X.. ",
" . X . ",
" ..X X.. ",
" ... ... ",
" ....... ",
" "};
Tix8.4.3/bitmaps/maximize.xbm 0000644 00000000434 15173441414 0011702 0 ustar 00 #define maximize_width 15
#define maximize_height 15
static unsigned char maximize_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x04, 0x10, 0x04, 0x70, 0x04, 0x70,
0x04, 0x70, 0x04, 0x70, 0x04, 0x70, 0x04, 0x70, 0x04, 0x70, 0x04, 0x70,
0xfc, 0x7f, 0xf0, 0x7f, 0xf0, 0x7f};
Tix8.4.3/bitmaps/srcfile.gif 0000644 00000000117 15173441414 0011463 0 ustar 00 GIF89a � ��� ��� !� , D�k�X{�@i�^�U�jd�b�ބn� ; Tix8.4.3/bitmaps/folder.xbm 0000644 00000000327 15173441414 0011333 0 ustar 00 #define folder_width 16
#define folder_height 10
static unsigned char folder_bits[] = {
0xfc, 0x00, 0x02, 0x07, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08,
0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0xff, 0x07};
Tix8.4.3/bitmaps/file.gif 0000644 00000000114 15173441414 0010750 0 ustar 00 GIF89a � �� ��� !� , D�k�X{�@i�Yl�yW(r�G���}� ; Tix8.4.3/bitmaps/plusarm.xbm 0000644 00000000314 15173441414 0011537 0 ustar 00 #define plusarm_width 9
#define plusarm_height 9
static unsigned char plusarm_bits[] = {
0xff, 0x01, 0x01, 0x01, 0x6d, 0x01, 0x6d, 0x01, 0x01, 0x01, 0x6d, 0x01,
0x6d, 0x01, 0x01, 0x01, 0xff, 0x01};
Tix8.4.3/bitmaps/file.xbm 0000644 00000000351 15173441414 0010774 0 ustar 00 #define file_width 12
#define file_height 12
static unsigned char file_bits[] = {
0xfe, 0x00, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0xfe, 0x03};
Tix8.4.3/bitmaps/folder.gif 0000644 00000000117 15173441414 0011307 0 ustar 00 GIF89a � �� � !� , ��a�'/T[Bْ�Q�Vi>h����q�R ; Tix8.4.3/bitmaps/openfold.gif 0000644 00000000124 15173441414 0011640 0 ustar 00 GIF89a � ��� � !� , %��a�'/T[Bْ�Q�=8��T窸+�̑DrK ; Tix8.4.3/bitmaps/drop.xbm 0000644 00000000506 15173441414 0011023 0 ustar 00 #define drop_width 16
#define drop_height 16
#define drop_x_hot 6
#define drop_y_hot 4
static unsigned char drop_bits[] = {
0x00, 0x00, 0xfe, 0x07, 0x02, 0x04, 0x02, 0x04, 0x42, 0x04, 0xc2, 0x04,
0xc2, 0x05, 0xc2, 0x07, 0xc2, 0x07, 0xc2, 0x0f, 0xfe, 0x1f, 0xc0, 0x07,
0xc0, 0x06, 0x00, 0x0c, 0x00, 0x1c, 0x00, 0x08};
Tix8.4.3/bitmaps/openfold.xbm 0000644 00000000335 15173441414 0011665 0 ustar 00 #define openfold_width 16
#define openfold_height 10
static unsigned char openfold_bits[] = {
0xfc, 0x00, 0x02, 0x07, 0x01, 0x08, 0xc1, 0xff, 0x21, 0x80, 0x11, 0x40,
0x09, 0x20, 0x05, 0x10, 0x03, 0x08, 0xff, 0x07};
Tix8.4.3/bitmaps/incr.xbm 0000644 00000000143 15173441414 0011007 0 ustar 00 #define incr_width 7
#define incr_height 4
static char incr_bits[] = {
0x08, 0x1c, 0x3e, 0x7f};
Tix8.4.3/bitmaps/warning.gif 0000644 00000000264 15173441414 0011504 0 ustar 00 GIF89a � ��� �� !� , �����a� ����(�\偦&6�i�����)�şm�Y���p@Z���=#0�i:�B(*g<Z/Ϭh[��*^1�\n9�Su5v��� <E�G��;2m��'�5� �u�b���2�����0��5�D�s�y�ijP ; Tix8.4.3/bitmaps/textfile.xbm 0000644 00000000365 15173441414 0011706 0 ustar 00 #define textfile_width 12
#define textfile_height 12
static unsigned char textfile_bits[] = {
0xfe, 0x01, 0x02, 0x01, 0x02, 0x07, 0x7a, 0x04, 0x02, 0x04, 0x3a, 0x04,
0x02, 0x04, 0xfa, 0x04, 0x02, 0x04, 0xfa, 0x04, 0x02, 0x04, 0xfe, 0x07};
Tix8.4.3/bitmaps/network.xbm 0000644 00000001575 15173441414 0011557 0 ustar 00 #define network_width 32
#define network_height 32
static unsigned char network_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x02, 0x40,
0x00, 0x00, 0xfa, 0x5f, 0x00, 0x00, 0x0a, 0x50, 0x00, 0x00, 0x0a, 0x52,
0x00, 0x00, 0x0a, 0x52, 0x00, 0x00, 0x8a, 0x51, 0x00, 0x00, 0x0a, 0x50,
0x00, 0x00, 0x4a, 0x50, 0x00, 0x00, 0x0a, 0x50, 0x00, 0x00, 0x0a, 0x50,
0x00, 0x00, 0xfa, 0x5f, 0x00, 0x00, 0x02, 0x40, 0xfe, 0x7f, 0x52, 0x55,
0x02, 0x40, 0xaa, 0x6a, 0xfa, 0x5f, 0xfe, 0x7f, 0x0a, 0x50, 0xfe, 0x7f,
0x0a, 0x52, 0x80, 0x00, 0x0a, 0x52, 0x80, 0x00, 0x8a, 0x51, 0x80, 0x00,
0x0a, 0x50, 0x80, 0x00, 0x4a, 0x50, 0x80, 0x00, 0x0a, 0x50, 0xe0, 0x03,
0x0a, 0x50, 0x20, 0x02, 0xfa, 0xdf, 0x3f, 0x03, 0x02, 0x40, 0xa0, 0x02,
0x52, 0x55, 0xe0, 0x03, 0xaa, 0x6a, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00,
0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
Tix8.4.3/bitmaps/hourglas.mask 0000644 00000001711 15173441414 0012047 0 ustar 00 #define hourglass_mask_width 32
#define hourglass_mask_height 32
#define hourglass_mask_x_hot 16
#define hourglass_mask_y_hot 15
static char hourglass_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x7f,
0x58, 0x00, 0x00, 0x34, 0x58, 0x00, 0x00, 0x34, 0x58, 0x00, 0x00, 0x34,
0x98, 0x00, 0x00, 0x32, 0x98, 0x00, 0x00, 0x32, 0x98, 0x00, 0x00, 0x32,
0x18, 0x01, 0x00, 0x31, 0x18, 0xfd, 0x7e, 0x31, 0x18, 0xfa, 0xbf, 0x30,
0x18, 0xe4, 0x4f, 0x30, 0x18, 0xd8, 0x37, 0x30, 0x18, 0x20, 0x09, 0x30,
0x18, 0x40, 0x05, 0x30, 0x18, 0x20, 0x08, 0x30, 0x18, 0x18, 0x31, 0x30,
0x18, 0x04, 0x41, 0x30, 0x18, 0x02, 0x80, 0x30, 0x18, 0x01, 0x00, 0x31,
0x18, 0x01, 0x00, 0x31, 0x98, 0x00, 0x01, 0x32, 0x98, 0x00, 0x01, 0x32,
0x98, 0x80, 0x03, 0x32, 0x58, 0xc0, 0x07, 0x34, 0x58, 0xf0, 0x1f, 0x34,
0x58, 0xfe, 0xff, 0x34, 0xf8, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x7f,
0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00};
Tix8.4.3/bitmaps/warning.xpm 0000644 00000002356 15173441414 0011547 0 ustar 00 /* XPM */
static char * warning_xpm[] = {
"32 32 3 1",
" s None c None",
". c #000000000000",
"X c yellow",
" ",
" ......... ",
" ...XXXXXXXXX... ",
" .XXXXXXXXXXXXXXX. ",
" ..XXXXXXXXXXXXXXXXX.. ",
" .XXXXXXXXX...XXXXXXXXX. ",
" .XXXXXXXXX.....XXXXXXXXX. ",
" .XXXXXXXXX.....XXXXXXXXX. ",
" .XXXXXXXXX.......XXXXXXXXX. ",
" .XXXXXXXXXX.......XXXXXXXXXX. ",
" .XXXXXXXXXX.......XXXXXXXXXX. ",
" .XXXXXXXXXX.......XXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
".XXXXXXXXXXXX.....XXXXXXXXXXXX. ",
".XXXXXXXXXXXX.....XXXXXXXXXXXX. ",
".XXXXXXXXXXXX.....XXXXXXXXXXXX. ",
".XXXXXXXXXXXXX...XXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXX...XXXXXXXXXXXX. ",
" .XXXXXXXXXXX.....XXXXXXXXXXX. ",
" .XXXXXXXXX.......XXXXXXXXX. ",
" .XXXXXXXX.......XXXXXXXX. ",
" .XXXXXXXX.......XXXXXXXX. ",
" .XXXXXXXX.....XXXXXXXX. ",
" ..XXXXXXX...XXXXXXX.. ",
" .XXXXXXXXXXXXXXX. ",
" ...XXXXXXXXX... ",
" ......... "};
Tix8.4.3/bitmaps/minimize.xbm 0000644 00000000434 15173441414 0011700 0 ustar 00 #define minimize_width 15
#define minimize_height 15
static unsigned char minimize_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01,
0x20, 0x03, 0x20, 0x03, 0xe0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
Tix8.4.3/bitmaps/minus.gif 0000644 00000000071 15173441414 0011166 0 ustar 00 GIF89a � ��� !� , �����^�Lye|�� ; Tix8.4.3/bitmaps/folder.xpm 0000644 00000000642 15173441414 0011351 0 ustar 00 /* XPM */
static char * folder_foo_xpm[] = {
/* width height num_colors chars_per_pixel */
"16 12 3 1",
/* colors */
" s None c None",
". c black",
"X c #f0ff80",
/* pixels */
" .... ",
" .XXXX. ",
" .XXXXXX. ",
"............. ",
".XXXXXXXXXXX. ",
".XXXXXXXXXXX. ",
".XXXXXXXXXXX. ",
".XXXXXXXXXXX. ",
".XXXXXXXXXXX. ",
".XXXXXXXXXXX. ",
".XXXXXXXXXXX. ",
"............. "};
Tix8.4.3/bitmaps/minusarm.xbm 0000644 00000000317 15173441414 0011712 0 ustar 00 #define minusarm_width 9
#define minusarm_height 9
static unsigned char minusarm_bits[] = {
0xff, 0x01, 0x01, 0x01, 0x7d, 0x01, 0x7d, 0x01, 0x01, 0x01, 0x7d, 0x01,
0x7d, 0x01, 0x01, 0x01, 0xff, 0x01};
Tix8.4.3/bitmaps/system.xbm 0000644 00000000426 15173441414 0011404 0 ustar 00 #define system_width 15
#define system_height 15
static unsigned char system_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f,
0x02, 0x20, 0x02, 0x20, 0xfe, 0x3f, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
Tix8.4.3/bitmaps/resize2.xbm 0000644 00000000461 15173441414 0011442 0 ustar 00 #define resize2_width 13
#define resize2_height 13
#define resize2_x_hot 6
#define resize2_y_hot 6
static unsigned char resize2_bits[] = {
0xc0, 0x1f, 0x80, 0x10, 0x00, 0x11, 0x80, 0x11, 0xc0, 0x16, 0x60, 0x1b,
0xb1, 0x11, 0xdb, 0x00, 0x6d, 0x00, 0x31, 0x00, 0x11, 0x00, 0x21, 0x00,
0x7f, 0x00};
Tix8.4.3/bitmaps/srcfile.xpm 0000644 00000000446 15173441414 0011527 0 ustar 00 /* XPM */
static char * srcfile_xpm[] = {
"12 12 3 1",
" s None c None",
". c black",
"X c gray91",
" ........ ",
" .XXXXXX. ",
" .XXXXXX... ",
" .XXXXXXXX. ",
" .XX...XXX. ",
" .X.XXX.XX. ",
" .X.XXXXXX. ",
" .X.XXXXXX. ",
" .X.XXX.XX. ",
" .XX...XXX. ",
" .XXXXXXXX. ",
" .......... "};
Tix8.4.3/bitmaps/info.gif 0000644 00000000237 15173441414 0010772 0 ustar 00 GIF89a � ���!� , v����aC��[�V�tyϧ�\Iz��HjȖ����I�|O��)�O�W�Rɔ��|���1���Y�<���1R���9u]sc�q�0��d��:���Gu�Ǥ3H�8�g�Hrg�P ; Tix8.4.3/bitmaps/cross.xbm 0000644 00000000376 15173441414 0011215 0 ustar 00 #define cross_width 14
#define cross_height 14
static char cross_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x06, 0x18, 0x0e, 0x1c, 0x1c, 0x0e, 0x38, 0x07,
0xf0, 0x03, 0xe0, 0x01, 0xe0, 0x01, 0xf0, 0x03, 0x38, 0x07, 0x1c, 0x0e,
0x0e, 0x1c, 0x06, 0x18};
Tix8.4.3/bitmaps/act_fold.xbm 0000644 00000000335 15173441414 0011632 0 ustar 00 #define act_fold_width 16
#define act_fold_height 10
static unsigned char act_fold_bits[] = {
0xfc, 0x00, 0xaa, 0x0f, 0x55, 0x15, 0xeb, 0xff, 0x15, 0x80, 0x0b, 0x40,
0x05, 0x20, 0x03, 0x10, 0x01, 0x08, 0xff, 0x07};
Tix8.4.3/bitmaps/no_entry.xpm 0000644 00000002372 15173441414 0011735 0 ustar 00 /* XPM */
static char * no_entry_xpm[] = {
"32 32 4 1",
" s None c None",
". c #000000000000",
"X c red",
"o c yellow",
" ",
" ......... ",
" ...XXXXXXXXX... ",
" .XXXXXXXXXXXXXXX. ",
" ..XXXXXXXXXXXXXXXXX.. ",
" .XXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
".XXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
".XXX.......................XXX. ",
".XXX.ooooooooooooooooooooo.XXX. ",
".XXX.ooooooooooooooooooooo.XXX. ",
".XXX.ooooooooooooooooooooo.XXX. ",
".XXX.ooooooooooooooooooooo.XXX. ",
".XXX.ooooooooooooooooooooo.XXX. ",
".XXX.ooooooooooooooooooooo.XXX. ",
".XXX.......................XXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXX. ",
" ..XXXXXXXXXXXXXXXXX.. ",
" .XXXXXXXXXXXXXXX. ",
" ...XXXXXXXXX... ",
" ......... "};
Tix8.4.3/bitmaps/textfile.xpm 0000644 00000000456 15173441414 0011725 0 ustar 00 /* XPM */
static char * textfile_xpm[] = {
"12 12 3 1",
" s None c None",
". c black",
"X c #FFFFFFFFF3CE",
" ........ ",
" .XXXXXX. ",
" .XXXXXX... ",
" .X....XXX. ",
" .XXXXXXXX. ",
" .X...XXXX. ",
" .XXXXXXXX. ",
" .X.....XX. ",
" .XXXXXXXX. ",
" .X.....XX. ",
" .XXXXXXXX. ",
" .......... "};
Tix8.4.3/bitmaps/openfile.xbm 0000644 00000000335 15173441414 0011660 0 ustar 00 #define openfile_width 16
#define openfile_height 10
static unsigned char openfile_bits[] = {
0xf8, 0x01, 0x04, 0x06, 0x02, 0x08, 0x02, 0x10, 0xe2, 0xff, 0x52, 0x55,
0xaa, 0x2a, 0x56, 0x15, 0xaa, 0x0a, 0xfe, 0x07};
Tix8.4.3/bitmaps/cbxarrow.xbm 0000644 00000000407 15173441414 0011706 0 ustar 00 #define cbxarrow_width 11
#define cbxarrow_height 14
static char cbxarrow_bits[] = {
0x00, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
0xfe, 0x03, 0xfc, 0x01, 0xf8, 0x00, 0x70, 0x00, 0x20, 0x00, 0x00, 0x00,
0xfe, 0x03, 0xfe, 0x03};
Tix8.4.3/bitmaps/no_entry.gif 0000644 00000000260 15173441414 0011670 0 ustar 00 GIF89a � ��� �@�� !� , �����a� ����(�\偦&6��^������6m�6K�;�L/��2�T� �j������jW"���R�+���i͚=U��mW����� ��w�#Ȕ��XHƀ(��� 3T��0�p�Q ; Tix8.4.3/bitmaps/ck_on.xbm 0000644 00000000373 15173441414 0011152 0 ustar 00 #define ck_on_width 13
#define ck_on_height 13
static unsigned char ck_on_bits[] = {
0xff, 0x1f, 0x01, 0x10, 0x01, 0x10, 0x01, 0x14, 0x01, 0x16, 0x01, 0x17,
0x89, 0x13, 0xdd, 0x11, 0xf9, 0x10, 0x71, 0x10, 0x21, 0x10, 0x01, 0x10,
0xff, 0x1f};
Tix8.4.3/bitmaps/decr.xbm 0000644 00000000143 15173441414 0010771 0 ustar 00 #define decr_width 7
#define decr_height 4
static char decr_bits[] = {
0x7f, 0x3e, 0x1c, 0x08};
Tix8.4.3/bitmaps/info.xpm 0000644 00000002352 15173441414 0011031 0 ustar 00 /* XPM */
static char * info_xpm[] = {
"32 32 3 1",
" s None c None",
". c #000000000000",
"X c white",
" ",
" ......... ",
" ...XXXXXXXXX... ",
" .XXXXXXXXXXXXXXX. ",
" ..XXXXXXXXXXXXXXXXX.. ",
" .XXXXXXXXXXXXXXXXXXXXX. ",
" .XXXXXXXXXX...XXXXXXXXXX. ",
" .XXXXXXXXX.....XXXXXXXXX. ",
" .XXXXXXXXX.......XXXXXXXXX. ",
" .XXXXXXXXXX.......XXXXXXXXXX. ",
" .XXXXXXXXXX.......XXXXXXXXXX. ",
" .XXXXXXXXXXX.....XXXXXXXXXXX. ",
".XXXXXXXXXXXXX...XXXXXXXXXXXXX. ",
".XXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
".XXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
".XXXXXXXXXXX.......XXXXXXXXXXX. ",
" .XXXXXXXXXX.......XXXXXXXXXX. ",
" .XXXXXXXXXX.......XXXXXXXXXX. ",
" .XXXXXXXXXX.......XXXXXXXXXX. ",
" .XXXXXXXXX.......XXXXXXXXX. ",
" .XXXXXXXX.......XXXXXXXX. ",
" .XXXXXXXX.......XXXXXXXX. ",
" .XXXXXXXXXXXXXXXXXXXXX. ",
" ..XXXXXXXXXXXXXXXXX.. ",
" .XXXXXXXXXXXXXXX. ",
" ...XXXXXXXXX... ",
" ......... "};
Tix8.4.3/bitmaps/minusarm.xpm 0000644 00000000334 15173441414 0011727 0 ustar 00 /* XPM */
static char * minusarm_xpm[] = {
"9 9 3 1",
" c black",
". c yellow",
"X c #808080808080",
" ",
" ....... ",
" ....... ",
" .XXXXX. ",
" .X X. ",
" .XXXXX. ",
" ....... ",
" ....... ",
" "};
Tix8.4.3/Console.tcl 0000644 00000035717 15173441414 0010032 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Console.tcl,v 1.5 2008/02/27 22:17:28 hobbs Exp $
#
# Console.tcl --
#
# This code constructs the console window for an application.
# It can be used by non-unix systems that do not have built-in
# support for shells.
#
# This file was distributed as a part of Tk 4.1 by Sun
# Microsystems, Inc. and subsequently modified by Expert
# Interface Techonoligies and included as a part of Tix.
#
# Some of the functions in this file have been renamed from
# using a "tk" prefix to a "tix" prefix to avoid namespace
# conflict with the original file.
#
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "docs/license.tcltk" for information on usage and
# redistribution of the original file "console.tcl". These license
# terms do NOT apply to other files in the Tix distribution.
#
# See the file "license.terms" for information on usage and
# redistribution * of this file, and for a DISCLAIMER OF ALL
# WARRANTIES.
# tixConsoleInit --
# This procedure constructs and configures the console windows.
#
# Arguments:
# None.
foreach fun {tkTextSetCursor} {
if {![llength [info commands $fun]]} {
tk::unsupported::ExposePrivateCommand $fun
}
}
unset fun
proc tixConsoleInit {} {
global tcl_platform
uplevel #0 set tixConsoleTextFont Courier
uplevel #0 set tixConsoleTextSize 14
set f [frame .f]
set fontcb [tixComboBox $f.size -label "" -command "tixConsoleSetFont" \
-variable tixConsoleTextFont \
-options {
entry.width 15
listbox.height 5
}]
set sizecb [tixComboBox $f.font -label "" -command "tixConsoleSetFont" \
-variable tixConsoleTextSize \
-options {
entry.width 4
listbox.width 6
listbox.height 5
}]
pack $fontcb $sizecb -side left
pack $f -side top -fill x -padx 2 -pady 2
foreach font {
"Courier New"
"Courier"
"Helvetica"
"Lucida"
"Lucida Typewriter"
"MS LineDraw"
"System"
"Times Roman"
} {
$fontcb subwidget listbox insert end $font
}
for {set s 6} {$s < 25} {incr s} {
$sizecb subwidget listbox insert end $s
}
bind [$fontcb subwidget entry] <Escape> "focus .console"
bind [$sizecb subwidget entry] <Escape> "focus .console"
text .console -yscrollcommand ".sb set" -setgrid true \
-highlightcolor [. cget -bg] -highlightbackground [. cget -bg]
scrollbar .sb -command ".console yview" -highlightcolor [. cget -bg] \
-highlightbackground [. cget -bg]
pack .sb -side right -fill both
pack .console -fill both -expand 1 -side left
tixConsoleBind .console
.console tag configure stderr -foreground red
.console tag configure stdin -foreground blue
focus .console
wm protocol . WM_DELETE_WINDOW { wm withdraw . }
wm title . "Console"
flush stdout
.console mark set output [.console index "end - 1 char"]
tkTextSetCursor .console end
.console mark set promptEnd insert
.console mark gravity promptEnd left
tixConsoleSetFont
}
proc tixConsoleSetFont {args} {
if ![winfo exists .console] tixConsoleInit
global tixConsoleTextFont tixConsoleTextSize
set font -*-$tixConsoleTextFont-medium-r-normal-*-$tixConsoleTextSize-*-*-*-*-*-*-*
.console config -font $font
}
# tixConsoleInvoke --
# Processes the command line input. If the command is complete it
# is evaled in the main interpreter. Otherwise, the continuation
# prompt is added and more input may be added.
#
# Arguments:
# None.
proc tixConsoleInvoke {args} {
if ![winfo exists .console] tixConsoleInit
if {[.console dlineinfo insert] != {}} {
set setend 1
} else {
set setend 0
}
set ranges [.console tag ranges input]
set cmd ""
if {$ranges != ""} {
set pos 0
while {[lindex $ranges $pos] != ""} {
set start [lindex $ranges $pos]
set end [lindex $ranges [incr pos]]
append cmd [.console get $start $end]
incr pos
}
}
if {$cmd == ""} {
tixConsolePrompt
} elseif {[info complete $cmd]} {
.console mark set output end
.console tag delete input
set err [catch {
set result [interp record $cmd]
} result]
if {$result != ""} {
if {$err} {
.console insert insert "$result\n" stderr
} else {
.console insert insert "$result\n"
}
}
tixConsoleHistory reset
tixConsolePrompt
} else {
tixConsolePrompt partial
}
if {$setend} {
.console yview -pickplace insert
}
}
# tixConsoleHistory --
# This procedure implements command line history for the
# console. In general is evals the history command in the
# main interpreter to obtain the history. The global variable
# histNum is used to store the current location in the history.
#
# Arguments:
# cmd - Which action to take: prev, next, reset.
set histNum 1
proc tixConsoleHistory {cmd} {
if ![winfo exists .console] tixConsoleInit
global histNum
switch $cmd {
prev {
incr histNum -1
if {$histNum == 0} {
set cmd {history event [expr [history nextid] -1]}
} else {
set cmd "history event $histNum"
}
if {[catch {interp eval $cmd} cmd]} {
incr histNum
return
}
.console delete promptEnd end
.console insert promptEnd $cmd {input stdin}
}
next {
incr histNum
if {$histNum == 0} {
set cmd {history event [expr [history nextid] -1]}
} elseif {$histNum > 0} {
set cmd ""
set histNum 1
} else {
set cmd "history event $histNum"
}
if {$cmd != ""} {
catch {interp eval $cmd} cmd
}
.console delete promptEnd end
.console insert promptEnd $cmd {input stdin}
}
reset {
set histNum 1
}
}
}
# tixConsolePrompt --
# This procedure draws the prompt. If tcl_prompt1 or tcl_prompt2
# exists in the main interpreter it will be called to generate the
# prompt. Otherwise, a hard coded default prompt is printed.
#
# Arguments:
# partial - Flag to specify which prompt to print.
proc tixConsolePrompt {{partial normal}} {
if ![winfo exists .console] tixConsoleInit
if {$partial == "normal"} {
set temp [.console index "end - 1 char"]
.console mark set output end
if {[interp eval "info exists tcl_prompt1"]} {
interp eval "eval \[set tcl_prompt1\]"
} else {
puts -nonewline "% "
}
} else {
set temp [.console index output]
.console mark set output end
if {[interp eval "info exists tcl_prompt2"]} {
interp eval "eval \[set tcl_prompt2\]"
} else {
puts -nonewline "> "
}
}
flush stdout
.console mark set output $temp
tkTextSetCursor .console end
.console mark set promptEnd insert
.console mark gravity promptEnd left
}
# tixConsoleBind --
# This procedure first ensures that the default bindings for the Text
# class have been defined. Then certain bindings are overridden for
# the class.
#
# Arguments:
# None.
proc tixConsoleBind {win} {
if ![winfo exists .console] tixConsoleInit
bindtags $win "$win Text . all"
# Ignore all Alt, Meta, and Control keypresses unless explicitly bound.
# Otherwise, if a widget binding for one of these is defined, the
# <KeyPress> class binding will also fire and insert the character,
# which is wrong. Ditto for <Escape>.
bind $win <Alt-KeyPress> {# nothing }
bind $win <Meta-KeyPress> {# nothing}
bind $win <Control-KeyPress> {# nothing}
bind $win <Escape> {# nothing}
bind $win <KP_Enter> {# nothing}
bind $win <Tab> {
tixConsoleInsert %W \t
focus %W
break
}
bind $win <Return> {
%W mark set insert {end - 1c}
tixConsoleInsert %W "\n"
tixConsoleInvoke
break
}
bind $win <Delete> {
if {[%W tag nextrange sel 1.0 end] != ""} {
%W tag remove sel sel.first promptEnd
} else {
if {[%W compare insert < promptEnd]} {
break
}
}
}
bind $win <BackSpace> {
if {[%W tag nextrange sel 1.0 end] != ""} {
%W tag remove sel sel.first promptEnd
} else {
if {[%W compare insert <= promptEnd]} {
break
}
}
}
foreach left {Control-a Home} {
bind $win <$left> {
if {[%W compare insert < promptEnd]} {
tkTextSetCursor %W {insert linestart}
} else {
tkTextSetCursor %W promptEnd
}
break
}
}
foreach right {Control-e End} {
bind $win <$right> {
tkTextSetCursor %W {insert lineend}
break
}
}
bind $win <Control-d> {
if {[%W compare insert < promptEnd]} {
break
}
}
bind $win <Control-k> {
if {[%W compare insert < promptEnd]} {
%W mark set insert promptEnd
}
}
bind $win <Control-t> {
if {[%W compare insert < promptEnd]} {
break
}
}
bind $win <Meta-d> {
if {[%W compare insert < promptEnd]} {
break
}
}
bind $win <Meta-BackSpace> {
if {[%W compare insert <= promptEnd]} {
break
}
}
bind $win <Control-h> {
if {[%W compare insert <= promptEnd]} {
break
}
}
foreach prev {Control-p Up} {
bind $win <$prev> {
tixConsoleHistory prev
break
}
}
foreach prev {Control-n Down} {
bind $win <$prev> {
tixConsoleHistory next
break
}
}
bind $win <Control-v> {
if {[%W compare insert > promptEnd]} {
catch {
%W insert insert [selection get -displayof %W] {input stdin}
%W see insert
}
}
break
}
bind $win <Insert> {
catch {tixConsoleInsert %W [selection get -displayof %W]}
break
}
bind $win <KeyPress> {
tixConsoleInsert %W %A
break
}
foreach left {Control-b Left} {
bind $win <$left> {
if {[%W compare insert == promptEnd]} {
break
}
tkTextSetCursor %W insert-1c
break
}
}
foreach right {Control-f Right} {
bind $win <$right> {
tkTextSetCursor %W insert+1c
break
}
}
bind $win <Control-Up> {
%W yview scroll -1 unit
break;
}
bind $win <Control-Down> {
%W yview scroll 1 unit
break;
}
bind $win <Prior> {
%W yview scroll -1 pages
}
bind $win <Next> {
%W yview scroll 1 pages
}
bind $win <F9> {
eval destroy [winfo child .]
source $tix_library/Console.tcl
}
foreach copy {F16 Meta-w Control-i} {
bind $win <$copy> {
if {[selection own -displayof %W] == "%W"} {
clipboard clear -displayof %W
catch {
clipboard append -displayof %W [selection get -displayof %W]
}
}
break
}
}
foreach paste {F18 Control-y} {
bind $win <$paste> {
catch {
set clip [selection get -displayof %W -selection CLIPBOARD]
set list [split $clip \n\r]
tixConsoleInsert %W [lindex $list 0]
foreach x [lrange $list 1 end] {
%W mark set insert {end - 1c}
tixConsoleInsert %W "\n"
tixConsoleInvoke
tixConsoleInsert %W $x
}
}
break
}
}
}
# tixConsoleInsert --
# Insert a string into a text at the point of the insertion cursor.
# If there is a selection in the text, and it covers the point of the
# insertion cursor, then delete the selection before inserting. Insertion
# is restricted to the prompt area.
#
# Arguments:
# w - The text window in which to insert the string
# s - The string to insert (usually just a single character)
proc tixConsoleInsert {w s} {
if ![winfo exists .console] tixConsoleInit
if {[.console dlineinfo insert] != {}} {
set setend 1
} else {
set setend 0
}
if {$s == ""} {
return
}
catch {
if {[$w compare sel.first <= insert]
&& [$w compare sel.last >= insert]} {
$w tag remove sel sel.first promptEnd
$w delete sel.first sel.last
}
}
if {[$w compare insert < promptEnd]} {
$w mark set insert end
}
$w insert insert $s {input stdin}
if $setend {
.console see insert
}
}
# tixConsoleOutput --
#
# This routine is called directly by ConsolePutsCmd to cause a string
# to be displayed in the console.
#
# Arguments:
# dest - The output tag to be used: either "stderr" or "stdout".
# string - The string to be displayed.
proc tixConsoleOutput {dest string} {
if ![winfo exists .console] tixConsoleInit
if {[.console dlineinfo insert] != {}} {
set setend 1
} else {
set setend 0
}
.console insert output $string $dest
if $setend {
.console see insert
}
}
# tixConsoleExit --
#
# This routine is called by ConsoleEventProc when the main window of
# the application is destroyed.
#
# Arguments:
# None.
proc tixConsoleExit {} {
if ![winfo exists .console] tixConsoleInit
exit
}
# Configure the default Tk console
proc tixConsoleEvalAppend {inter} {
global tixOption
# A slave like the console interp has no global variables set!
if {!$inter} {
console hide
# Change the menubar to Close the console instead of exiting
# Your code must provide a way for the user to do a "console show"
console eval {
if {[winfo exists .menubar.file]} {
.menubar.file entryconfigure "Hide Console" \
-underline 0 \
-label Close \
-command [list wm withdraw .]
.menubar.file entryconfigure Exit -state disabled
}
}
}
console eval ".option configure -font \{$tixOption(fixed_font)\}"
console eval {
if {[winfo exists .menubar.edit]} {
.menubar.edit add sep
.menubar.edit add command \
-accelerator 'Ctrl+l' \
-underline 0 \
-label Clear \
-command [list .console delete 1.0 end]
bind .console <Control-Key-l> [list .console delete 1.0 end]
}
if {![winfo exists .menubar.font]} {
set m .menubar.font
menu $m -tearoff 0
.menubar add cascade -menu .menubar.font \
-underline 0 -label Options
global _TixConsole
set font [font actual [.console cget -font]]
set pos [lsearch $font -family]
set _TixConsole(font) [lindex $font [incr pos]]
set pos [lsearch $font -size]
set _TixConsole(size) [lindex $font [incr pos]]
set pos [lsearch $font -weight]
set _TixConsole(weight) [lindex $font [incr pos]]
set allowed {System Fixedsys Terminal {MS Serif}
{MS Sans Serif} Courier {Lucida Console} Tahoma
Arial {Courier New} {Times New Roman}
{Arial Black} Verdana Garamond {Arial Narrow}}
.menubar.font add cascade -label Font -menu $m.font
menu $m.font -tearoff 0
foreach font [lsort [font families]] {
if {[lsearch $allowed $font] < 0} {continue}
$m.font add radiobutton -label $font \
-variable _TixConsole(font) \
-value $font \
-command \
".console configure -font \"\{$font\} \$_TixConsole(size) \$_TixConsole(weight)\""
}
.menubar.font add cascade -label Size -menu $m.size
menu $m.size -tearoff 0
foreach size {8 9 10 12 14 16 18} {
$m.size add radiobutton -label $size \
-variable _TixConsole(size) \
-value $size \
-command \
".console configure -font \"\{\$_TixConsole(font)\} $size \$_TixConsole(weight)\""
}
.menubar.font add cascade -label Weight -menu $m.weight
menu $m.weight -tearoff 0
foreach weight {normal bold} {
$m.weight add radiobutton -label [string totit $weight] \
-variable _TixConsole(weight) \
-value $weight \
-command \
".console configure -font \"\{\$_TixConsole(font)\} \$_TixConsole(size) $weight\""
}
}
}
}
Tix8.4.3/WInfo.tcl 0000644 00000001705 15173441414 0007440 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: WInfo.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# WInfo.tcl --
#
# This file implements the command tixWInfo, which return various
# information about a Tix widget.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
proc tixWInfo {option w} {
upvar #0 $w data
case $option {
tix {
# Is this a Tix widget?
#
return [info exists data(className)]
}
compound {
# Is this a compound widget?
# Currently this is the same as "tixWinfo tix" because only
# Tix compilant compound widgets are supported
return [info exists data(className)]
}
class {
if {[info exists data(className)]} {
return $data(className)
} else {
return ""
}
}
}
}
Tix8.4.3/license.terms 0000644 00000005414 15173441414 0010411 0 ustar 00 Copyright (c) 1993-1999 Ioi Kim Lam.
Copyright (c) 2000-2001 Tix Project Group.
Copyright (c) 2004 ActiveState
This software is copyrighted by the above entities
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.
----------------------------------------------------------------------
Parts of this software are based on the Tcl/Tk software copyrighted by
the Regents of the University of California, Sun Microsystems, Inc.,
and other parties. The original license terms of the Tcl/Tk software
distribution is included in the file docs/license.tcltk.
Parts of this software are based on the HTML Library software
copyrighted by Sun Microsystems, Inc. The original license terms of
the HTML Library software distribution is included in the file
docs/license.html_lib.
Tix8.4.3/Compat.tcl 0000644 00000001546 15173441414 0007644 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Compat.tcl,v 1.3 2004/03/28 02:44:57 hobbs Exp $
#
# Compat.tcl --
#
# This file wraps around many incompatibilities from Tix 3.6
# to Tix 4.0.
#
# (1) "box" to "Box" changes
# (2) "DlgBtns" to "ButtonBox" changes
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
foreach {old new} {
tixDlgBtns tixButtonBox
tixStdDlgBtns tixStdButtonBox
tixCombobox tixComboBox
tixFileSelectbox tixFileSelectBox
tixScrolledListbox tixScrolledListBox
} {
interp alias {} $old {} $new
}
proc tixInit {args} {
eval tix config $args
puts stderr "tixInit no longer needed for this version of Tix"
}
Tix8.4.3/STList.tcl 0000644 00000004574 15173441414 0007607 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: STList.tcl,v 1.4 2001/12/09 05:04:02 idiscovery Exp $
#
# STList.tcl --
#
# This file implements Scrolled TList widgets
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixScrolledTList {
-classname TixScrolledTList
-superclass tixScrolledWidget
-method {
}
-flag {
}
-configspec {
}
-default {
{.scrollbar auto}
{*borderWidth 1}
{*tlist.background #c3c3c3}
{*tlist.highlightBackground #d9d9d9}
{*tlist.relief sunken}
{*tlist.takeFocus 1}
{*Scrollbar.takeFocus 0}
}
}
proc tixScrolledTList:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:tlist) \
[tixTList $w.tlist]
set data(w:hsb) \
[scrollbar $w.hsb -orient horizontal]
set data(w:vsb) \
[scrollbar $w.vsb -orient vertical ]
set data(pw:client) $data(w:tlist)
}
proc tixScrolledTList:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:tlist) config \
-xscrollcommand "$data(w:hsb) set"\
-yscrollcommand "$data(w:vsb) set"\
-sizecmd [list tixScrolledWidget:Configure $w]
$data(w:hsb) config -command "$data(w:tlist) xview"
$data(w:vsb) config -command "$data(w:tlist) yview"
}
#----------------------------------------------------------------------
#
# option configs
#----------------------------------------------------------------------
proc tixScrolledTList:config-takefocus {w value} {
upvar #0 $w data
$data(w:tlist) config -takefocus $value
}
#----------------------------------------------------------------------
#
# Widget commands
#----------------------------------------------------------------------
#----------------------------------------------------------------------
#
# Private Methods
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#----------------------------------------------------------------------
proc tixScrolledTList:GeometryInfo {w mW mH} {
upvar #0 $w data
return [$data(w:tlist) geometryinfo $mW $mH]
}
Tix8.4.3/ChkList.tcl 0000644 00000011737 15173441414 0007765 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: ChkList.tcl,v 1.6 2004/03/28 02:44:57 hobbs Exp $
#
# ChkList.tcl --
#
# This file implements the TixCheckList widget.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixCheckList {
-classname TixCheckList
-superclass tixTree
-method {
getselection getstatus setstatus
}
-flag {
-radio
}
-configspec {
{-radio radio Radio false tixVerifyBoolean}
{-ignoreinvoke ignoreInvoke IgnoreInvoke true tixVerifyBoolean}
}
-static {
-radio
}
-default {
{.scrollbar auto}
{.doubleClick false}
{*Scrollbar.takeFocus 0}
{*borderWidth 1}
{*hlist.background #c3c3c3}
{*hlist.drawBranch 1}
{*hlist.height 10}
{*hlist.highlightBackground #d9d9d9}
{*hlist.indicator 1}
{*hlist.indent 20}
{*hlist.itemType imagetext}
{*hlist.padX 3}
{*hlist.padY 0}
{*hlist.relief sunken}
{*hlist.takeFocus 1}
{*hlist.wideSelection 0}
{*hlist.width 20}
}
}
proc tixCheckList:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
if {$data(-radio)} {
set data(selected) ""
}
}
#----------------------------------------------------------------------
#
# Widget commands
#
#----------------------------------------------------------------------
# Helper function for getselection
#
proc tixCheckList:GetSel {w var ent mode} {
upvar #0 $w data
upvar $var img
set ents ""
catch {
if {[$data(w:hlist) entrycget $ent -bitmap] eq $img($mode)} {
lappend ents $ent
}
}
foreach child [$data(w:hlist) info children $ent] {
set ents [concat $ents [tixCheckList:GetSel $w img $child $mode]]
}
return $ents
}
# Mode can be on, off, default
#
proc tixCheckList:getselection {w {mode on}} {
upvar #0 $w data
set img(on) [tix getbitmap ck_on]
set img(off) [tix getbitmap ck_off]
set img(default) [tix getbitmap ck_def]
set ents ""
foreach child [$data(w:hlist) info children] {
set ents [concat $ents [tixCheckList:GetSel $w img $child $mode]]
}
return $ents
}
proc tixCheckList:getstatus {w ent} {
upvar #0 $w data
if {[$data(w:hlist) entrycget $ent -itemtype] eq "imagetext"} {
set img(on) [tix getbitmap ck_on]
set img(off) [tix getbitmap ck_off]
set img(default) [tix getbitmap ck_def]
set bitmap [$data(w:hlist) entrycget $ent -bitmap]
if {$bitmap eq $img(on)} {
set status on
}
if {$bitmap eq $img(off)} {
set status off
}
if {$bitmap eq $img(default)} {
set status default
}
}
if {[info exists status]} {
return $status
} else {
return "none"
}
}
proc tixCheckList:setstatus {w ent {mode on}} {
upvar #0 $w data
if {$data(-radio)} {
set status [tixCheckList:getstatus $w $ent]
if {$status eq $mode} {
return
}
if {$mode eq "on"} {
if {$data(selected) != ""} {
tixCheckList:Select $w $data(selected) off
}
set data(selected) $ent
tixCheckList:Select $w $ent $mode
} elseif {$mode eq "off"} {
if {$data(selected) eq $ent} {
return
}
tixCheckList:Select $w $ent $mode
} else {
tixCheckList:Select $w $ent $mode
}
} else {
tixCheckList:Select $w $ent $mode
}
}
proc tixCheckList:Select {w ent mode} {
upvar #0 $w data
if {[$data(w:hlist) entrycget $ent -itemtype] eq "imagetext"} {
set img(on) ck_on
set img(off) ck_off
set img(default) ck_def
if [catch {
set bitmap [tix getbitmap $img($mode)]
$data(w:hlist) entryconfig $ent -bitmap $bitmap
}] {
# must be the "none" mode
#
catch {
$data(w:hlist) entryconfig $ent -bitmap ""
}
}
}
return $mode
}
proc tixCheckList:HandleCheck {w ent} {
upvar #0 $w data
if {[$data(w:hlist) entrycget $ent -itemtype] eq "imagetext"} {
set img(on) [tix getbitmap ck_on]
set img(off) [tix getbitmap ck_off]
set img(default) [tix getbitmap ck_def]
set curMode [tixCheckList:getstatus $w $ent]
case $curMode {
on {
tixCheckList:setstatus $w $ent off
}
off {
tixCheckList:setstatus $w $ent on
}
none {
return
}
default {
tixCheckList:setstatus $w $ent on
}
}
}
}
proc tixCheckList:Command {w B} {
upvar #0 $w data
upvar $B bind
set ent [tixEvent flag V]
tixCheckList:HandleCheck $w $ent
tixChainMethod $w Command $B
}
proc tixCheckList:BrowseCmd {w B} {
upvar #0 $w data
upvar $B bind
set ent [tixEvent flag V]
case [tixEvent type] {
{<ButtonPress-1> <space>} {
tixCheckList:HandleCheck $w $ent
}
}
tixChainMethod $w BrowseCmd $B
}
Tix8.4.3/StdShell.tcl 0000644 00000002225 15173441414 0010136 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: StdShell.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# StdShell.tcl --
#
# Standard Dialog Shell.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixStdDialogShell {
-classname TixStdDialogShell
-superclass tixDialogShell
-method {}
-flag {
-cached
}
-configspec {
{-cached cached Cached ""}
}
}
proc tixStdDialogShell:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:btns) [tixStdButtonBox $w.btns]
set data(w_tframe) [frame $w.tframe]
pack $data(w_tframe) -side top -expand yes -fill both
pack $data(w:btns) -side bottom -fill both
tixCallMethod $w ConstructTopFrame $data(w_tframe)
}
# Subclasses of StdDialogShell should override this method instead of
# ConstructWidget.
#
# Override : always
# chain : before
proc tixStdDialogShell:ConstructTopFrame {w frame} {
# Do nothing
}
Tix8.4.3/SWidget.tcl 0000644 00000023024 15173441414 0007762 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: SWidget.tcl,v 1.5 2002/01/24 09:13:58 idiscovery Exp $
#
# SWidget.tcl --
#
# tixScrolledWidget: virtual base class. Do not instantiate
# This is the core class for all scrolled widgets.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixScrolledWidget {
-virtual true
-classname TixScrolledWidget
-superclass tixPrimitive
-method {
}
-flag {
-scrollbar -scrollbarspace
}
-configspec {
{-scrollbar scrollbar Scrollbar both}
{-scrollbarspace scrollbarSpace ScrollbarSpace {both}}
{-sizebox sizeBox SizeBox 0}
}
}
proc tixScrolledWidget:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(x,first) 0
set data(x,last) 0
set data(y,first) 0
set data(y,last) 0
set data(lastSpec) ""
set data(lastMW) ""
set data(lastMH) ""
set data(lastScbW) ""
set data(lastScbH) ""
set data(repack) 0
set data(counter) 0
set data(vsbPadY) 0
set data(hsbPadX) 0
}
proc tixScrolledWidget:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
tixManageGeometry $data(pw:client) "tixScrolledWidget:ClientGeomProc $w"
bind $data(pw:client) <Configure> \
[list tixScrolledWidget:ClientGeomProc $w "" $data(pw:client)]
tixManageGeometry $data(w:hsb) "tixScrolledWidget:ClientGeomProc $w"
bind $data(w:hsb) <Configure> \
[list tixScrolledWidget:ClientGeomProc $w "" $data(w:hsb)]
tixManageGeometry $data(w:vsb) "tixScrolledWidget:ClientGeomProc $w"
bind $data(w:vsb) <Configure> \
[list tixScrolledWidget:ClientGeomProc $w "" $data(w:vsb)]
bind $w <Configure> "tixScrolledWidget:MasterGeomProc $w"
tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
set data(repack) 1
}
proc tixScrolledWidget:config-scrollbar {w value} {
upvar #0 $w data
global tcl_platform
if {[lindex $value 0] == "auto"} {
foreach xspec [lrange $value 1 end] {
case $xspec {
{+x -x +y -y} {}
default {
error "bad -scrollbar value \"$value\""
}
}
}
} else {
case $value in {
{none x y both} {}
default {
error "bad -scrollbar value \"$value\""
}
}
}
if {$data(-sizebox) && $tcl_platform(platform) == "windows"} {
set data(-scrollbar) both
}
if {$data(repack) == 0} {
set data(repack) 1
tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
}
}
proc tixScrolledWidget:config-scrollbarspace {w value} {
upvar #0 $w data
if {$data(repack) == 0} {
set data(repack) 1
tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
}
}
proc tixScrolledWidget:config-sizebox {w value} {
error "unimplemented"
}
#----------------------------------------------------------------------
#
# Scrollbar calculations
#
#----------------------------------------------------------------------
proc tixScrolledWidget:ClientGeomProc {w type client} {
upvar #0 $w data
if {$data(repack) == 0} {
set data(repack) 1
tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
}
}
proc tixScrolledWidget:MasterGeomProc {w} {
upvar #0 $w data
if {$data(repack) == 0} {
set data(repack) 1
tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
}
}
proc tixScrolledWidget:Configure {w} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
if {$data(repack) == 0} {
set data(repack) 1
tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
}
}
proc tixScrolledWidget:ScrollCmd {w scrollbar axis first last} {
upvar #0 $w data
$scrollbar set $first $last
}
# Show or hide the scrollbars as required.
#
# spec: 00 = need none
# spec: 01 = need y
# spec: 10 = need x
# spec: 11 = need xy
#
proc tixScrolledWidget:Repack {w} {
tixCallMethod $w RepackHook
}
proc tixScrolledWidget:RepackHook {w} {
upvar #0 $w data
global tcl_platform
if {![winfo exists $w]} {
# This was generated by the <Destroy> event
#
return
}
set client $data(pw:client)
# Calculate the size of the master
#
set mreqw [winfo reqwidth $w]
set mreqh [winfo reqheight $w]
set creqw [winfo reqwidth $client]
set creqh [winfo reqheight $client]
set scbW [winfo reqwidth $w.vsb]
set scbH [winfo reqheight $w.hsb]
case $data(-scrollbarspace) {
"x" {
incr creqh $scbH
}
"y" {
incr creqw $scbW
}
"both" {
incr creqw $scbW
incr creqh $scbH
}
}
if {$data(-width) != 0} {
set creqw $data(-width)
}
if {$data(-height) != 0} {
set creqh $data(-height)
}
if {$mreqw != $creqw || $mreqh != $creqh } {
if {![info exists data(counter)]} {
set data(counter) 0
}
if {$data(counter) < 50} {
incr data(counter)
tixGeometryRequest $w $creqw $creqh
tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
set data(repack) 1
return
}
}
set data(counter) 0
set mw [winfo width $w]
set mh [winfo height $w]
set cw [expr $mw - $scbW]
set ch [expr $mh - $scbH]
set scbx [expr $mw - $scbW]
set scby [expr $mh - $scbH]
# Check the validity of the sizes: if window was not mapped then
# sizes will be below 1x1
if {$cw < 1} {
set cw 1
}
if {$ch < 1} {
set ch 1
}
if {$scbx < 1} {
set scbx 1
}
if {$scby < 1} {
set scby 1
}
if {[lindex $data(-scrollbar) 0] == "auto"} {
# Find out how we are going to pack the scrollbars
#
set spec [tixScrolledWidget:CheckScrollbars $w $scbW $scbH]
foreach xspec [lrange $data(-scrollbar) 1 end] {
case $xspec {
+x {
set spec [expr $spec | 10]
}
-x {
set spec [expr $spec & 01]
}
+y {
set spec [expr $spec | 01]
}
-y {
set spec [expr $spec & 10]
}
}
}
if {$spec == 0} {
set spec 00
}
if {$spec == 1} {
set spec 01
}
} else {
case $data(-scrollbar) in {
none {
set spec 00
}
x {
set spec 10
}
y {
set spec 01
}
both {
set spec 11
}
}
}
if {$data(lastSpec)==$spec && $data(lastMW)==$mw && $data(lastMH)==$mh} {
if {$data(lastScbW) == $scbW && $data(lastScbH) == $scbH} {
tixCallMethod $w PlaceWindow
set data(repack) 0
return
}
}
set vsbH [expr $mh - $data(vsbPadY)]
set hsbW [expr $mw - $data(hsbPadX)]
if {$vsbH < 1} {
set vsbH 1
}
if {$hsbW < 1} {
set hsbW 1
}
case $spec in {
"00" {
tixMoveResizeWindow $client 0 0 $mw $mh
tixMapWindow $client
tixUnmapWindow $data(w:hsb)
tixUnmapWindow $data(w:vsb)
}
"01" {
tixMoveResizeWindow $client 0 0 $cw $mh
tixMoveResizeWindow $data(w:vsb) $scbx $data(vsbPadY) $scbW $vsbH
tixMapWindow $client
tixUnmapWindow $data(w:hsb)
tixMapWindow $data(w:vsb)
}
"10" {
tixMoveResizeWindow $client 0 0 $mw $ch
tixMoveResizeWindow $data(w:hsb) $data(hsbPadX) $scby $hsbW $scbH
tixMapWindow $client
tixMapWindow $data(w:hsb)
tixUnmapWindow $data(w:vsb)
}
"11" {
set vsbH [expr $ch - $data(vsbPadY)]
set hsbW [expr $cw - $data(hsbPadX)]
if {$vsbH < 1} {
set vsbH 1
}
if {$hsbW < 1} {
set hsbW 1
}
tixMoveResizeWindow $client 0 0 $cw $ch
tixMoveResizeWindow $data(w:vsb) $scbx $data(vsbPadY) $scbW $vsbH
tixMoveResizeWindow $data(w:hsb) $data(hsbPadX) $scby $hsbW $scbH
if {$data(-sizebox) && $tcl_platform(platform) == "windows"} {
tixMoveResizeWindow $data(w:sizebox) $scbx $scby $scbW $scbH
}
tixMapWindow $client
tixMapWindow $data(w:hsb)
tixMapWindow $data(w:vsb)
if {$data(-sizebox) && $tcl_platform(platform) == "windows"} {
tixMapWindow $data(w:sizebox)
}
}
}
set data(lastSpec) $spec
set data(lastMW) $mw
set data(lastMH) $mh
set data(lastScbW) $scbW
set data(lastScbH) $scbH
tixCallMethod $w PlaceWindow
set data(repack) 0
}
proc tixScrolledWidget:PlaceWindow {w} {
# virtual base function
}
#
# Helper function
#
proc tixScrolledWidget:NeedScrollbar {w axis} {
upvar #0 $w data
if {$data($axis,first) > 0.0} {
return 1
}
if {$data($axis,last) < 1.0} {
return 1
}
return 0
}
# Return whether H and V needs scrollbars in a list of two booleans
#
#
proc tixScrolledWidget:CheckScrollbars {w scbW scbH} {
upvar #0 $w data
set mW [winfo width $w]
set mH [winfo height $w]
set info [tixCallMethod $w GeometryInfo $mW $mH]
if {$info != ""} {
set xSpec [lindex $info 0]
set ySpec [lindex $info 1]
set data(x,first) [lindex $xSpec 0]
set data(x,last) [lindex $xSpec 1]
set data(y,first) [lindex $ySpec 0]
set data(y,last) [lindex $ySpec 1]
}
set needX [tixScrolledWidget:NeedScrollbar $w x]
set needY [tixScrolledWidget:NeedScrollbar $w y]
if {[winfo ismapped $w]==0} {
return "$needX$needY"
}
if {$needX && $needY} {
return 11
}
if {$needX == 0 && $needY == 0} {
return 00
}
if {$needX} {
set mH [expr $mH - $scbH]
}
if {$needY} {
set mW [expr $mW - $scbW]
}
set info [tixCallMethod $w GeometryInfo $mW $mH]
if {$info != ""} {
set xSpec [lindex $info 0]
set ySpec [lindex $info 1]
set data(x,first) [lindex $xSpec 0]
set data(x,last) [lindex $xSpec 1]
set data(y,first) [lindex $ySpec 0]
set data(y,last) [lindex $ySpec 1]
}
set needX [tixScrolledWidget:NeedScrollbar $w x]
set needY [tixScrolledWidget:NeedScrollbar $w y]
return "$needX$needY"
}
Tix8.4.3/PanedWin.tcl 0000644 00000067273 15173441414 0010137 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: PanedWin.tcl,v 1.7 2004/03/28 02:44:57 hobbs Exp $
#
# PanedWin.tcl --
#
# This file implements the TixPanedWindow widget
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixPanedWindow {
-classname TixPanedWindow
-superclass tixPrimitive
-method {
add delete forget manage panecget paneconfigure panes setsize
}
-flag {
-command -dynamicgeometry -handleactivebg -handlebg -orient
-orientation -panebd -paneborderwidth -panerelief
-separatoractivebg -separatorbg
}
-static {
-orientation
}
-configspec {
{-command command Command ""}
{-dynamicgeometry dynamicGeometry DynamicGeometry 1 tixVerifyBoolean}
{-handleactivebg handleActiveBg HandleActiveBg #ececec}
{-handlebg handleBg Background #d9d9d9}
{-orientation orientation Orientation vertical}
{-paneborderwidth paneBorderWidth PaneBorderWidth 1}
{-panerelief paneRelief PaneRelief raised}
{-separatoractivebg separatorActiveBg SeparatorActiveBg red}
{-separatorbg separatorBg Background #d9d9d9}
}
-alias {
{-panebd -paneborderwidth}
{-orient -orientation}
}
}
#----------------------------------------------------------------------
# ClassInitialization:
#----------------------------------------------------------------------
proc tixPanedWindow:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(items) ""
set data(nItems) 0
set data(totalsize) 0
set data(movePending) 0
set data(repack) 0
set data(counter) 0
set data(maxReqW) 1
set data(maxReqH) 1
}
proc tixPanedWindow:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
# Do nothing
}
proc tixPanedWindow:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
bind $w <Configure> [list tixPanedWindow:MasterGeomProc $w ""]
}
#----------------------------------------------------------------------
# ConfigOptions:
#----------------------------------------------------------------------
proc tixPanedWindow:config-handlebg {w arg} {
upvar #0 $w data
for {set i 1} {$i < $data(nItems)} {incr i} {
$data(btn,$i) config -bg $arg
}
}
#----------------------------------------------------------------------
# PublicMethods:
#----------------------------------------------------------------------
# method: add
#
# Adds a new pane into the PanedWindow.
#
# options -size -max -min -allowresize
#
proc tixPanedWindow:add {w name args} {
upvar #0 $w data
if {[winfo exists $w.$name] && !$data($name,forgotten)} {
error "Pane $name is already managed"
}
# Step 1: Parse the options to get the children's size options
# The default values
#
if {[info exists data($name,forgotten)]} {
set option(-size) $data($name,size)
set option(-min) $data($name,min)
set option(-max) $data($name,max)
set option(-allowresize) $data($name,allowresize)
set option(-expand) $data($name,expand)
} else {
set option(-size) 0
set option(-min) 0
set option(-max) 100000
set option(-allowresize) 1
set option(-expand) 0
}
set option(-before) ""
set option(-after) ""
set option(-at) ""
set validOpts {-after -allowresize -at -before -expand -max -min -size}
tixHandleOptions option $validOpts $args
set data($name,size) $option(-size)
set data($name,rsize) $option(-size)
set data($name,min) $option(-min)
set data($name,max) $option(-max)
set data($name,allowresize) $option(-allowresize)
set data($name,expand) $option(-expand)
set data($name,forgotten) 0
if {$data($name,expand) < 0} {
set data($name,expand) 0
}
# Step 2: Add the frame and the separator (if necessary)
#
if {![winfo exist $w.$name]} {
# need to check because the frame may have been "forget'ten"
#
frame $w.$name -bd $data(-paneborderwidth) -relief $data(-panerelief)
}
if {$option(-at) != ""} {
set at [tixGetInt $option(-at)]
if {$at < 0} {
set at 0
}
} elseif {$option(-after) != ""} {
set index [lsearch -exact $data(items) $option(-after)]
if {$index == -1} {
error "Pane $option(-after) doesn't exists"
} else {
set at [incr index]
}
} elseif {$option(-before) != ""} {
set index [lsearch -exact $data(items) $option(-before)]
if {$index == -1} {
error "Pane $option(-before) doesn't exists"
}
set at $index
} else {
set at end
}
set data(items) [linsert $data(items) $at $name]
incr data(nItems)
if {$data(nItems) > 1} {
tixPanedWindow:AddSeparator $w
}
set data(w:$name) $w.$name
# Step 3: Add the new frame. Adjust the window later (do when idle)
#
tixManageGeometry $w.$name [list tixPanedWindow:ClientGeomProc $w]
bind $w.$name <Configure> \
[list tixPanedWindow:ClientGeomProc $w "" $w.$name]
tixPanedWindow:RepackWhenIdle $w
return $w.$name
}
proc tixPanedWindow:manage {w name args} {
upvar #0 $w data
if {![winfo exists $w.$name]} {
error "Pane $name does not exist"
}
if {!$data($name,forgotten)} {
error "Pane $name is already managed"
}
tixMapWindow $data(w:$name)
eval tixPanedWindow:add $w [list $name] $args
}
proc tixPanedWindow:forget {w name} {
upvar #0 $w data
if {![winfo exists $w.$name]} {
error "Pane $name does not exist"
}
if $data($name,forgotten) {
# It has already been forgotten
#
return
}
set items ""
foreach item $data(items) {
if {$item != $name} {
lappend items $item
}
}
set data(items) $items
incr data(nItems) -1
set i $data(nItems)
if {$i > 0} {
destroy $data(btn,$i)
destroy $data(sep,$i)
unset data(btn,$i)
unset data(sep,$i)
}
set data($name,forgotten) 1
tixUnmapWindow $w.$name
tixPanedWindow:RepackWhenIdle $w
}
proc tixPanedWindow:delete {w name} {
upvar #0 $w data
if {![winfo exists $w.$name]} {
error "Pane $name does not exist"
}
if {!$data($name,forgotten)} {
set items ""
foreach item $data(items) {
if {$item != $name} {
lappend items $item
}
}
set data(items) $items
incr data(nItems) -1
set i $data(nItems)
if {$i > 0} {
destroy $data(btn,$i)
destroy $data(sep,$i)
unset data(btn,$i)
unset data(sep,$i)
}
}
unset data($name,allowresize)
unset data($name,expand)
unset data($name,forgotten)
unset data($name,max)
unset data($name,min)
unset data($name,rsize)
unset data($name,size)
unset data(w:$name)
destroy $w.$name
tixPanedWindow:RepackWhenIdle $w
}
proc tixPanedWindow:paneconfigure {w name args} {
upvar #0 $w data
if {![info exists data($name,size)]} {
error "pane \"$name\" does not exist in $w"
}
set len [llength $args]
if {$len == 0} {
set value [$data(w:$name) configure]
lappend value [list -allowresize "" "" "" $data($name,allowresize)]
lappend value [list -expand "" "" "" $data($name,expand)]
lappend value [list -max "" "" "" $data($name,max)]
lappend value [list -min "" "" "" $data($name,min)]
lappend value [list -size "" "" "" $data($name,size)]
return $value
}
if {$len == 1} {
case [lindex $args 0] {
-allowresize {
return [list -allowresize "" "" "" $data($name,allowresize)]
}
-expand {
return [list -expand "" "" "" $data($name,expand)]
}
-min {
return [list -min "" "" "" $data($name,min)]
}
-max {
return [list -max "" "" "" $data($name,max)]
}
-size {
return [list -size "" "" "" $data($name,size)]
}
default {
return [$data(w:$name) configure [lindex $args 0]]
}
}
}
# By default handle each of the options
#
set option(-allowresize) $data($name,allowresize)
set option(-expand) $data($name,expand)
set option(-min) $data($name,min)
set option(-max) $data($name,max)
set option(-size) $data($name,size)
tixHandleOptions -nounknown option {-allowresize -expand -max -min -size} \
$args
#
# the widget options
set new_args ""
foreach {flag value} $args {
case $flag {
{-expand -min -max -allowresize -size} {
}
default {
lappend new_args $flag
lappend new_args $value
}
}
}
if {[llength $new_args] >= 2} {
eval $data(w:$name) configure $new_args
}
#
# The add-on options
set data($name,allowresize) $option(-allowresize)
set data($name,expand) $option(-expand)
set data($name,max) $option(-max)
set data($name,min) $option(-min)
set data($name,rsize) $option(-size)
set data($name,size) $option(-size)
#
# Integrity check
if {$data($name,expand) < 0} {
set data($name,expand) 0
}
if {$data($name,size) < $data($name,min)} {
set data($name,size) $data($name,min)
}
if {$data($name,size) > $data($name,max)} {
set data($name,size) $data($name,max)
}
tixPanedWindow:RepackWhenIdle $w
return ""
}
proc tixPanedWindow:panecget {w name option} {
upvar #0 $w data
if {![info exists data($name,size)]} {
error "pane \"$name\" does not exist in $w"
}
case $option {
{-min -max -allowresize -size} {
regsub \\\- $option "" option
return "$data($name,$option)"
}
default {
return [$data(w:$name) cget $option]
}
}
}
# return the name of all panes
proc tixPanedWindow:panes {w} {
upvar #0 $w data
return $data(items)
}
# set the size of a pane, specifying which direction it should
# grow/shrink
proc tixPanedWindow:setsize {w item size {direction next}} {
upvar #0 $w data
set posn [lsearch $data(items) $item]
if {$posn == -1} {
error "pane \"$item\" does not exist"
}
set diff [expr {$size - $data($item,size)}]
if {$diff == 0} {
return
}
if {$posn == 0 && $direction eq "prev"} {
set direction next
}
if {$posn == $data(nItems)-1 && $direction eq "next"} {
set direction prev
}
if {$data(-orientation) eq "vertical"} {
set rx [winfo rooty $data(w:$item)]
} else {
set rx [winfo rootx $data(w:$item)]
}
if {$direction eq "prev"} {
set rx [expr {$rx - $diff}]
} elseif {$data(-orientation) eq "vertical"} {
set rx [expr {$rx + [winfo height $data(w:$item)] + $diff}]
incr posn
} else {
set rx [expr {$rx + [winfo width $data(w:$item)] + $diff}]
incr posn
}
# Set up the panedwin in a proper state
#
tixPanedWindow:BtnDown $w $posn 1
tixPanedWindow:BtnMove $w $posn $rx 1
tixPanedWindow:BtnUp $w $posn 1
return $data(items)
}
#----------------------------------------------------------------------
# PrivateMethods:
#----------------------------------------------------------------------
proc tixPanedWindow:AddSeparator {w} {
global tcl_platform
upvar #0 $w data
set n [expr {$data(nItems)-1}]
# CYGNUS: On Windows, use relief ridge and a thicker line.
if {$tcl_platform(platform) eq "windows"} then {
set relief "ridge"
set thickness 4
} else {
set relief "sunken"
set thickness 2
}
if {$data(-orientation) eq "vertical"} {
set data(sep,$n) [frame $w.sep$n -relief $relief \
-bd 1 -height $thickness -width 10000 -bg $data(-separatorbg)]
} else {
set data(sep,$n) [frame $w.sep$n -relief $relief \
-bd 1 -width $thickness -height 10000 -bg $data(-separatorbg)]
}
set data(btn,$n) [frame $w.btn$n -relief raised \
-bd 1 -width 9 -height 9 \
-bg $data(-handlebg)]
if {$data(-orientation) eq "vertical"} {
set cursor sb_v_double_arrow
} else {
set cursor sb_h_double_arrow
}
$data(sep,$n) config -cursor $cursor
$data(btn,$n) config -cursor $cursor
foreach wid [list $data(btn,$n) $data(sep,$n)] {
bind $wid \
<ButtonPress-1> [list tixPanedWindow:BtnDown $w $n]
bind $wid \
<ButtonRelease-1> [list tixPanedWindow:BtnUp $w $n]
bind $wid \
<Any-Enter> [list tixPanedWindow:HighlightBtn $w $n]
bind $wid \
<Any-Leave> [list tixPanedWindow:DeHighlightBtn $w $n]
}
if {$data(-orientation) eq "vertical"} {
bind $data(btn,$n) <B1-Motion> [list tixPanedWindow:BtnMove $w $n %Y]
} else {
bind $data(btn,$n) <B1-Motion> [list tixPanedWindow:BtnMove $w $n %X]
}
if {$data(-orientation) eq "vertical"} {
# place $data(btn,$n) -relx 0.90 -y [expr "$data(totalsize)-5"]
# place $data(sep,$n) -x 0 -y [expr "$data(totalsize)-1"] -relwidth 1
} else {
# place $data(btn,$n) -rely 0.90 -x [expr "$data(totalsize)-5"]
# place $data(sep,$n) -y 0 -x [expr "$data(totalsize)-1"] -relheight 1
}
}
proc tixPanedWindow:BtnDown {w item {fake 0}} {
upvar #0 $w data
if {$data(-orientation) eq "vertical"} {
set spec -height
} else {
set spec -width
}
if {!$fake} {
for {set i 1} {$i < $data(nItems)} {incr i} {
$data(sep,$i) config -bg $data(-separatoractivebg) $spec 1
}
update idletasks
$data(btn,$item) config -relief sunken
}
tixPanedWindow:GetMotionLimit $w $item $fake
if {!$fake} {
grab -global $data(btn,$item)
}
set data(movePending) 0
}
proc tixPanedWindow:Min2 {a b} {
if {$a < $b} {
return $a
} else {
return $b
}
}
proc tixPanedWindow:GetMotionLimit {w item fake} {
upvar #0 $w data
set curBefore 0
set minBefore 0
set maxBefore 0
for {set i 0} {$i < $item} {incr i} {
set name [lindex $data(items) $i]
incr curBefore $data($name,size)
incr minBefore $data($name,min)
incr maxBefore $data($name,max)
}
set curAfter 0
set minAfter 0
set maxAfter 0
while {$i < $data(nItems)} {
set name [lindex $data(items) $i]
incr curAfter $data($name,size)
incr minAfter $data($name,min)
incr maxAfter $data($name,max)
incr i
}
set beforeToGo [tixPanedWindow:Min2 \
[expr {$curBefore-$minBefore}] \
[expr {$maxAfter-$curAfter}]]
set afterToGo [tixPanedWindow:Min2 \
[expr {$curAfter-$minAfter}] \
[expr {$maxBefore-$curBefore}]]
set data(beforeLimit) [expr {$curBefore-$beforeToGo}]
set data(afterLimit) [expr {$curBefore+$afterToGo}]
set data(curSize) $curBefore
if {!$fake} {
tixPanedWindow:PlotHandles $w 1
}
}
# Compress the motion so that update is quick even on slow machines
#
# rootp = root position (either rootx or rooty)
proc tixPanedWindow:BtnMove {w item rootp {fake 0}} {
upvar #0 $w data
set data(rootp) $rootp
if {$fake} {
tixPanedWindow:BtnMoveCompressed $w $item $fake
} else {
if {$data(movePending) == 0} {
after 2 tixPanedWindow:BtnMoveCompressed $w $item
set data(movePending) 1
}
}
}
proc tixPanedWindow:BtnMoveCompressed {w item {fake 0}} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
if {$data(-orientation) eq "vertical"} {
set p [expr {$data(rootp)-[winfo rooty $w]}]
} else {
set p [expr {$data(rootp)-[winfo rootx $w]}]
}
if {$p == $data(curSize)} {
set data(movePending) 0
return
}
if {$p < $data(beforeLimit)} {
set p $data(beforeLimit)
}
if {$p >= $data(afterLimit)} {
set p $data(afterLimit)
}
tixPanedWindow:CalculateChange $w $item $p $fake
if {!$fake} {
# Force the redraw to happen
#
update idletasks
}
set data(movePending) 0
}
# Calculate the change in response to mouse motions
#
proc tixPanedWindow:CalculateChange {w item p {fake 0}} {
upvar #0 $w data
if {$p < $data(curSize)} {
tixPanedWindow:MoveBefore $w $item $p
} elseif {$p > $data(curSize)} {
tixPanedWindow:MoveAfter $w $item $p
}
if {!$fake} {
tixPanedWindow:PlotHandles $w 1
}
}
proc tixPanedWindow:MoveBefore {w item p} {
upvar #0 $w data
set n [expr {$data(curSize)-$p}]
# Shrink the frames before
#
set from [expr {$item-1}]
set to 0
tixPanedWindow:Iterate $w $from $to tixPanedWindow:Shrink $n
# Adjust the frames after
#
set from $item
set to [expr {$data(nItems)-1}]
tixPanedWindow:Iterate $w $from $to tixPanedWindow:Grow $n
set data(curSize) $p
}
proc tixPanedWindow:MoveAfter {w item p} {
upvar #0 $w data
set n [expr {$p-$data(curSize)}]
# Shrink the frames after
#
set from $item
set to [expr {$data(nItems)-1}]
tixPanedWindow:Iterate $w $from $to tixPanedWindow:Shrink $n
# Graw the frame before
#
set from [expr {$item-1}]
set to 0
tixPanedWindow:Iterate $w $from $to tixPanedWindow:Grow $n
set data(curSize) $p
}
proc tixPanedWindow:CancleLines {w} {
upvar #0 $w data
if {[info exists data(lines)]} {
foreach line $data(lines) {
set x1 [lindex $line 0]
set y1 [lindex $line 1]
set x2 [lindex $line 2]
set y2 [lindex $line 3]
tixTmpLine $x1 $y1 $x2 $y2 $w
}
catch {unset data(lines)}
}
}
proc tixPanedWindow:PlotHandles {w transient} {
global tcl_platform
upvar #0 $w data
set totalsize 0
set i 0
if {$data(-orientation) eq "vertical"} {
set btnp [expr {[winfo width $w]-13}]
} else {
set h [winfo height $w]
if {$h > 18} {
set btnp 9
} else {
set btnp [expr {$h-9}]
}
}
set firstpane [lindex $data(items) 0]
set totalsize $data($firstpane,size)
if {$transient} {
tixPanedWindow:CancleLines $w
set data(lines) ""
}
for {set i 1} {$i < $data(nItems)} {incr i} {
if {! $transient} {
if {$data(-orientation) eq "vertical"} {
place $data(btn,$i) -x $btnp -y [expr {$totalsize-4}]
place $data(sep,$i) -x 0 -y [expr {$totalsize-1}] -relwidth 1
} else {
place $data(btn,$i) -y $btnp -x [expr {$totalsize-5}]
place $data(sep,$i) -y 0 -x [expr {$totalsize-1}] -relheight 1
}
} else {
if {$data(-orientation) eq "vertical"} {
set x1 [winfo rootx $w]
set x2 [expr {$x1 + [winfo width $w]}]
set y [expr {$totalsize-1+[winfo rooty $w]}]
tixTmpLine $x1 $y $x2 $y $w
lappend data(lines) [list $x1 $y $x2 $y]
} else {
set y1 [winfo rooty $w]
set y2 [expr {$y1 + [winfo height $w]}]
set x [expr {$totalsize-1+[winfo rootx $w]}]
tixTmpLine $x $y1 $x $y2 $w
lappend data(lines) [list $x $y1 $x $y2]
}
}
set name [lindex $data(items) $i]
incr totalsize $data($name,size)
}
}
proc tixPanedWindow:BtnUp {w item {fake 0}} {
upvar #0 $w data
if {!$fake} {
tixPanedWindow:CancleLines $w
}
tixPanedWindow:UpdateSizes $w
if {!$fake} {
$data(btn,$item) config -relief raised
grab release $data(btn,$item)
}
}
proc tixPanedWindow:HighlightBtn {w item} {
upvar #0 $w data
$data(btn,$item) config -background $data(-handleactivebg)
}
proc tixPanedWindow:DeHighlightBtn {w item} {
upvar #0 $w data
$data(btn,$item) config -background $data(-handlebg)
}
#----------------------------------------------------------------------
#
#
# Geometry management routines
#
#
#----------------------------------------------------------------------
# update the sizes of each pane according to the data($name,size) variables
#
proc tixPanedWindow:UpdateSizes {w} {
global tcl_platform
upvar #0 $w data
set data(totalsize) 0
set mw [winfo width $w]
set mh [winfo height $w]
for {set i 0} {$i < $data(nItems)} {incr i} {
set name [lindex $data(items) $i]
if {$data($name,size) > 0} {
if {$data(-orientation) eq "vertical"} {
tixMoveResizeWindow $w.$name 0 $data(totalsize) \
$mw $data($name,size)
tixMapWindow $w.$name
raise $w.$name
} else {
tixMoveResizeWindow $w.$name $data(totalsize) 0 \
$data($name,size) $mh
tixMapWindow $w.$name
raise $w.$name
}
} else {
tixUnmapWindow $w.$name
}
incr data(totalsize) $data($name,size)
}
# Reset the color and width of the separator
#
if {$data(-orientation) eq "vertical"} {
set spec -height
} else {
set spec -width
}
# CYGNUS: On Windows, use a thicker line.
if {$tcl_platform(platform) eq "windows"} then {
set thickness 4
} else {
set thickness 2
}
for {set i 1} {$i < $data(nItems)} {incr i} {
$data(sep,$i) config -bg $data(-separatorbg) $spec $thickness
raise $data(sep,$i)
raise $data(btn,$i)
}
# Invoke the callback command
#
if {$data(-command) != ""} {
set sizes ""
foreach item $data(items) {
lappend sizes $data($item,size)
}
set bind(specs) ""
tixEvalCmdBinding $w $data(-command) bind [list $sizes]
}
}
proc tixPanedWindow:GetNaturalSizes {w} {
upvar #0 $w data
set data(totalsize) 0
set totalreq 0
if {$data(-orientation) eq "vertical"} {
set majorspec height
set minorspec width
} else {
set majorspec width
set minorspec height
}
set minorsize 0
foreach name $data(items) {
if {[winfo manager $w.$name] ne "tixGeometry"} {
error "Geometry management error: pane \"$w.$name\" cannot be managed by \"[winfo manager $w.$name]\"\nhint: delete the line \"[winfo manager $w.$name] $w.$name ...\" from your program"
}
# set the minor size
#
set req_minor [winfo req$minorspec $w.$name]
if {$req_minor > $minorsize} {
set minorsize $req_minor
}
# Check the natural size against the max, min requirements.
# Change the natural size if necessary
#
if {$data($name,size) <= 1} {
set data($name,size) [winfo req$majorspec $w.$name]
}
if {$data($name,size) > 1} {
# If we get zero maybe the widget was not initialized yet ...
#
# %% hazard : what if the window is really 1x1?
#
if {$data($name,size) < $data($name,min)} {
set data($name,size) $data($name,min)
}
if {$data($name,size) > $data($name,max)} {
set data($name,size) $data($name,max)
}
}
# kludge: because a frame always returns req size of {1,1} before
# the packer processes it, we do the following to mark the
# pane as "size unknown"
#
# if {$data($name,size) == 1 && ![winfo ismapped $w.$name]} {
# set data($name,size) 0
# }
# Add up the total size
#
incr data(totalsize) $data($name,size)
# Find out the request size
#
if {$data($name,rsize) == 0} {
set rsize [winfo req$majorspec $w.$name]
} else {
set rsize $data($name,rsize)
}
if {$rsize < $data($name,min)} {
set rsize $data($name,min)
}
if {$rsize > $data($name,max)} {
set rsize $data($name,max)
}
incr totalreq $rsize
}
if {$data(-orientation) eq "vertical"} {
return [list $minorsize $totalreq]
} else {
return [list $totalreq $minorsize]
}
}
#--------------------------------------------------
# Handling resize
#--------------------------------------------------
proc tixPanedWindow:ClientGeomProc {w type client} {
tixPanedWindow:RepackWhenIdle $w
}
#
# This monitor the sizes of the master window
#
proc tixPanedWindow:MasterGeomProc {w master} {
tixPanedWindow:RepackWhenIdle $w
}
proc tixPanedWindow:RepackWhenIdle {w} {
if {![winfo exist $w]} {
return
}
upvar #0 $w data
if {$data(repack) == 0} {
tixWidgetDoWhenIdle tixPanedWindow:Repack $w
set data(repack) 1
}
}
#
# This monitor the sizes of the master window
#
proc tixPanedWindow:Repack {w} {
upvar #0 $w data
# Calculate the desired size of the master
#
set dim [tixPanedWindow:GetNaturalSizes $w]
if {$data(-width) != 0} {
set mreqw $data(-width)
} else {
set mreqw [lindex $dim 0]
}
if {$data(-height) != 0} {
set mreqh $data(-height)
} else {
set mreqh [lindex $dim 1]
}
if !$data(-dynamicgeometry) {
if {$mreqw < $data(maxReqW)} {
set mreqw $data(maxReqW)
}
if {$mreqh < $data(maxReqH)} {
set mreqh $data(maxReqH)
}
set data(maxReqW) $mreqw
set data(maxReqH) $mreqh
}
if {$mreqw != [winfo reqwidth $w] || $mreqh != [winfo reqheight $w] } {
if {![info exists data(counter)]} {
set data(counter) 0
}
if {$data(counter) < 50} {
incr data(counter)
tixGeometryRequest $w $mreqw $mreqh
tixWidgetDoWhenIdle tixPanedWindow:Repack $w
set data(repack) 1
return
}
}
set data(counter) 0
if {$data(nItems) == 0} {
set data(repack) 0
return
}
tixWidgetDoWhenIdle tixPanedWindow:DoRepack $w
}
proc tixPanedWindow:DoRepack {w} {
upvar #0 $w data
if {$data(-orientation) eq "vertical"} {
set newSize [winfo height $w]
} else {
set newSize [winfo width $w]
}
if {$newSize <= 1} {
# Probably this window is too small to see anyway
# %%Kludge: I don't know if this always work.
#
set data(repack) 0
return
}
set totalExp 0
foreach name $data(items) {
set totalExp [expr {$totalExp + $data($name,expand)}]
}
if {$newSize > $data(totalsize)} {
# Grow
#
set toGrow [expr {$newSize-$data(totalsize)}]
set p [llength $data(items)]
foreach name $data(items) {
set toGrow [tixPanedWindow:xGrow $w $name $toGrow $totalExp $p]
if {$toGrow > 0} {
set totalExp [expr {$totalExp-$data($name,expand)}]
incr p -1
} else {
break
}
}
} else {
# Shrink
#
set toShrink [expr {$data(totalsize)-$newSize}]
set usedSize 0
foreach name $data(items) {
set toShrink [tixPanedWindow:xShrink $w $name $toShrink \
$totalExp $newSize $usedSize]
if {$toShrink > 0} {
set totalExp [expr {$totalExp-$data($name,expand)}]
incr usedSize $data($name,size)
} else {
break
}
}
}
tixPanedWindow:UpdateSizes $w
tixPanedWindow:PlotHandles $w 0
set data(repack) 0
}
#--------------------------------------------------
# Shrink and grow items
#--------------------------------------------------
#
# toGrow: how much free area to grow into
# p: == 1 if $name is the last in the list of items
# totalExp: used to calculate the amount of the free area that this
# window can grow into
#
proc tixPanedWindow:xGrow {w name toGrow totalExp p} {
upvar #0 $w data
if {$p == 1} {
set canGrow $toGrow
} else {
if {$totalExp == 0} {
set canGrow 0
} else {
set canGrow [expr {int($toGrow * $data($name,expand) / $totalExp)}]
}
}
if {($canGrow + $data($name,size)) > $data($name,max)} {
set canGrow [expr {$data($name,max) - $data($name,size)}]
}
incr data($name,size) $canGrow
incr toGrow -$canGrow
return $toGrow
}
proc tixPanedWindow:xShrink {w name toShrink totalExp newSize usedSize} {
upvar #0 $w data
if {$totalExp == 0} {
set canShrink 0
} else {
set canShrink [expr {int($toShrink * $data($name,expand) / $totalExp)}]
}
if {$data($name,size) - $canShrink < $data($name,min)} {
set canShrink [expr {$data($name,size) - $data($name,min)}]
}
if {$usedSize + $data($name,size) - $canShrink > $newSize} {
set data($name,size) [expr {$newSize - $usedSize}]
return 0
} else {
incr data($name,size) -$canShrink
incr toShrink -$canShrink
return $toShrink
}
}
#--------------------------------------------------
# Shrink and grow items
#--------------------------------------------------
proc tixPanedWindow:Shrink {w name n} {
upvar #0 $w data
set canShrink [expr {$data($name,size) - $data($name,min)}]
if {$canShrink > $n} {
incr data($name,size) -$n
return 0
} elseif {$canShrink > 0} {
set data($name,size) $data($name,min)
incr n -$canShrink
}
return $n
}
proc tixPanedWindow:Grow {w name n} {
upvar #0 $w data
set canGrow [expr {$data($name,max) - $data($name,size)}]
if {$canGrow > $n} {
incr data($name,size) $n
return 0
} elseif {$canGrow > 0} {
set data($name,size) $data($name,max)
incr n -$canGrow
}
return $n
}
proc tixPanedWindow:Iterate {w from to proc n} {
upvar #0 $w data
if {$from <= $to} {
for {set i $from} {$i <= $to} {incr i} {
set n [$proc $w [lindex $data(items) $i] $n]
if {$n == 0} {
break
}
}
} else {
for {set i $from} {$i >= $to} {incr i -1} {
set n [$proc $w [lindex $data(items) $i] $n]
if {$n == 0} {
break
}
}
}
}
Tix8.4.3/pkgIndex.tcl 0000644 00000000172 15173441414 0010164 0 ustar 00 if {[catch {package require Tcl 8.4}]} return
package ifneeded Tix 8.4.3 \
[list load [file join $dir libTix.so] Tix]
Tix8.4.3/ComboBox.tcl 0000644 00000106657 15173441414 0010142 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: ComboBox.tcl,v 1.9 2008/02/28 22:39:13 hobbs Exp $
#
# tixCombobox --
#
# A combobox widget is basically a listbox widget with an entry
# widget.
#
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
global tkPriv
if {![llength [info globals tkPriv]]} {
tk::unsupported::ExposePrivateVariable tkPriv
}
#--------------------------------------------------------------------------
# tkPriv elements used in this file:
#
# afterId - Token returned by "after" for autoscanning.
#--------------------------------------------------------------------------
#
foreach fun {tkCancelRepeat tkListboxUpDown tkButtonUp} {
if {![llength [info commands $fun]]} {
tk::unsupported::ExposePrivateCommand $fun
}
}
unset fun
tixWidgetClass tixComboBox {
-classname TixComboBox
-superclass tixLabelWidget
-method {
addhistory align appendhistory flash invoke insert pick popdown
}
-flag {
-anchor -arrowbitmap -browsecmd -command -crossbitmap
-disablecallback -disabledforeground -dropdown -editable
-fancy -grab -histlimit -historylimit -history -listcmd
-listwidth -prunehistory -selection -selectmode -state
-tickbitmap -validatecmd -value -variable
}
-static {
-dropdown -fancy
}
-forcecall {
-variable -selectmode -state
}
-configspec {
{-arrowbitmap arrowBitmap ArrowBitmap ""}
{-anchor anchor Anchor w}
{-browsecmd browseCmd BrowseCmd ""}
{-command command Command ""}
{-crossbitmap crossBitmap CrossBitmap ""}
{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
{-disabledforeground disabledForeground DisabledForeground #606060}
{-dropdown dropDown DropDown true tixVerifyBoolean}
{-editable editable Editable false tixVerifyBoolean}
{-fancy fancy Fancy false tixVerifyBoolean}
{-grab grab Grab global}
{-listcmd listCmd ListCmd ""}
{-listwidth listWidth ListWidth ""}
{-historylimit historyLimit HistoryLimit ""}
{-history history History false tixVerifyBoolean}
{-prunehistory pruneHistory PruneHistory true tixVerifyBoolean}
{-selectmode selectMode SelectMode browse}
{-selection selection Selection ""}
{-state state State normal}
{-validatecmd validateCmd ValidateCmd ""}
{-value value Value ""}
{-variable variable Variable ""}
{-tickbitmap tickBitmap TickBitmap ""}
}
-alias {
{-histlimit -historylimit}
}
-default {
{*Entry.relief sunken}
{*TixScrolledListBox.scrollbar auto}
{*Listbox.exportSelection false}
{*Listbox.takeFocus false}
{*shell.borderWidth 2}
{*shell.relief raised}
{*shell.cursor arrow}
{*Button.anchor c}
{*Button.borderWidth 1}
{*Button.highlightThickness 0}
{*Button.padX 0}
{*Button.padY 0}
{*tick.width 18}
{*tick.height 18}
{*cross.width 18}
{*cross.height 18}
{*arrow.anchor c}
{*arrow.width 15}
{*arrow.height 18}
}
}
# States: normal numbers: for dropdown style
# d+digit(s) : for non-dropdown style
#
proc tixComboBox:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(curIndex) ""
set data(varInited) 0
set data(state) none
set data(ignore) 0
if {$data(-history)} {
set data(-editable) 1
}
if {$data(-arrowbitmap) eq ""} {
set data(-arrowbitmap) [tix getbitmap cbxarrow]
}
if {$data(-crossbitmap) eq ""} {
set data(-crossbitmap) [tix getbitmap cross]
}
if {$data(-tickbitmap) eq ""} {
set data(-tickbitmap) [tix getbitmap tick]
}
}
proc tixComboBox:ConstructFramedWidget {w frame} {
upvar #0 $w data
tixChainMethod $w ConstructFramedWidget $frame
if {$data(-dropdown)} {
tixComboBox:ConstructEntryFrame $w $frame
tixComboBox:ConstructListShell $w
} else {
set f1 [frame $frame.f1]
set f2 [frame $frame.f2]
tixComboBox:ConstructEntryFrame $w $f1
tixComboBox:ConstructListFrame $w $f2
pack $f1 -side top -pady 2 -fill x
pack $f2 -side top -pady 2 -fill both -expand yes
}
}
proc tixComboBox:ConstructEntryFrame {w frame} {
upvar #0 $w data
# (1) The entry
#
set data(w:entry) [entry $frame.entry]
if {!$data(-editable)} {
set bg [$w cget -bg]
$data(w:entry) config -bg $bg -state disabled -takefocus 1
}
# This is used during "config-state"
#
set data(entryfg) [$data(w:entry) cget -fg]
# (2) The dropdown button, not necessary when not in dropdown mode
#
set data(w:arrow) [button $frame.arrow -bitmap $data(-arrowbitmap)]
if {!$data(-dropdown)} {
set xframe [frame $frame.xframe -width 19]
}
# (3) The fancy tick and cross buttons
#
if {$data(-fancy)} {
if {$data(-editable)} {
set data(w:cross) [button $frame.cross -bitmap $data(-crossbitmap)]
set data(w:tick) [button $frame.tick -bitmap $data(-tickbitmap)]
pack $frame.cross -side left -padx 1
pack $frame.tick -side left -padx 1
} else {
set data(w:tick) [button $frame.tick -bitmap $data(-tickbitmap)]
pack $frame.tick -side left -padx 1
}
}
if {$data(-dropdown)} {
pack $data(w:arrow) -side right -padx 1
foreach wid [list $data(w:frame) $data(w:label)] {
tixAddBindTag $wid TixComboWid
tixSetMegaWidget $wid $w TixComboBox
}
} else {
pack $xframe -side right -padx 1
}
pack $frame.entry -side right -fill x -expand yes -padx 1
}
proc tixComboBox:ConstructListShell {w} {
upvar #0 $w data
# Create the shell and the list
#------------------------------
set data(w:shell) [menu $w.shell -bd 2 -relief raised -tearoff 0]
wm overrideredirect $data(w:shell) 1
wm withdraw $data(w:shell)
set data(w:slistbox) [tixScrolledListBox $data(w:shell).slistbox \
-anchor $data(-anchor) -scrollbarspace y \
-options {listbox.selectMode "browse"}]
set data(w:listbox) [$data(w:slistbox) subwidget listbox]
pack $data(w:slistbox) -expand yes -fill both -padx 2 -pady 2
}
proc tixComboBox:ConstructListFrame {w frame} {
upvar #0 $w data
set data(w:slistbox) [tixScrolledListBox $frame.slistbox \
-anchor $data(-anchor)]
set data(w:listbox) [$data(w:slistbox) subwidget listbox]
pack $data(w:slistbox) -expand yes -fill both
}
proc tixComboBox:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
# (1) Fix the bindings for the combobox
#
bindtags $w [list $w TixComboBox [winfo toplevel $w] all]
# (2) The entry subwidget
#
tixSetMegaWidget $data(w:entry) $w TixComboBox
bindtags $data(w:entry) [list $data(w:entry) Entry TixComboEntry\
TixComboWid [winfo toplevel $data(w:entry)] all]
# (3) The listbox and slistbox
#
$data(w:slistbox) config -browsecmd \
[list tixComboBox:LbBrowse $w]
$data(w:slistbox) config -command\
[list tixComboBox:LbCommand $w]
$data(w:listbox) config -takefocus 0
tixAddBindTag $data(w:listbox) TixComboLb
tixAddBindTag $data(w:slistbox) TixComboLb
tixSetMegaWidget $data(w:listbox) $w TixComboBox
tixSetMegaWidget $data(w:slistbox) $w TixComboBox
# (4) The buttons
#
if {$data(-dropdown)} {
$data(w:arrow) config -takefocus 0
tixAddBindTag $data(w:arrow) TixComboArrow
tixSetMegaWidget $data(w:arrow) $w TixComboBox
bind $data(w:root) <1> [list tixComboBox:RootDown $w]
bind $data(w:root) <ButtonRelease-1> [list tixComboBox:RootUp $w]
}
if {$data(-fancy)} {
if {$data(-editable)} {
$data(w:cross) config -command [list tixComboBox:CrossBtn $w] \
-takefocus 0
}
$data(w:tick) config -command [list tixComboBox:Invoke $w] -takefocus 0
}
if {$data(-dropdown)} {
set data(state) 0
} else {
set data(state) n0
}
}
proc tixComboBoxBind {} {
#----------------------------------------------------------------------
# The class bindings for the TixComboBox
#
tixBind TixComboBox <Escape> {
if {[tixComboBox:EscKey %W]} {
break
}
}
tixBind TixComboBox <Configure> {
tixWidgetDoWhenIdle tixComboBox:align %W
}
# Only the two "linear" detail_fields are for tabbing (moving) among
# widgets inside the same toplevel. Other detail_fields are sort
# of irrelevant
#
tixBind TixComboBox <FocusOut> {
if {[string equal %d NotifyNonlinear] ||
[string equal %d NotifyNonlinearVirtual]} {
if {[info exists %W(cancelTab)]} {
unset %W(cancelTab)
} else {
if {[set %W(-state)] ne "disabled"} {
if {[set %W(-selection)] ne [set %W(-value)]} {
tixComboBox:Invoke %W
}
}
}
}
}
tixBind TixComboBox <FocusIn> {
if {"%d" eq "NotifyNonlinear" || "%d" eq "NotifyNonlinearVirtual"} {
focus [%W subwidget entry]
# CYGNUS: Setting the selection if there is no data
# causes backspace to misbehave.
if {[[set %W(w:entry)] get] ne ""} {
[set %W(w:entry)] selection from 0
[set %W(w:entry)] selection to end
}
}
}
#----------------------------------------------------------------------
# The class tixBindings for the arrow button widget inside the TixComboBox
#
tixBind TixComboArrow <1> {
tixComboBox:ArrowDown [tixGetMegaWidget %W TixComboBox]
}
tixBind TixComboArrow <ButtonRelease-1> {
tixComboBox:ArrowUp [tixGetMegaWidget %W TixComboBox]
}
tixBind TixComboArrow <Escape> {
if {[tixComboBox:EscKey [tixGetMegaWidget %W TixComboBox]]} {
break
}
}
#----------------------------------------------------------------------
# The class tixBindings for the entry widget inside the TixComboBox
#
tixBind TixComboEntry <Up> {
tixComboBox:EntDirKey [tixGetMegaWidget %W TixComboBox] up
}
tixBind TixComboEntry <Down> {
tixComboBox:EntDirKey [tixGetMegaWidget %W TixComboBox] down
}
tixBind TixComboEntry <Prior> {
tixComboBox:EntDirKey [tixGetMegaWidget %W TixComboBox] pageup
}
tixBind TixComboEntry <Next> {
tixComboBox:EntDirKey [tixGetMegaWidget %W TixComboBox] pagedown
}
tixBind TixComboEntry <Return> {
tixComboBox:EntReturnKey [tixGetMegaWidget %W TixComboBox]
}
tixBind TixComboEntry <KeyPress> {
tixComboBox:EntKeyPress [tixGetMegaWidget %W TixComboBox]
}
tixBind TixComboEntry <Escape> {
if {[tixComboBox:EscKey [tixGetMegaWidget %W TixComboBox]]} {
break
}
}
tixBind TixComboEntry <Tab> {
if {[set [tixGetMegaWidget %W TixComboBox](-state)] ne "disabled"} {
if {[tixComboBox:EntTab [tixGetMegaWidget %W TixComboBox]]} {
break
}
}
}
tixBind TixComboEntry <1> {
if {[set [tixGetMegaWidget %W TixComboBox](-state)] ne "disabled"} {
focus %W
}
}
tixBind TixComboEntry <ButtonRelease-2> {
tixComboBox:EntKeyPress [tixGetMegaWidget %W TixComboBox]
}
#----------------------------------------------------------------------
# The class bindings for the listbox subwidget
#
tixBind TixComboWid <Escape> {
if {[tixComboBox:EscKey [tixGetMegaWidget %W TixComboBox]]} {
break
}
}
#----------------------------------------------------------------------
# The class bindings for some widgets inside ComboBox
#
tixBind TixComboWid <ButtonRelease-1> {
tixComboBox:WidUp [tixGetMegaWidget %W TixComboBox]
}
tixBind TixComboWid <Escape> {
if {[tixComboBox:EscKey [tixGetMegaWidget %W TixComboBox]]} {
break
}
}
}
#----------------------------------------------------------------------
# Cooked events
#----------------------------------------------------------------------
proc tixComboBox:ArrowDown {w} {
upvar #0 $w data
if {$data(-state) eq "disabled"} {
return
}
switch -exact -- $data(state) {
0 { tixComboBox:GoState 1 $w }
2 { tixComboBox:GoState 19 $w }
default { tixComboBox:StateError $w }
}
}
proc tixComboBox:ArrowUp {w} {
upvar #0 $w data
switch -exact -- $data(state) {
1 { tixComboBox:GoState 2 $w }
19 {
# data(ignore) was already set in state 19
tixComboBox:GoState 4 $w
}
5 { tixComboBox:GoState 13 $w }
default { tixComboBox:StateError $w }
}
}
proc tixComboBox:RootDown {w} {
upvar #0 $w data
switch -exact -- $data(state) {
0 {
# Ignore
}
2 { tixComboBox:GoState 3 $w }
default { tixComboBox:StateError $w }
}
}
proc tixComboBox:RootUp {w} {
upvar #0 $w data
switch -exact -- $data(state) {
{1} {
tixComboBox:GoState 12 $w
}
{3} {
# data(ignore) was already set in state 3
tixComboBox:GoState 4 $w
}
{5} {
tixComboBox:GoState 7 $w
}
default {
tixComboBox:StateError $w
}
}
}
proc tixComboBox:WidUp {w} {
upvar #0 $w data
switch -exact -- $data(state) {
{1} {
tixComboBox:GoState 12 $w
}
{5} {
tixComboBox:GoState 13 $w
}
}
}
proc tixComboBox:LbBrowse {w args} {
upvar #0 $w data
set event [tixEvent type]
set x [tixEvent flag x]
set y [tixEvent flag y]
set X [tixEvent flag X]
set Y [tixEvent flag Y]
if {$data(-state) eq "disabled"} { return }
switch -exact -- $event {
<1> {
case $data(state) {
{2} {
tixComboBox:GoState 5 $w $x $y $X $Y
}
{5} {
tixComboBox:GoState 5 $w $x $y $X $Y
}
{n0} {
tixComboBox:GoState n6 $w $x $y $X $Y
}
default {
tixComboBox:StateError $w
}
}
}
<ButtonRelease-1> {
case $data(state) {
{5} {
tixComboBox:GoState 6 $w $x $y $X $Y
}
{n6} {
tixComboBox:GoState n0 $w
}
default {
tixComboBox:StateError $w
}
}
}
default {
# Must be a motion event
case $data(state) {
{1} {
tixComboBox:GoState 9 $w $x $y $X $Y
}
{5} {
tixComboBox:GoState 5 $w $x $y $X $Y
}
{n6} {
tixComboBox:GoState n6 $w $x $y $X $Y
}
default {
tixComboBox:StateError $w
}
}
}
}
}
proc tixComboBox:LbCommand {w} {
upvar #0 $w data
if {$data(state) eq "n0"} {
tixComboBox:GoState n1 $w
}
}
#----------------------------------------------------------------------
# General keyboard event
# returns 1 if the combobox is in some special state and the Escape key
# shouldn't be handled by the toplevel bind tag. As a result, when a combobox
# is popped up in a dialog box, Escape will popdown the combo. If the combo
# is not popped up, Escape will invoke the toplevel bindtag (which can
# pop down the dialog box)
#
proc tixComboBox:EscKey {w} {
upvar #0 $w data
if {$data(-state) eq "disabled"} { return 0 }
switch -exact -- $data(state) {
{0} {
tixComboBox:GoState 17 $w
}
{2} {
tixComboBox:GoState 16 $w
return 1
}
{n0} {
tixComboBox:GoState n4 $w
}
default {
# ignore
return 1
}
}
return 0
}
#----------------------------------------
# Keyboard events
#----------------------------------------
proc tixComboBox:EntDirKey {w dir} {
upvar #0 $w data
if {$data(-state) eq "disabled"} { return }
switch -exact -- $data(state) {
{0} {
tixComboBox:GoState 10 $w $dir
}
{2} {
tixComboBox:GoState 11 $w $dir
}
{5} {
# ignore
}
{n0} {
tixComboBox:GoState n3 $w $dir
}
}
}
proc tixComboBox:EntReturnKey {w} {
upvar #0 $w data
if {$data(-state) eq "disabled"} { return }
switch -exact -- $data(state) {
{0} {
tixComboBox:GoState 14 $w
}
{2} {
tixComboBox:GoState 15 $w
}
{5} {
# ignore
}
{n0} {
tixComboBox:GoState n1 $w
}
}
}
# Return 1 == break from the binding == no keyboard focus traversal
proc tixComboBox:EntTab {w} {
upvar #0 $w data
switch -exact -- $data(state) {
{0} {
tixComboBox:GoState 14 $w
set data(cancelTab) ""
return 0
}
{2} {
tixComboBox:GoState 15 $w
set data(cancelTab) ""
return 0
}
{n0} {
tixComboBox:GoState n1 $w
set data(cancelTab) ""
return 0
}
default {
return 1
}
}
}
proc tixComboBox:EntKeyPress {w} {
upvar #0 $w data
if {$data(-state) eq "disabled" || !$data(-editable)} { return }
switch -exact -- $data(state) {
0 - 2 - n0 {
tixComboBox:ClearListboxSelection $w
tixComboBox:SetSelection $w [$data(w:entry) get] 0 0
}
}
}
#----------------------------------------------------------------------
proc tixComboBox:HandleDirKey {w dir} {
upvar #0 $w data
if {[tixComboBox:CheckListboxSelection $w]} {
switch -exact -- $dir {
"up" {
tkListboxUpDown $data(w:listbox) -1
set data(curIndex) [lindex [$data(w:listbox) curselection] 0]
tixComboBox:SetSelectionFromListbox $w
}
"down" {
tkListboxUpDown $data(w:listbox) 1
set data(curIndex) [lindex [$data(w:listbox) curselection] 0]
tixComboBox:SetSelectionFromListbox $w
}
"pageup" {
$data(w:listbox) yview scroll -1 pages
}
"pagedown" {
$data(w:listbox) yview scroll 1 pages
}
}
} else {
# There wasn't good selection in the listbox.
#
tixComboBox:SetSelectionFromListbox $w
}
}
proc tixComboBox:Invoke {w} {
upvar #0 $w data
tixComboBox:SetValue $w $data(-selection)
if {![winfo exists $w]} {
return
}
if {$data(-history)} {
tixComboBox:addhistory $w $data(-value)
set data(curIndex) 0
}
$data(w:entry) selection from 0
$data(w:entry) selection to end
$data(w:entry) icursor end
}
#----------------------------------------------------------------------
# MAINTAINING THE -VALUE
#----------------------------------------------------------------------
proc tixComboBox:SetValue {w newValue {noUpdate 0} {updateEnt 1}} {
upvar #0 $w data
if {[llength $data(-validatecmd)]} {
set data(-value) [tixEvalCmdBinding $w $data(-validatecmd) "" $newValue]
} else {
set data(-value) $newValue
}
if {! $noUpdate} {
tixVariable:UpdateVariable $w
}
if {$updateEnt} {
if {!$data(-editable)} {
$data(w:entry) delete 0 end
$data(w:entry) insert 0 $data(-value)
}
}
if {!$data(-disablecallback) && [llength $data(-command)]} {
if {![info exists data(varInited)]} {
set bind(specs) {%V}
set bind(%V) $data(-value)
tixEvalCmdBinding $w $data(-command) bind $data(-value)
if {![winfo exists $w]} {
# The user destroyed the window!
return
}
}
}
set data(-selection) $data(-value)
if {$updateEnt} {
tixSetEntry $data(w:entry) $data(-value)
if {$data(-anchor) eq "e"} {
tixComboBox:EntryAlignEnd $w
}
}
}
# markSel: should the all the text in the entry be highlighted?
#
proc tixComboBox:SetSelection {w value {markSel 1} {setent 1}} {
upvar #0 $w data
if {$setent} {
tixSetEntry $data(w:entry) $value
}
set data(-selection) $value
if {$data(-selectmode) eq "browse"} {
if {$markSel} {
$data(w:entry) selection range 0 end
}
if {[llength $data(-browsecmd)]} {
set bind(specs) {%V}
set bind(%V) [$data(w:entry) get]
tixEvalCmdBinding $w $data(-browsecmd) bind [$data(w:entry) get]
}
} else {
tixComboBox:SetValue $w $value 0 0
}
}
proc tixComboBox:ClearListboxSelection {w} {
upvar #0 $w data
if {![winfo exists $data(w:listbox)]} {
tixDebug "tixComboBox:ClearListboxSelection error non-existent $data(w:listbox)"
return
}
$data(w:listbox) selection clear 0 end
}
proc tixComboBox:UpdateListboxSelection {w index} {
upvar #0 $w data
if {![winfo exists $data(w:listbox)]} {
tixDebug "tixComboBox:UpdateListboxSelection error non-existent $data(w:listbox)"
return
}
if {$index != ""} {
$data(w:listbox) selection set $index
$data(w:listbox) selection anchor $index
}
}
proc tixComboBox:Cancel {w} {
upvar #0 $w data
tixSetEntry $data(w:entry) $data(-value)
tixComboBox:SetSelection $w $data(-value)
if {[tixComboBox:LbGetSelection $w] ne $data(-selection)} {
tixComboBox:ClearListboxSelection $w
}
}
proc tixComboBox:flash {w} {
tixComboBox:BlinkEntry $w
}
# Make the entry blink when the user selects a choice
#
proc tixComboBox:BlinkEntry {w} {
upvar #0 $w data
if {![info exists data(entryBlacken)]} {
set old_bg [$data(w:entry) cget -bg]
set old_fg [$data(w:entry) cget -fg]
$data(w:entry) config -fg $old_bg
$data(w:entry) config -bg $old_fg
set data(entryBlacken) 1
after 50 tixComboBox:RestoreBlink $w [list $old_bg] [list $old_fg]
}
}
proc tixComboBox:RestoreBlink {w old_bg old_fg} {
upvar #0 $w data
if {[info exists data(w:entry)] && [winfo exists $data(w:entry)]} {
$data(w:entry) config -fg $old_fg
$data(w:entry) config -bg $old_bg
}
if {[info exists data(entryBlacken)]} {
unset data(entryBlacken)
}
}
#----------------------------------------
# Handle events inside the list box
#----------------------------------------
proc tixComboBox:LbIndex {w {flag ""}} {
upvar #0 $w data
if {![winfo exists $data(w:listbox)]} {
tixDebug "tixComboBox:LbIndex error non-existent $data(w:listbox)"
if {$flag eq "emptyOK"} {
return ""
} else {
return 0
}
}
set sel [lindex [$data(w:listbox) curselection] 0]
if {$sel != ""} {
return $sel
} else {
if {$flag eq "emptyOK"} {
return ""
} else {
return 0
}
}
}
#----------------------------------------------------------------------
#
# STATE MANIPULATION
#
#----------------------------------------------------------------------
proc tixComboBox:GoState-0 {w} {
upvar #0 $w data
if {[info exists data(w:root)] && [grab current] eq "$data(w:root)"} {
grab release $w
}
}
proc tixComboBox:GoState-1 {w} {
upvar #0 $w data
tixComboBox:Popup $w
}
proc tixComboBox:GoState-2 {w} {
upvar #0 $w data
}
proc tixComboBox:GoState-3 {w} {
upvar #0 $w data
set data(ignore) 1
tixComboBox:Popdown $w
}
proc tixComboBox:GoState-4 {w} {
upvar #0 $w data
tixComboBox:Ungrab $w
if {$data(ignore)} {
tixComboBox:Cancel $w
} else {
tixComboBox:Invoke $w
}
tixComboBox:GoState 0 $w
}
proc tixComboBox:GoState-5 {w x y X Y} {
upvar #0 $w data
tixComboBox:LbSelect $w $x $y $X $Y
}
proc tixComboBox:GoState-6 {w x y X Y} {
upvar #0 $w data
tixComboBox:Popdown $w
if {[tixWithinWindow $data(w:shell) $X $Y]} {
set data(ignore) 0
} else {
set data(ignore) 1
}
tixComboBox:GoState 4 $w
}
proc tixComboBox:GoState-7 {w} {
upvar #0 $w data
tixComboBox:Popdown $w
set data(ignore) 1
catch {
global tkPriv
if {$tkPriv(afterId) != ""} {
tkCancelRepeat
}
}
set data(ignore) 1
tixComboBox:GoState 4 $w
}
proc tixComboBox:GoState-9 {w x y X Y} {
upvar #0 $w data
catch {
tkButtonUp $data(w:arrow)
}
tixComboBox:GoState 5 $w $x $y $X $Y
}
proc tixComboBox:GoState-10 {w dir} {
upvar #0 $w data
tixComboBox:Popup $w
if {![tixComboBox:CheckListboxSelection $w]} {
# There wasn't good selection in the listbox.
#
tixComboBox:SetSelectionFromListbox $w
}
tixComboBox:GoState 2 $w
}
proc tixComboBox:GoState-11 {w dir} {
upvar #0 $w data
tixComboBox:HandleDirKey $w $dir
tixComboBox:GoState 2 $w
}
proc tixComboBox:GoState-12 {w} {
upvar #0 $w data
catch {
tkButtonUp $data(w:arrow)
}
tixComboBox:GoState 2 $w
}
proc tixComboBox:GoState-13 {w} {
upvar #0 $w data
catch {
global tkPriv
if {$tkPriv(afterId) != ""} {
tkCancelRepeat
}
}
tixComboBox:GoState 2 $w
}
proc tixComboBox:GoState-14 {w} {
upvar #0 $w data
tixComboBox:Invoke $w
tixComboBox:GoState 0 $w
}
proc tixComboBox:GoState-15 {w} {
upvar #0 $w data
tixComboBox:Popdown $w
set data(ignore) 0
tixComboBox:GoState 4 $w
}
proc tixComboBox:GoState-16 {w} {
upvar #0 $w data
tixComboBox:Popdown $w
tixComboBox:Cancel $w
set data(ignore) 1
tixComboBox:GoState 4 $w
}
proc tixComboBox:GoState-17 {w} {
upvar #0 $w data
tixComboBox:Cancel $w
tixComboBox:GoState 0 $w
}
proc tixComboBox:GoState-19 {w} {
upvar #0 $w data
set data(ignore) [string equal $data(-selection) $data(-value)]
tixComboBox:Popdown $w
}
#----------------------------------------------------------------------
# Non-dropdown states
#----------------------------------------------------------------------
proc tixComboBox:GoState-n0 {w} {
upvar #0 $w data
}
proc tixComboBox:GoState-n1 {w} {
upvar #0 $w data
tixComboBox:Invoke $w
tixComboBox:GoState n0 $w
}
proc tixComboBox:GoState-n3 {w dir} {
upvar #0 $w data
tixComboBox:HandleDirKey $w $dir
tixComboBox:GoState n0 $w
}
proc tixComboBox:GoState-n4 {w} {
upvar #0 $w data
tixComboBox:Cancel $w
tixComboBox:GoState n0 $w
}
proc tixComboBox:GoState-n6 {w x y X Y} {
upvar #0 $w data
tixComboBox:LbSelect $w $x $y $X $Y
}
#----------------------------------------------------------------------
# General State Manipulation
#----------------------------------------------------------------------
proc tixComboBox:GoState {s w args} {
upvar #0 $w data
tixComboBox:SetState $w $s
eval tixComboBox:GoState-$s $w $args
}
proc tixComboBox:SetState {w s} {
upvar #0 $w data
# catch {puts [info level -2]}
# puts "setting state $data(state) --> $s"
set data(state) $s
}
proc tixComboBox:StateError {w} {
upvar #0 $w data
# error "wrong state $data(state)"
}
#----------------------------------------------------------------------
# Listbox handling
#----------------------------------------------------------------------
# Set a selection if there isn't one. Returns true if there was already
# a good selection inside the listbox
#
proc tixComboBox:CheckListboxSelection {w} {
upvar #0 $w data
if {![winfo exists $data(w:listbox)]} {
tixDebug "tixComboBox:CheckListboxSelection error non-existent $data(w:listbox)"
return 0
}
if {[$data(w:listbox) curselection] == ""} {
if {$data(curIndex) == ""} {
set data(curIndex) 0
}
$data(w:listbox) activate $data(curIndex)
$data(w:listbox) selection clear 0 end
$data(w:listbox) selection set $data(curIndex)
$data(w:listbox) see $data(curIndex)
return 0
} else {
return 1
}
}
proc tixComboBox:SetSelectionFromListbox {w} {
upvar #0 $w data
set string [$data(w:listbox) get $data(curIndex)]
tixComboBox:SetSelection $w $string
tixComboBox:UpdateListboxSelection $w $data(curIndex)
}
proc tixComboBox:LbGetSelection {w} {
upvar #0 $w data
set index [tixComboBox:LbIndex $w emptyOK]
if {$index >=0} {
return [$data(w:listbox) get $index]
} else {
return ""
}
}
proc tixComboBox:LbSelect {w x y X Y} {
upvar #0 $w data
set index [tixComboBox:LbIndex $w emptyOK]
if {$index == ""} {
set index [$data(w:listbox) nearest $y]
}
if {$index >= 0} {
if {[focus -lastfor $data(w:entry)] ne $data(w:entry) &&
[focus -lastfor $data(w:entry)] ne $data(w:listbox)} {
focus $data(w:entry)
}
set string [$data(w:listbox) get $index]
tixComboBox:SetSelection $w $string
tixComboBox:UpdateListboxSelection $w $index
}
}
#----------------------------------------------------------------------
# Internal commands
#----------------------------------------------------------------------
proc tixComboBox:CrossBtn {w} {
upvar #0 $w data
$data(w:entry) delete 0 end
tixComboBox:ClearListboxSelection $w
tixComboBox:SetSelection $w ""
}
#--------------------------------------------------
# Popping up list shell
#--------------------------------------------------
# Popup the listbox and grab
#
#
proc tixComboBox:Popup {w} {
global tcl_platform
upvar #0 $w data
if {![winfo ismapped $data(w:root)]} {
return
}
#---------------------------------------------------------------------
# Pop up
#
if {$data(-listcmd) != ""} {
# This option allows the user to fill in the listbox on demand
#
tixEvalCmdBinding $w $data(-listcmd)
}
# calculate the size
set y [winfo rooty $data(w:entry)]
incr y [winfo height $data(w:entry)]
incr y 3
set bd [$data(w:shell) cget -bd]
# incr bd [$data(w:shell) cget -highlightthickness]
set height [expr {[winfo reqheight $data(w:slistbox)] + 2*$bd}]
set x1 [winfo rootx $data(w:entry)]
if {$data(-listwidth) == ""} {
if {[winfo ismapped $data(w:arrow)]} {
set x2 [winfo rootx $data(w:arrow)]
if {$x2 >= $x1} {
incr x2 [winfo width $data(w:arrow)]
set width [expr {$x2 - $x1}]
} else {
set width [winfo width $data(w:entry)]
set x2 [expr {$x1 + $width}]
}
} else {
set width [winfo width $data(w:entry)]
set x2 [expr {$x1 + $width}]
}
} else {
set width $data(-listwidth)
set x2 [expr {$x1 + $width}]
}
set reqwidth [winfo reqwidth $data(w:shell)]
if {$reqwidth < $width} {
set reqwidth $width
} else {
if {$reqwidth > [expr {$width *3}]} {
set reqwidth [expr {$width *3}]
}
if {$reqwidth > [winfo vrootwidth .]} {
set reqwidth [winfo vrootwidth .]
}
}
set width $reqwidth
# If the listbox is too far right, pull it back to the left
#
set scrwidth [winfo vrootwidth .]
if {$x2 > $scrwidth} {
set x1 [expr {$scrwidth - $width}]
}
# If the listbox is too far left, pull it back to the right
#
if {$x1 < 0} {
set x1 0
}
# If the listbox is below bottom of screen, put it upwards
#
set scrheight [winfo vrootheight .]
set bottom [expr {$y+$height}]
if {$bottom > $scrheight} {
set y [expr {$y-$height-[winfo height $data(w:entry)]-5}]
}
# OK , popup the shell
#
global tcl_platform
wm geometry $data(w:shell) $reqwidth\x$height+$x1+$y
if {$tcl_platform(platform) eq "windows"} {
update
}
wm deiconify $data(w:shell)
if {$tcl_platform(platform) eq "windows"} {
update
}
raise $data(w:shell)
focus $data(w:entry)
set data(popped) 1
# add for safety
update
tixComboBox:Grab $w
}
proc tixComboBox:SetCursor {w cursor} {
upvar #0 $w data
$w config -cursor $cursor
}
proc tixComboBox:Popdown {w} {
upvar #0 $w data
wm withdraw $data(w:shell)
tixComboBox:SetCursor $w ""
}
# Grab the server so that user cannot move the windows around
proc tixComboBox:Grab {w} {
upvar #0 $w data
tixComboBox:SetCursor $w arrow
if {[catch {
# We catch here because grab may fail under a lot of circumstances
# Just don't want to break the code ...
switch -exact -- $data(-grab) {
global { tixPushGrab -global $data(w:root) }
local { tixPushGrab $data(w:root) }
}
} err]} {
tixDebug "tixComboBox:Grab+: Error grabbing $data(w:root)\n$err"
}
}
proc tixComboBox:Ungrab {w} {
upvar #0 $w data
if {[catch {
catch {
switch -exact -- $data(-grab) {
global { tixPopGrab }
local { tixPopGrab }
}
}
} err]} {
tixDebug "tixComboBox:Grab+: Error grabbing $data(w:root)\n$err"
}
}
#----------------------------------------------------------------------
# Alignment
#----------------------------------------------------------------------
# The following two routines can emulate a "right align mode" for the
# entry in the combo box.
proc tixComboBox:EntryAlignEnd {w} {
upvar #0 $w data
$data(w:entry) xview end
}
proc tixComboBox:Destructor {w} {
upvar #0 $w data
tixUnsetMegaWidget $data(w:entry)
tixVariable:DeleteVariable $w
# Chain this to the superclass
#
tixChainMethod $w Destructor
}
#----------------------------------------------------------------------
# CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixComboBox:config-state {w value} {
upvar #0 $w data
catch {if {[$data(w:arrow) cget -state] eq $value} {set a 1}}
if {[info exists a]} {
return
}
catch {$data(w:arrow) config -state $value}
catch {$data(w:tick) config -state $value}
catch {$data(w:cross) config -state $value}
catch {$data(w:slistbox) config -state $value}
if {[string equal $value normal]} {
set fg [$data(w:arrow) cget -fg]
set entryFg $data(entryfg)
set lbSelFg [lindex [$data(w:listbox) config -selectforeground] 3]
set lbSelBg [lindex [$data(w:listbox) config -selectbackground] 3]
set entrySelFg [lindex [$data(w:entry) config -selectforeground] 3]
set entrySelBg [lindex [$data(w:entry) config -selectbackground] 3]
} else {
set fg [$data(w:arrow) cget -disabledforeground]
set entryFg $data(-disabledforeground)
set lbSelFg $entryFg
set lbSelBg [$data(w:listbox) cget -bg]
set entrySelFg $entryFg
set entrySelBg [$data(w:entry) cget -bg]
}
if {$fg ne ""} {
$data(w:label) config -fg $fg
$data(w:listbox) config -fg $fg -selectforeground $lbSelFg \
-selectbackground $lbSelBg
}
$data(w:entry) config -fg $entryFg -selectforeground $entrySelFg \
-selectbackground $entrySelBg
if {$value eq "normal"} {
if {$data(-editable)} {
$data(w:entry) config -state normal
}
$data(w:entry) config -takefocus 1
} else {
if {$data(-editable)} {
$data(w:entry) config -state disabled
}
$data(w:entry) config -takefocus 0
}
}
proc tixComboBox:config-value {w value} {
upvar #0 $w data
tixComboBox:SetValue $w $value
set data(-selection) $value
if {[tixComboBox:LbGetSelection $w] ne $value} {
tixComboBox:ClearListboxSelection $w
}
}
proc tixComboBox:config-selection {w value} {
upvar #0 $w data
tixComboBox:SetSelection $w $value
if {[tixComboBox:LbGetSelection $w] ne $value} {
tixComboBox:ClearListboxSelection $w
}
}
proc tixComboBox:config-variable {w arg} {
upvar #0 $w data
if {[tixVariable:ConfigVariable $w $arg]} {
# The value of data(-value) is changed if tixVariable:ConfigVariable
# returns true
set data(-selection) $data(-value)
tixComboBox:SetValue $w $data(-value) 1
}
catch {
unset data(varInited)
}
set data(-variable) $arg
}
#----------------------------------------------------------------------
# WIDGET COMMANDS
#----------------------------------------------------------------------
proc tixComboBox:align {w args} {
upvar #0 $w data
if {$data(-anchor) eq "e"} {
tixComboBox:EntryAlignEnd $w
}
}
proc tixComboBox:addhistory {w value} {
upvar #0 $w data
tixComboBox:insert $w 0 $value
$data(w:listbox) selection clear 0 end
if {$data(-prunehistory)} {
# Prune from the end
#
set max [$data(w:listbox) size]
if {$max <= 1} {
return
}
for {set i [expr {$max -1}]} {$i >= 1} {incr i -1} {
if {[$data(w:listbox) get $i] eq $value} {
$data(w:listbox) delete $i
break
}
}
}
}
proc tixComboBox:appendhistory {w value} {
upvar #0 $w data
tixComboBox:insert $w end $value
$data(w:listbox) selection clear 0 end
if {$data(-prunehistory)} {
# Prune from the end
#
set max [$data(w:listbox) size]
if {$max <= 1} {
return
}
for {set i [expr {$max -2}]} {$i >= 0} {incr i -1} {
if {[$data(w:listbox) get $i] eq $value} {
$data(w:listbox) delete $i
break
}
}
}
}
proc tixComboBox:insert {w index newitem} {
upvar #0 $w data
$data(w:listbox) insert $index $newitem
if {$data(-history) && $data(-historylimit) != ""
&& [$data(w:listbox) size] eq $data(-historylimit)} {
$data(w:listbox) delete 0
}
}
proc tixComboBox:pick {w index} {
upvar #0 $w data
$data(w:listbox) activate $index
$data(w:listbox) selection clear 0 end
$data(w:listbox) selection set active
$data(w:listbox) see active
set text [$data(w:listbox) get $index]
tixComboBox:SetValue $w $text
set data(curIndex) $index
}
proc tixComboBox:invoke {w} {
tixComboBox:Invoke $w
}
proc tixComboBox:popdown {w} {
upvar #0 $w data
if {$data(-dropdown)} {
tixComboBox:Popdown $w
}
}
Tix8.4.3/VStack.tcl 0000644 00000022663 15173441414 0007617 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: VStack.tcl,v 1.4 2004/03/28 02:44:57 hobbs Exp $
#
# VStack.tcl --
#
# Virtual base class, do not instantiate! This is the core
# class for all NoteBook style widgets. Stack maintains a list
# of windows. It provides methods to create, delete windows as
# well as stepping through them.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
tixWidgetClass tixVStack {
-virtual true
-classname TixVStack
-superclass tixPrimitive
-method {
add delete pageconfigure pagecget pages raise raised
}
-flag {
-dynamicgeometry -ipadx -ipady
}
-configspec {
{-dynamicgeometry dynamicGeometry DynamicGeometry 0 tixVerifyBoolean}
{-ipadx ipadX Pad 0}
{-ipady ipadY Pad 0}
}
}
proc tixVStack:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(pad-x1) 0
set data(pad-x2) 0
set data(pad-y1) 0
set data(pad-y2) 0
set data(windows) ""
set data(nWindows) 0
set data(topchild) ""
set data(minW) 1
set data(minH) 1
set data(w:top) $w
set data(counter) 0
set data(repack) 0
}
proc tixVStack:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
tixCallMethod $w InitGeometryManager
}
#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
proc tixVStack:add {w child args} {
upvar #0 $w data
set validOptions {-createcmd -raisecmd}
set opt(-createcmd) ""
set opt(-raisecmd) ""
tixHandleOptions -nounknown opt $validOptions $args
set data($child,raisecmd) $opt(-raisecmd)
set data($child,createcmd) $opt(-createcmd)
set data(w:$child) [tixCallMethod $w CreateChildFrame $child]
lappend data(windows) $child
incr data(nWindows) 1
return $data(w:$child)
}
proc tixVStack:delete {w child} {
upvar #0 $w data
if {[info exists data($child,createcmd)]} {
if {[winfo exists $data(w:$child)]} {
bind $data(w:$child) <Destroy> {;}
destroy $data(w:$child)
}
catch {unset data($child,createcmd)}
catch {unset data($child,raisecmd)}
catch {unset data(w:$child)}
set index [lsearch $data(windows) $child]
if {$index >= 0} {
set data(windows) [lreplace $data(windows) $index $index]
incr data(nWindows) -1
}
if {[string equal $data(topchild) $child]} {
set data(topchild) ""
foreach page $data(windows) {
if {$page ne $child} {
$w raise $page
set data(topchild) $page
break
}
}
}
} else {
error "page $child does not exist"
}
}
proc tixVStack:pagecget {w child option} {
upvar #0 $w data
if {![info exists data($child,createcmd)]} {
error "page \"$child\" does not exist in $w"
}
case $option {
-createcmd {
return "$data($child,createcmd)"
}
-raisecmd {
return "$data($child,raisecmd)"
}
default {
if {$data(w:top) ne $w} {
return [$data(w:top) pagecget $child $option]
} else {
error "unknown option \"$option\""
}
}
}
}
proc tixVStack:pageconfigure {w child args} {
upvar #0 $w data
if {![info exists data($child,createcmd)]} {
error "page \"$child\" does not exist in $w"
}
set len [llength $args]
if {$len == 0} {
set value [$data(w:top) pageconfigure $child]
lappend value [list -createcmd "" "" "" $data($child,createcmd)]
lappend value [list -raisecmd "" "" "" $data($child,raisecmd)]
return $value
}
if {$len == 1} {
case [lindex $args 0] {
-createcmd {
return [list -createcmd "" "" "" $data($child,createcmd)]
}
-raisecmd {
return [list -raisecmd "" "" "" $data($child,raisecmd)]
}
default {
return [$data(w:top) pageconfigure $child [lindex $args 0]]
}
}
}
# By default handle each of the options
#
set opt(-createcmd) $data($child,createcmd)
set opt(-raisecmd) $data($child,raisecmd)
tixHandleOptions -nounknown opt {-createcmd -raisecmd} $args
#
# the widget options
set new_args ""
foreach {flag value} $args {
if {$flag ne "-createcmd" && $flag ne "-raisecmd"} {
lappend new_args $flag
lappend new_args $value
}
}
if {[llength $new_args] >= 2} {
eval $data(w:top) pageconfig $child $new_args
}
#
# The add-on options
set data($child,raisecmd) $opt(-raisecmd)
set data($child,createcmd) $opt(-createcmd)
return ""
}
proc tixVStack:pages {w} {
upvar #0 $w data
return $data(windows)
}
proc tixVStack:raise {w child} {
upvar #0 $w data
if {![info exists data($child,createcmd)]} {
error "page $child does not exist"
}
if {[llength $data($child,createcmd)]} {
uplevel #0 $data($child,createcmd)
set data($child,createcmd) ""
}
tixCallMethod $w RaiseChildFrame $child
set oldTopChild $data(topchild)
set data(topchild) $child
if {$oldTopChild ne $child} {
if {[llength $data($child,raisecmd)]} {
uplevel #0 $data($child,raisecmd)
}
}
}
proc tixVStack:raised {w} {
upvar #0 $w data
return $data(topchild)
}
#----------------------------------------------------------------------
# Virtual Methods
#----------------------------------------------------------------------
proc tixVStack:InitGeometryManager {w} {
upvar #0 $w data
bind $w <Configure> "tixVStack:MasterGeomProc $w"
bind $data(w:top) <Destroy> "+tixVStack:DestroyTop $w"
if {$data(repack) == 0} {
set data(repack) 1
tixWidgetDoWhenIdle tixCallMethod $w Resize
}
}
proc tixVStack:CreateChildFrame {w child} {
upvar #0 $w data
set f [frame $data(w:top).$child]
tixManageGeometry $f "tixVStack:ClientGeomProc $w"
bind $f <Configure> "tixVStack:ClientGeomProc $w -configure $f"
bind $f <Destroy> "$w delete $child"
return $f
}
proc tixVStack:RaiseChildFrame {w child} {
upvar #0 $w data
# Hide the original visible window
if {$data(topchild) ne "" && $data(topchild) ne $child} {
tixUnmapWindow $data(w:$data(topchild))
}
set myW [winfo width $w]
set myH [winfo height $w]
set cW [expr {$myW - $data(pad-x1) - $data(pad-x2) - 2*$data(-ipadx)}]
set cH [expr {$myH - $data(pad-y1) - $data(pad-y2) - 2*$data(-ipady)}]
set cX [expr {$data(pad-x1) + $data(-ipadx)}]
set cY [expr {$data(pad-y1) + $data(-ipady)}]
if {$cW > 0 && $cH > 0} {
tixMoveResizeWindow $data(w:$child) $cX $cY $cW $cH
tixMapWindow $data(w:$child)
raise $data(w:$child)
}
}
#----------------------------------------------------------------------
#
# G E O M E T R Y M A N A G E M E N T
#
#----------------------------------------------------------------------
proc tixVStack:DestroyTop {w} {
catch {
destroy $w
}
}
proc tixVStack:MasterGeomProc {w args} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
if {$data(repack) == 0} {
set data(repack) 1
tixWidgetDoWhenIdle tixCallMethod $w Resize
}
}
proc tixVStack:ClientGeomProc {w flag client} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
if {$data(repack) == 0} {
set data(repack) 1
tixWidgetDoWhenIdle tixCallMethod $w Resize
}
if {$flag eq "-lostslave"} {
error "Geometry Management Error: \
Another geometry manager has taken control of $client.\
This error is usually caused because a widget has been created\
in the wrong frame: it should have been created inside $client instead\
of $w"
}
}
proc tixVStack:Resize {w} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
if {$data(nWindows) == 0} {
set data(repack) 0
return
}
if {$data(-width) == 0 || $data(-height) == 0} {
if {!$data(-dynamicgeometry)} {
# Calculate my required width and height
#
set maxW 1
set maxH 1
foreach child $data(windows) {
set cW [winfo reqwidth $data(w:$child)]
set cH [winfo reqheight $data(w:$child)]
if {$maxW < $cW} {
set maxW $cW
}
if {$maxH < $cH} {
set maxH $cH
}
}
set reqW $maxW
set reqH $maxH
} else {
if {$data(topchild) ne ""} {
set reqW [winfo reqwidth $data(w:$data(topchild))]
set reqH [winfo reqheight $data(w:$data(topchild))]
} else {
set reqW 1
set reqH 1
}
}
incr reqW [expr {$data(pad-x1) + $data(pad-x2) + 2*$data(-ipadx)}]
incr reqH [expr {$data(pad-y1) + $data(pad-y2) + 2*$data(-ipady)}]
if {$reqW < $data(minW)} {
set reqW $data(minW)
}
if {$reqH < $data(minH)} {
set reqH $data(minH)
}
}
# These take higher precedence
#
if {$data(-width) != 0} {
set reqW $data(-width)
}
if {$data(-height) != 0} {
set reqH $data(-height)
}
if {[winfo reqwidth $w] != $reqW || [winfo reqheight $w] != $reqH} {
if {![info exists data(counter)]} {
set data(counter) 0
}
if {$data(counter) < 50} {
incr data(counter)
tixGeometryRequest $w $reqW $reqH
tixWidgetDoWhenIdle tixCallMethod $w Resize
set data(repack) 1
return
}
}
set data(counter) 0
if {$data(w:top) ne $w} {
tixMoveResizeWindow $data(w:top) 0 0 [winfo width $w] [winfo height $w]
tixMapWindow $data(w:top)
}
if {[string equal $data(topchild) ""]} {
set top [lindex $data(windows) 0]
} else {
set top $data(topchild)
}
if {$top ne ""} {
tixCallMethod $w raise $top
}
set data(repack) 0
}
Tix8.4.3/fs.tcl 0000644 00000007633 15173441414 0007034 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: fs.tcl,v 1.6 2004/03/28 02:44:57 hobbs Exp $
#
# File system routines to handle some file system variations
# and how that interoperates with the Tix widgets (mainly HList).
#
# Copyright (c) 2004 ActiveState
##
## Cross-platform
##
proc tixFSSep {} { return "/" }
proc tixFSNormalize {path} {
# possibly use tixFSTilde ?
return [file normalize $path]
}
proc tixFSVolumes {} {
return [file volumes]
}
proc tixFSAncestors {path} {
return [file split [file normalize $path]]
}
# how a filename should be displayed
proc tixFSDisplayFileName {path} {
if {$path eq [file dirname $path]} {
return $path
} else {
return [file tail $path]
}
}
# dir: Make a listing of this directory
# showSubDir: Want to list the subdirectories?
# showFile: Want to list the non-directory files in this directory?
# showPrevDir: Want to list ".." as well?
# showHidden: Want to list the hidden files?
#
# return value: a list of files and/or subdirectories
#
proc tixFSListDir {dir showSubDir showFile showPrevDir \
showHidden {pattern ""}} {
if {$pattern eq ""} { set pattern [list "*"] }
if {$::tcl_platform(platform) eq "unix"
&& $showHidden && $pattern eq "*"} { lappend pattern ".*" }
if {[catch {eval [list glob -nocomplain -directory $dir] \
$pattern} files]} {
# The user has entered an invalid or unreadable directory
# %% todo: prompt error, go back to last succeed directory
return ""
}
set list ""
foreach f [lsort -dictionary $files] {
set tail [file tail $f]
# file tail handles this automatically
#if {[string match ~* $tail]} { set tail ./$tail }
if {[file isdirectory $f]} {
if {$tail eq "."} { continue }
if {$showSubDir} {
if {$tail eq ".." && !$showPrevDir} { continue }
lappend list $tail
}
} else {
if {$showFile} { lappend list $tail }
}
}
return $list
}
# in: internal name
# out: native name
proc tixFSNativeNorm {path} {
return [tixFSNative [tixFSNormalize $path]]
}
# tixFSDisplayName --
#
# Returns the name of a normalized path which is usually displayed by
# the OS
#
proc tixFSDisplayName {path} {
return [tixFSNative $path]
}
proc tixFSTilde {path} {
# verify that paths with leading ~ are files or real users
if {[string match ~* $path]} {
# The following will report if the user doesn't exist
if {![file isdirectory $path]} {
set path ./$path
} else {
set path [file normalize $path]
}
}
return $path
}
proc tixFSJoin {dir sub} {
return [tixFSNative [file join $dir [tixFSTilde $sub]]]
}
proc tixFSNative {path} {
return $path
}
if {$::tcl_platform(platform) eq "windows"} {
##
## WINDOWS
##
# is an absoulte path only if it starts with a baclskash
# or starts with "<drive letter>:"
#
# in: nativeName
#
proc tixFSIsAbsPath {nativeName} {
set ptype [file pathtype $nativename]
return [expr {$ptype eq "absolute" || $ptype eq "volumerelative"}]
}
# tixFSIsValid --
#
# Checks whether a native pathname contains invalid characters.
#
proc tixFSIsValid {path} {
#if {$::tcl_platform(platform) eq "windows"} {set bad "\\/:*?\"<>|\0"}
return 1
}
proc tixFSExternal {path} {
# Avoid normalization on root adding unwanted volumerelative pwd
if {[string match -nocase {[A-Z]:} $path]} {
return $path/
}
return [file normalize $path]
}
proc tixFSInternal {path} {
# Only need to watch for ^[A-Z]:/$, but this does the trick
return [string trimright [file normalize $path] /]
}
} else {
##
## UNIX
##
proc tixFSIsAbsPath {path} {
return [string match {[~/]*} $path]
}
# tixFSIsValid --
#
# Checks whether a native pathname contains invalid characters.
#
proc tixFSIsValid {path} { return 1 }
proc tixFSExternal {path} { return $path }
proc tixFSInternal {path} { return $path }
}
Tix8.4.3/DialogS.tcl 0000644 00000010310 15173441414 0007730 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: DialogS.tcl,v 1.5 2004/03/28 02:44:57 hobbs Exp $
#
# DialogS.tcl --
#
#
# Implements the DialogShell widget. It tells the window
# manager that it is a dialog window and should be treated specially.
# The exact treatment depends on the treatment of the window
# manager
#
# Copyright (c) 1994-1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixDialogShell {
-superclass tixShell
-classname TixDialogShell
-method {
popdown popup center
}
-flag {
-mapped -minheight -minwidth -parent -transient
}
-static {}
-configspec {
{-mapped mapped Mapped 0}
{-minwidth minWidth MinWidth 0}
{-minheight minHeight MinHeight 0}
{-transient transient Transient true}
{-parent parent Parent ""}
}
}
#----------------------------------------------------------------------
# Construct widget
#----------------------------------------------------------------------
proc tixDialogShell:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
# Set the title of this shell appropriately
#
if {$data(-title) == ""} {
# dynamically sets the title
#
set data(-title) [winfo name $w]
}
wm title $w $data(-title)
# Set the parent of this dialog shell
#
if {$data(-parent) == ""} {
set data(-parent) [winfo parent $w]
}
# Set the minsize and maxsize of the thing
#
wm minsize $w $data(-minwidth) $data(-minheight)
wm transient $w ""
}
# The next procedures manage the dialog boxes
#
proc tixDialogShell:popup {w {parent ""}} {
upvar #0 $w data
# First update to make sure the boxes are the right size
#
update idletask
# Then we set the position and update
#
# tixDialogShell:center $w $parent
# and now make it visible. Viola! Centered over parent.
#
wm deiconify $w
after idle raise $w
}
# This procedure centers a dialog box over a window making sure that the
# dialog box doesn't appear off the screen
#
# However, if the parent is smaller than this dialog, make this dialog
# appear at parent(x,y) + (20,20)
#
proc tixDialogShell:center {w {parent ""}} {
upvar #0 $w data
# Tell the WM that we'll do this ourselves.
wm sizefrom $w user
wm positionfrom $w user
if {$parent == ""} {
set parent $data(-parent)
}
if {$parent == "" || [catch {set parent [winfo toplevel $parent]}]} {
set parent "."
}
# Where is my parent and what are it's dimensions
#
if {$parent != ""} {
set pargeo [split [wm geometry $parent] "+x"]
set parentW [lindex $pargeo 0]
set parentH [lindex $pargeo 1]
set parx [lindex $pargeo 2]
set pary [lindex $pargeo 3]
if {[string is true -strict $data(-transient)]} {
wm transient $w $parent
}
} else {
set parentW [winfo screenwidth $w]
set parentH [winfo screenheight $w]
set parx 0
set pary 0
set parent [winfo parent $w]
}
# What are is the offset of the virtual window
set vrootx [winfo vrootx $parent]
set vrooty [winfo vrooty $parent]
# What are my dimensions ?
set dialogW [winfo reqwidth $w]
set dialogH [winfo reqheight $w]
if {$dialogW < $parentW-30 || $dialogW < $parentH-30} {
set dialogx [expr {$parx+($parentW-$dialogW)/2+$vrootx}]
set dialogy [expr {$pary+($parentH-$dialogH)/2+$vrooty}]
} else {
# This dialog is too big. Place it at (parentx, parenty) + (20,20)
#
set dialogx [expr {$parx+20+$vrootx}]
set dialogy [expr {$pary+20+$vrooty}]
}
set maxx [expr {[winfo screenwidth $parent] - $dialogW}]
set maxy [expr {[winfo screenheight $parent] - $dialogH}]
# Make sure it doesn't go off screen
#
if {$dialogx < 0} {
set dialogx 0
} else {
if {$dialogx > $maxx} {
set dialogx $maxx
}
}
if {$dialogy < 0} {
set dialogy 0
} else {
if {$dialogy > $maxy} {
set dialogy $maxy
}
}
# set my new position (and dimensions)
#
if {[wm geometry $w] == "1x1+0+0"} {
wm geometry $w ${dialogW}x${dialogH}+${dialogx}+${dialogy}
}
}
proc tixDialogShell:popdown {w args} {
wm withdraw $w
}
Tix8.4.3/DefSchm.tcl 0000644 00000005705 15173441414 0007733 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: DefSchm.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# DefSchm.tcl --
#
# Implements the default color and font schemes for Tix.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
proc tixSetDefaultFontset {} {
global tixOption tcl_platform
switch -- $tcl_platform(platform) "windows" {
# This should be Tahoma for Win2000/XP
set font "MS Sans Serif"
set fixedfont "Courier New"
set size 8
} unix {
set font "helvetica"
set fixedfont "courier"
set size -12
}
set tixOption(font) [list $font $size]
set tixOption(bold_font) [list $font $size bold]
set tixOption(menu_font) [list $font $size]
set tixOption(italic_font) [list $font $size bold italic]
set tixOption(fixed_font) [list $fixedfont $size]
set tixOption(border1) 1
}
proc tixSetDefaultScheme-Color {} {
global tixOption
set tixOption(bg) #d9d9d9
set tixOption(fg) black
set tixOption(dark1_bg) #c3c3c3
set tixOption(dark1_fg) black
set tixOption(dark2_bg) #a3a3a3
set tixOption(dark2_fg) black
set tixOption(inactive_bg) #a3a3a3
set tixOption(inactive_fg) black
set tixOption(light1_bg) #ececec
set tixOption(light1_fg) white
set tixOption(light2_bg) #fcfcfc
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) #d9d9d9
set tixOption(input2_bg) #d9d9d9
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) #c3c3c3
set tixOption(selector) #b03060
}
proc tixSetDefaultScheme-Mono {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray70
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray60
set tixOption(dark2_fg) white
set tixOption(inactive_bg) lightgray
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) gray90
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) $tixOption(light1_bg)
set tixOption(input2_bg) $tixOption(light1_bg)
set tixOption(output1_bg) $tixOption(light1_bg)
set tixOption(output2_bg) $tixOption(light1_bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) black
}
Tix8.4.3/HListDD.tcl 0000644 00000010624 15173441414 0007651 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: HListDD.tcl,v 1.3 2001/12/09 05:04:02 idiscovery Exp $
#
# HListDD.tcl --
#
# !!! PRE-ALPHA CODE, NOT USED, DON'T USE !!!
#
# This file implements drag+drop for HList.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
# events
#
#
proc tixHListSingle:DragTimer {w ent} {
case [tixHListSingle:GetState $w] {
{1} {
# fire up
}
}
}
#----------------------------------------------------------------------
#
# Drag + Drop Bindings
#
#----------------------------------------------------------------------
#----------------------------------------#
# Sending Actions #
#----------------------------------------#
#----------------------------------------------------------------------
# tixHListSingle:Send:WaitDrag --
#
# Sender wait for dragging action
#----------------------------------------------------------------------
proc tixHListSingle:Send:WaitDrag {w x y} {
global tixPriv
set ent [tixHListSingle:GetNearest $w $y]
if {$ent != ""} {
$w anchor set $ent
$w select clear
$w select set $ent
set tixPriv(dd,$w:moved) 0
set tixPriv(dd,$w:entry) $ent
# set browsecmd [$w cget -browsecmd]
# if {$browsecmd != "" && $ent != ""} {
# eval $browsecmd $ent
# }
}
}
proc tixHListSingle:Send:StartDrag {w x y} {
global tixPriv
set dd [tixGetDragDropContext $w]
if {![info exists tixPriv(dd,$w:entry)]} {
return
}
if {$tixPriv(dd,$w:entry) == ""} {
return
}
if {$tixPriv(dd,$w:moved) == 0} {
$w dragsite set $tixPriv(dd,$w:entry)
set tixPriv(dd,$w:moved) 1
$dd config -source $w -command [list tixHListSingle:Send:Cmd $w]
$dd startdrag $X $Y
} else {
$dd drag $X $Y
}
}
proc tixHListSingle:Send:DoneDrag {w x y} {
global tixPriv
global moved
if {![info exists tixPriv(dd,$w:entry)]} {
return
}
if {$tixPriv(dd,$w:entry) == ""} {
return
}
if {$tixPriv(dd,$w:moved) == 1} {
set dd [tixGetDragDropContext $w]
$dd drop $X $Y
}
$w dragsite clear
catch {unset tixPriv(dd,$w:moved)}
catch {unset tixPriv(dd,$w:entry)}
}
proc tixHListSingle:Send:Cmd {w option args} {
set dragCmd [$w cget -dragcmd]
if {$dragCmd != ""} {
return [eval $dragCmd $option $args]
}
# Perform the default action
#
case "$option" {
who {
return $w
}
types {
return {data text}
}
get {
global tixPriv
if {[lindex $args 0] == "text"} {
if {$tixPriv(dd,$w:entry) != ""} {
return [$w entrycget $tixPriv(dd,$w:entry) -text]
}
}
if {[lindex $args 0] == "data"} {
if {$tixPriv(dd,$w:entry) != ""} {
return [$w entrycget $tixPriv(dd,$w:entry) -data]
}
}
}
}
}
#----------------------------------------#
# Receiving Actions #
#----------------------------------------#
proc tixHListSingle:Rec:DragOver {w sender x y} {
if {[$w cget -selectmode] != "dragdrop"} {
return
}
set ent [tixHListSingle:GetNearest $w $y]
if {$ent != ""} {
$w dropsite set $ent
} else {
$w dropsite clear
}
}
proc tixHListSingle:Rec:DragIn {w sender x y} {
if {[$w cget -selectmode] != "dragdrop"} {
return
}
set ent [tixHListSingle:GetNearest $w $y]
if {$ent != ""} {
$w dropsite set $ent
} else {
$w dropsite clear
}
}
proc tixHListSingle:Rec:DragOut {w sender x y} {
if {[$w cget -selectmode] != "dragdrop"} {
return
}
$w dropsite clear
}
proc tixHListSingle:Rec:Drop {w sender x y} {
if {[$w cget -selectmode] != "dragdrop"} {
return
}
$w dropsite clear
set ent [tixHListSingle:GetNearest $w $y]
if {$ent != ""} {
$w anchor set $ent
$w select clear
$w select set $ent
}
set dropCmd [$w cget -dropcmd]
if {$dropCmd != ""} {
eval $dropCmd $sender $x $y
return
}
# set browsecmd [$w cget -browsecmd]
# if {$browsecmd != "" && $ent != ""} {
# eval $browsecmd [list $ent]
# }
}
tixDropBind TixHListSingle <In> "tixHListSingle:Rec:DragIn %W %S %x %y"
tixDropBind TixHListSingle <Over> "tixHListSingle:Rec:DragOver %W %S %x %y"
tixDropBind TixHListSingle <Out> "tixHListSingle:Rec:DragOut %W %S %x %y"
tixDropBind TixHListSingle <Drop> "tixHListSingle:Rec:Drop %W %S %x %y"
Tix8.4.3/LabEntry.tcl 0000644 00000004137 15173441414 0010140 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: LabEntry.tcl,v 1.4 2004/03/28 02:44:57 hobbs Exp $
#
# LabEntry.tcl --
#
# TixLabelEntry Widget: an entry box with a label
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixLabelEntry {
-classname TixLabelEntry
-superclass tixLabelWidget
-method {
}
-flag {
-disabledforeground -state
}
-forcecall {
-state
}
-static {
}
-configspec {
{-disabledforeground disabledForeground DisabledForeground #303030}
{-state state State normal}
}
-default {
{.borderWidth 0}
{*entry.relief sunken}
{*entry.width 7}
{*label.anchor e}
{*label.borderWidth 0}
}
}
proc tixLabelEntry:ConstructFramedWidget {w frame} {
upvar #0 $w data
tixChainMethod $w ConstructFramedWidget $frame
set data(w:entry) [entry $frame.entry]
pack $data(w:entry) -side left -expand yes -fill both
# This value is used to configure the disable/normal fg of the ebtry
#
set data(entryfg) [$data(w:entry) cget -fg]
set data(labelfg) [$data(w:label) cget -fg]
}
proc tixLabelEntryBind {} {
tixBind TixLabelEntry <FocusIn> {
if {[focus -displayof [set %W(w:entry)]] ne [set %W(w:entry)]} {
focus [%W subwidget entry]
[set %W(w:entry)] selection from 0
[set %W(w:entry)] selection to end
[set %W(w:entry)] icursor end
}
}
}
#----------------------------------------------------------------------
# CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixLabelEntry:config-state {w value} {
upvar #0 $w data
if {$value == "normal"} {
catch {
$data(w:label) config -fg $data(labelfg)
}
$data(w:entry) config -state $value -fg $data(entryfg)
} else {
catch {
$data(w:label) config -fg $data(-disabledforeground)
}
$data(w:entry) config -state $value -fg $data(-disabledforeground)
}
}
Tix8.4.3/StdBBox.tcl 0000644 00000003170 15173441414 0007721 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: StdBBox.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# StdBBox.tcl --
#
# Standard Button Box, used in standard dialog boxes
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixStdButtonBox {
-classname TixStdButtonBox
-superclass tixButtonBox
-flag {
-applycmd -cancelcmd -helpcmd -okcmd
}
-configspec {
{-applycmd applyCmd ApplyCmd ""}
{-cancelcmd cancelCmd CancelCmd ""}
{-helpcmd helpCmd HelpCmd ""}
{-okcmd okCmd OkCmd ""}
}
-default {
{.borderWidth 1}
{.relief raised}
{.padX 5}
{.padY 10}
{*Button.anchor c}
{*Button.padX 5}
}
}
proc tixStdButtonBox:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
$w add ok -text OK -under 0 -width 6 -command $data(-okcmd)
$w add apply -text Apply -under 0 -width 6 -command $data(-applycmd)
$w add cancel -text Cancel -under 0 -width 6 -command $data(-cancelcmd)
$w add help -text Help -under 0 -width 6 -command $data(-helpcmd)
}
proc tixStdButtonBox:config {w flag value} {
upvar #0 $w data
case $flag {
-okcmd {
$data(w:ok) config -command $value
}
-applycmd {
$data(w:apply) config -command $value
}
-cancelcmd {
$data(w:cancel) config -command $value
}
-helpcmd {
$data(w:help) config -command $value
}
default {
tixChainMethod $w config $flag $value
}
}
}
Tix8.4.3/FloatEnt.tcl 0000644 00000006150 15173441414 0010131 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: FloatEnt.tcl,v 1.4 2004/03/28 02:44:57 hobbs Exp $
#
# FloatEnt.tcl --
#
# An entry widget that can be attached on top of any widget to
# provide dynamic editing. It is used to provide dynamic editing
# for the tixGrid widget, among other things.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixFloatEntry {
-classname TixFloatEntry
-superclass tixPrimitive
-method {
invoke post unpost
}
-flag {
-command -value
}
-configspec {
{-value value Value ""}
{-command command Command ""}
}
-default {
{.entry.highlightThickness 0}
}
}
#----------------------------------------------------------------------
#
# Initialization bindings
#
#----------------------------------------------------------------------
proc tixFloatEntry:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
}
proc tixFloatEntry:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:entry) [entry $w.entry]
pack $data(w:entry) -expand yes -fill both
}
proc tixFloatEntry:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
tixBind $data(w:entry) <Return> [list tixFloatEntry:invoke $w]
}
#----------------------------------------------------------------------
#
# Class bindings
#
#----------------------------------------------------------------------
proc tixFloatEntryBind {} {
tixBind TixFloatEntry <FocusIn> {
if {[focus -displayof [set %W(w:entry)]] ne [set %W(w:entry)]} {
focus [%W subwidget entry]
[set %W(w:entry)] selection from 0
[set %W(w:entry)] selection to end
[set %W(w:entry)] icursor end
}
}
}
#----------------------------------------------------------------------
#
# Public methods
#
#----------------------------------------------------------------------
proc tixFloatEntry:post {w x y {width ""} {height ""}} {
upvar #0 $w data
if {$width == ""} {
set width [winfo reqwidth $data(w:entry)]
}
if {$height == ""} {
set height [winfo reqheight $data(w:entry)]
}
place $w -x $x -y $y -width $width -height $height -bordermode ignore
raise $w
focus $data(w:entry)
}
proc tixFloatEntry:unpost {w} {
upvar #0 $w data
place forget $w
}
proc tixFloatEntry:config-value {w val} {
upvar #0 $w data
$data(w:entry) delete 0 end
$data(w:entry) insert 0 $val
$data(w:entry) selection from 0
$data(w:entry) selection to end
$data(w:entry) icursor end
}
#----------------------------------------------------------------------
#
# Private methods
#
#----------------------------------------------------------------------
proc tixFloatEntry:invoke {w} {
upvar #0 $w data
if {[llength $data(-command)]} {
set bind(specs) {%V}
set bind(%V) [$data(w:entry) get]
tixEvalCmdBinding $w $data(-command) bind $bind(%V)
}
}
Tix8.4.3/StatBar.tcl 0000644 00000002473 15173441414 0007761 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: StatBar.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# StatBar.tcl --
#
# The StatusBar of an application.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixStatusBar {
-classname TixStatusBar
-superclass tixPrimitive
-method {
}
-flag {
-fields
}
-static {
-fields
}
-configspec {
{-fields fields Fields ""}
}
}
#--------------------------
# Create Widget
#--------------------------
proc tixStatusBar:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
foreach field $data(-fields) {
set name [lindex $field 0]
set width [lindex $field 1]
set data(w:width) [label $w.$name -width $width]
}
}
#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# Internal commands
#----------------------------------------------------------------------
Tix8.4.3/SListBox.tcl 0000644 00000015742 15173441414 0010133 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: SListBox.tcl,v 1.5 2004/03/28 02:44:57 hobbs Exp $
#
# SListBox.tcl --
#
# This file implements Scrolled Listbox widgets
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# ToDo:
# -anchor (none)
#
tixWidgetClass tixScrolledListBox {
-classname TixScrolledListBox
-superclass tixScrolledWidget
-method {
}
-flag {
-anchor -browsecmd -command -state
}
-static {
-anchor
}
-configspec {
{-anchor anchor Anchor w}
{-browsecmd browseCmd BrowseCmd ""}
{-command command Command ""}
{-state state State normal}
{-takefocus takeFocus TakeFocus 1 tixVerifyBoolean}
}
-default {
{.scrollbar auto}
{*borderWidth 1}
{*listbox.highlightBackground #d9d9d9}
{*listbox.relief sunken}
{*listbox.background #c3c3c3}
{*listbox.takeFocus 1}
{*Scrollbar.takeFocus 0}
}
}
proc tixScrolledListBox:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(x-first) 0
set data(x-last) 1
set data(y-first) 0
set data(y-last) 1
}
proc tixScrolledListBox:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:listbox) \
[listbox $w.listbox]
set data(w:hsb) \
[scrollbar $w.hsb -orient horizontal]
set data(w:vsb) \
[scrollbar $w.vsb -orient vertical ]
set data(pw:client) $data(w:listbox)
}
proc tixScrolledListBox:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:listbox) config \
-xscrollcommand "tixScrolledListBox:XView $w"\
-yscrollcommand "tixScrolledListBox:YView $w"
$data(w:hsb) config -command "$data(w:listbox) xview"
$data(w:vsb) config -command "$data(w:listbox) yview"
bind $w <Configure> "+tixScrolledListBox:Configure $w"
bind $w <FocusIn> "focus $data(w:listbox)"
bindtags $data(w:listbox) \
"$data(w:listbox) TixListboxState Listbox TixListbox [winfo toplevel $data(w:listbox)] all"
tixSetMegaWidget $data(w:listbox) $w
}
proc tixScrolledListBoxBind {} {
tixBind TixListboxState <1> {
if {[set [tixGetMegaWidget %W](-state)] eq "disabled"} {
break
}
}
tixBind TixListbox <1> {
if {[string is true -strict [%W cget -takefocus]]} {
focus %W
}
tixScrolledListBox:Browse [tixGetMegaWidget %W]
}
tixBind TixListboxState <B1-Motion> {
if {[set [tixGetMegaWidget %W](-state)] eq "disabled"} {
break
}
}
tixBind TixListbox <B1-Motion> {
tixScrolledListBox:Browse [tixGetMegaWidget %W]
}
tixBind TixListboxState <Up> {
if {[set [tixGetMegaWidget %W](-state)] eq "disabled"} {
break
}
}
tixBind TixListbox <Up> {
tixScrolledListBox:KeyBrowse [tixGetMegaWidget %W]
}
tixBind TixListboxState <Down> {
if {[set [tixGetMegaWidget %W](-state)] eq "disabled"} {
break
}
}
tixBind TixListbox <Down> {
tixScrolledListBox:KeyBrowse [tixGetMegaWidget %W]
}
tixBind TixListboxState <Return> {
if {[set [tixGetMegaWidget %W](-state)] eq "disabled"} {
break
}
}
tixBind TixListbox <Return> {
tixScrolledListBox:KeyInvoke [tixGetMegaWidget %W]
}
tixBind TixListboxState <Double-1> {
if {[set [tixGetMegaWidget %W](-state)] eq "disabled"} {
break
}
}
tixBind TixListbox <Double-1> {
tixScrolledListBox:Invoke [tixGetMegaWidget %W]
}
tixBind TixListboxState <ButtonRelease-1> {
if {[set [tixGetMegaWidget %W](-state)] eq "disabled"} {
break
}
}
tixBind TixListbox <ButtonRelease-1> {
tixScrolledListBox:Browse [tixGetMegaWidget %W]
}
}
proc tixScrolledListBox:Browse {w} {
upvar #0 $w data
if {$data(-browsecmd) != ""} {
set bind(specs) {%V}
set bind(%V) [$data(w:listbox) get \
[$data(w:listbox) nearest [tixEvent flag y]]]
tixEvalCmdBinding $w $data(-browsecmd) bind
}
}
proc tixScrolledListBox:KeyBrowse {w} {
upvar #0 $w data
if {$data(-browsecmd) != ""} {
set bind(specs) {%V}
set bind(%V) [$data(w:listbox) get active]
tixEvalCmdBinding $w $data(-browsecmd) bind
}
}
# tixScrolledListBox:Invoke --
#
# The user has invoked the listbox by pressing either the <Returh>
# key or double-clicking. Call the user-supplied -command function.
#
# For both -browsecmd and -command, it is the responsibility of the
# user-supplied function to determine the current selection of the listbox
#
proc tixScrolledListBox:Invoke {w} {
upvar #0 $w data
if {$data(-command) != ""} {
set bind(specs) {%V}
set bind(%V) [$data(w:listbox) get \
[$data(w:listbox) nearest [tixEvent flag y]]]
tixEvalCmdBinding $w $data(-command) bind
}
}
proc tixScrolledListBox:KeyInvoke {w} {
upvar #0 $w data
if {$data(-command) != ""} {
set bind(specs) {%V}
set bind(%V) [$data(w:listbox) get active]
tixEvalCmdBinding $w $data(-command) bind
}
}
#----------------------------------------------------------------------
#
# option configs
#----------------------------------------------------------------------
proc tixScrolledListBox:config-takefocus {w value} {
upvar #0 $w data
$data(w:listbox) config -takefocus $value
}
#----------------------------------------------------------------------
#
# Widget commands
#----------------------------------------------------------------------
#----------------------------------------------------------------------
#
# Private Methods
#----------------------------------------------------------------------
proc tixScrolledListBox:XView {w first last} {
upvar #0 $w data
set data(x-first) $first
set data(x-last) $last
$data(w:hsb) set $first $last
tixWidgetDoWhenIdle tixScrolledWidget:Configure $w
}
proc tixScrolledListBox:YView {w first last} {
upvar #0 $w data
set data(y-first) $first
set data(y-last) $last
$data(w:vsb) set $first $last
tixWidgetDoWhenIdle tixScrolledWidget:Configure $w
# Somehow an update here must be used to advoid osscilation
#
update idletasks
}
#
#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#----------------------------------------------------------------------
proc tixScrolledListBox:GeometryInfo {w mW mH} {
upvar #0 $w data
return [list \
[list $data(x-first) $data(x-last)]\
[list $data(y-first) $data(y-last)]]
}
proc tixScrolledListBox:Configure {w} {
upvar #0 $w data
tixWidgetDoWhenIdle tixScrolledListBox:TrickScrollbar $w
if {$data(-anchor) eq "e"} {
$data(w:listbox) xview 100000
}
}
# This procedure is necessary because listbox does not call x,y scroll command
# when its size is changed
#
proc tixScrolledListBox:TrickScrollbar {w} {
upvar #0 $w data
set inc [$data(w:listbox) select include 0]
$data(w:listbox) select set 0
if {!$inc} {
$data(w:listbox) select clear 0
}
}
Tix8.4.3/TList.tcl 0000644 00000043131 15173441414 0007454 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: TList.tcl,v 1.6 2002/01/24 09:13:58 idiscovery Exp $
#
# TList.tcl --
#
# This file defines the default bindings for Tix Tabular Listbox
# widgets.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
global tkPriv
if {![llength [info globals tkPriv]]} {
tk::unsupported::ExposePrivateVariable tkPriv
}
#--------------------------------------------------------------------------
# tkPriv elements used in this file:
#
# afterId - Token returned by "after" for autoscanning.
# fakeRelease - Cancel the ButtonRelease-1 after the user double click
#--------------------------------------------------------------------------
#
proc tixTListBind {} {
tixBind TixTList <ButtonPress-1> {
tixTList:Button-1 %W %x %y
}
tixBind TixTList <Shift-ButtonPress-1> {
tixTList:Shift-Button-1 %W %x %y
}
tixBind TixTList <Control-ButtonPress-1> {
tixTList:Control-Button-1 %W %x %y
}
tixBind TixTList <ButtonRelease-1> {
tixTList:ButtonRelease-1 %W %x %y
}
tixBind TixTList <Double-ButtonPress-1> {
tixTList:Double-1 %W %x %y
}
tixBind TixTList <B1-Motion> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixTList:B1-Motion %W %x %y
}
tixBind TixTList <Control-B1-Motion> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixTList:Control-B1-Motion %W %x %y
}
tixBind TixTList <B1-Leave> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixTList:B1-Leave %W
}
tixBind TixTList <B1-Enter> {
tixTList:B1-Enter %W %x %y
}
tixBind TixTList <Control-B1-Leave> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixTList:Control-B1-Leave %W
}
tixBind TixTList <Control-B1-Enter> {
tixTList:Control-B1-Enter %W %x %y
}
# Keyboard bindings
#
tixBind TixTList <Up> {
tixTList:DirKey %W up
}
tixBind TixTList <Down> {
tixTList:DirKey %W down
}
tixBind TixTList <Left> {
tixTList:DirKey %W left
}
tixBind TixTList <Right> {
tixTList:DirKey %W right
}
tixBind TixTList <Prior> {
%W yview scroll -1 pages
}
tixBind TixTList <Next> {
%W yview scroll 1 pages
}
tixBind TixTList <Return> {
tixTList:Return %W
}
tixBind TixTList <space> {
tixTList:Space %W
}
#
# Don't use tixBind because %A causes Tk 8.3.2 to crash
#
bind TixTList <MouseWheel> {
if {"[%W cget -orient]" == "vertical"} {
%W xview scroll [expr {- (%D / 120) * 4}] units
} else {
%W yview scroll [expr {- (%D / 120) * 2}] units
}
}
}
#----------------------------------------------------------------------
#
#
# Mouse bindings
#
#
#----------------------------------------------------------------------
proc tixTList:Button-1 {w x y} {
if {[$w cget -state] == "disabled"} {
return
}
if {[$w cget -takefocus]} {
focus $w
}
case [tixTList:GetState $w] {
{s0} {
tixTList:GoState s1 $w $x $y
}
{b0} {
tixTList:GoState b1 $w $x $y
}
{m0} {
tixTList:GoState m1 $w $x $y
}
{e0} {
tixTList:GoState e1 $w $x $y
}
}
}
proc tixTList:Shift-Button-1 {w x y} {
if {[$w cget -state] == "disabled"} {
return
}
if {[$w cget -takefocus]} {
focus $w
}
case [tixTList:GetState $w] {
{s0} {
tixTList:GoState s1 $w $x $y
}
{b0} {
tixTList:GoState b1 $w $x $y
}
{m0} {
tixTList:GoState m7 $w $x $y
}
{e0} {
tixTList:GoState e7 $w $x $y
}
}
}
proc tixTList:Control-Button-1 {w x y} {
if {[$w cget -state] == "disabled"} {
return
}
if {[$w cget -takefocus]} {
focus $w
}
case [tixTList:GetState $w] {
{s0} {
tixTList:GoState s1 $w $x $y
}
{b0} {
tixTList:GoState b1 $w $x $y
}
{m0} {
tixTList:GoState m1 $w $x $y
}
{e0} {
tixTList:GoState e10 $w $x $y
}
}
}
proc tixTList:ButtonRelease-1 {w x y} {
case [tixTList:GetState $w] {
{s2 s4 s5 s6} {
tixTList:GoState s3 $w
}
{b2 b4 b5 b6} {
tixTList:GoState b3 $w
}
{m2} {
tixTList:GoState m3 $w
}
{m5} {
tixTList:GoState m6 $w $x $y
}
{m9} {
tixTList:GoState m0 $w
}
{e2} {
tixTList:GoState e3 $w
}
{e5} {
tixTList:GoState e6 $w $x $y
}
{e9} {
tixTList:GoState e0 $w
}
}
}
proc tixTList:B1-Motion {w x y} {
case [tixTList:GetState $w] {
{s2 s4} {
tixTList:GoState s4 $w $x $y
}
{b2 b4} {
tixTList:GoState b4 $w $x $y
}
{m2 m5} {
tixTList:GoState m4 $w $x $y
}
{e2 e5} {
tixTList:GoState e4 $w $x $y
}
}
}
proc tixTList:Control-B1-Motion {w x y} {
case [tixTList:GetState $w] {
{s2 s4} {
tixTList:GoState s4 $w $x $y
}
{b2 b4} {
tixTList:GoState b4 $w $x $y
}
{m2 m5} {
tixTList:GoState m4 $w $x $y
}
}
}
proc tixTList:Double-1 {w x y} {
case [tixTList:GetState $w] {
{s0} {
tixTList:GoState s7 $w $x $y
}
{b0} {
tixTList:GoState b7 $w $x $y
}
}
}
proc tixTList:B1-Leave {w} {
case [tixTList:GetState $w] {
{s2 s4} {
tixTList:GoState s5 $w
}
{b2 b4} {
tixTList:GoState b5 $w
}
{m2 m5} {
tixTList:GoState m8 $w
}
{e2 e5} {
tixTList:GoState e8 $w
}
}
}
proc tixTList:B1-Enter {w x y} {
case [tixTList:GetState $w] {
{s5 s6} {
tixTList:GoState s4 $w $x $y
}
{b5 b6} {
tixTList:GoState b4 $w $x $y
}
{m8 m9} {
tixTList:GoState m4 $w $x $y
}
{e8 e9} {
tixTList:GoState e4 $w $x $y
}
}
}
proc tixTList:Control-B1-Leave {w} {
case [tixTList:GetState $w] {
{s2 s4} {
tixTList:GoState s5 $w
}
{b2 b4} {
tixTList:GoState b5 $w
}
{m2 m5} {
tixTList:GoState m8 $w
}
}
}
proc tixTList:Control-B1-Enter {w x y} {
case [tixTList:GetState $w] {
{s5 s6} {
tixTList:GoState s4 $w $x $y
}
{b5 b6} {
tixTList:GoState b4 $w $x $y
}
{m8 m9} {
tixTList:GoState m4 $w $x $y
}
}
}
proc tixTList:AutoScan {w} {
case [tixTList:GetState $w] {
{s5 s6} {
tixTList:GoState s6 $w
}
{b5 b6} {
tixTList:GoState b6 $w
}
{m8 m9} {
tixTList:GoState m9 $w
}
{e8 e9} {
tixTList:GoState e9 $w
}
}
}
#----------------------------------------------------------------------
#
#
# Key bindings
#
#
#----------------------------------------------------------------------
proc tixTList:DirKey {w key} {
if {[$w cget -state] == "disabled"} {
return
}
case [tixTList:GetState $w] {
{s0} {
tixTList:GoState s8 $w $key
}
{b0} {
tixTList:GoState b8 $w $key
}
}
}
proc tixTList:Return {w} {
if {[$w cget -state] == "disabled"} {
return
}
case [tixTList:GetState $w] {
{s0} {
tixTList:GoState s9 $w
}
{b0} {
tixTList:GoState b9 $w
}
}
}
proc tixTList:Space {w} {
if {[$w cget -state] == "disabled"} {
return
}
case [tixTList:GetState $w] {
{s0} {
tixTList:GoState s10 $w
}
{b0} {
tixTList:GoState b10 $w
}
}
}
#----------------------------------------------------------------------
#
# STATE MANIPULATION
#
#
#----------------------------------------------------------------------
proc tixTList:GetState {w} {
global $w:priv:state
if {[info exists $w:priv:state]} {
#
# If the app has changed the selectmode, reset the state to the
# original state.
#
set type [string index [$w cget -selectmode] 0]
if {"[string index [set $w:priv:state] 0]" != "$type"} {
unset $w:priv:state
}
}
if {![info exists $w:priv:state]} {
case [$w cget -selectmode] {
single {
set $w:priv:state s0
}
browse {
set $w:priv:state b0
}
multiple {
set $w:priv:state m0
}
extended {
set $w:priv:state e0
}
default {
set $w:priv:state unknown
}
}
}
return [set $w:priv:state]
}
proc tixTList:SetState {w n} {
global $w:priv:state
set $w:priv:state $n
}
proc tixTList:GoState {n w args} {
# puts "going from [tixTList:GetState $w] --> $n"
tixTList:SetState $w $n
eval tixTList:GoState-$n $w $args
}
#----------------------------------------------------------------------
# States
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# SINGLE SELECTION
#----------------------------------------------------------------------
proc tixTList:GoState-s0 {w} {
}
proc tixTList:GoState-s1 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w anchor set $ent
$w see $ent
}
tixTList:GoState s2 $w
}
proc tixTList:GoState-s2 {w} {
}
proc tixTList:GoState-s3 {w} {
set ent [$w info anchor]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixTList:CallBrowseCmd $w $ent
}
tixTList:GoState s0 $w
}
proc tixTList:GoState-s4 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w anchor set $ent
$w see $ent
}
}
proc tixTList:GoState-s5 {w} {
tixTList:StartScan $w
}
proc tixTList:GoState-s6 {w} {
global tkPriv
tixTList:DoScan $w
}
proc tixTList:GoState-s7 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixTList:CallCommand $w $ent
}
tixTList:GoState s0 $w
}
proc tixTList:GoState-s8 {w key} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
} else {
set anchor [$w info $key $anchor]
}
$w anchor set $anchor
$w see $anchor
tixTList:GoState s0 $w
}
proc tixTList:GoState-s9 {w} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
$w anchor set $anchor
$w see $anchor
}
if {[$w info anchor] != ""} {
# ! may not have any elements
#
tixTList:CallCommand $w [$w info anchor]
$w selection clear
$w selection set $anchor
}
tixTList:GoState s0 $w
}
proc tixTList:GoState-s10 {w} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
$w anchor set $anchor
$w see $anchor
}
if {[$w info anchor] != ""} {
# ! may not have any elements
#
tixTList:CallBrowseCmd $w [$w info anchor]
$w selection clear
$w selection set $anchor
}
tixTList:GoState s0 $w
}
#----------------------------------------------------------------------
# BROWSE SELECTION
#----------------------------------------------------------------------
proc tixTList:GoState-b0 {w} {
}
proc tixTList:GoState-b1 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w anchor set $ent
$w see $ent
$w selection clear
$w selection set $ent
tixTList:CallBrowseCmd $w $ent
}
tixTList:GoState b2 $w
}
proc tixTList:GoState-b2 {w} {
}
proc tixTList:GoState-b3 {w} {
set ent [$w info anchor]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixTList:CallBrowseCmd $w $ent
}
tixTList:GoState b0 $w
}
proc tixTList:GoState-b4 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w anchor set $ent
$w see $ent
$w selection clear
$w selection set $ent
tixTList:CallBrowseCmd $w $ent
}
}
proc tixTList:GoState-b5 {w} {
tixTList:StartScan $w
}
proc tixTList:GoState-b6 {w} {
global tkPriv
tixTList:DoScan $w
}
proc tixTList:GoState-b7 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixTList:CallCommand $w $ent
}
tixTList:GoState b0 $w
}
proc tixTList:GoState-b8 {w key} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
} else {
set anchor [$w info $key $anchor]
}
$w anchor set $anchor
$w selection clear
$w selection set $anchor
$w see $anchor
tixTList:CallBrowseCmd $w $anchor
tixTList:GoState b0 $w
}
proc tixTList:GoState-b9 {w} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
$w anchor set $anchor
$w see $anchor
}
if {[$w info anchor] != ""} {
# ! may not have any elements
#
tixTList:CallCommand $w [$w info anchor]
$w selection clear
$w selection set $anchor
}
tixTList:GoState b0 $w
}
proc tixTList:GoState-b10 {w} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
$w anchor set $anchor
$w see $anchor
}
if {[$w info anchor] != ""} {
# ! may not have any elements
#
tixTList:CallBrowseCmd $w [$w info anchor]
$w selection clear
$w selection set $anchor
}
tixTList:GoState b0 $w
}
#----------------------------------------------------------------------
# MULTIPLE SELECTION
#----------------------------------------------------------------------
proc tixTList:GoState-m0 {w} {
}
proc tixTList:GoState-m1 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w anchor set $ent
$w see $ent
$w selection clear
$w selection set $ent
tixTList:CallBrowseCmd $w $ent
}
tixTList:GoState m2 $w
}
proc tixTList:GoState-m2 {w} {
}
proc tixTList:GoState-m3 {w} {
set ent [$w info anchor]
if {$ent != ""} {
tixTList:CallBrowseCmd $w $ent
}
tixTList:GoState m0 $w
}
proc tixTList:GoState-m4 {w x y} {
set from [$w info anchor]
set to [$w nearest $x $y]
if {$to != ""} {
$w selection clear
$w selection set $from $to
tixTList:CallBrowseCmd $w $to
}
tixTList:GoState m5 $w
}
proc tixTList:GoState-m5 {w} {
}
proc tixTList:GoState-m6 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
tixTList:CallBrowseCmd $w $ent
}
tixTList:GoState m0 $w
}
proc tixTList:GoState-m7 {w x y} {
set from [$w info anchor]
set to [$w nearest $x $y]
if {$from == ""} {
set from $to
$w anchor set $from
$w see $from
}
if {$to != ""} {
$w selection clear
$w selection set $from $to
tixTList:CallBrowseCmd $w $to
}
tixTList:GoState m5 $w
}
proc tixTList:GoState-m8 {w} {
tixTList:StartScan $w
}
proc tixTList:GoState-m9 {w} {
tixTList:DoScan $w
}
proc tixTList:GoState-xm7 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixTList:CallCommand $w $ent
}
tixTList:GoState m0 $w
}
#----------------------------------------------------------------------
# EXTENDED SELECTION
#----------------------------------------------------------------------
proc tixTList:GoState-e0 {w} {
}
proc tixTList:GoState-e1 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w anchor set $ent
$w see $ent
$w selection clear
$w selection set $ent
tixTList:CallBrowseCmd $w $ent
}
tixTList:GoState e2 $w
}
proc tixTList:GoState-e2 {w} {
}
proc tixTList:GoState-e3 {w} {
set ent [$w info anchor]
if {$ent != ""} {
tixTList:CallBrowseCmd $w $ent
}
tixTList:GoState e0 $w
}
proc tixTList:GoState-e4 {w x y} {
set from [$w info anchor]
set to [$w nearest $x $y]
if {$to != ""} {
$w selection clear
$w selection set $from $to
tixTList:CallBrowseCmd $w $to
}
tixTList:GoState e5 $w
}
proc tixTList:GoState-e5 {w} {
}
proc tixTList:GoState-e6 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
tixTList:CallBrowseCmd $w $ent
}
tixTList:GoState e0 $w
}
proc tixTList:GoState-e7 {w x y} {
set from [$w info anchor]
set to [$w nearest $x $y]
if {$from == ""} {
set from $to
$w anchor set $from
$w see $from
}
if {$to != ""} {
$w selection clear
$w selection set $from $to
tixTList:CallBrowseCmd $w $to
}
tixTList:GoState e5 $w
}
proc tixTList:GoState-e8 {w} {
tixTList:StartScan $w
}
proc tixTList:GoState-e9 {w} {
tixTList:DoScan $w
}
proc tixTList:GoState-e10 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
if {[$w info anchor] == ""} {
$w anchor set $ent
$w see $ent
}
if {[$w selection includes $ent]} {
$w selection clear $ent
} else {
$w selection set $ent
}
tixTList:CallBrowseCmd $w $ent
}
tixTList:GoState e2 $w
}
proc tixTList:GoState-xm7 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixTList:CallCommand $w $ent
}
tixTList:GoState e0 $w
}
#----------------------------------------------------------------------
# callback actions
#----------------------------------------------------------------------
proc tixTList:SetAnchor {w x y} {
set ent [$w nearest $x $y]
if {$ent != "" && [$w entrycget $ent -state] != "disabled"} {
$w anchor set $ent
$w see $ent
return $ent
}
return ""
}
proc tixTList:Select {w ent} {
$w selection clear
$w select set $ent
}
proc tixTList:StartScan {w} {
global tkPriv
set tkPriv(afterId) [after 50 tixTList:AutoScan $w]
}
proc tixTList:DoScan {w} {
global tkPriv
set x $tkPriv(x)
set y $tkPriv(y)
set X $tkPriv(X)
set Y $tkPriv(Y)
set out 0
if {$y >= [winfo height $w]} {
$w yview scroll 1 units
set out 1
}
if {$y < 0} {
$w yview scroll -1 units
set out 1
}
if {$x >= [winfo width $w]} {
$w xview scroll 2 units
set out 1
}
if {$x < 0} {
$w xview scroll -2 units
set out 1
}
if {$out} {
set tkPriv(afterId) [after 50 tixTList:AutoScan $w]
}
}
proc tixTList:CallBrowseCmd {w ent} {
set browsecmd [$w cget -browsecmd]
if {$browsecmd != ""} {
set bind(specs) {%V}
set bind(%V) $ent
tixEvalCmdBinding $w $browsecmd bind $ent
}
}
proc tixTList:CallCommand {w ent} {
set command [$w cget -command]
if {$command != ""} {
set bind(specs) {%V}
set bind(%V) $ent
tixEvalCmdBinding $w $command bind $ent
}
}
Tix8.4.3/PopMenu.tcl 0000644 00000012574 15173441414 0010007 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: PopMenu.tcl,v 1.7 2004/03/28 02:44:57 hobbs Exp $
#
# PopMenu.tcl --
#
# This file implements the TixPopupMenu widget
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
global tkPriv
if {![llength [info globals tkPriv]]} {
tk::unsupported::ExposePrivateVariable tkPriv
}
#--------------------------------------------------------------------------
# tkPriv elements used in this file:
#
# inMenubutton -
#--------------------------------------------------------------------------
#
foreach fun {tkMenuUnpost tkMbButtonUp tkMbEnter tkMbPost} {
if {![llength [info commands $fun]]} {
tk::unsupported::ExposePrivateCommand $fun
}
}
unset fun
tixWidgetClass tixPopupMenu {
-classname TixPopupMenu
-superclass tixShell
-method {
bind post unbind
}
-flag {
-buttons -installcolormap -postcmd -spring -state -title
}
-configspec {
{-buttons buttons Buttons {{3 {Any}}}}
{-installcolormap installColormap InstallColormap false}
{-postcmd postCmd PostCmd ""}
{-spring spring Spring 1 tixVerifyBoolean}
{-state state State normal}
{-cursor corsor Cursor arrow}
}
-static {
-buttons
}
-default {
{*Menu.tearOff 0}
}
}
proc tixPopupMenu:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(g:clients) ""
}
proc tixPopupMenu:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
wm overrideredirect $w 1
wm withdraw $w
set data(w:menubutton) [menubutton $w.menubutton -text $data(-title) \
-menu $w.menubutton.menu -anchor w]
set data(w:menu) [menu $w.menubutton.menu]
pack $data(w:menubutton) -expand yes -fill both
}
proc tixPopupMenu:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
foreach elm $data(-buttons) {
set btn [lindex $elm 0]
foreach mod [lindex $elm 1] {
tixBind TixPopupMenu:MB:$w <$mod-ButtonPress-$btn> \
"tixPopupMenu:Unpost $w"
tixBind TixPopupMenu:$w <$mod-ButtonPress-$btn> \
"tixPopupMenu:post $w %W %x %y"
}
tixBind TixPopupMenu:MB:$w <ButtonRelease-$btn> \
"tixPopupMenu:BtnRelease $w %X %Y"
tixBind TixPopupMenu:M:$w <Unmap> \
"tixPopupMenu:Unmap $w"
tixBind TixPopupMenu:$w <ButtonRelease-$btn> \
"tixPopupMenu:BtnRelease $w %X %Y"
tixAddBindTag $data(w:menubutton) TixPopupMenu:MB:$w
tixAddBindTag $data(w:menu) TixPopupMenu:M:$w
}
}
#----------------------------------------------------------------------
# PrivateMethods:
#----------------------------------------------------------------------
proc tixPopupMenu:Unpost {w} {
upvar #0 $w data
catch {
tkMenuUnpost ""
}
# tkMbButtonUp $data(w:menubutton)
}
proc tixPopupMenu:BtnRelease {w rootX rootY} {
upvar #0 $w data
set cW [winfo containing -displayof $w $rootX $rootY]
if {$data(-spring)} {
tixPopupMenu:Unpost $w
}
}
proc tixPopupMenu:Unmap {w} {
upvar #0 $w data
wm withdraw $w
}
proc tixPopupMenu:Destructor {w} {
upvar #0 $w data
foreach client $data(g:clients) {
if {[winfo exists $client]} {
tixDeleteBindTag $client TixPopupMenu:$w
}
}
# delete the extra bindings
#
foreach tag [list TixPopupMenu:MB:$w TixPopupMenu:M:$w] {
foreach e [bind $tag] {
bind $tag $e ""
}
}
tixChainMethod $w Destructor
}
proc tixPopupMenu:config-title {w value} {
upvar #0 $w data
$data(w:menubutton) config -text $value
}
#----------------------------------------------------------------------
# PublicMethods:
#----------------------------------------------------------------------
proc tixPopupMenu:bind {w args} {
upvar #0 $w data
foreach client $args {
if {[lsearch $data(g:clients) $client] == -1} {
lappend data(g:clients) $client
tixAppendBindTag $client TixPopupMenu:$w
}
}
}
proc tixPopupMenu:unbind {w args} {
upvar #0 $w data
foreach client $args {
if {[winfo exists $client]} {
set index [lsearch $data(g:clients) $client]
if {$index != -1} {
tixDeleteBindTag $client TixPopupMenu:$w
set data(g:clients) [lreplace $data(g:clients) $index $index]
}
}
}
}
proc tixPopupMenu:post {w client x y} {
upvar #0 $w data
global tkPriv
if {$data(-state) == "disabled"} {
return
}
set rootx [expr $x + [winfo rootx $client]]
set rooty [expr $y + [winfo rooty $client]]
if {$data(-postcmd) != ""} {
set ret [tixEvalCmdBinding $w $data(-postcmd) "" $rootx $rooty]
if {![tixGetBoolean $ret]} {
return
}
}
if {[string is true -strict $data(-installcolormap)]} {
wm colormapwindows . $w
}
set menuWidth [winfo reqwidth $data(w:menu)]
set width [winfo reqwidth $w]
set height [winfo reqheight $w]
if {$width < $menuWidth} {
set width $menuWidth
}
set wx $rootx
set wy $rooty
# trick: the following lines allow the popup menu
# acquire a stable width and height when it is finally
# put on the visible screen. Advoid flashing
#
wm geometry $w +10000+10000
wm deiconify $w
raise $w
update
wm geometry $w ${width}x${height}+${wx}+${wy}
update
tkMbEnter $data(w:menubutton)
tkMbPost $tkPriv(inMenubutton) $rootx $rooty
}
Tix8.4.3/EFileDlg.tcl 0000644 00000003266 15173441414 0010035 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: EFileDlg.tcl,v 1.3 2002/01/24 09:13:58 idiscovery Exp $
#
# EFileDlg.tcl --
#
# Implements the Extended File Selection Dialog widget.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
foreach fun {tkButtonInvoke} {
if {![llength [info commands $fun]]} {
tk::unsupported::ExposePrivateCommand $fun
}
}
unset fun
tixWidgetClass tixExFileSelectDialog {
-classname TixExFileSelectDialog
-superclass tixDialogShell
-method {}
-flag {
-command
}
-configspec {
{-command command Command ""}
{-title title Title "Select A File"}
}
}
proc tixExFileSelectDialog:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:fsbox) [tixExFileSelectBox $w.fsbox -dialog $w \
-command $data(-command)]
pack $data(w:fsbox) -expand yes -fill both
}
proc tixExFileSelectDialog:config-command {w value} {
upvar #0 $w data
$data(w:fsbox) config -command $value
}
proc tixExFileSelectDialog:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
bind $w <Alt-Key-f> "focus [$data(w:fsbox) subwidget file]"
bind $w <Alt-Key-t> "focus [$data(w:fsbox) subwidget types]"
bind $w <Alt-Key-d> "focus [$data(w:fsbox) subwidget dir]"
bind $w <Alt-Key-o> "tkButtonInvoke [$data(w:fsbox) subwidget ok]"
bind $w <Alt-Key-c> "tkButtonInvoke [$data(w:fsbox) subwidget cancel]"
bind $w <Alt-Key-s> "tkButtonInvoke [$data(w:fsbox) subwidget hidden]"
}
Tix8.4.3/Primitiv.tcl 0000644 00000024437 15173441414 0010230 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Primitiv.tcl,v 1.7 2004/03/28 02:44:57 hobbs Exp $
#
# Primitiv.tcl --
#
# This is the primitive widget. It is just a frame with proper
# inheritance wrapping. All new Tix widgets will be derived from
# this widget
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# No superclass, so the superclass switch is not used
#
#
tixWidgetClass tixPrimitive {
-virtual true
-superclass {}
-classname TixPrimitive
-method {
cget configure subwidget subwidgets
}
-flag {
-background -borderwidth -cursor
-height -highlightbackground -highlightcolor -highlightthickness
-options -relief -takefocus -width -bd -bg
}
-static {
-options
}
-configspec {
{-background background Background #d9d9d9}
{-borderwidth borderWidth BorderWidth 0}
{-cursor cursor Cursor ""}
{-height height Height 0}
{-highlightbackground highlightBackground HighlightBackground #c3c3c3}
{-highlightcolor highlightColor HighlightColor black}
{-highlightthickness highlightThickness HighlightThickness 0}
{-options options Options ""}
{-relief relief Relief flat}
{-takefocus takeFocus TakeFocus 0 tixVerifyBoolean}
{-width width Width 0}
}
-alias {
{-bd -borderwidth}
{-bg -background}
}
}
#----------------------------------------------------------------------
# ClassInitialization:
#----------------------------------------------------------------------
# not used
# Implemented in C
#
# Override: never
proc tixPrimitive:Constructor {w args} {
upvar #0 $w data
upvar #0 $data(className) classRec
# Set up some minimal items in the class record.
#
set data(w:root) $w
set data(rootCmd) $w:root
# We need to create the root widget in order to parse the options
# database
tixCallMethod $w CreateRootWidget
# Parse the default options from the options database
#
tixPrimitive:ParseDefaultOptions $w
# Parse the options supplied by the user
#
tixPrimitive:ParseUserOptions $w $args
# Rename the widget command so that it can be use to access
# the methods of this class
tixPrimitive:MkWidgetCmd $w
# Inistalize the Widget Record
#
tixCallMethod $w InitWidgetRec
# Construct the compound widget
#
tixCallMethod $w ConstructWidget
# Do the bindings
#
tixCallMethod $w SetBindings
# Call the configuration methods for all "force call" options
#
foreach option $classRec(forceCall) {
tixInt_ChangeOptions $w $option $data($option)
}
}
# Create only the root widget. We need the root widget to query the option
# database.
#
# Override: seldom. (unless you want to use a toplevel as root widget)
# Chain : never.
proc tixPrimitive:CreateRootWidget {w args} {
upvar #0 $w data
upvar #0 $data(className) classRec
frame $w -class $data(ClassName)
}
proc tixPrimitive:ParseDefaultOptions {w} {
upvar #0 $w data
upvar #0 $data(className) classRec
# SET UP THE INSTANCE RECORD ACCORDING TO DEFAULT VALUES IN
# THE OPTIONS DATABASE
#
foreach option $classRec(options) {
set spec [tixInt_GetOptionSpec $data(className) $option]
if {[lindex $spec 0] eq "="} {
continue
}
set o_name [lindex $spec 1]
set o_class [lindex $spec 2]
set o_default [lindex $spec 3]
if {![catch {option get $w $o_name $o_class} db_default]} {
if {$db_default ne ""} {
set data($option) $db_default
} else {
set data($option) $o_default
}
} else {
set data($option) $o_default
}
}
}
proc tixPrimitive:ParseUserOptions {w arglist} {
upvar #0 $w data
upvar #0 $data(className) classRec
# SET UP THE INSTANCE RECORD ACCORDING TO COMMAND ARGUMENTS FROM
# THE USER OF THE TIX LIBRARY (i.e. Application programmer:)
#
foreach {option arg} $arglist {
if {[lsearch $classRec(options) $option] != "-1"} {
set spec [tixInt_GetOptionSpec $data(className) $option]
if {[lindex $spec 0] ne "="} {
set data($option) $arg
} else {
set realOption [lindex $spec 1]
set data($realOption) $arg
}
} else {
error "unknown option $option. Should be: [tixInt_ListOptions $w]"
}
}
}
#----------------------------------------------------------------------
# Initialize the widget record
#
#
# Override: always
# Chain : always, before
proc tixPrimitive:InitWidgetRec {w} {
# default: do nothing
}
#----------------------------------------------------------------------
# SetBindings
#
#
# Override: sometimes
# Chain : sometimes, before
#
bind TixDestroyHandler <Destroy> {
[tixGetMethod %W [set %W(className)] Destructor] %W
}
proc tixPrimitive:SetBindings {w} {
upvar #0 $w data
if {[winfo toplevel $w] eq $w} {
bindtags $w [concat TixDestroyHandler [bindtags $w]]
} else {
bind $data(w:root) <Destroy> \
"[tixGetMethod $w $data(className) Destructor] $w"
}
}
#----------------------------------------------------------------------
# PrivateMethod: ConstructWidget
#
# Construct and set up the compound widget
#
# Override: sometimes
# Chain : sometimes, before
#
proc tixPrimitive:ConstructWidget {w} {
upvar #0 $w data
$data(rootCmd) config \
-background $data(-background) \
-borderwidth $data(-borderwidth) \
-cursor $data(-cursor) \
-relief $data(-relief)
if {$data(-width) != 0} {
$data(rootCmd) config -width $data(-width)
}
if {$data(-height) != 0} {
$data(rootCmd) config -height $data(-height)
}
set rootname *[string range $w 1 end]
foreach {spec value} $data(-options) {
option add $rootname*$spec $value 100
}
}
#----------------------------------------------------------------------
# PrivateMethod: MkWidgetCmd
#
# Construct and set up the compound widget
#
# Override: sometimes
# Chain : sometimes, before
#
proc tixPrimitive:MkWidgetCmd {w} {
upvar #0 $w data
rename $w $data(rootCmd)
tixInt_MkInstanceCmd $w
}
#----------------------------------------------------------------------
# ConfigOptions:
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# ConfigMethod: config
#
# Configure one option.
#
# Override: always
# Chain : automatic.
#
# Note the hack of [winfo width] in this procedure
#
# The hack is necessary because of the bad interaction between TK's geometry
# manager (the packer) and the frame widget. The packer determines the size
# of the root widget of the ComboBox (a frame widget) according to the
# requirement of the slaves inside the frame widget, NOT the -width
# option of the frame widget.
#
# However, everytime the frame widget is
# configured, it sends a geometry request to the packer according to its
# -width and -height options and the packer will temporarily resize
# the frame widget according to the requested size! The packer then realizes
# something is wrong and revert to the size determined by the slaves. This
# cause a flash on the screen.
#
foreach opt {-height -width -background -borderwidth -cursor
-highlightbackground -highlightcolor -relief -takefocus -bd -bg} {
set tixPrimOpt($opt) 1
}
proc tixPrimitive:config {w option value} {
global tixPrimOpt
upvar #0 $w data
if {[info exists tixPrimOpt($option)]} {
$data(rootCmd) config $option $value
}
}
#----------------------------------------------------------------------
# PublicMethods:
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# This method is used to implement the "subwidgets" widget command.
# Will be re-written in C. It can't be used as a public method because
# of the lame substring comparison routines used in tixClass.c
#
#
proc tixPrimitive:subwidgets {w type args} {
upvar #0 $w data
case $type {
-class {
set name [lindex $args 0]
set args [lrange $args 1 end]
# access subwidgets of a particular class
#
# note: if $name=="Frame", will *not return the root widget as well
#
set sub ""
foreach des [tixDescendants $w] {
if {[winfo class $des] eq $name} {
lappend sub $des
}
}
# Note: if the there is no subwidget of this class, does not
# cause any error.
#
if {$args eq ""} {
return $sub
} else {
foreach des $sub {
eval [linsert $args 0 $des]
}
return ""
}
}
-group {
set name [lindex $args 0]
set args [lrange $args 1 end]
# access subwidgets of a particular group
#
if {[info exists data(g:$name)]} {
if {$args eq ""} {
set ret ""
foreach item $data(g:$name) {
lappend ret $w.$item
}
return $ret
} else {
foreach item $data(g:$name) {
eval [linsert $args 0 $w.$item]
}
return ""
}
} else {
error "no such subwidget group $name"
}
}
-all {
set sub [tixDescendants $w]
if {$args eq ""} {
return $sub
} else {
foreach des $sub {
eval [linsert $args 0 $des]
}
return ""
}
}
default {
error "unknown flag $type, should be -all, -class or -group"
}
}
}
#----------------------------------------------------------------------
# PublicMethod: subwidget
#
# Access a subwidget withe a particular name
#
# Override: never
# Chain : never
#
# This is implemented in native C code in tixClass.c
#
proc tixPrimitive:subwidget {w name args} {
upvar #0 $w data
if {[info exists data(w:$name)]} {
if {$args eq ""} {
return $data(w:$name)
} else {
return [eval [linsert $args 0 $data(w:$name)]]
}
} else {
error "no such subwidget $name"
}
}
#----------------------------------------------------------------------
# PrivateMethods:
#----------------------------------------------------------------------
# delete the widget record and remove the command
#
proc tixPrimitive:Destructor {w} {
upvar #0 $w data
if {![info exists data(w:root)]} {
return
}
if {[llength [info commands $w]]} {
# remove the command
rename $w ""
}
if {[llength [info commands $data(rootCmd)]]} {
# remove the command of the root widget
rename $data(rootCmd) ""
}
# delete the widget record
catch {unset data}
}
Tix8.4.3/DirList.tcl 0000644 00000015630 15173441414 0007772 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: DirList.tcl,v 1.5 2004/03/28 02:44:57 hobbs Exp $
#
# DirList.tcl --
#
# Implements the tixDirList widget.
#
# - overrides the -browsecmd and -command options of the
# HList subwidget
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixDirList {
-classname TixDirList
-superclass tixScrolledHList
-method {
chdir
}
-flag {
-browsecmd -command -dircmd -disablecallback
-root -rootname -showhidden -value
}
-configspec {
{-browsecmd browseCmd BrowseCmd ""}
{-command command Command ""}
{-dircmd dirCmd DirCmd ""}
{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
{-root root Root ""}
{-rootname rootName RootName ""}
{-showhidden showHidden ShowHidden 0 tixVerifyBoolean}
{-value value Value ""}
}
-default {
{.scrollbar auto}
{*borderWidth 1}
{*hlist.background #c3c3c3}
{*hlist.indent 7}
{*hlist.relief sunken}
{*hlist.height 10}
{*hlist.width 20}
{*hlist.padX 2}
{*hlist.padY 0}
{*hlist.wideSelection 0}
{*hlist.drawBranch 0}
{*hlist.highlightBackground #d9d9d9}
{*hlist.itemType imagetext}
{*hlist.takeFocus 1}
}
-forcecall {
-value
}
}
# Important data members:
#
# data(vpath)
# The currently selected vpath. This internal variable is useful on
# the Win95 platform, where an directory may correspond to more than
# one node in the hierarchy. For example, C:\Windows\Desktop\Foo
# can appead as "Desktop\Foo" and
# "Desktop\My Computer\C:\Windows\Desktop\Foo". This variable tells us
# which icon should we show given the same DOS pathname.
#
proc tixDirList:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
}
proc tixDirList:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
$data(w:hlist) config -separator [tixFSSep] -selectmode "single"
}
proc tixDirList:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:hlist) config \
-browsecmd [list tixDirList:Browse $w] \
-command [list tixDirList:Command $w]
if {$data(-value) eq ""
|| [catch {set data(-value) [tixFSNormalize $data(-value)]}]} {
set data(-value) [pwd]
}
set data(vpath) [tixFSInternal $data(-value)]
}
#----------------------------------------------------------------------
# Incoming-Events
#----------------------------------------------------------------------
proc tixDirList:Browse {w args} {
upvar #0 $w data
set vpath [tixEvent flag V]
set value [$data(w:hlist) info data $vpath]
tixDirList:HighLight $w $vpath
set data(vpath) $vpath
set data(-value) [tixFSExternal $value]
tixDirList:CallBrowseCmd $w $data(-value)
}
proc tixDirList:Command {w args} {
upvar #0 $w data
set vpath [tixEvent value]
set value [$data(w:hlist) info data $vpath]
set data(-value) [tixFSExternal $value]
tixDirList:LoadDir $w [tixFSNativeNorm $value] $vpath
tixDirList:HighLight $w $vpath
set data(vpath) $vpath
tixDirList:CallCommand $w $data(-value)
}
#----------------------------------------------------------------------
# Outgoing-Events
#----------------------------------------------------------------------
proc tixDirList:CallBrowseCmd {w npath} {
upvar #0 $w data
if {[llength $data(-browsecmd)]} {
set bind(specs) "%V"
set bind(%V) $npath
tixEvalCmdBinding $w $data(-browsecmd) bind $npath
}
}
proc tixDirList:CallCommand {w npath} {
upvar #0 $w data
if {[llength $data(-command)] && !$data(-disablecallback)} {
set bind(specs) "%V"
set bind(%V) $npath
tixEvalCmdBinding $w $data(-command) bind $npath
}
}
#----------------------------------------------------------------------
# Directory loading
#----------------------------------------------------------------------
proc tixDirList:LoadDir {w {npath ""} {vpath ""}} {
upvar #0 $w data
tixBusy $w on $data(w:hlist)
$data(w:hlist) delete all
if {$npath eq ""} {
set npath [tixFSNativeNorm $data(-value)]
set vpath [tixFSInternal $npath]
}
tixDirList:ListHierachy $w $npath $vpath
tixDirList:ListSubDirs $w $npath $vpath
tixWidgetDoWhenIdle tixBusy $w off $data(w:hlist)
}
proc tixDirList:ListHierachy {w npath vpath} {
upvar #0 $w data
set img [tix getimage openfold]
set curpath ""
foreach part [tixFSAncestors $npath] {
set curpath [file join $curpath $part]
set text [tixFSDisplayFileName $curpath]
set vpath [tixFSInternal $curpath]
$data(w:hlist) add $vpath -text $text -data $curpath -image $img
}
}
proc tixDirList:ListSubDirs {w npath vpath} {
upvar #0 $w data
$data(w:hlist) entryconfig $vpath -image [tix getimage act_fold]
set img [tix getimage folder]
foreach ent [tixFSListDir $npath 1 0 0 $data(-showhidden)] {
set curpath [file join $npath $ent]
set vp [tixFSInternal $curpath]
if {![$data(w:hlist) info exists $vp]} {
$data(w:hlist) add $vp -text $ent -data $curpath -image $img
}
}
}
proc tixDirList:SetValue {w npath vpath {flag ""}} {
upvar #0 $w data
if {$flag eq "reload" || ![$data(w:hlist) info exists $vpath]} {
tixDirList:LoadDir $w $npath $vpath
}
tixDirList:HighLight $w $vpath
set data(-value) [tixFSNativeNorm $npath]
set data(vpath) $vpath
tixDirList:CallCommand $w $data(-value)
}
proc tixDirList:HighLight {w vpath} {
upvar #0 $w data
if {$data(vpath) ne $vpath} {
set old $data(vpath)
if {[$data(w:hlist) info exists $old]} {
# Un-highlight the originally selected entry by changing its
# folder image
if {[llength [$data(w:hlist) info children $old]]} {
set img [tix getimage openfold]
} else {
set img [tix getimage folder]
}
$data(w:hlist) entryconfig $old -image $img
}
}
# Highlight the newly selected entry
#
$data(w:hlist) entryconfig $vpath -image [tix getimage act_fold]
$data(w:hlist) anchor set $vpath
$data(w:hlist) select clear
$data(w:hlist) select set $vpath
$data(w:hlist) see $vpath
}
#----------------------------------------------------------------------
# Config options
#----------------------------------------------------------------------
proc tixDirList:config-value {w value} {
upvar #0 $w data
tixDirList:chdir $w $value
return $data(-value)
}
proc tixDirList:config-showhidden {w value} {
upvar #0 $w data
tixWidgetDoWhenIdle tixDirList:LoadDir $w
}
#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
proc tixDirList:chdir {w value} {
upvar #0 $w data
set npath [tixFSNativeNorm $value]
tixDirList:SetValue $w $npath [tixFSInternal $npath]
}
Tix8.4.3/Variable.tcl 0000644 00000005003 15173441414 0010136 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Variable.tcl,v 1.4 2001/12/09 05:04:02 idiscovery Exp $
#
# Variable.tcl --
#
# Routines in this file are used to set up and operate variables
# for classes that support the -variable option
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# tixVariable:ConfigVariable --
#
# Set up the -variable option for the object $w
#
# Side effects:
#
# data(-variable) is changed to the name of the global variable
# if the global variable exists, data(-value) takes the value of this
# variable.
# if the global variable does not exist, it is created with the
# current data(-value)
#
# Return value:
#
# true is data(-value) is changed, indicating that data(-command)
# should be invoked.
#
proc tixVariable:ConfigVariable {w arg} {
upvar #0 $w data
set changed 0
if {$data(-variable) != ""} {
uplevel #0 \
[list trace vdelete $data(-variable) w "tixVariable:TraceProc $w"]
}
if {$arg != ""} {
if {[uplevel #0 info exists [list $arg]]} {
# This global variable exists, we use its value
#
set data(-value) [uplevel #0 set [list $arg]]
set changed 1
} else {
# This global variable does not exist; let's set it
#
uplevel #0 [list set $arg $data(-value)]
}
uplevel #0 \
[list trace variable $arg w "tixVariable:TraceProc $w"]
}
return $changed
}
proc tixVariable:UpdateVariable {w} {
upvar #0 $w data
if {$data(-variable) != ""} {
uplevel #0 \
[list trace vdelete $data(-variable) w "tixVariable:TraceProc $w"]
uplevel #0 \
[list set $data(-variable) $data(-value)]
uplevel #0 \
[list trace variable $data(-variable) w "tixVariable:TraceProc $w"]
# just in case someone has another trace and restricted my change
#
set data(-value) [uplevel #0 set [list $data(-variable)]]
}
}
proc tixVariable:TraceProc {w name1 name2 op} {
upvar #0 $w data
set varname $data(-variable)
if {[catch {$w config -value [uplevel #0 [list set $varname]]} err]} {
uplevel #0 [list set $varname [list [$w cget -value]]]
error $err
}
return
}
proc tixVariable:DeleteVariable {w} {
upvar #0 $w data
# Must delete the trace command of the -variable
#
if {$data(-variable) != ""} {
uplevel #0 \
[list trace vdelete $data(-variable) w "tixVariable:TraceProc $w"]
}
}
Tix8.4.3/Control.tcl 0000644 00000030162 15173441414 0010035 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Control.tcl,v 1.9 2004/03/28 02:44:57 hobbs Exp $
#
# Control.tcl --
#
# Implements the TixControl Widget. It is called the "SpinBox"
# in other toolkits.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixControl {
-classname TixControl
-superclass tixLabelWidget
-method {
incr decr invoke update
}
-flag {
-allowempty -autorepeat -command -decrcmd -disablecallback
-disabledforeground -incrcmd -initwait -integer -llimit
-repeatrate -max -min -selectmode -step -state -validatecmd
-value -variable -ulimit
}
-forcecall {
-variable -state
}
-configspec {
{-allowempty allowEmpty AllowEmpty false}
{-autorepeat autoRepeat AutoRepeat true}
{-command command Command ""}
{-decrcmd decrCmd DecrCmd ""}
{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
{-disabledforeground disabledForeground DisabledForeground #303030}
{-incrcmd incrCmd IncrCmd ""}
{-initwait initWait InitWait 500}
{-integer integer Integer false}
{-max max Max ""}
{-min min Min ""}
{-repeatrate repeatRate RepeatRate 50}
{-step step Step 1}
{-state state State normal}
{-selectmode selectMode SelectMode normal}
{-validatecmd validateCmd ValidateCmd ""}
{-value value Value 0}
{-variable variable Variable ""}
}
-alias {
{-llimit -min}
{-ulimit -max}
}
-default {
{.borderWidth 0}
{*entry.relief sunken}
{*entry.width 5}
{*label.anchor e}
{*label.borderWidth 0}
{*Button.anchor c}
{*Button.borderWidth 2}
{*Button.highlightThickness 1}
{*Button.takeFocus 0}
}
}
proc tixControl:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(varInited) 0
set data(serial) 0
}
proc tixControl:ConstructFramedWidget {w frame} {
upvar #0 $w data
tixChainMethod $w ConstructFramedWidget $frame
set data(w:entry) [entry $frame.entry]
set data(w:incr) \
[button $frame.incr -bitmap [tix getbitmap incr] -takefocus 0]
set data(w:decr) \
[button $frame.decr -bitmap [tix getbitmap decr] -takefocus 0]
# tixForm $data(w:entry) -left 0 -top 0 -bottom -1 -right $data(w:decr)
# tixForm $data(w:incr) -right -1 -top 0 -bottom %50
# tixForm $data(w:decr) -right -1 -top $data(w:incr) -bottom -1
pack $data(w:entry) -side left -expand yes -fill both
pack $data(w:decr) -side bottom -fill both -expand yes
pack $data(w:incr) -side top -fill both -expand yes
$data(w:entry) delete 0 end
$data(w:entry) insert 0 $data(-value)
# This value is used to configure the disable/normal fg of the ebtry
set data(entryfg) [$data(w:entry) cget -fg]
set data(labelfg) [$data(w:label) cget -fg]
}
proc tixControl:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
bind $data(w:incr) <ButtonPress-1> \
[list after idle tixControl:StartRepeat $w 1]
bind $data(w:decr) <ButtonPress-1> \
[list after idle tixControl:StartRepeat $w -1]
# These bindings will stop the button autorepeat when the
# mouse button is up
foreach btn [list $data(w:incr) $data(w:decr)] {
bind $btn <ButtonRelease-1> [list tixControl:StopRepeat $w]
}
tixSetMegaWidget $data(w:entry) $w
# If user press <return>, verify the value and call the -command
#
tixAddBindTag $data(w:entry) TixControl:Entry
}
proc tixControlBind {} {
tixBind TixControl:Entry <Return> {
tixControl:Invoke [tixGetMegaWidget %W] 1
}
tixBind TixControl:Entry <Escape> {
tixControl:Escape [tixGetMegaWidget %W]
}
tixBind TixControl:Entry <Up> {
[tixGetMegaWidget %W] incr
}
tixBind TixControl:Entry <Down> {
[tixGetMegaWidget %W] decr
}
tixBind TixControl:Entry <FocusOut> {
if {"%d" eq "NotifyNonlinear" || "%d" eq "NotifyNonlinearVirtual"} {
tixControl:Tab [tixGetMegaWidget %W] %d
}
}
tixBind TixControl:Entry <Any-KeyPress> {
tixControl:KeyPress [tixGetMegaWidget %W]
}
tixBind TixControl:Entry <Any-Tab> {
# This has a higher priority than the <Any-KeyPress> binding
# --> so that data(edited) is not set
}
}
#----------------------------------------------------------------------
# CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixControl:config-state {w arg} {
upvar #0 $w data
if {$arg eq "normal"} {
$data(w:incr) config -state $arg
$data(w:decr) config -state $arg
catch {
$data(w:label) config -fg $data(labelfg)
}
$data(w:entry) config -state $arg -fg $data(entryfg)
} else {
$data(w:incr) config -state $arg
$data(w:decr) config -state $arg
catch {
$data(w:label) config -fg $data(-disabledforeground)
}
$data(w:entry) config -state $arg -fg $data(-disabledforeground)
}
}
proc tixControl:config-value {w value} {
upvar #0 $w data
tixControl:SetValue $w $value 0 1
# This will tell the Intrinsics: "Please use this value"
# because "value" might be altered by SetValues
#
return $data(-value)
}
proc tixControl:config-variable {w arg} {
upvar #0 $w data
if {[tixVariable:ConfigVariable $w $arg]} {
# The value of data(-value) is changed if tixVariable:ConfigVariable
# returns true
tixControl:SetValue $w $data(-value) 1 1
}
catch {
unset data(varInited)
}
set data(-variable) $arg
}
#----------------------------------------------------------------------
# User Commands
#----------------------------------------------------------------------
proc tixControl:incr {w {by 1}} {
upvar #0 $w data
if {$data(-state) ne "disabled"} {
if {![catch {$data(w:entry) index sel.first}]} {
$data(w:entry) select from end
$data(w:entry) select to end
}
# CYGNUS - why set value before changing it?
#tixControl:SetValue $w [$data(w:entry) get] 0 1
tixControl:AdjustValue $w $by
}
}
proc tixControl:decr {w {by 1}} {
upvar #0 $w data
if {$data(-state) ne "disabled"} {
if {![catch {$data(w:entry) index sel.first}]} {
$data(w:entry) select from end
$data(w:entry) select to end
}
# CYGNUS - why set value before changing it?
#tixControl:SetValue $w [$data(w:entry) get] 0 1
tixControl:AdjustValue $w [expr {0 - $by}]
}
}
proc tixControl:invoke {w} {
upvar #0 $w data
tixControl:Invoke $w 0
}
proc tixControl:update {w} {
upvar #0 $w data
if {[info exists data(edited)]} {
tixControl:invoke $w
}
}
#----------------------------------------------------------------------
# Internal Commands
#----------------------------------------------------------------------
# Change the value by a multiple of the data(-step)
#
proc tixControl:AdjustValue {w amount} {
upvar #0 $w data
if {$amount == 1 && [llength $data(-incrcmd)]} {
set newValue [tixEvalCmdBinding $w $data(-incrcmd) "" $data(-value)]
} elseif {$amount == -1 && [llength $data(-decrcmd)]} {
set newValue [tixEvalCmdBinding $w $data(-decrcmd) "" $data(-value)]
} else {
set newValue [expr {$data(-value) + $amount * $data(-step)}]
}
if {$data(-state) ne "disabled"} {
tixControl:SetValue $w $newValue 0 1
}
}
proc tixControl:SetValue {w newvalue noUpdate forced} {
upvar #0 $w data
if {[$data(w:entry) selection present]} {
set oldSelection [list [$data(w:entry) index sel.first] \
[$data(w:entry) index sel.last]]
}
set oldvalue $data(-value)
set oldCursor [$data(w:entry) index insert]
set changed 0
if {[llength $data(-validatecmd)]} {
# Call the user supplied validation command
#
set data(-value) [tixEvalCmdBinding $w $data(-validatecmd) "" $newvalue]
} else {
# Here we only allow int or floating numbers
#
# If the new value is not a valid number, the old value will be
# kept due to the "catch" statements
#
if {[catch {expr 0+$newvalue}]} {
set newvalue 0
set data(-value) 0
set changed 1
}
if {$newvalue == ""} {
if {![string is true -strict $data(-allowempty)]} {
set newvalue 0
set changed 1
} else {
set data(-value) ""
}
}
if {$newvalue != ""} {
# Change this to a valid decimal string (trim leading 0)
#
regsub -- {^[0]*} $newvalue "" newvalue
if {[catch {expr 0+$newvalue}]} {
set newvalue 0
set data(-value) 0
set changed 1
}
if {$newvalue == ""} {
set newvalue 0
}
if {[string is true -strict $data(-integer)]} {
set data(-value) [tixGetInt -nocomplain $newvalue]
} else {
if {[catch {set data(-value) [format "%d" $newvalue]}]} {
if {[catch {set data(-value) [expr $newvalue+0.0]}]} {
set data(-value) $oldvalue
}
}
}
# Now perform boundary checking
#
if {$data(-max) != "" && $data(-value) > $data(-max)} {
set data(-value) $data(-max)
}
if {$data(-min) != "" && $data(-value) < $data(-min)} {
set data(-value) $data(-min)
}
}
}
if {! $noUpdate} {
tixVariable:UpdateVariable $w
}
if {$forced || ($newvalue ne $data(-value)) || $changed} {
$data(w:entry) delete 0 end
$data(w:entry) insert 0 $data(-value)
$data(w:entry) icursor $oldCursor
if {[info exists oldSelection]} {
eval [list $data(w:entry) selection range] $oldSelection
}
}
if {!$data(-disablecallback) && $data(-command) != ""} {
if {![info exists data(varInited)]} {
set bind(specs) ""
tixEvalCmdBinding $w $data(-command) bind $data(-value)
}
}
}
proc tixControl:Invoke {w forced} {
upvar #0 $w data
catch {
unset data(edited)
}
if {[catch {$data(w:entry) index sel.first}] == 0} {
# THIS ENTRY OWNS SELECTION --> TURN IT OFF
#
$data(w:entry) select from end
$data(w:entry) select to end
}
tixControl:SetValue $w [$data(w:entry) get] 0 $forced
}
#----------------------------------------------------------------------
# The three functions StartRepeat, Repeat and StopRepeat make use of the
# data(serial) variable to discard spurious repeats: If a button is clicked
# repeatedly but is not hold down, the serial counter will increase
# successively and all "after" time event handlers will be discarded
#----------------------------------------------------------------------
proc tixControl:StartRepeat {w amount} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
incr data(serial)
# CYGNUS bug fix
# Need to set a local variable because otherwise the buttonrelease
# callback could change the value of data(serial) between now and
# the time the repeat is scheduled.
set serial $data(serial)
if {![catch {$data(w:entry) index sel.first}]} {
$data(w:entry) select from end
$data(w:entry) select to end
}
if {[info exists data(edited)]} {
unset data(edited)
tixControl:SetValue $w [$data(w:entry) get] 0 1
}
tixControl:AdjustValue $w $amount
if {$data(-autorepeat)} {
after $data(-initwait) tixControl:Repeat $w $amount $serial
}
focus $data(w:entry)
}
proc tixControl:Repeat {w amount serial} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
if {$serial eq $data(serial)} {
tixControl:AdjustValue $w $amount
if {$data(-autorepeat)} {
after $data(-repeatrate) tixControl:Repeat $w $amount $serial
}
}
}
proc tixControl:StopRepeat {w} {
upvar #0 $w data
incr data(serial)
}
proc tixControl:Destructor {w} {
tixVariable:DeleteVariable $w
# Chain this to the superclass
#
tixChainMethod $w Destructor
}
# ToDo: maybe should return -code break if the value is not good ...
#
proc tixControl:Tab {w detail} {
upvar #0 $w data
if {![info exists data(edited)]} {
return
} else {
unset data(edited)
}
tixControl:invoke $w
}
proc tixControl:Escape {w} {
upvar #0 $w data
$data(w:entry) delete 0 end
$data(w:entry) insert 0 $data(-value)
}
proc tixControl:KeyPress {w} {
upvar #0 $w data
if {$data(-selectmode) eq "normal"} {
set data(edited) 0
return
} else {
# == "immediate"
after 1 tixControl:invoke $w
}
}
Tix8.4.3/Grid.tcl 0000644 00000052241 15173441414 0007304 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Grid.tcl,v 1.6 2004/03/28 02:44:57 hobbs Exp $
#
# Grid.tcl --
#
# This file defines the default bindings for Tix Grid widgets.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
global tkPriv
if {![llength [info globals tkPriv]]} {
tk::unsupported::ExposePrivateVariable tkPriv
}
#--------------------------------------------------------------------------
# tkPriv elements used in this file:
#
# afterId - Token returned by "after" for autoscanning.
# fakeRelease - Cancel the ButtonRelease-1 after the user double click
#--------------------------------------------------------------------------
#
foreach fun {tkCancelRepeat} {
if {![llength [info commands $fun]]} {
tk::unsupported::ExposePrivateCommand $fun
}
}
unset fun
proc tixGridBind {} {
tixBind TixGrid <ButtonPress-1> {
tixGrid:Button-1 %W %x %y
}
tixBind TixGrid <Shift-ButtonPress-1> {
tixGrid:Shift-Button-1 %W %x %y
}
tixBind TixGrid <Control-ButtonPress-1> {
tixGrid:Control-Button-1 %W %x %y
}
tixBind TixGrid <ButtonRelease-1> {
tixGrid:ButtonRelease-1 %W %x %y
}
tixBind TixGrid <Double-ButtonPress-1> {
tixGrid:Double-1 %W %x %y
}
tixBind TixGrid <B1-Motion> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixGrid:B1-Motion %W %x %y
}
tixBind TixGrid <Control-B1-Motion> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixGrid:Control-B1-Motion %W %x %y
}
tixBind TixGrid <B1-Leave> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixGrid:B1-Leave %W
}
tixBind TixGrid <B1-Enter> {
tixGrid:B1-Enter %W %x %y
}
tixBind TixGrid <Control-B1-Leave> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixGrid:Control-B1-Leave %W
}
tixBind TixGrid <Control-B1-Enter> {
tixGrid:Control-B1-Enter %W %x %y
}
# Keyboard bindings
#
tixBind TixGrid <Up> {
tixGrid:DirKey %W up
}
tixBind TixGrid <Down> {
tixGrid:DirKey %W down
}
tixBind TixGrid <Left> {
tixGrid:DirKey %W left
}
tixBind TixGrid <Right> {
tixGrid:DirKey %W right
}
tixBind TixGrid <Prior> {
%W yview scroll -1 pages
}
tixBind TixGrid <Next> {
%W yview scroll 1 pages
}
tixBind TixGrid <Return> {
tixGrid:Return %W
}
tixBind TixGrid <space> {
tixGrid:Space %W
}
#
# Don't use tixBind because %A causes Tk 8.3.2 to crash
#
bind TixGrid <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 2}] units
}
}
#----------------------------------------------------------------------
#
#
# Mouse bindings
#
#
#----------------------------------------------------------------------
proc tixGrid:Button-1 {w x y} {
if {[$w cget -state] eq "disabled"} {
return
}
tixGrid:SetFocus $w
if {[tixGrid:GetState $w] == 0} {
tixGrid:GoState 1 $w $x $y
}
}
proc tixGrid:Shift-Button-1 {w x y} {
if {[$w cget -state] eq "disabled"} {
return
}
tixGrid:SetFocus $w
}
proc tixGrid:Control-Button-1 {w x y} {
if {[$w cget -state] eq "disabled"} {
return
}
tixGrid:SetFocus $w
case [tixGrid:GetState $w] {
{s0} {
tixGrid:GoState s1 $w $x $y
}
{b0} {
tixGrid:GoState b1 $w $x $y
}
{m0} {
tixGrid:GoState m1 $w $x $y
}
{e0} {
tixGrid:GoState e10 $w $x $y
}
}
}
proc tixGrid:ButtonRelease-1 {w x y} {
case [tixGrid:GetState $w] {
{2} {
tixGrid:GoState 5 $w $x $y
}
{4} {
tixGrid:GoState 3 $w $x $y
}
}
}
proc tixGrid:B1-Motion {w x y} {
case [tixGrid:GetState $w] {
{2 4} {
tixGrid:GoState 4 $w $x $y
}
}
}
proc tixGrid:Control-B1-Motion {w x y} {
case [tixGrid:GetState $w] {
{s2 s4} {
tixGrid:GoState s4 $w $x $y
}
{b2 b4} {
tixGrid:GoState b4 $w $x $y
}
{m2 m5} {
tixGrid:GoState m4 $w $x $y
}
}
}
proc tixGrid:Double-1 {w x y} {
case [tixGrid:GetState $w] {
{s0} {
tixGrid:GoState s7 $w $x $y
}
{b0} {
tixGrid:GoState b7 $w $x $y
}
}
}
proc tixGrid:B1-Leave {w} {
case [tixGrid:GetState $w] {
{s2 s4} {
tixGrid:GoState s5 $w
}
{b2 b4} {
tixGrid:GoState b5 $w
}
{m2 m5} {
tixGrid:GoState m8 $w
}
{e2 e5} {
tixGrid:GoState e8 $w
}
}
}
proc tixGrid:B1-Enter {w x y} {
case [tixGrid:GetState $w] {
{s5 s6} {
tixGrid:GoState s4 $w $x $y
}
{b5 b6} {
tixGrid:GoState b4 $w $x $y
}
{m8 m9} {
tixGrid:GoState m4 $w $x $y
}
{e8 e9} {
tixGrid:GoState e4 $w $x $y
}
}
}
proc tixGrid:Control-B1-Leave {w} {
case [tixGrid:GetState $w] {
{s2 s4} {
tixGrid:GoState s5 $w
}
{b2 b4} {
tixGrid:GoState b5 $w
}
{m2 m5} {
tixGrid:GoState m8 $w
}
}
}
proc tixGrid:Control-B1-Enter {w x y} {
case [tixGrid:GetState $w] {
{s5 s6} {
tixGrid:GoState s4 $w $x $y
}
{b5 b6} {
tixGrid:GoState b4 $w $x $y
}
{m8 m9} {
tixGrid:GoState m4 $w $x $y
}
}
}
proc tixGrid:AutoScan {w} {
case [tixGrid:GetState $w] {
{s5 s6} {
tixGrid:GoState s6 $w
}
{b5 b6} {
tixGrid:GoState b6 $w
}
{m8 m9} {
tixGrid:GoState m9 $w
}
{e8 e9} {
tixGrid:GoState e9 $w
}
}
}
#----------------------------------------------------------------------
#
#
# Key bindings
#
#
#----------------------------------------------------------------------
proc tixGrid:DirKey {w key} {
if {[$w cget -state] eq "disabled"} {
return
}
case [tixGrid:GetState $w] {
{s0} {
tixGrid:GoState s8 $w $key
}
{b0} {
tixGrid:GoState b8 $w $key
}
}
}
proc tixGrid:Return {w} {
if {[$w cget -state] eq "disabled"} {
return
}
case [tixGrid:GetState $w] {
{s0} {
tixGrid:GoState s9 $w
}
{b0} {
tixGrid:GoState b9 $w
}
}
}
proc tixGrid:Space {w} {
if {[$w cget -state] eq "disabled"} {
return
}
case [tixGrid:GetState $w] {
{s0} {
tixGrid:GoState s10 $w
}
{b0} {
tixGrid:GoState b10 $w
}
}
}
#----------------------------------------------------------------------
#
# STATE MANIPULATION
#
#
#----------------------------------------------------------------------
proc tixGrid:GetState {w} {
global $w:priv:state
if {![info exists $w:priv:state]} {
set $w:priv:state 0
}
return [set $w:priv:state]
}
proc tixGrid:SetState {w n} {
global $w:priv:state
set $w:priv:state $n
}
proc tixGrid:GoState {n w args} {
# puts "going from [tixGrid:GetState $w] --> $n"
tixGrid:SetState $w $n
eval tixGrid:GoState-$n $w $args
}
#----------------------------------------------------------------------
# SELECTION ROUTINES
#----------------------------------------------------------------------
proc tixGrid:SelectSingle {w ent} {
$w selection set [lindex $ent 0] [lindex $ent 1]
tixGrid:CallBrowseCmd $w $ent
}
#----------------------------------------------------------------------
# SINGLE SELECTION
#----------------------------------------------------------------------
proc tixGrid:GoState-0 {w} {
set list $w:_list
global $list
if {[info exists $list]} {
foreach cmd [set $list] {
uplevel #0 $cmd
}
if {[info exists $list]} {
unset $list
}
}
}
proc tixGrid:GoState-1 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
tixGrid:SetAnchor $w $ent
}
tixGrid:CheckEdit $w
$w selection clear 0 0 max max
if {[$w cget -selectmode] ne "single"} {
tixGrid:SelectSingle $w $ent
}
tixGrid:GoState 2 $w
}
proc tixGrid:GoState-2 {w} {
}
proc tixGrid:GoState-3 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
tixGrid:SelectSingle $w $ent
}
tixGrid:GoState 0 $w
}
proc tixGrid:GoState-5 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
tixGrid:SelectSingle $w $ent
tixGrid:SetEdit $w $ent
}
tixGrid:GoState 0 $w
}
proc tixGrid:GoState-4 {w x y} {
set ent [$w nearest $x $y]
case [$w cget -selectmode] {
single {
tixGrid:SetAnchor $w $ent
}
browse {
tixGrid:SetAnchor $w $ent
$w selection clear 0 0 max max
tixGrid:SelectSingle $w $ent
}
{multiple extended} {
set anchor [$w anchor get]
$w selection adjust [lindex $anchor 0] [lindex $anchor 1] \
[lindex $ent 0] [lindex $ent 1]
}
}
}
proc tixGrid:GoState-s5 {w} {
tixGrid:StartScan $w
}
proc tixGrid:GoState-s6 {w} {
global tkPriv
tixGrid:DoScan $w
}
proc tixGrid:GoState-s7 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixGrid:CallCommand $w $ent
}
tixGrid:GoState s0 $w
}
proc tixGrid:GoState-s8 {w key} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
} else {
set anchor [$w info $key $anchor]
}
$w anchor set $anchor
$w see $anchor
tixGrid:GoState s0 $w
}
proc tixGrid:GoState-s9 {w} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
$w anchor set $anchor
$w see $anchor
}
if {[$w info anchor] != ""} {
# ! may not have any elements
#
tixGrid:CallCommand $w [$w info anchor]
$w selection clear
$w selection set $anchor
}
tixGrid:GoState s0 $w
}
proc tixGrid:GoState-s10 {w} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
$w anchor set $anchor
$w see $anchor
}
if {[$w info anchor] != ""} {
# ! may not have any elements
#
tixGrid:CallBrowseCmd $w [$w info anchor]
$w selection clear
$w selection set $anchor
}
tixGrid:GoState s0 $w
}
#----------------------------------------------------------------------
# BROWSE SELECTION
#----------------------------------------------------------------------
proc tixGrid:GoState-b0 {w} {
}
proc tixGrid:GoState-b1 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w anchor set $ent
$w selection clear
$w selection set $ent
tixGrid:CallBrowseCmd $w $ent
}
tixGrid:GoState b2 $w
}
proc tixGrid:GoState-b2 {w} {
}
proc tixGrid:GoState-b3 {w} {
set ent [$w info anchor]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixGrid:CallBrowseCmd $w $ent
}
tixGrid:GoState b0 $w
}
proc tixGrid:GoState-b4 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w anchor set $ent
$w selection clear
$w selection set $ent
tixGrid:CallBrowseCmd $w $ent
}
}
proc tixGrid:GoState-b5 {w} {
tixGrid:StartScan $w
}
proc tixGrid:GoState-b6 {w} {
global tkPriv
tixGrid:DoScan $w
}
proc tixGrid:GoState-b7 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixGrid:CallCommand $w $ent
}
tixGrid:GoState b0 $w
}
proc tixGrid:GoState-b8 {w key} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
} else {
set anchor [$w info $key $anchor]
}
$w anchor set $anchor
$w selection clear
$w selection set $anchor
$w see $anchor
tixGrid:CallBrowseCmd $w $anchor
tixGrid:GoState b0 $w
}
proc tixGrid:GoState-b9 {w} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
$w anchor set $anchor
$w see $anchor
}
if {[$w info anchor] != ""} {
# ! may not have any elements
#
tixGrid:CallCommand $w [$w info anchor]
$w selection clear
$w selection set $anchor
}
tixGrid:GoState b0 $w
}
proc tixGrid:GoState-b10 {w} {
set anchor [$w info anchor]
if {$anchor == ""} {
set anchor 0
$w anchor set $anchor
$w see $anchor
}
if {[$w info anchor] != ""} {
# ! may not have any elements
#
tixGrid:CallBrowseCmd $w [$w info anchor]
$w selection clear
$w selection set $anchor
}
tixGrid:GoState b0 $w
}
#----------------------------------------------------------------------
# MULTIPLE SELECTION
#----------------------------------------------------------------------
proc tixGrid:GoState-m0 {w} {
}
proc tixGrid:GoState-m1 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w anchor set $ent
$w selection clear
$w selection set $ent
tixGrid:CallBrowseCmd $w $ent
}
tixGrid:GoState m2 $w
}
proc tixGrid:GoState-m2 {w} {
}
proc tixGrid:GoState-m3 {w} {
set ent [$w info anchor]
if {$ent != ""} {
tixGrid:CallBrowseCmd $w $ent
}
tixGrid:GoState m0 $w
}
proc tixGrid:GoState-m4 {w x y} {
set from [$w info anchor]
set to [$w nearest $x $y]
if {$to != ""} {
$w selection clear
$w selection set $from $to
tixGrid:CallBrowseCmd $w $to
}
tixGrid:GoState m5 $w
}
proc tixGrid:GoState-m5 {w} {
}
proc tixGrid:GoState-m6 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
tixGrid:CallBrowseCmd $w $ent
}
tixGrid:GoState m0 $w
}
proc tixGrid:GoState-m7 {w x y} {
set from [$w info anchor]
set to [$w nearest $x $y]
if {$from == ""} {
set from $to
$w anchor set $from
}
if {$to != ""} {
$w selection clear
$w selection set $from $to
tixGrid:CallBrowseCmd $w $to
}
tixGrid:GoState m5 $w
}
proc tixGrid:GoState-m8 {w} {
tixGrid:StartScan $w
}
proc tixGrid:GoState-m9 {w} {
tixGrid:DoScan $w
}
proc tixGrid:GoState-xm7 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixGrid:CallCommand $w $ent
}
tixGrid:GoState m0 $w
}
#----------------------------------------------------------------------
# EXTENDED SELECTION
#----------------------------------------------------------------------
proc tixGrid:GoState-e0 {w} {
}
proc tixGrid:GoState-e1 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w anchor set $ent
$w selection clear
$w selection set $ent
tixGrid:CallBrowseCmd $w $ent
}
tixGrid:GoState e2 $w
}
proc tixGrid:GoState-e2 {w} {
}
proc tixGrid:GoState-e3 {w} {
set ent [$w info anchor]
if {$ent != ""} {
tixGrid:CallBrowseCmd $w $ent
}
tixGrid:GoState e0 $w
}
proc tixGrid:GoState-e4 {w x y} {
set from [$w info anchor]
set to [$w nearest $x $y]
if {$to != ""} {
$w selection clear
$w selection set $from $to
tixGrid:CallBrowseCmd $w $to
}
tixGrid:GoState e5 $w
}
proc tixGrid:GoState-e5 {w} {
}
proc tixGrid:GoState-e6 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
tixGrid:CallBrowseCmd $w $ent
}
tixGrid:GoState e0 $w
}
proc tixGrid:GoState-e7 {w x y} {
set from [$w info anchor]
set to [$w nearest $x $y]
if {$from == ""} {
set from $to
$w anchor set $from
}
if {$to != ""} {
$w selection clear
$w selection set $from $to
tixGrid:CallBrowseCmd $w $to
}
tixGrid:GoState e5 $w
}
proc tixGrid:GoState-e8 {w} {
tixGrid:StartScan $w
}
proc tixGrid:GoState-e9 {w} {
tixGrid:DoScan $w
}
proc tixGrid:GoState-e10 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
if {[$w info anchor] == ""} {
$w anchor set $ent
}
if {[$w selection includes $ent]} {
$w selection clear $ent
} else {
$w selection set $ent
}
tixGrid:CallBrowseCmd $w $ent
}
tixGrid:GoState e2 $w
}
proc tixGrid:GoState-xm7 {w x y} {
set ent [$w nearest $x $y]
if {$ent != ""} {
$w selection clear
$w selection set $ent
tixGrid:CallCommand $w $ent
}
tixGrid:GoState e0 $w
}
#----------------------------------------------------------------------
# HODGE PODGE
#----------------------------------------------------------------------
proc tixGrid:GoState-12 {w x y} {
tkCancelRepeat
tixGrid:GoState 5 $w $x $y
}
proc tixGrid:GoState-13 {w ent oldEnt} {
global tkPriv
set tkPriv(tix,indicator) $ent
set tkPriv(tix,oldEnt) $oldEnt
tixGrid:IndicatorCmd $w <Arm> $ent
}
proc tixGrid:GoState-14 {w x y} {
global tkPriv
if {[tixGrid:InsideArmedIndicator $w $x $y]} {
$w anchor set $tkPriv(tix,indicator)
$w select clear
$w select set $tkPriv(tix,indicator)
tixGrid:IndicatorCmd $w <Activate> $tkPriv(tix,indicator)
} else {
tixGrid:IndicatorCmd $w <Disarm> $tkPriv(tix,indicator)
}
unset tkPriv(tix,indicator)
tixGrid:GoState 0 $w
}
proc tixGrid:GoState-16 {w ent} {
if {$ent == ""} {
return
}
if {[$w cget -selectmode] ne "single"} {
tixGrid:Select $w $ent
tixGrid:Browse $w $ent
}
}
proc tixGrid:GoState-18 {w} {
global tkPriv
tkCancelRepeat
tixGrid:GoState 6 $w $tkPriv(x) $tkPriv(y)
}
proc tixGrid:GoState-20 {w x y} {
global tkPriv
if {![tixGrid:InsideArmedIndicator $w $x $y]} {
tixGrid:GoState 21 $w $x $y
} else {
tixGrid:IndicatorCmd $w <Arm> $tkPriv(tix,indicator)
}
}
proc tixGrid:GoState-21 {w x y} {
global tkPriv
if {[tixGrid:InsideArmedIndicator $w $x $y]} {
tixGrid:GoState 20 $w $x $y
} else {
tixGrid:IndicatorCmd $w <Disarm> $tkPriv(tix,indicator)
}
}
proc tixGrid:GoState-22 {w} {
global tkPriv
if {$tkPriv(tix,oldEnt) != ""} {
$w anchor set $tkPriv(tix,oldEnt)
} else {
$w anchor clear
}
tixGrid:GoState 0 $w
}
#----------------------------------------------------------------------
# callback actions
#----------------------------------------------------------------------
proc tixGrid:SetAnchor {w ent} {
if {$ent ne ""} {
$w anchor set [lindex $ent 0] [lindex $ent 1]
# $w see $ent
}
}
proc tixGrid:Select {w ent} {
$w selection clear
$w select set $ent
}
proc tixGrid:StartScan {w} {
global tkPriv
set tkPriv(afterId) [after 50 tixGrid:AutoScan $w]
}
proc tixGrid:DoScan {w} {
global tkPriv
set x $tkPriv(x)
set y $tkPriv(y)
set X $tkPriv(X)
set Y $tkPriv(Y)
set out 0
if {$y >= [winfo height $w]} {
$w yview scroll 1 units
set out 1
}
if {$y < 0} {
$w yview scroll -1 units
set out 1
}
if {$x >= [winfo width $w]} {
$w xview scroll 2 units
set out 1
}
if {$x < 0} {
$w xview scroll -2 units
set out 1
}
if {$out} {
set tkPriv(afterId) [after 50 tixGrid:AutoScan $w]
}
}
proc tixGrid:CallBrowseCmd {w ent} {
return
set browsecmd [$w cget -browsecmd]
if {$browsecmd != ""} {
set bind(specs) {%V}
set bind(%V) $ent
tixEvalCmdBinding $w $browsecmd bind $ent
}
}
proc tixGrid:CallCommand {w ent} {
set command [$w cget -command]
if {$command != ""} {
set bind(specs) {%V}
set bind(%V) $ent
tixEvalCmdBinding $w $command bind $ent
}
}
# tixGrid:EditCell --
#
# This command is called when "$w edit set $x $y" is called. It causes
# an SetEdit call when the grid's state is 0.
#
proc tixGrid:EditCell {w x y} {
set list $w:_list
global $list
if {[tixGrid:GetState $w] == 0} {
tixGrid:SetEdit $w [list $x $y]
} else {
lappend $list [list tixGrid:SetEdit $w [list $x $y]]
}
}
# tixGrid:EditApply --
#
# This command is called when "$w edit apply $x $y" is called. It causes
# an CheckEdit call when the grid's state is 0.
#
proc tixGrid:EditApply {w} {
set list $w:_list
global $list
if {[tixGrid:GetState $w] == 0} {
tixGrid:CheckEdit $w
} else {
lappend $list [list tixGrid:CheckEdit $w]
}
}
# tixGrid:CheckEdit --
#
# This procedure is called when the user sets the focus on a cell.
# If another cell is being edited, apply the changes of that cell.
#
proc tixGrid:CheckEdit {w} {
set edit $w.tixpriv__edit
if {[winfo exists $edit]} {
#
# If it -command is not empty, it is being used for another cell.
# Invoke it so that the other cell can be updated.
#
if {[$edit cget -command] ne ""} {
$edit invoke
}
}
}
# tixGrid:SetEdit --
#
# Puts a floatentry on top of an editable entry.
#
proc tixGrid:SetEdit {w ent} {
set edit $w.tixpriv__edit
tixGrid:CheckEdit $w
set editnotifycmd [$w cget -editnotifycmd]
if {$editnotifycmd eq ""} {
return
}
set px [lindex $ent 0]
set py [lindex $ent 1]
if {![uplevel #0 $editnotifycmd $px $py]} {
return
}
if {[$w info exists $px $py]} {
if [catch {
set oldValue [$w entrycget $px $py -text]
}] {
# The entry doesn't support -text option. Can't edit it.
#
# If the application wants to force editing of an entry, it could
# delete or replace the entry in the editnotifyCmd procedure.
#
return
}
} else {
set oldValue ""
}
set bbox [$w info bbox [lindex $ent 0] [lindex $ent 1]]
set x [lindex $bbox 0]
set y [lindex $bbox 1]
set W [lindex $bbox 2]
set H [lindex $bbox 3]
if {![winfo exists $edit]} {
tixFloatEntry $edit
}
$edit config -command "tixGrid:DoneEdit $w $ent"
$edit post $x $y $W $H
$edit config -value $oldValue
}
proc tixGrid:DoneEdit {w x y args} {
set edit $w.tixpriv__edit
$edit config -command ""
$edit unpost
set value [tixEvent value]
if {[$w info exists $x $y]} {
if [catch {
$w entryconfig $x $y -text $value
}] {
return
}
} elseif {$value ne ""} {
if {[catch {
# This needs to be catch'ed because the default itemtype may
# not support the -text option
#
$w set $x $y -text $value
}]} {
return
}
} else {
return
}
set editDoneCmd [$w cget -editdonecmd]
if {$editDoneCmd ne ""} {
uplevel #0 $editDoneCmd $x $y
}
}
proc tixGrid:SetFocus {w} {
if {[$w cget -takefocus] && ![string match $w.* [focus -displayof $w]]} {
focus $w
}
}
Tix8.4.3/EFileBox.tcl 0000644 00000026176 15173441414 0010064 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: EFileBox.tcl,v 1.5 2004/03/28 02:44:57 hobbs Exp $
#
# EFileBox.tcl --
#
# Implements the Extended File Selection Box widget.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
# ToDo
# (1) If user has entered an invalid directory, give an error dialog
#
tixWidgetClass tixExFileSelectBox {
-classname TixExFileSelectBox
-superclass tixPrimitive
-method {
filter invoke
}
-flag {
-browsecmd -command -dialog -dir -dircmd -directory
-disablecallback -filetypes -pattern -selection -showhidden -value
}
-forcecall {
-filetypes
}
-configspec {
{-browsecmd browseCmd BrowseCmd ""}
{-command command Command ""}
{-dialog dialog Dialog ""}
{-dircmd dirCmd DirCmd ""}
{-directory directory Directory ""}
{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
{-filetypes fileTypes FileTypes ""}
{-pattern pattern Pattern *}
{-showhidden showHidden ShowHidden 0 tixVerifyBoolean}
{-value value Value ""}
}
-alias {
{-dir -directory}
{-selection -value}
}
-default {
{*dir.label {Directories:}}
{*dir.editable true}
{*dir.history true}
{*dir*listbox.height 5}
{*file.label Files:}
{*file.editable true}
{*file.history false}
{*file*listbox.height 5}
{*types.label {List Files of Type:}}
{*types*listbox.height 3}
{*TixComboBox.labelSide top}
{*TixComboBox*Label.anchor w}
{*dir.label.underline 0}
{*file.label.underline 0}
{*types.label.underline 14}
{*TixComboBox.anchor e}
{*TixHList.height 7}
{*filelist*listbox.height 7}
{*hidden.wrapLength 3c}
{*hidden.justify left}
}
}
proc tixExFileSelectBox:InitWidgetRec {w} {
upvar #0 $w data
global env
tixChainMethod $w InitWidgetRec
if {$data(-directory) eq ""} {
set data(-directory) [pwd]
}
set data(oldDir) ""
set data(flag) 0
}
#----------------------------------------------------------------------
# Construct widget
#----------------------------------------------------------------------
proc tixExFileSelectBox:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
# listbox frame
set lf [frame $w.lf]
# The pane that contains the two listboxes
#
set pane [tixPanedWindow $lf.pane -orientation horizontal]
set dpane [$pane add 1 -size 160]
set fpane [$pane add 2 -size 160]
$dpane config -relief flat
$fpane config -relief flat
# The File List Pane
#
set data(w:file) [tixComboBox $fpane.file\
-command [list tixExFileSelectBox:Cmd-FileCombo $w]\
-prunehistory true \
-options {
label.anchor w
}]
set data(w:filelist) \
[tixScrolledListBox $fpane.filelist \
-command [list tixExFileSelectBox:Cmd-FileList $w 1] \
-browsecmd [list tixExFileSelectBox:Cmd-FileList $w 0]]
pack $data(w:file) -padx 8 -pady 4 -side top -fill x
pack $data(w:filelist) -padx 8 -pady 4 -side top -fill both -expand yes
# The Directory Pane
#
set data(w:dir) [tixComboBox $dpane.dir \
-command [list tixExFileSelectBox:Cmd-DirCombo $w]\
-prunehistory true \
-options {
label.anchor w
}]
set data(w:dirlist) \
[tixDirList $dpane.dirlist \
-command [list tixExFileSelectBox:Cmd-DirList $w]\
-browsecmd [list tixExFileSelectBox:Browse-DirList $w]]
pack $data(w:dir) -padx 8 -pady 4 -side top -fill x
pack $data(w:dirlist) -padx 8 -pady 4 -side top -fill both -expand yes
# The file types listbox
#
set data(w:types) [tixComboBox $lf.types\
-command [list tixExFileSelectBox:Cmd-TypeCombo $w]\
-options {
label.anchor w
}]
pack $data(w:types) -padx 12 -pady 4 -side bottom -fill x -anchor w
pack $pane -side top -padx 4 -pady 4 -expand yes -fill both
# Buttons to the right
#
set bf [frame $w.bf]
set data(w:ok) [button $bf.ok -text Ok -width 6 \
-underline 0 -command [list tixExFileSelectBox:Ok $w]]
set data(w:cancel) [button $bf.cancel -text Cancel -width 6 \
-underline 0 -command [list tixExFileSelectBox:Cancel $w]]
set data(w:hidden) [checkbutton $bf.hidden -text "Show Hidden Files"\
-underline 0\
-variable [format %s(-showhidden) $w] -onvalue 1 -offvalue 0\
-command [list tixExFileSelectBox:SetShowHidden $w]]
pack $data(w:ok) $data(w:cancel) $data(w:hidden)\
-side top -fill x -padx 6 -pady 3
pack $bf -side right -fill y -pady 6
pack $lf -side left -expand yes -fill both
tixDoWhenMapped $w [list tixExFileSelectBox:Map $w]
if {$data(-filetypes) == ""} {
$data(w:types) config -state disabled
}
}
#----------------------------------------------------------------------
# Configuration
#----------------------------------------------------------------------
proc tixExFileSelectBox:config-showhidden {w value} {
upvar #0 $w data
set data(-showhidden) $value
tixExFileSelectBox:SetShowHidden $w
}
# Update both DirList and {file list and dir combo}
#
proc tixExFileSelectBox:config-directory {w value} {
upvar #0 $w data
set data(-directory) [tixFSNormalize $value]
tixSetSilent $data(w:dirlist) $data(-directory)
tixSetSilent $data(w:dir) $data(-directory)
tixWidgetDoWhenIdle tixExFileSelectBox:LoadFiles $w reload
return $data(-directory)
}
proc tixExFileSelectBox:config-filetypes {w value} {
upvar #0 $w data
$data(w:types) subwidget listbox delete 0 end
foreach name [array names data] {
if {[string match type,* $name]} {
catch {unset data($name)}
}
}
if {$value == ""} {
$data(w:types) config -state disabled
} else {
$data(w:types) config -state normal
foreach type $value {
$data(w:types) insert end [lindex $type 1]
set data(type,[lindex $type 1]) [lindex $type 0]
}
tixSetSilent $data(w:types) ""
}
}
#----------------------------------------------------------------------
# MISC Methods
#----------------------------------------------------------------------
proc tixExFileSelectBox:SetShowHidden {w} {
upvar #0 $w data
$data(w:dirlist) config -showhidden $data(-showhidden)
tixWidgetDoWhenIdle tixExFileSelectBox:LoadFiles $w reload
}
# User activates the dir combobox
#
#
proc tixExFileSelectBox:Cmd-DirCombo {w args} {
upvar #0 $w data
set dir [tixEvent flag V]
set dir [tixFSExternal $dir]
if {![file isdirectory $dir]} {
return
}
set dir [tixFSNormalize $dir]
$data(w:dirlist) config -value $dir
set data(-directory) $dir
}
# User activates the dir list
#
#
proc tixExFileSelectBox:Cmd-DirList {w args} {
upvar #0 $w data
set dir $data(-directory)
catch {set dir [tixEvent flag V]}
set dir [tixFSNormalize [tixFSExternal $dir]]
tixSetSilent $data(w:dir) $dir
set data(-directory) $dir
tixWidgetDoWhenIdle tixExFileSelectBox:LoadFiles $w noreload
}
# User activates the dir list
#
#
proc tixExFileSelectBox:Browse-DirList {w args} {
upvar #0 $w data
set dir [tixEvent flag V]
set dir [tixFSNormalize [tixFSExternal $dir]]
tixExFileSelectBox:Cmd-DirList $w $dir
}
proc tixExFileSelectBox:IsPattern {w string} {
return [regexp "\[\[\\\{\\*\\?\]" $string]
}
proc tixExFileSelectBox:Cmd-FileCombo {w value} {
upvar #0 $w data
if {[tixEvent type] eq "<Return>"} {
tixExFileSelectBox:Ok $w
}
}
proc tixExFileSelectBox:Ok {w} {
upvar #0 $w data
set value [string trim [$data(w:file) subwidget entry get]]
if {$value == ""} {
set value $data(-pattern)
}
tixSetSilent $data(w:file) $value
if {[tixExFileSelectBox:IsPattern $w $value]} {
set data(-pattern) $value
tixWidgetDoWhenIdle tixExFileSelectBox:LoadFiles $w reload
} else {
# ensure absolute path
set value [file join $data(-directory) $value]; # native
set data(-value) [tixFSNativeNorm $value]
tixExFileSelectBox:Invoke $w
}
}
proc tixExFileSelectBox:Cancel {w} {
upvar #0 $w data
if {$data(-dialog) != ""} {
eval $data(-dialog) popdown
}
}
proc tixExFileSelectBox:Invoke {w} {
upvar #0 $w data
# Save some old history
#
$data(w:dir) addhistory [$data(w:dir) cget -value]
$data(w:file) addhistory $data(-pattern)
$data(w:file) addhistory $data(-value)
if {$data(-dialog) != ""} {
eval $data(-dialog) popdown
}
if {$data(-command) != "" && !$data(-disablecallback)} {
set bind(specs) "%V"
set bind(%V) $data(-value)
tixEvalCmdBinding $w $data(-command) bind $data(-value)
}
}
proc tixExFileSelectBox:Cmd-FileList {w invoke args} {
upvar #0 $w data
set index [lindex [$data(w:filelist) subwidget listbox curselection] 0]
if {$index == ""} {
set index 0
}
set file [$data(w:filelist) subwidget listbox get $index]
tixSetSilent $data(w:file) $file
set value [file join $data(-directory) $file]
set data(-value) [tixFSNativeNorm $value]
if {$invoke == 1} {
tixExFileSelectBox:Invoke $w
} elseif {$data(-browsecmd) != ""} {
tixEvalCmdBinding $w $data(-browsecmd) "" $data(-value)
}
}
proc tixExFileSelectBox:Cmd-TypeCombo {w args} {
upvar #0 $w data
set value [tixEvent flag V]
if {[info exists data(type,$value)]} {
set data(-pattern) $data(type,$value)
tixSetSilent $data(w:file) $data(-pattern)
tixWidgetDoWhenIdle tixExFileSelectBox:LoadFiles $w reload
}
}
proc tixExFileSelectBox:LoadFiles {w flag} {
upvar #0 $w data
if {$flag ne "reload" && $data(-directory) eq $data(oldDir)} {
return
}
if {![winfo ismapped [winfo toplevel $w]]} {
tixDoWhenMapped [winfo toplevel $w] \
[list tixExFileSelectBox:LoadFiles $w $flag]
return
}
set listbox [$data(w:filelist) subwidget listbox]
$listbox delete 0 end
set data(-value) ""
tixBusy $w on [$data(w:dirlist) subwidget hlist]
# wrap in a catch so you can't get stuck in a Busy state
if {[catch {
foreach name [tixFSListDir $data(-directory) 0 1 0 \
$data(-showhidden) $data(-pattern)] {
$listbox insert end $name
}
if {$data(oldDir) ne $data(-directory)} {
# Otherwise if the user has already selected a file and then
# presses "show hidden", the selection won't be wiped out.
tixSetSilent $data(w:file) $data(-pattern)
}
} err]} {
tixDebug "tixExFileSelectBox:LoadFiles error for $w\n$err"
}
set data(oldDir) $data(-directory)
tixWidgetDoWhenIdle tixBusy $w off [$data(w:dirlist) subwidget hlist]
}
#
# Called when thd listbox is first mapped
proc tixExFileSelectBox:Map {w} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
set bind(specs) "%V"
set bind(%V) $data(-value)
tixEvalCmdBinding $w bind \
[list tixExFileSelectBox:Cmd-DirList $w] $data(-directory)
}
#----------------------------------------------------------------------
# Public commands
#
#----------------------------------------------------------------------
proc tixExFileSelectBox:invoke {w} {
tixExFileSelectBox:Invoke $w
}
proc tixExFileSelectBox:filter {w} {
tixExFileSelectBox:LoadFiles $w reload
}
Tix8.4.3/LabFrame.tcl 0000644 00000002235 15173441414 0010066 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: LabFrame.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# LabFrame.tcl --
#
# TixLabelFrame Widget: a frame box with a label
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixLabelFrame {
-classname TixLabelFrame
-superclass tixLabelWidget
-method {
frame
}
-flag {}
-static {}
-configspec {
{-labelside labelSide LabelSide acrosstop}
{-padx padX Pad 2}
{-pady padY Pad 2}
}
-alias {}
-default {
{*Label.anchor c}
{.frame.borderWidth 2}
{.frame.relief groove}
{.border.borderWidth 2}
{.border.relief groove}
{.borderWidth 2}
{.padX 2}
{.padY 2}
{.anchor sw}
}
}
#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
proc tixLabelFrame:frame {w args} {
return [eval tixCallMethod $w subwidget frame $args]
}
Tix8.4.3/SGrid.tcl 0000644 00000013457 15173441414 0007435 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: SGrid.tcl,v 1.6 2002/01/24 09:13:58 idiscovery Exp $
#
# SGrid.tcl --
#
# This file implements Scrolled Grid widgets
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
global tkPriv
if {![llength [info globals tkPriv]]} {
tk::unsupported::ExposePrivateVariable tkPriv
}
#--------------------------------------------------------------------------
# tkPriv elements used in this file:
#
# x -
# y -
# X -
# Y -
#--------------------------------------------------------------------------
#
tixWidgetClass tixScrolledGrid {
-classname TixScrolledGrid
-superclass tixScrolledWidget
-method {
}
-flag {
}
-configspec {
}
-default {
{.scrollbar auto}
{*grid.borderWidth 1}
{*grid.Background #c3c3c3}
{*grid.highlightBackground #d9d9d9}
{*grid.relief sunken}
{*grid.takeFocus 1}
{*Scrollbar.takeFocus 0}
}
}
proc tixScrolledGrid:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:grid) [tixGrid $w.grid]
set data(w:hsb) \
[scrollbar $w.hsb -orient horizontal -takefocus 0]
set data(w:vsb) \
[scrollbar $w.vsb -orient vertical -takefocus 0]
set data(pw:client) $data(w:grid)
pack $data(w:grid) -expand yes -fill both -padx 0 -pady 0
}
proc tixScrolledGrid:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:grid) config \
-xscrollcommand "$data(w:hsb) set"\
-yscrollcommand "$data(w:vsb) set"\
-sizecmd [list tixScrolledWidget:Configure $w] \
-formatcmd "tixCallMethod $w FormatCmd"
$data(w:hsb) config -command "$data(w:grid) xview"
$data(w:vsb) config -command "$data(w:grid) yview"
bindtags $data(w:grid) \
"$data(w:grid) TixSGrid TixGrid [winfo toplevel $data(w:grid)] all"
tixSetMegaWidget $data(w:grid) $w
}
#----------------------------------------------------------------------
# RAW event bindings
#----------------------------------------------------------------------
proc tixScrolledGridBind {} {
tixBind TixScrolledGrid <ButtonPress-1> {
tixScrolledGrid:Button-1 [tixGetMegaWidget %W] %x %y
}
tixBind TixScrolledGrid <Shift-ButtonPress-1> {
tixScrolledGrid:Shift-Button-1 %W %x %y
}
tixBind TixScrolledGrid <Control-ButtonPress-1> {
tixScrolledGrid:Control-Button-1 %W %x %y
}
tixBind TixScrolledGrid <ButtonRelease-1> {
tixScrolledGrid:ButtonRelease-1 %W %x %y
}
tixBind TixScrolledGrid <Double-ButtonPress-1> {
tixScrolledGrid:Double-1 %W %x %y
}
tixBind TixScrolledGrid <B1-Motion> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixScrolledGrid:B1-Motion %W %x %y
}
tixBind TixScrolledGrid <Control-B1-Motion> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixScrolledGrid:Control-B1-Motion %W %x %y
}
tixBind TixScrolledGrid <B1-Leave> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixScrolledGrid:B1-Leave %W
}
tixBind TixScrolledGrid <B1-Enter> {
tixScrolledGrid:B1-Enter %W %x %y
}
tixBind TixScrolledGrid <Control-B1-Leave> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixScrolledGrid:Control-B1-Leave %W
}
tixBind TixScrolledGrid <Control-B1-Enter> {
tixScrolledGrid:Control-B1-Enter %W %x %y
}
# Keyboard bindings
#
tixBind TixScrolledGrid <Up> {
tixScrolledGrid:DirKey %W up
}
tixBind TixScrolledGrid <Down> {
tixScrolledGrid:DirKey %W down
}
tixBind TixScrolledGrid <Left> {
tixScrolledGrid:DirKey %W left
}
tixBind TixScrolledGrid <Right> {
tixScrolledGrid:DirKey %W right
}
tixBind TixScrolledGrid <Prior> {
%W yview scroll -1 pages
}
tixBind TixScrolledGrid <Next> {
%W yview scroll 1 pages
}
tixBind TixScrolledGrid <Return> {
tixScrolledGrid:Return %W
}
tixBind TixScrolledGrid <space> {
tixScrolledGrid:Space %W
}
}
#----------------------------------------------------------------------
#
#
# Mouse bindings
#
#
#----------------------------------------------------------------------
proc tixScrolledGrid:Button-1 {w x y} {
if {[$w cget -state] == "disabled"} {
return
}
if {[$w cget -takefocus]} {
focus $w
}
case [tixScrolled:GetState $w] {
{0} {
tixScrolledGrid:GoState s1 $w $x $y
}
{b0} {
tixScrolledGrid:GoState b1 $w $x $y
}
{m0} {
tixScrolledGrid:GoState m1 $w $x $y
}
{e0} {
tixScrolledGrid:GoState e1 $w $x $y
}
}
}
#----------------------------------------------------------------------
#
# option configs
#----------------------------------------------------------------------
#----------------------------------------------------------------------
#
# Widget commands
#----------------------------------------------------------------------
#----------------------------------------------------------------------
#
# Private Methods
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# Virtual Methods
#----------------------------------------------------------------------
proc tixScrolledGrid:FormatCmd {w area x1 y1 x2 y2} {
# do nothing
}
#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#----------------------------------------------------------------------
proc tixScrolledGrid:GeometryInfo {w mW mH} {
upvar #0 $w data
if {$mW < 1} {
set mW 1
}
if {$mH < 1} {
set mH 1
}
return [$data(w:grid) geometryinfo $mW $mH]
}
Tix8.4.3/DirBox.tcl 0000644 00000012461 15173441414 0007606 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: DirBox.tcl,v 1.4 2004/03/28 02:44:57 hobbs Exp $
#
# DirBox.tcl --
#
# Implements the tixDirSelectBox widget.
#
# - overrides the -browsecmd and -command options of the
# HList subwidget
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixDirSelectBox {
-classname TixDirSelectBox
-superclass tixPrimitive
-method {
}
-flag {
-command -disablecallback -value
}
-configspec {
{-command command Command ""}
{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
{-label label Label "Directory:"}
{-value value Value ""}
}
-forcecall {
-value -label
}
-default {
{*combo*listbox.height 5}
{*combo.label.anchor w}
{*combo.labelSide top}
{*combo.history true}
{*combo.historyLimit 20}
}
}
proc tixDirSelectBox:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
}
proc tixDirSelectBox:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:dircbx) [tixFileComboBox $w.dircbx]
set data(w:dirlist) [tixDirList $w.dirlist]
pack $data(w:dircbx) -side top -fill x -padx 4 -pady 2
pack $data(w:dirlist) -side top -fill both -expand yes -padx 4 -pady 2
if {$data(-value) eq ""} {
set data(-value) [pwd]
}
}
proc tixDirSelectBox:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:dircbx) config -command [list tixDirSelectBox:Cmd-DirCbx $w]
$data(w:dirlist) config -command [list tixDirSelectBox:Cmd-DirList $w]\
-browsecmd [list tixDirSelectBox:Browse-DirList $w]
}
#----------------------------------------------------------------------
# Incoming event: User
#----------------------------------------------------------------------
# User activates the FileComboBox
#
#
proc tixDirSelectBox:Cmd-DirCbx {w args} {
upvar #0 $w data
set fInfo [tixEvent value]
set path [lindex $fInfo 0]
if {![file exists $path]} {
# 1.1 Check for validity. The pathname cannot contain invalid chars
#
if {![tixFSIsValid $path]} {
tk_messageBox -title "Invalid Directory" \
-type ok -icon error \
-message "\"$path\" is not a valid directory name"
$data(w:dircbx) config \
-text [tixFSDisplayName [file normalize $data(-value)]] \
-directory $data(-value)
return
}
# 1.2 Prompt for creation
#
set choice [tk_messageBox -title "Create Directory?" \
-type yesno -icon question \
-message "Directory \"$path\" does not exist.\
\nDo you want to create it?"]
if {$choice eq "yes"
&& [catch {file mkdir [file dirname $path]} err]} {
tk_messageBox -title "Error Creating Directory" \
-icon error -type ok \
-message "Cannot create directory \"$path\":\n$err"
set choice "no"
}
if {$choice eq "no"} {
$data(w:dircbx) config \
-text [tixFSDisplayName [file normalize $data(-value)]] \
-directory $data(-value)
return
}
tixDirSelectBox:SetValue $w $path 1 1
} elseif {![file isdirectory $path]} {
# 2.1: Can't choose a non-directory file
#
tk_messageBox -title "Invalid Directory" \
-type ok -icon error \
-message "\"$path\" is not a directory"
$data(w:dircbx) config \
-text [tixFSDisplayName [file normalize $data(-value)]] \
-directory $data(-value)
return
} else {
# OK. It is an existing directory
#
tixDirSelectBox:SetValue $w $path 1 1
}
}
# User activates the dir list
#
#
proc tixDirSelectBox:Cmd-DirList {w args} {
upvar #0 $w data
set dir $data(-value)
catch {set dir [tixEvent flag V]}
set dir [tixFSNormalize $dir]
tixDirSelectBox:SetValue $w $dir 0 0
}
# User browses the dir list
#
#
proc tixDirSelectBox:Browse-DirList {w args} {
upvar #0 $w data
set dir $data(-value)
catch {set dir [tixEvent flag V]}
set dir [tixFSNormalize $dir]
tixDirSelectBox:SetValue $w $dir 0 0
}
#----------------------------------------------------------------------
# Incoming event: Application
#----------------------------------------------------------------------
proc tixDirSelectBox:config-value {w value} {
upvar #0 $w data
set value [tixFSNormalize $value]
tixDirSelectBox:SetValue $w $value 1 1
return $value
}
proc tixDirSelectBox:config-label {w value} {
upvar #0 $w data
$data(w:dircbx) subwidget combo config -label $value
}
#----------------------------------------------------------------------
#
# Internal functions
#
#----------------------------------------------------------------------
# Arguments:
# callback:Bool Should we invoke the the -command.
# setlist:Bool Should we set the -value of the DirList subwidget.
#
proc tixDirSelectBox:SetValue {w dir callback setlist} {
upvar #0 $w data
set data(-value) $dir
$data(w:dircbx) config -text [tixFSDisplayName $dir] -directory $dir
if {$setlist && [file isdirectory $dir]} {
tixSetSilent $data(w:dirlist) $dir
}
if {$callback} {
if {!$data(-disablecallback) && [llength $data(-command)]} {
set bind(specs) {%V}
set bind(%V) $data(-value)
tixEvalCmdBinding $w $data(-command) bind $data(-value)
}
}
}
Tix8.4.3/FileEnt.tcl 0000644 00000016227 15173441414 0007751 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: FileEnt.tcl,v 1.7 2004/03/28 02:44:57 hobbs Exp $
#
# FileEnt.tcl --
#
# TixFileEntry Widget: an entry box for entering filenames.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixFileEntry {
-classname TixFileEntry
-superclass tixLabelWidget
-method {
invoke filedialog update
}
-flag {
-activatecmd -command -dialogtype -disablecallback -disabledforeground
-filebitmap -selectmode -state -validatecmd -value -variable
}
-forcecall {
-variable
}
-static {
-filebitmap
}
-configspec {
{-activatecmd activateCmd ActivateCmd ""}
{-command command Command ""}
{-dialogtype dialogType DialogType ""}
{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
{-disabledforeground disabledForeground DisabledForeground #303030}
{-filebitmap fileBitmap FileBitmap ""}
{-selectmode selectMode SelectMode normal}
{-state state State normal}
{-validatecmd validateCmd ValidateCmd ""}
{-value value Value ""}
{-variable variable Variable ""}
}
-default {
{*frame.borderWidth 2}
{*frame.relief sunken}
{*Button.highlightThickness 0}
{*Entry.highlightThickness 0}
{*Entry.borderWidth 0}
}
}
proc tixFileEntry:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(varInited) 0
if {$data(-filebitmap) eq ""} {
set data(-filebitmap) [tix getbitmap openfile]
}
}
proc tixFileEntry:ConstructFramedWidget {w frame} {
upvar #0 $w data
tixChainMethod $w ConstructFramedWidget $frame
set data(w:entry) [entry $frame.entry]
set data(w:button) [button $frame.button -bitmap $data(-filebitmap) \
-takefocus 0]
set data(entryfg) [$data(w:entry) cget -fg]
pack $data(w:button) -side right -fill both
pack $data(w:entry) -side left -expand yes -fill both
}
proc tixFileEntry:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:button) config -command [list tixFileEntry:OpenFile $w]
tixSetMegaWidget $data(w:entry) $w
# If user press <return>, verify the value and call the -command
#
bind $data(w:entry) <Return> [list tixFileEntry:invoke $w]
bind $data(w:entry) <KeyPress> {
if {[set [tixGetMegaWidget %W](-selectmode)] eq "immediate"} {
tixFileEntry:invoke [tixGetMegaWidget %W]
}
}
bind $data(w:entry) <FocusOut> {
if {"%d" eq "NotifyNonlinear" || "%d" eq "NotifyNonlinearVirtual"} {
tixFileEntry:invoke [tixGetMegaWidget %W]
}
}
bind $w <FocusIn> [list focus $data(w:entry)]
}
#----------------------------------------------------------------------
# CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixFileEntry:config-state {w value} {
upvar #0 $w data
if {$value eq "normal"} {
$data(w:button) config -state $value
$data(w:entry) config -state $value -fg $data(entryfg)
catch {$data(w:label) config -fg $data(entryfg)}
} else {
$data(w:button) config -state $value
$data(w:entry) config -state $value -fg $data(-disabledforeground)
catch {$data(w:label) config -fg $data(-disabledforeground)}
}
return ""
}
proc tixFileEntry:config-value {w value} {
tixFileEntry:SetValue $w $value
}
proc tixFileEntry:config-variable {w arg} {
upvar #0 $w data
if {[tixVariable:ConfigVariable $w $arg]} {
# The value of data(-value) is changed if tixVariable:ConfigVariable
# returns true
tixFileEntry:SetValue $w $data(-value)
}
catch {
unset data(varInited)
}
set data(-variable) $arg
}
#----------------------------------------------------------------------
# User Commands
#----------------------------------------------------------------------
proc tixFileEntry:invoke {w} {
upvar #0 $w data
if {![catch {$data(w:entry) index sel.first}]} {
# THIS ENTRY OWNS SELECTION --> TURN IT OFF
#
$data(w:entry) select from end
$data(w:entry) select to end
}
tixFileEntry:SetValue $w [$data(w:entry) get]
}
proc tixFileEntry:filedialog {w args} {
upvar #0 $w data
if {[llength $args]} {
return [eval [tix filedialog $data(-dialogtype)] $args]
} else {
return [tix filedialog $data(-dialogtype)]
}
}
proc tixFileEntry:update {w} {
upvar #0 $w data
if {[$data(w:entry) get] ne $data(-value)} {
tixFileEntry:invoke $w
}
}
#----------------------------------------------------------------------
# Internal Commands
#----------------------------------------------------------------------
proc tixFileEntry:OpenFile {w} {
upvar #0 $w data
if {$data(-activatecmd) != ""} {
uplevel #0 $data(-activatecmd)
}
switch -- $data(-dialogtype) tk_chooseDirectory {
set args [list -parent [winfo toplevel $w]]
if {[set initial $data(-value)] != ""} {
lappend args -initialdir $data(value)
}
set retval [eval [linsert $args 0 tk_chooseDirectory]]
if {$retval != ""} {tixFileEntry:SetValue $w [tixFSNative $retval]}
} tk_getOpenFile - tk_getSaveFile {
set args [list -parent [winfo toplevel $w]]
if {[set initial [$data(w:entry) get]] != ""} {
switch -glob -- $initial *.py {
set types [list {"Python Files" {.py .pyw}} {"All Files" *}]
} *.txt {
set types [list {"Text Files" .txt} {"All Files" *}]
} *.tcl {
set types [list {"Tcl Files" .tcl} {"All Files" *}]
} * - default {
set types [list {"All Files" *}]
}
if {[file isfile $initial]} {
lappend args -initialdir [file dir $initial] \
-initialfile $initial
} elseif {[file isdir $initial]} {
lappend args -initialdir $initial
}
} else {
set types [list {"All Files" *}]
}
lappend args -filetypes $types
set retval [eval $data(-dialogtype) $args]
if {$retval != ""} {tixFileEntry:SetValue $w [tixFSNative $retval]}
} default {
set filedlg [tix filedialog $data(-dialogtype)]
$filedlg config -parent [winfo toplevel $w] \
-command [list tixFileEntry:FileDlgCallback $w]
focus $data(w:entry)
$filedlg popup
}
}
proc tixFileEntry:FileDlgCallback {w args} {
set filename [tixEvent flag V]
tixFileEntry:SetValue $w $filename
}
proc tixFileEntry:SetValue {w value} {
upvar #0 $w data
if {[llength $data(-validatecmd)]} {
set value [tixEvalCmdBinding $w $data(-validatecmd) "" $value]
}
if {$data(-state) eq "normal"} {
$data(w:entry) delete 0 end
$data(w:entry) insert 0 $value
$data(w:entry) xview end
}
set data(-value) $value
tixVariable:UpdateVariable $w
if {[llength $data(-command)] && !$data(-disablecallback)} {
if {![info exists data(varInited)]} {
set bind(specs) ""
tixEvalCmdBinding $w $data(-command) bind $value
}
}
}
proc tixFileEntry:Destructor {w} {
upvar #0 $w data
tixUnsetMegaWidget $data(w:entry)
tixVariable:DeleteVariable $w
# Chain this to the superclass
#
tixChainMethod $w Destructor
}
Tix8.4.3/CObjView.tcl 0000644 00000017072 15173441414 0010072 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: CObjView.tcl,v 1.3 2001/12/09 05:04:02 idiscovery Exp $
#
# CObjView.tcl --
#
# This file implements the Canvas Object View widget. This is a base
# class of IconView. It implements:
# (1) Automatic placement/adjustment of the scrollbars according
# to the canvas objects inside the canvas subwidget. The
# scrollbars are adjusted so that the canvas is just large
# enough to see all the objects.
#
# (2) D+D bindings of the objects (%% not implemented)
#
# (3) Keyboard traversal of the objects (%% not implemented). By the
# virtual method :SelectObject.
#
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixCObjView {
-classname TixCObjView
-superclass tixScrolledWidget
-method {
adjustscrollregion
}
-flag {
-xscrollincrement -yscrollincrement
}
-static {
}
-configspec {
{-xscrollincrement xScrollIncrement ScrollIncrement 10}
{-yscrollincrement yScrollIncrement ScrollIncrement 10}
}
-default {
{.scrollbar auto}
{*borderWidth 1}
{*canvas.background #c3c3c3}
{*canvas.highlightBackground #d9d9d9}
{*canvas.relief sunken}
{*canvas.takeFocus 1}
{*Scrollbar.takeFocus 0}
}
-forcecall {
-scrollbar
}
}
proc tixCObjView:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:canvas) \
[canvas $w.canvas]
set data(w:hsb) \
[scrollbar $w.hsb -orient horizontal]
set data(w:vsb) \
[scrollbar $w.vsb -orient vertical]
set data(pw:client) $data(w:canvas)
set data(xorig) 0
set data(yorig) 0
set data(sx1) 0
set data(sy1) 0
set data(sx2) 0
set data(sy2) 0
}
proc tixCObjView:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
# %% scan/drag of canvas??
#
# $data(w:canvas) config \
# -xscrollcommand "tixCObjView:XScroll $w"\
# -yscrollcommand "tixCObjView:YScroll $w"
$data(w:hsb) config -command "tixCObjView:UserScroll $w x"
$data(w:vsb) config -command "tixCObjView:UserScroll $w y"
}
#----------------------------------------------------------------------
#
# option configs
#----------------------------------------------------------------------
proc tixCObjView:config-takefocus {w value} {
upvar #0 $w data
$data(w:canvas) config -takefocus $value
}
#----------------------------------------------------------------------
#
# Widget commands
#----------------------------------------------------------------------
proc tixCObjView:adjustscrollregion {w} {
upvar #0 $w data
set cW [tixWinWidth $data(w:canvas)]
set cH [tixWinHeight $data(w:canvas)]
tixCObjView:GetScrollRegion $w $cW $cH 1 1
}
#----------------------------------------------------------------------
#
# Private Methods
#----------------------------------------------------------------------
proc tixCObjView:GeometryInfo {w cW cH} {
upvar #0 $w data
set bd \
[expr [$data(w:canvas) cget -bd] + [$data(w:canvas) cget -highlightthickness]]
incr cW -[expr {2*$bd}]
incr cH -[expr {2*$bd}]
return [tixCObjView:GetScrollRegion $w $cW $cH 0 0]
}
proc tixCObjView:PlaceWindow {w} {
upvar #0 $w data
set cW [tixWinWidth $data(w:canvas)]
set cH [tixWinHeight $data(w:canvas)]
tixCObjView:GetScrollRegion $w $cW $cH 1 0
tixChainMethod $w PlaceWindow
}
proc tixCObjView:GetScrollRegion {w cW cH setReg callConfig} {
upvar #0 $w data
set x1max $data(xorig)
set y1max $data(yorig)
set x2min [expr {$x1max + $cW - 1}]
set y2min [expr {$y1max + $cH - 1}]
set bbox [$data(w:canvas) bbox all]
if {$bbox == ""} {
set bbox {0 0 1 1}
}
set x1 [lindex $bbox 0]
set y1 [lindex $bbox 1]
set x2 [lindex $bbox 2]
set y2 [lindex $bbox 3]
set bd \
[expr [$data(w:canvas) cget -bd] + [$data(w:canvas) cget -highlightthickness]]
incr x1 -$bd
incr y1 -$bd
incr x2 -$bd
incr y2 -$bd
if {$x1 > $x1max} {
set x1 $x1max
}
if {$y1 > $y1max} {
set y1 $y1max
}
if {$x2 < $x2min} {
set x2 $x2min
}
if {$y2 < $y2min} {
set y2 $y2min
}
set data(sx1) $x1
set data(sy1) $y1
set data(sx2) $x2
set data(sy2) $y2
set sW [expr {$x2 - $x1 + 1}]
set sH [expr {$y2 - $y1 + 1}]
# puts "sregion = {$x1 $y1 $x2 $y2}; sW=$sW; cW=$cW"
if {$sW > $cW} {
set hsbSpec {0.5 1}
} else {
set hsbSpec {0 1}
}
if {$sH > $cH} {
set vsbSpec {0.5 1}
} else {
set vsbSpec {0 1}
}
if $setReg {
tixCObjView:SetScrollBars $w $cW $cH $sW $sH
}
if $callConfig {
tixWidgetDoWhenIdle tixScrolledWidget:Configure $w
}
return [list $hsbSpec $vsbSpec]
}
#xF = xFirst
#
proc tixCObjView:SetScrollBars {w cW cH sW sH} {
upvar #0 $w data
# puts "$data(xorig) <--> $data(sx1)"
set xF [expr ($data(xorig).0-$data(sx1).0)/$sW.0]
set xL [expr $cW.0/$sW.0 + $xF]
set yF [expr ($data(yorig).0-$data(sy1).0)/$sH.0]
set yL [expr $cH.0/$sH.0 + $yF]
# puts "$xF $xL : $yF $yL"
$data(w:hsb) set $xF $xL
$data(w:vsb) set $yF $yL
}
proc tixCObjView:UserScroll {w dir type args} {
upvar #0 $w data
$data(w:canvas) config -xscrollincrement 1 -yscrollincrement 1
case $dir {
x {
set n $data(xorig)
set orig $data(xorig)
set s1 $data(sx1)
set total [expr {$data(sx2)-$data(sx1)}]
set page [tixWinWidth $data(w:canvas)]
set min $data(sx1)
set max [expr {$data(sx1)+$total-$page}]
set inc $data(-xscrollincrement)
}
y {
set n $data(yorig)
set orig $data(yorig)
set s1 $data(sy1)
set total [expr {$data(sy2)-$data(sy1)}]
set page [tixWinHeight $data(w:canvas)]
set min $data(sy1)
set max [expr {$data(sy1)+$total-$page}]
set inc $data(-yscrollincrement)
}
}
case $type {
scroll {
set amt [lindex $args 0]
set unit [lindex $args 1]
case $unit {
units {
incr n [expr int($inc)*$amt]
}
pages {
incr n [expr {$page*$amt}]
}
}
}
moveto {
set first [lindex $args 0]
set n [expr round($first*$total)+$s1]
}
}
if {$n < $min} {
set n $min
}
if {$n > $max} {
set n $max
}
# puts "n=$n min=$min max=$max"
case $dir {
x {
$data(w:canvas) xview scroll [expr {$n-$orig}] units
set data(xorig) $n
}
y {
$data(w:canvas) yview scroll [expr {$n-$orig}] units
set data(yorig) $n
}
}
set cW [tixWinWidth $data(w:canvas)]
set cH [tixWinHeight $data(w:canvas)]
set sW [expr {$data(sx2)-$data(sx1)+1}]
set sH [expr {$data(sy2)-$data(sy1)+1}]
tixCObjView:SetScrollBars $w $cW $cH $sW $sH
}
# Junk
#
#
proc tixCObjView:XScroll {w first last} {
upvar #0 $w data
set sc [$data(w:canvas) cget -scrollregion]
if {$sc == ""} {
set x1 1
set x2 [tixWinWidth $data(w:canvas)]
} else {
set x1 [lindex $sc 0]
set x2 [lindex $sc 2]
}
set W [expr {$x2 - $x1}]
if {$W < 1} {
set W 1
}
$data(w:hsb) set $first $last
# tixWidgetDoWhenIdle tixScrolledWidget:Configure $w
}
# Junk
#
proc tixCObjView:YScroll {w first last} {
upvar #0 $w data
set sc [$data(w:canvas) cget -scrollregion]
if {$sc == ""} {
set y1 1
set y2 [tixWinHeight $data(w:canvas)]
} else {
set y1 [lindex $sc 1]
set y2 [lindex $sc 3]
}
set H [expr {$y2 - $y1}]
if {$H < 1} {
set H 1
}
$data(w:vsb) set $first $last
# tixWidgetDoWhenIdle tixScrolledWidget:Configure $w
}
Tix8.4.3/Utils.tcl 0000644 00000025044 15173441414 0007520 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Utils.tcl,v 1.4 2004/03/28 02:44:57 hobbs Exp $
#
# Util.tcl --
#
# The Tix utility commands. Some of these commands are
# replacement of or extensions to the existing TK
# commands. Occasionaly, you have to use the commands inside
# this file instead of thestandard TK commands to make your
# applicatiion work better with Tix. Please read the
# documentations (programmer's guide, man pages) for information
# about these utility commands.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
# kludge: should be able to handle all kinds of flags
# now only handles "-flag value" pairs.
#
proc tixHandleArgv {p_argv p_options validFlags} {
upvar $p_options opt
upvar $p_argv argv
set old_argv $argv
set argv ""
foreac {flag value} $old_argv {
if {[lsearch $validFlags $flag] != -1} {
# The caller will handle this option exclusively
# It won't be added back to the original arglist
#
eval $opt($flag,action) $value
} else {
# The caller does not handle this option
#
lappend argv $flag
lappend argv $value
}
}
}
#-----------------------------------------------------------------------
# tixDisableAll -
#
# Disable all members in a sub widget tree
#
proc tixDisableAll {w} {
foreach x [tixDescendants $w] {
catch {$x config -state disabled}
}
}
#----------------------------------------------------------------------
# tixEnableAll -
#
# enable all members in a sub widget tree
#
proc tixEnableAll {w} {
foreach x [tixDescendants $w] {
catch {$x config -state normal}
}
}
#----------------------------------------------------------------------
# tixDescendants -
#
# Return a list of all the member of a widget subtree, including
# the tree's root widget.
#
proc tixDescendants {parent} {
set des ""
lappend des $parent
foreach w [winfo children $parent] {
foreach x [tixDescendants $w] {
lappend des $x
}
}
return $des
}
#----------------------------------------------------------------------
# tixTopLevel -
#
# Create a toplevel widget and unmap it immediately. This will ensure
# that this toplevel widgets will not be popped up prematurely when you
# create Tix widgets inside it.
#
# "tixTopLevel" also provide options for you to specify the appearance
# and behavior of this toplevel.
#
#
#
proc tixTopLevel {w args} {
set opt (-geometry) ""
set opt (-minsize) ""
set opt (-maxsize) ""
set opt (-width) ""
set opt (-height) ""
eval [linsert $args 0 toplevel $w]
wm withdraw $w
}
# This is a big kludge
#
# Substitutes all [...] and $.. in the string in $args
#
proc tixInt_Expand {args} {
return $args
}
# Print out all the config options of a widget
#
proc tixPConfig {w} {
puts [join [lsort [$w config]] \n]
}
proc tixAppendBindTag {w tag} {
bindtags $w [concat [bindtags $w] $tag]
}
proc tixAddBindTag {w tag} {
bindtags $w [concat $tag [bindtags $w] ]
}
proc tixSubwidgetRef {sub} {
return $::tixSRef($sub)
}
proc tixSubwidgetRetCreate {sub ref} {
set ::tixSRef($sub) $ref
}
proc tixSubwidgetRetDelete {sub} {
catch {unset ::tixSRef($sub)}
}
proc tixListboxGetCurrent {listbox} {
return [tixEvent flag V]
}
# tixSetMegaWidget --
#
# Associate a subwidget with its mega widget "owner". This is mainly
# used when we add a new bindtag to a subwidget and we need to find out
# the name of the mega widget inside the binding.
#
proc tixSetMegaWidget {w mega {type any}} {
set ::tixMega($type,$w) $mega
}
proc tixGetMegaWidget {w {type any}} {
return $::tixMega($type,$w)
}
proc tixUnsetMegaWidget {w} {
if {[info exists ::tixMega($w)]} { unset ::tixMega($w) }
}
# tixBusy : display busy cursors on a window
#
#
# Should flush the event queue (but not do any idle tasks) before blocking
# the target window (I am not sure if it is aready doing so )
#
# ToDo: should take some additional windows to raise
#
proc tixBusy {w flag {focuswin ""}} {
if {[info command tixInputOnly] == ""} {
return
}
global tixBusy
set toplevel [winfo toplevel $w]
if {![info exists tixBusy(cursor)]} {
set tixBusy(cursor) watch
# set tixBusy(cursor) "[tix getbitmap hourglass] \
# [string range [tix getbitmap hourglass.mask] 1 end]\
# black white"
}
if {$toplevel eq "."} {
set inputonly0 .__tix__busy0
set inputonly1 .__tix__busy1
set inputonly2 .__tix__busy2
set inputonly3 .__tix__busy3
} else {
set inputonly0 $toplevel.__tix__busy0
set inputonly1 $toplevel.__tix__busy1
set inputonly2 $toplevel.__tix__busy2
set inputonly3 $toplevel.__tix__busy3
}
if {![winfo exists $inputonly0]} {
for {set i 0} {$i < 4} {incr i} {
tixInputOnly [set inputonly$i] -cursor $tixBusy(cursor)
}
}
if {$flag eq "on"} {
if {$focuswin != "" && [winfo id $focuswin] != 0} {
if {[info exists tixBusy($focuswin,oldcursor)]} {
return
}
set tixBusy($focuswin,oldcursor) [$focuswin cget -cursor]
$focuswin config -cursor $tixBusy(cursor)
set x1 [expr {[winfo rootx $focuswin]-[winfo rootx $toplevel]}]
set y1 [expr {[winfo rooty $focuswin]-[winfo rooty $toplevel]}]
set W [winfo width $focuswin]
set H [winfo height $focuswin]
set x2 [expr {$x1 + $W}]
set y2 [expr {$y1 + $H}]
if {$y1 > 0} {
tixMoveResizeWindow $inputonly0 0 0 10000 $y1
}
if {$x1 > 0} {
tixMoveResizeWindow $inputonly1 0 0 $x1 10000
}
tixMoveResizeWindow $inputonly2 0 $y2 10000 10000
tixMoveResizeWindow $inputonly3 $x2 0 10000 10000
for {set i 0} {$i < 4} {incr i} {
tixMapWindow [set inputonly$i]
tixRaiseWindow [set inputonly$i]
}
tixFlushX $w
} else {
tixMoveResizeWindow $inputonly0 0 0 10000 10000
tixMapWindow $inputonly0
tixRaiseWindow $inputonly0
}
} else {
tixUnmapWindow $inputonly0
tixUnmapWindow $inputonly1
tixUnmapWindow $inputonly2
tixUnmapWindow $inputonly3
if {$focuswin != "" && [winfo id $focuswin] != 0} {
if {[info exists tixBusy($focuswin,oldcursor)]} {
$focuswin config -cursor $tixBusy($focuswin,oldcursor)
if {[info exists tixBusy($focuswin,oldcursor)]} {
unset tixBusy($focuswin,oldcursor)
}
}
}
}
}
proc tixOptionName {w} {
return [string range $w 1 end]
}
proc tixSetSilent {chooser value} {
$chooser config -disablecallback true
$chooser config -value $value
$chooser config -disablecallback false
}
# This command is useful if you want to ingore the arguments
# passed by the -command or -browsecmd options of the Tix widgets. E.g
#
# tixFileSelectDialog .c -command "puts foo; tixBreak"
#
#
proc tixBreak {args} {}
#----------------------------------------------------------------------
# tixDestroy -- deletes a Tix class object (not widget classes)
#----------------------------------------------------------------------
proc tixDestroy {w} {
upvar #0 $w data
set destructor ""
if {[info exists data(className)]} {
catch {
set destructor [tixGetMethod $w $data(className) Destructor]
}
}
if {$destructor != ""} {
$destructor $w
}
catch {rename $w ""}
catch {unset data}
return ""
}
proc tixPushGrab {args} {
global tix_priv
if {![info exists tix_priv(grab-list)]} {
set tix_priv(grab-list) ""
set tix_priv(grab-mode) ""
set tix_priv(grab-nopush) ""
}
set len [llength $args]
if {$len == 1} {
set opt ""
set w [lindex $args 0]
} elseif {$len == 2} {
set opt [lindex $args 0]
set w [lindex $args 1]
} else {
error "wrong # of arguments: tixPushGrab ?-global? window"
}
# Not everyone will call tixPushGrab. If someone else has a grab already
# save that one as well, so that we can restore that later
#
set last [lindex $tix_priv(grab-list) end]
set current [grab current $w]
if {$current ne "" && $current ne $last} {
# Someone called "grab" directly
#
lappend tix_priv(grab-list) $current
lappend tix_priv(grab-mode) [grab status $current]
lappend tix_priv(grab-nopush) 1
}
# Now push myself into the stack
#
lappend tix_priv(grab-list) $w
lappend tix_priv(grab-mode) $opt
lappend tix_priv(grab-nopush) 0
if {$opt eq "-global"} {
grab -global $w
} else {
grab $w
}
}
proc tixPopGrab {} {
global tix_priv
if {![info exists tix_priv(grab-list)]} {
set tix_priv(grab-list) ""
set tix_priv(grab-mode) ""
set tix_priv(grab-nopush) ""
}
set len [llength $tix_priv(grab-list)]
if {$len <= 0} {
error "no window is grabbed by tixGrab"
}
set w [lindex $tix_priv(grab-list) end]
grab release $w
if {$len > 1} {
set tix_priv(grab-list) [lrange $tix_priv(grab-list) 0 end-1]
set tix_priv(grab-mode) [lrange $tix_priv(grab-mode) 0 end-1]
set tix_priv(grab-nopush) [lrange $tix_priv(grab-nopush) 0 end-1]
set w [lindex $tix_priv(grab-list) end]
set m [lindex $tix_priv(grab-list) end]
set np [lindex $tix_priv(grab-nopush) end]
if {$np == 1} {
# We have a grab set by "grab"
#
set len [llength $tix_priv(grab-list)]
if {$len > 1} {
set tix_priv(grab-list) [lrange $tix_priv(grab-list) 0 end-1]
set tix_priv(grab-mode) [lrange $tix_priv(grab-mode) 0 end-1]
set tix_priv(grab-nopush) \
[lrange $tix_priv(grab-nopush) 0 end-1]
} else {
set tix_priv(grab-list) ""
set tix_priv(grab-mode) ""
set tix_priv(grab-nopush) ""
}
}
if {$m == "-global"} {
grab -global $w
} else {
grab $w
}
} else {
set tix_priv(grab-list) ""
set tix_priv(grab-mode) ""
set tix_priv(grab-nopush) ""
}
}
proc tixWithinWindow {wid rootX rootY} {
set wc [winfo containing $rootX $rootY]
if {$wid eq $wc} { return 1 }
# no see if it is an enclosing parent
set rx1 [winfo rootx $wid]
set ry1 [winfo rooty $wid]
set rw [winfo width $wid]
set rh [winfo height $wid]
set rx2 [expr {$rx1+$rw}]
set ry2 [expr {$ry1+$rh}]
if {$rootX >= $rx1 && $rootX < $rx2 && $rootY >= $ry1 && $rootY < $ry2} {
return 1
} else {
return 0
}
}
proc tixWinWidth {w} {
set W [winfo width $w]
set bd [expr {[$w cget -bd] + [$w cget -highlightthickness]}]
return [expr {$W - 2*$bd}]
}
proc tixWinHeight {w} {
set H [winfo height $w]
set bd [expr {[$w cget -bd] + [$w cget -highlightthickness]}]
return [expr {$H - 2*$bd}]
}
# junk?
#
proc tixWinCmd {w} {
return [winfo command $w]
}
Tix8.4.3/SHList.tcl 0000644 00000007321 15173441414 0007564 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: SHList.tcl,v 1.7 2004/04/09 21:37:33 hobbs Exp $
#
# SHList.tcl --
#
# This file implements Scrolled HList widgets
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixScrolledHList {
-classname TixScrolledHList
-superclass tixScrolledWidget
-method {
}
-flag {
-highlightbackground -highlightcolor -highlightthickness
}
-configspec {
{-highlightbackground -highlightBackground HighlightBackground #d9d9d9}
{-highlightcolor -highlightColor HighlightColor black}
{-highlightthickness -highlightThickness HighlightThickness 2}
}
-default {
{.scrollbar auto}
{*f1.borderWidth 1}
{*hlist.Background #c3c3c3}
{*hlist.highlightBackground #d9d9d9}
{*hlist.relief sunken}
{*hlist.takeFocus 1}
{*Scrollbar.takeFocus 0}
}
-forcecall {
-highlightbackground -highlightcolor -highlightthickness
}
}
proc tixScrolledHList:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(pw:f1) [frame $w.f1 -takefocus 0]
set data(w:hlist) \
[tixHList $w.f1.hlist -bd 0 -takefocus 1 -highlightthickness 0]
pack $data(w:hlist) -in $data(pw:f1) -expand yes -fill both -padx 0 -pady 0
set data(w:hsb) [scrollbar $w.hsb -orient horizontal -takefocus 0]
set data(w:vsb) [scrollbar $w.vsb -orient vertical -takefocus 0]
set data(pw:client) $data(pw:f1)
}
proc tixScrolledHList:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:hlist) config \
-xscrollcommand [list $data(w:hsb) set] \
-yscrollcommand [list $data(w:vsb) set] \
-sizecmd [list tixScrolledWidget:Configure $w]
$data(w:hsb) config -command [list $data(w:hlist) xview]
$data(w:vsb) config -command [list $data(w:hlist) yview]
}
#----------------------------------------------------------------------
#
# option configs
#----------------------------------------------------------------------
proc tixScrolledHList:config-takefocus {w value} {
upvar #0 $w data
$data(w:hlist) config -takefocus $value
}
proc tixScrolledHList:config-highlightbackground {w value} {
upvar #0 $w data
$data(pw:f1) config -highlightbackground $value
}
proc tixScrolledHList:config-highlightcolor {w value} {
upvar #0 $w data
$data(pw:f1) config -highlightcolor $value
}
proc tixScrolledHList:config-highlightthickness {w value} {
upvar #0 $w data
$data(pw:f1) config -highlightthickness $value
}
#----------------------------------------------------------------------
#
# Widget commands
#----------------------------------------------------------------------
#----------------------------------------------------------------------
#
# Private Methods
#----------------------------------------------------------------------
# virtual
#
proc tixScrolledHList:RepackHook {w} {
upvar #0 $w data
tixChainMethod $w RepackHook
}
#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#----------------------------------------------------------------------
proc tixScrolledHList:GeometryInfo {w mW mH} {
upvar #0 $w data
if {[winfo class $w.f1] eq "Frame"} {
set extra [expr {[$w.f1 cget -bd]+[$w.f1 cget -highlightthickness]}]
} else {
set extra 0
}
set mW [expr {$mW - $extra*2}]
set mH [expr {$mH - $extra*2}]
if {$mW < 1} {
set mW 1
}
if {$mH < 1} {
set mH 1
}
return [$data(w:hlist) geometryinfo $mW $mH]
}
Tix8.4.3/ListNBk.tcl 0000644 00000006775 15173441414 0007740 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: ListNBk.tcl,v 1.5 2004/03/28 02:44:57 hobbs Exp $
#
# ListNBk.tcl --
#
# "List NoteBook" widget. Acts similarly to the notebook but uses a
# HList widget to represent the pages.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixListNoteBook {
-classname TixListNoteBook
-superclass tixVStack
-method {
}
-flag {
-height -width
}
-configspec {
{-width width Width 0}
{-height height Height 0}
}
-forcecall {
-dynamicgeometry -width -height
}
-default {
{*Orientation horizontal}
}
}
proc tixListNoteBook:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w_pane) [tixPanedWindow $w.pane -panerelief flat]
set p1 [$data(w_pane) add p1 -expand 0]
set p2 [$data(w_pane) add p2 -expand 1]
set data(w_p2) $p2
set data(w:shlist) [tixScrolledHList $p1.shlist]
set data(w:hlist) [$data(w:shlist) subwidget hlist]
if {[$data(w_pane) cget -orientation] eq "vertical"} {
pack $data(w:shlist) -expand yes -fill both -padx 2 -pady 3
} else {
pack $data(w:shlist) -expand yes -fill both -padx 3 -pady 2
}
$data(w:hlist) config \
-command [list tixListNoteBook:Choose $w] \
-browsecmd [list tixListNoteBook:Choose $w] \
-selectmode single
pack $data(w_pane) -expand yes -fill both
}
proc tixListNoteBook:add {w child args} {
upvar #0 $w data
if {[string match *.* $child]} {
error "the name of the page cannot contain the \".\" character"
}
return [eval tixChainMethod $w add $child $args]
}
#----------------------------------------------------------------------
# Virtual Methods
#----------------------------------------------------------------------
proc tixListNoteBook:InitGeometryManager {w} {
tixWidgetDoWhenIdle tixListNoteBook:InitialRaise $w
}
proc tixListNoteBook:InitialRaise {w} {
upvar #0 $w data
if {$data(topchild) eq ""} {
set top [lindex $data(windows) 0]
} else {
set top $data(topchild)
}
if {$top ne ""} {
tixCallMethod $w raise $top
}
}
proc tixListNoteBook:CreateChildFrame {w child} {
upvar #0 $w data
return [frame $data(w_p2).$child]
}
proc tixListNoteBook:RaiseChildFrame {w child} {
upvar #0 $w data
if {$data(topchild) ne $child} {
if {$data(topchild) ne ""} {
pack forget $data(w:$data(topchild))
}
pack $data(w:$child) -expand yes -fill both
}
}
#
#----------------------------------------------------------------------
#
proc tixListNoteBook:config-dynamicgeometry {w value} {
upvar #0 $w data
$data(w_pane) config -dynamicgeometry $value
}
proc tixListNoteBook:config-width {w value} {
upvar #0 $w data
if {$value != 0} {
$data(w_pane) config -width $value
}
}
proc tixListNoteBook:config-height {w value} {
upvar #0 $w data
if {$value != 0} {
$data(w_pane) config -height $value
}
}
proc tixListNoteBook:raise {w child} {
upvar #0 $w data
$data(w:hlist) selection clear
$data(w:hlist) selection set $child
$data(w:hlist) anchor set $child
tixChainMethod $w raise $child
}
proc tixListNoteBook:Choose {w args} {
upvar #0 $w data
set entry [tixEvent flag V]
if {[lsearch $data(windows) $entry] != -1} {
tixCallMethod $w raise $entry
}
}
Tix8.4.3/Balloon.tcl 0000644 00000031745 15173441414 0010013 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Balloon.tcl,v 1.7 2008/02/27 22:17:28 hobbs Exp $
#
# Balloon.tcl --
#
# The help widget. It provides both "balloon" type of help
# message and "status bar" type of help message. You can use
# this widget to indicate the function of the widgets inside
# your application.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixBalloon {
-classname TixBalloon
-superclass tixShell
-method {
bind post unbind
}
-flag {
-installcolormap -initwait -state -statusbar -cursor
}
-configspec {
{-installcolormap installColormap InstallColormap false}
{-initwait initWait InitWait 1000}
{-state state State both}
{-statusbar statusBar StatusBar ""}
{-cursor cursor Cursor {}}
}
-default {
{*background #ffff60}
{*foreground black}
{*borderWidth 0}
{.borderWidth 1}
{.background black}
{*Label.anchor w}
{*Label.justify left}
}
}
# static seem to be -installcolormap -initwait -statusbar -cursor
# Class Record
#
global tixBalloon
set tixBalloon(bals) ""
proc tixBalloon:InitWidgetRec {w} {
upvar #0 $w data
global tixBalloon
tixChainMethod $w InitWidgetRec
set data(isActive) 0
set data(client) ""
lappend tixBalloon(bals) $w
}
proc tixBalloon:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
if {[tk windowingsystem] eq "aqua"} {
::tk::unsupported::MacWindowStyle style $w help none
} else {
wm overrideredirect $w 1
}
catch {wm attributes $w -topmost 1}
wm positionfrom $w program
wm withdraw $w
# Frame 1 : arrow
frame $w.f1 -bd 0
set data(w:label) [label $w.f1.lab -bd 0 -relief flat \
-bitmap [tix getbitmap balarrow]]
pack $data(w:label) -side left -padx 1 -pady 1
# Frame 2 : Message
frame $w.f2 -bd 0
set data(w:message) [label $w.f2.message -padx 0 -pady 0 -bd 0]
pack $data(w:message) -side left -expand yes -fill both -padx 10 -pady 1
# Pack all
pack $w.f1 -fill both
pack $w.f2 -fill both
# This is an event tag used by the clients
#
bind TixBal$w <Destroy> [list tixBalloon:ClientDestroy $w %W]
}
proc tixBalloon:Destructor {w} {
global tixBalloon
set bals ""
foreach b $tixBalloon(bals) {
if {$w != $b} {
lappend bals $b
}
}
set tixBalloon(bals) $bals
tixChainMethod $w Destructor
}
#----------------------------------------------------------------------
# Config:
#----------------------------------------------------------------------
proc tixBalloon:config-state {w value} {
upvar #0 $w data
set re {^(none|balloon|status|both)$}
if {![regexp -- $re $value]} {
error "invalid value $value, must be none, balloon, status, or both"
}
}
#----------------------------------------------------------------------
# "RAW" event bindings:
#----------------------------------------------------------------------
bind all <B1-Motion> "+tixBalloon_XXMotion %X %Y 1"
bind all <B2-Motion> "+tixBalloon_XXMotion %X %Y 2"
bind all <B3-Motion> "+tixBalloon_XXMotion %X %Y 3"
bind all <B4-Motion> "+tixBalloon_XXMotion %X %Y 4"
bind all <B5-Motion> "+tixBalloon_XXMotion %X %Y 5"
bind all <Any-Motion> "+tixBalloon_XXMotion %X %Y 0"
# Should %b be 0? %b is illegal
bind all <Leave> "+tixBalloon_XXMotion %X %Y 0"
bind all <Button> "+tixBalloon_XXButton %X %Y %b"
bind all <ButtonRelease> "+tixBalloon_XXButtonUp %X %Y %b"
proc tixBalloon_XXMotion {rootX rootY b} {
global tixBalloon
foreach w $tixBalloon(bals) {
tixBalloon:XXMotion $w $rootX $rootY $b
}
}
proc tixBalloon_XXButton {rootX rootY b} {
global tixBalloon
foreach w $tixBalloon(bals) {
tixBalloon:XXButton $w $rootX $rootY $b
}
}
proc tixBalloon_XXButtonUp {rootX rootY b} {
global tixBalloon
foreach w $tixBalloon(bals) {
tixBalloon:XXButtonUp $w $rootX $rootY $b
}
}
# return true if d is a descendant of w
#
proc tixIsDescendant {w d} {
return [expr {$w eq "." || [string match $w.* $d]}]
}
# All the button events are fine if the ballooned widget is
# a descendant of the grabbing widget
#
proc tixBalloon:GrabBad {w cw} {
global tixBalloon
set g [grab current $w]
if {$g == ""} {
return 0
}
if {[info exists tixBalloon(g_ignore,$g)]} {
return 1
}
if {[info exists tixBalloon(g_ignore,[winfo class $g])]} {
return 1
}
if {$g == $cw || [tixIsDescendant $g $cw]} {
return 0
}
return 1
}
proc tixBalloon:XXMotion {w rootX rootY b} {
upvar #0 $w data
if {![info exists data(-state)]} {
# puts "tixBalloon:XXMotion called without a state\n$w"
set data(state) none
return
}
if {$data(-state) eq "none"} {
return
}
if {$b == 0} {
if {[info exists data(b:1)]} {unset data(b:1)}
if {[info exists data(b:2)]} {unset data(b:2)}
if {[info exists data(b:3)]} {unset data(b:3)}
if {[info exists data(b:4)]} {unset data(b:4)}
if {[info exists data(b:5)]} {unset data(b:5)}
}
if {[llength [array names data b:*]]} {
# Some buttons are down. Do nothing
#
return
}
set cw [winfo containing -displayof $w $rootX $rootY]
if {[tixBalloon:GrabBad $w $cw]} {
return
}
# Find the a client window that matches
#
if {$w eq $cw || [string match $w.* $cw]} {
# Cursor moved over the balloon -- Ignore
return
}
while {$cw != ""} {
if {[info exists data(m:$cw)]} {
set client $cw
break
} else {
set cw [winfo parent $cw]
}
}
if {![info exists client]} {
# The cursor is at a position covered by a non-client
# Popdown the balloon if it is up
if {$data(isActive)} {
tixBalloon:Deactivate $w
}
set data(client) ""
if {[info exists data(cancel)]} {
unset data(cancel)
}
return
}
if {$data(client) ne $client} {
if {$data(isActive)} {
tixBalloon:Deactivate $w
}
set data(client) $client
after $data(-initwait) tixBalloon:SwitchToClient $w $client
}
}
proc tixBalloon:XXButton {w rootX rootY b} {
upvar #0 $w data
tixBalloon:XXMotion $w $rootX $rootY $b
set data(b:$b) 1
if {$data(isActive)} {
tixBalloon:Deactivate $w
} else {
set data(cancel) 1
}
}
proc tixBalloon:XXButtonUp {w rootX rootY b} {
upvar #0 $w data
tixBalloon:XXMotion $w $rootX $rootY $b
if {[info exists data(b:$b)]} {
unset data(b:$b)
}
}
#----------------------------------------------------------------------
# "COOKED" event bindings:
#----------------------------------------------------------------------
# switch the balloon to a new client
#
proc tixBalloon:SwitchToClient {w client} {
upvar #0 $w data
if {![winfo exists $w]} {
return
}
if {![winfo exists $client]} {
return
}
if {$client ne $data(client)} {
return
}
if {[info exists data(cancel)]} {
unset data(cancel)
return
}
if {[tixBalloon:GrabBad $w $w]} {
return
}
tixBalloon:Activate $w
}
proc tixBalloon:ClientDestroy {w client} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
if {$data(client) eq $client} {
tixBalloon:Deactivate $w
set data(client) ""
}
# Maybe thses have already been unset by the Destroy method
#
if {[info exists data(m:$client)]} {unset data(m:$client)}
if {[info exists data(s:$client)]} {unset data(s:$client)}
}
#----------------------------------------------------------------------
# Popping up balloon:
#----------------------------------------------------------------------
proc tixBalloon:Activate {w} {
upvar #0 $w data
if {[tixBalloon:GrabBad $w $w]} {
return
}
if {[winfo containing -displayof $w \
[winfo pointerx $w] [winfo pointery $w]] == ""} {
return
}
if {![info exists data(-state)]} {
# puts "tixBalloon:Activate called without a state\n$w"
set data(state) none
return
}
if {$data(-state) eq "none"} {
return
}
switch -exact -- $data(-state) {
"both" {
tixBalloon:PopUp $w
tixBalloon:SetStatus $w
}
"balloon" {
tixBalloon:PopUp $w
}
"status" {
tixBalloon:SetStatus $w
}
}
set data(isActive) 1
after 200 tixBalloon:Verify $w
}
# %% Perhaps this is no more needed
#
proc tixBalloon:Verify {w} {
upvar #0 $w data
if {![winfo exists $w]} {
return
}
if {!$data(isActive)} {
return
}
if {[tixBalloon:GrabBad $w $w]} {
tixBalloon:Deactivate $w
return
}
if {[winfo containing -displayof $w \
[winfo pointerx $w] [winfo pointery $w]] == ""} {
tixBalloon:Deactivate $w
return
}
after 200 tixBalloon:Verify $w
}
proc tixBalloon:Deactivate {w} {
upvar #0 $w data
tixBalloon:PopDown $w
tixBalloon:ClearStatus $w
set data(isActive) 0
if {[info exists data(cancel)]} {
unset data(cancel)
}
}
proc tixBalloon:PopUp {w} {
upvar #0 $w data
if {[string is true -strict $data(-installcolormap)]} {
wm colormapwindows [winfo toplevel $data(client)] $w
}
# trick: the following lines allow the balloon window to
# acquire a stable width and height when it is finally
# put on the visible screen
#
set client $data(client)
if {$data(m:$client) == ""} {return ""}
$data(w:message) config -text $data(m:$client)
wm geometry $w +10000+10000
wm deiconify $w
raise $w
update
# The windows may become destroyed as a result of the "update" command
#
if {![winfo exists $w]} {
return
}
if {![winfo exists $client]} {
return
}
# Put it on the visible screen
#
set x [expr {[winfo rootx $client]+[winfo width $client]/2}]
set y [expr {int([winfo rooty $client]+[winfo height $client]/1.3)}]
set width [winfo reqwidth $w]
set height [winfo reqheight $w]
set scrwidth [winfo vrootwidth $w]
set scrheight [winfo vrootheight $w]
# If the balloon is too far right, pull it back to the left
#
if {($x + $width) > $scrwidth} {
set x [expr {$scrwidth - $width}]
}
# If the balloon is too far left, pull it back to the right
#
if {$x < 0} {
set x 0
}
# If the listbox is below bottom of screen, put it upwards
#
if {($y + $height) > $scrheight} {
set y [expr {$scrheight-$height}]
}
if {$y < 0} {
set y 0
}
wm geometry $w +$x+$y
after idle raise $w
}
proc tixBalloon:PopDown {w} {
upvar #0 $w data
# Close the balloon
#
wm withdraw $w
# We don't set the data(client) to be zero, so that the balloon
# will re-appear only if you move out then in the client window
# set data(client) ""
}
proc tixBalloon:SetStatus {w} {
upvar #0 $w data
if {![winfo exists $data(-statusbar)]
|| ![info exists data(s:$data(client))]} {
return
}
set vv [$data(-statusbar) cget -textvariable]
if {$vv == ""} {
$data(-statusbar) config -text $data(s:$data(client))
} else {
uplevel #0 set $vv [list $data(s:$data(client))]
}
}
proc tixBalloon:ClearStatus {w} {
upvar #0 $w data
if {![winfo exists $data(-statusbar)]} {
return
}
# Clear the StatusBar widget
#
set vv [$data(-statusbar) cget -textvariable]
if {$vv == ""} {
$data(-statusbar) config -text ""
} else {
uplevel #0 set $vv [list ""]
}
}
#----------------------------------------------------------------------
# PublicMethods:
#----------------------------------------------------------------------
# %% if balloon is already popped-up for this client, change mesage
#
proc tixBalloon:bind {w client args} {
upvar #0 $w data
set alreadyBound [info exists data(m:$client)]
set opt(-balloonmsg) ""
set opt(-statusmsg) ""
set opt(-msg) ""
tixHandleOptions opt {-balloonmsg -msg -statusmsg} $args
if {$opt(-balloonmsg) != ""} {
set data(m:$client) $opt(-balloonmsg)
} else {
set data(m:$client) $opt(-msg)
}
if {$opt(-statusmsg) != ""} {
set data(s:$client) $opt(-statusmsg)
} else {
set data(s:$client) $opt(-msg)
}
tixAppendBindTag $client TixBal$w
}
proc tixBalloon:post {w client} {
upvar #0 $w data
if {![info exists data(m:$client)] || $data(m:$client) == ""} {
return
}
tixBalloon:Enter $w $client
incr data(fakeEnter)
}
proc tixBalloon:unbind {w client} {
upvar #0 $w data
if {[info exists data(m:$client)]} {
if {[info exists data(m:$client)]} {unset data(m:$client)}
if {[info exists data(s:$client)]} {unset data(s:$client)}
if {[winfo exists $client]} {
catch {tixDeleteBindTag $client TixBal$w}
}
}
}
#----------------------------------------------------------------------
#
# Utility function
#
#----------------------------------------------------------------------
#
# $w can be a widget name or a classs name
proc tixBalIgnoreWhenGrabbed {wc} {
global tixBalloon
set tixBalloon(g_ignore,$wc) ""
}
tixBalIgnoreWhenGrabbed TixComboBox
tixBalIgnoreWhenGrabbed Menu
tixBalIgnoreWhenGrabbed Menubutton
Tix8.4.3/Init.tcl 0000644 00000014067 15173441414 0007326 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Init.tcl,v 1.18 2008/02/28 04:35:16 hobbs Exp $
#
# Init.tcl --
#
# Initializes the Tix library and performes version checking to ensure
# the Tcl, Tk and Tix script libraries loaded matches with the binary
# of the respective packages.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
namespace eval ::tix {
}
proc tixScriptVersion {} { return $::tix_version }
proc tixScriptPatchLevel {} { return $::tix_patchLevel }
proc ::tix::Init {dir} {
global tix env tix_library tcl_platform auto_path
if {[info exists tix(initialized)]} {
return
}
if {![info exists tix_library]} {
# we're running from stand-alone module.
set tix_library ""
} elseif {[file isdir $tix_library]} {
if {![info exists auto_path] ||
[lsearch $auto_path $tix_library] == -1} {
lappend auto_path $tix_library
}
}
# STEP 1: Version checking
#
#
package require Tcl 8.4
package require -exact Tix 8.4.3
# STEP 2: Initialize file compatibility modules
#
foreach file {
fs.tcl
Tix.tcl Event.tcl
Balloon.tcl BtnBox.tcl
CObjView.tcl ChkList.tcl
ComboBox.tcl Compat.tcl
Console.tcl Control.tcl
DefSchm.tcl DialogS.tcl
DirBox.tcl DirDlg.tcl
DirList.tcl DirTree.tcl
DragDrop.tcl DtlList.tcl
EFileBox.tcl EFileDlg.tcl
FileBox.tcl FileCbx.tcl
FileDlg.tcl FileEnt.tcl
FloatEnt.tcl
Grid.tcl HList.tcl
HListDD.tcl IconView.tcl
LabEntry.tcl LabFrame.tcl
LabWidg.tcl ListNBk.tcl
Meter.tcl MultView.tcl
NoteBook.tcl OldUtil.tcl
OptMenu.tcl PanedWin.tcl
PopMenu.tcl Primitiv.tcl
ResizeH.tcl SGrid.tcl
SHList.tcl SListBox.tcl
STList.tcl SText.tcl
SWidget.tcl SWindow.tcl
Select.tcl Shell.tcl
SimpDlg.tcl StackWin.tcl
StatBar.tcl StdBBox.tcl
StdShell.tcl TList.tcl
Tree.tcl
Utils.tcl VResize.tcl
VStack.tcl VTree.tcl
Variable.tcl WInfo.tcl
} {
uplevel \#0 [list source [file join $dir $file]]
}
# STEP 3: Initialize the Tix application context
#
tixAppContext tix
# DO NOT DO THIS HERE !!
# This causes the global defaults to be altered, which may not
# be desirable. The user can call this after requiring Tix if
# they wish to use different defaults.
#
#tix initstyle
# STEP 4: Initialize the bindings for widgets that are implemented in C
#
foreach w {
HList TList Grid ComboBox Control FloatEntry
LabelEntry ScrolledGrid ScrolledListBox
} {
tix${w}Bind
}
rename ::tix::Init ""
}
# tixWidgetClassEx --
#
# This procedure is similar to tixWidgetClass, except it
# performs a [subst] on the class declaration before evaluating
# it. This gives us a chance to specify platform-specific widget
# default without using a lot of ugly double quotes.
#
# The use of subst'able entries in the class declaration should
# be restrained to widget default values only to avoid producing
# unreadable code.
#
# Arguments:
# name - The name of the class to declare.
# classDecl - Various declarations about the class. See documentation
# of tixWidgetClass for details.
proc tixWidgetClassEx {name classDecl} {
tixWidgetClass $name [uplevel [list subst $classDecl]]
}
#
# Deprecated tix* functions
#
interp alias {} tixFileJoin {} file join
interp alias {} tixStrEq {} string equal
proc tixTrue {args} { return 1 }
proc tixFalse {args} { return 0 }
proc tixStringSub {var fromStr toStr} {
upvar 1 var var
set var [string map $var [list $fromStr $toStr]]
}
proc tixGetBoolean {args} {
set len [llength [info level 0]]
set nocomplain 0
if {$len == 3} {
if {[lindex $args 0] ne "-nocomplain"} {
return -code error "wrong \# args:\
must be [lindex [info level 0] 0] ?-nocomplain? string"
}
set nocomplain 1
set val [lindex $args 1]
} elseif {$len != 2} {
return -code error "wrong \# args:\
must be [lindex [info level 0] 0] ?-nocomplain? string"
} else {
set val [lindex $args 0]
}
if {[string is boolean -strict $val] || $nocomplain} {
return [string is true -strict $val]
} elseif {$nocomplain} {
return 0
} else {
return -code error "\"$val\" is not a valid boolean"
}
}
interp alias {} tixVerifyBoolean {} tixGetBoolean
proc tixGetInt {args} {
set len [llength [info level 0]]
set nocomplain 0
set trunc 0
for {set i 1} {$i < $len-1} {incr i} {
set arg [lindex $args 0]
if {$arg eq "-nocomplain"} {
set nocomplain 1
} elseif {$arg eq "-trunc"} {
set trunc 1
} else {
return -code error "wrong \# args: must be\
[lindex [info level 0] 0] ?-nocomplain? ?-trunc? string"
}
}
if {$i != $len-1} {
return -code error "wrong \# args: must be\
[lindex [info level 0] 0] ?-nocomplain? ?-trunc? string"
}
set val [lindex $args end]
set code [catch {expr {round($val)}} res]
if {$code} {
if {$nocomplain} {
return 0
} else {
return -code error "\"$val\" cannot be converted to integer"
}
}
if {$trunc} {
return [expr {int($val)}]
} else {
return $res
}
}
proc tixFile {option filename} {
set len [string length $option]
if {$len > 1 && [string equal -length $len $option "tildesubst"]} {
set code [catch {file normalize $filename} res]
if {$code == 0} {
set filename $res
}
} elseif {$len > 1 && [string equal -length $len $option "trimslash"]} {
# normalize extra slashes
set filename [file join $filename]
if {$filename ne "/"} {
set filename [string trimright $filename "/"]
}
} else {
return -code error "unknown option \"$option\",\
must be tildesubst or trimslash"
}
return $filename
}
interp alias {} tixRaiseWindow {} raise
#proc tixUnmapWindow {w} { }
#
# if tix_library is not defined, we're running in SAM mode. ::tix::Init
# will be called later by the Tix_Init() C code.
#
if {[info exists tix_library]} {
::tix::Init [file dirname [info script]]
}
Tix8.4.3/README.txt 0000644 00000001733 15173441414 0007411 0 ustar 00
Tix 8.4.3 for Tcl 8.4+
Tix Documentation Master Index
This file is the master index of all the documentation included in
this package. For additional information about Tix, please visit the
Tix Home Page at
http://tix.sourceforge.net/
or join the mailing lists there.
* ABOUT.html A brief description of Tix.
* docs/Release.html Release notes on this version of Tix.
* unix/README.txt Compiling and installing Tix under Unix.
* win/README.txt Compiling and installing Tix under Windows.
* docs/html/TixUser/TixUser.html Tix Users's Guide.
* Programming with Tix:
+ Tix Programmer's Guide.
+ Using Tix Stand Alone Modules (SAM).
* docs/FAQ.html The Tix Frequent Asked Questions.
* ChangeLog.txt Changes made to Tix since the previous release.
* man/index.html Programmer's Reference Manual.
Versions of Tcl/Tk prior to 8.4 are no longer supported.
Tix8.4.3/DirDlg.tcl 0000644 00000004236 15173441414 0007565 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: DirDlg.tcl,v 1.3 2001/12/09 05:04:02 idiscovery Exp $
#
# DirDlg.tcl --
#
# Implements the Directory Selection Dialog widget.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixDirSelectDialog {
-classname TixDirSelectDialog
-superclass tixDialogShell
-method {}
-flag {
-command
}
-configspec {
{-command command Command ""}
{-title title Title "Select A Directory"}
}
-default {
{*ok.text "OK"}
{*ok.underline 0}
{*ok.width 6}
{*cancel.text "Cancel"}
{*cancel.underline 0}
{*cancel.width 6}
{*dirbox.borderWidth 1}
{*dirbox.relief raised}
}
}
proc tixDirSelectDialog:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
# the buttons
frame $w.f -relief raised -bd 1
set data(w:ok) [button $w.f.ok -command \
"tixDirSelectDialog:OK $w"]
set data(w:cancel) [button $w.f.cancel -command \
"tixDirSelectDialog:Cancel $w"]
pack $data(w:ok) $data(w:cancel) -side left -expand yes -padx 10 -pady 8
pack $w.f -side bottom -fill x
# the dir select box
set data(w:dirbox) [tixDirSelectBox $w.dirbox \
-command [list tixDirSelectDialog:DirBoxCmd $w]]
pack $data(w:dirbox) -expand yes -fill both
}
proc tixDirSelectDialog:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
bind $w <Alt-Key-d> "focus [$data(w:dirbox) subwidget dircbx]"
}
proc tixDirSelectDialog:OK {w} {
upvar #0 $w data
wm withdraw $w
$data(w:dirbox) subwidget dircbx invoke
}
proc tixDirSelectDialog:DirBoxCmd {w args} {
upvar #0 $w data
set value [tixEvent flag V]
wm withdraw $w
tixDirSelectDialog:CallCmd $w $value
}
proc tixDirSelectDialog:CallCmd {w value} {
upvar #0 $w data
if {$data(-command) != ""} {
set bind(specs) "%V"
set bind(%V) $value
tixEvalCmdBinding $w $data(-command) bind $value
}
}
proc tixDirSelectDialog:Cancel {w} {
wm withdraw $w
}
Tix8.4.3/LabWidg.tcl 0000644 00000007557 15173441414 0007742 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: LabWidg.tcl,v 1.3 2001/12/09 05:04:02 idiscovery Exp $
#
# LabWidg.tcl --
#
# TixLabelWidget: Virtual base class. Do not instantiate
#
# This widget class is the base class for all widgets that has a
# label. Most Tix compound widgets will have a label so that
# the app programmer doesn't need to add labels themselvel.
#
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# LabelSide : top, left, right, bottom, none, acrosstop
#
# public widgets:
# frame, label
#
tixWidgetClass tixLabelWidget {
-superclass tixPrimitive
-classname TixLabelWidget
-flag {
-label -labelside -padx -pady
}
-static {-labelside}
-configspec {
{-label label Label ""}
{-labelside labelSide LabelSide left}
{-padx padX Pad 0}
{-pady padY Pad 0}
}
}
proc tixLabelWidget:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
if {$data(-labelside) != "acrosstop"} {
set data(w:frame) [frame $w.frame]
} else {
set data(pw:border) [frame $w.border]
set data(pw:pad) [frame $w.border.pad]
set data(w:frame) [frame $w.border.frame]
}
if {$data(-labelside) != "none"} {
set data(w:label) [label $w.label -text $data(-label)]
}
tixLabelWidget:Pack $w
tixCallMethod $w ConstructFramedWidget $data(w:frame)
}
proc tixLabelWidget:ConstructFramedWidget {w frame} {
# Do nothing
}
proc tixLabelWidget:Pack {w} {
upvar #0 $w data
if {[catch {tixLabelWidget:Pack-$data(-labelside) $w}]} {
error "unknown -labelside option \"$data(-labelside)\""
}
}
proc tixLabelWidget:Pack-acrosstop {w} {
upvar #0 $w data
set labHalfHeight [expr [winfo reqheight $data(w:label)] / 2]
set padHeight [expr $labHalfHeight - [$data(pw:border) cget -bd]]
if {$padHeight < 0} {
set padHeight 0
}
tixForm $data(w:label) -top 0 -left 4\
-padx [expr $data(-padx) +4] -pady $data(-pady)
tixForm $data(pw:border) -top $labHalfHeight -bottom -1 \
-left 0 -right -1 -padx $data(-padx) -pady $data(-pady)
tixForm $data(pw:pad) -left 0 -right -1 \
-top 0 -bottom $padHeight
tixForm $data(w:frame) -top $data(pw:pad) -bottom -1 \
-left 0 -right -1
}
proc tixLabelWidget:Pack-top {w} {
upvar #0 $w data
pack $data(w:label) -side top \
-padx $data(-padx) -pady $data(-pady) \
-fill x
pack $data(w:frame) -side top \
-padx $data(-padx) -pady $data(-pady) \
-expand yes -fill both
}
proc tixLabelWidget:Pack-bottom {w} {
upvar #0 $w data
pack $data(w:label) -side bottom \
-padx $data(-padx) -pady $data(-pady) \
-fill x
pack $data(w:frame) -side bottom \
-padx $data(-padx) -pady $data(-pady) \
-expand yes -fill both
}
proc tixLabelWidget:Pack-left {w} {
upvar #0 $w data
pack $data(w:label) -side left \
-padx $data(-padx) -pady $data(-pady) \
-fill y
pack $data(w:frame) -side left \
-padx $data(-padx) -pady $data(-pady) \
-expand yes -fill both
}
proc tixLabelWidget:Pack-right {w} {
upvar #0 $w data
pack $data(w:label) -side right \
-padx $data(-padx) -pady $data(-pady) \
-fill x
pack $data(w:frame) -side right \
-padx $data(-padx) -pady $data(-pady) \
-expand yes -fill both
}
proc tixLabelWidget:Pack-none {w} {
upvar #0 $w data
pack $data(w:frame)\
-padx $data(-padx) -pady $data(-pady) \
-expand yes -fill both
}
#----------------------------------------------------------------------
# CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixLabelWidget:config-label {w value} {
upvar #0 $w data
$data(w:label) config -text $value
if {$data(-labelside) == "acrosstop"} {
tixLabelWidget:Pack-acrosstop $w
}
}
Tix8.4.3/Select.tcl 0000644 00000016044 15173441414 0007637 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Select.tcl,v 1.3 2001/12/09 05:04:02 idiscovery Exp $
#
# Select.tcl --
#
# Implement the tixSelect widget.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixSelect {
-superclass tixLabelWidget
-classname TixSelect
-method {
add button invoke
}
-flag {
-allowzero -buttontype -command -disablecallback -orientation
-orient -padx -pady -radio -selectedbg -state -validatecmd
-value -variable
}
-forcecall {
-variable -state
}
-static {
-allowzero -orientation -padx -pady -radio
}
-configspec {
{-allowzero allowZero AllowZero 0 tixVerifyBoolean}
{-buttontype buttonType ButtonType button}
{-command command Command ""}
{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
{-orientation orientation Orientation horizontal}
{-padx padx Pad 0}
{-pady pady Pad 0}
{-radio radio Radio 0 tixVerifyBoolean}
{-selectedbg selectedBg SelectedBg gray}
{-state state State normal}
{-validatecmd validateCmd ValidateCmd ""}
{-value value Value ""}
{-variable variable Variable ""}
}
-alias {
{-orient -orientation}
}
-default {
{*frame.borderWidth 1}
{*frame.relief sunken}
{*Button.borderWidth 2}
{*Button.highlightThickness 0}
}
}
proc tixSelect:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(items) ""
set data(buttonbg) ""
set data(varInited) 0
}
#----------------------------------------------------------------------
# CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixSelect:config-state {w arg} {
upvar #0 $w data
if {$arg == "disabled"} {
foreach item $data(items) {
$data(w:$item) config -state disabled -relief raised \
-bg $data(buttonbg)
}
if {![info exists data(labelFg)]} {
set data(labelFg) [$data(w:label) cget -foreground]
catch {
$data(w:label) config -fg [tix option get disabled_fg]
}
}
} else {
foreach item $data(items) {
if {[lsearch $data(-value) $item] != -1} {
# This button is selected
#
$data(w:$item) config -relief sunken -bg $data(-selectedbg) \
-state normal
} else {
$data(w:$item) config -relief raised -bg $data(buttonbg) \
-command "$w invoke $item" -state normal
}
}
if {[info exists data(labelFg)]} {
catch {
$data(w:label) config -fg $data(labelFg)
}
unset data(labelFg)
}
}
return ""
}
proc tixSelect:config-variable {w arg} {
upvar #0 $w data
set oldValue $data(-value)
if {[tixVariable:ConfigVariable $w $arg]} {
# The value of data(-value) is changed if tixVariable:ConfigVariable
# returns true
set newValue $data(-value)
set data(-value) $oldValue
tixSelect:config-value $w $newValue
}
catch {
unset data(varInited)
}
set data(-variable) $arg
}
proc tixSelect:config-value {w value} {
upvar #0 $w data
# sanity checking
#
foreach item $value {
if {[lsearch $data(items) $item] == "-1"} {
error "subwidget \"$item\" does not exist"
}
}
tixSelect:SetValue $w $value
}
#----------------------------------------------------------------------
# WIDGET COMMANDS
#----------------------------------------------------------------------
proc tixSelect:add {w name args} {
upvar #0 $w data
set data(w:$name) [eval $data(-buttontype) $data(w:frame).$name -command \
[list "$w invoke $name"] -takefocus 0 $args]
if {$data(-orientation) == "horizontal"} {
pack $data(w:$name) -side left -expand yes -fill y\
-padx $data(-padx) -pady $data(-pady)
} else {
pack $data(w:$name) -side top -expand yes -fill x\
-padx $data(-padx) -pady $data(-pady)
}
if {$data(-state) == "disabled"} {
$data(w:$name) config -relief raised -state disabled
}
# find out the background of the buttons
#
if {$data(buttonbg) == ""} {
set data(buttonbg) [lindex [$data(w:$name) config -background] 4]
}
lappend data(items) $name
}
# Obsolete command
#
proc tixSelect:button {w name args} {
upvar #0 $w data
if {$args != ""} {
return [eval $data(w:$name) $args]
} else {
return $w.$name
}
}
# This is called when a button is invoked
#
proc tixSelect:invoke {w button} {
upvar #0 $w data
if {$data(-state) != "normal"} {
return
}
set newValue $data(-value)
if {[lsearch $data(-value) $button] != -1} {
# This button was selected
#
if {[llength $data(-value)] > 1 || [tixGetBoolean $data(-allowzero)]} {
# Take the button from the selected list
#
set newValue ""
foreach item $data(-value) {
if {$item != $button} {
lappend newValue $item
}
}
}
} else {
# This button was not selected
#
if {[tixGetBoolean $data(-radio)]} {
# The button become the sole item in the list
#
set newValue [list $button]
} else {
# Add this button into the list
#
lappend newValue $button
}
}
if {$newValue != $data(-value)} {
tixSelect:SetValue $w $newValue
}
}
#----------------------------------------------------------------------
# Private functions
#----------------------------------------------------------------------
proc tixSelect:SetValue {w newValue {noUpdate 0}} {
upvar #0 $w data
set oldValue $data(-value)
if {$data(-validatecmd) != ""} {
set data(-value) [tixEvalCmdBinding $w $data(-validatecmd) "" $newValue]
} else {
if {[tixGetBoolean $data(-radio)] && [llength $newValue] > 1} {
error "cannot choose more than one items in a radio box"
}
if {![tixGetBoolean $data(-allowzero)] && [llength $newValue] == 0} {
error "empty selection not allowed"
}
set data(-value) $newValue
}
if {! $noUpdate} {
tixVariable:UpdateVariable $w
}
# Reset all to be unselected
#
foreach item $data(items) {
if {[lsearch $data(-value) $item] == -1} {
# Is unselected
#
if {[lsearch $oldValue $item] != -1} {
# was selected
# -> popup the button, call command
#
$data(w:$item) config -relief raised -bg $data(buttonbg)
tixSelect:CallCommand $w $item 0
}
} else {
# Is selected
#
if {[lsearch $oldValue $item] == -1} {
# was unselected
# -> push down the button, call command
#
$data(w:$item) config -relief sunken -bg $data(-selectedbg)
tixSelect:CallCommand $w $item 1
}
}
}
}
proc tixSelect:CallCommand {w name value} {
upvar #0 $w data
if {!$data(-disablecallback) && $data(-command) != ""} {
if {![info exists data(varInited)]} {
set bind(specs) "name value"
set bind(name) $name
set bind(value) $value
tixEvalCmdBinding $w $data(-command) bind $name $value
}
}
}
proc tixSelect:Destructor {w} {
tixVariable:DeleteVariable $w
# Chain this to the superclass
#
tixChainMethod $w Destructor
}
Tix8.4.3/SWindow.tcl 0000644 00000015374 15173441414 0010017 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: SWindow.tcl,v 1.4 2001/12/09 05:04:02 idiscovery Exp $
#
# SWindow.tcl --
#
# This file implements Scrolled Window widgets
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
#
# Example:
#
# tixScrolledWindow .w
# set window [.w subwidget window]
# # Now you can put a whole widget hierachy inside $window.
# #
# button $window.b
# pack $window.b
#
# Author's note
#
# Note, the current implementation does not allow the child window
# to be outside of the parent window when the parent's size is larger
# than the child's size. This is fine for normal operations. However,
# it is not suitable for an MDI master window. Therefore, you will notice
# that the MDI master window is not a subclass of ScrolledWidget at all.
#
#
tixWidgetClass tixScrolledWindow {
-classname TixScrolledWindow
-superclass tixScrolledWidget
-method {
}
-flag {
-expandmode -shrink -xscrollincrement -yscrollincrement
}
-static {
}
-configspec {
{-expandmode expandMode ExpandMode expand}
{-shrink shrink Shrink ""}
{-xscrollincrement xScrollIncrement ScrollIncrement ""}
{-yscrollincrement yScrollIncrement ScrollIncrement ""}
{-scrollbarspace scrollbarSpace ScrollbarSpace {both}}
}
-default {
{.scrollbar auto}
{*window.borderWidth 1}
{*f1.borderWidth 1}
{*Scrollbar.borderWidth 1}
{*Scrollbar.takeFocus 0}
}
}
proc tixScrolledWindow:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(dx) 0
set data(dy) 0
}
proc tixScrolledWindow:ConstructWidget {w} {
upvar #0 $w data
global tcl_platform
tixChainMethod $w ConstructWidget
set data(pw:f1) \
[frame $w.f1 -relief sunken]
set data(pw:f2) \
[frame $w.f2 -bd 0]
set data(w:window) \
[frame $w.f2.window -bd 0]
pack $data(pw:f2) -in $data(pw:f1) -expand yes -fill both
set data(w:hsb) \
[scrollbar $w.hsb -orient horizontal -takefocus 0]
set data(w:vsb) \
[scrollbar $w.vsb -orient vertical -takefocus 0]
# set data(w:pann) \
# [frame $w.pann -bd 2 -relief groove]
$data(pw:f1) config -highlightthickness \
[$data(w:hsb) cget -highlightthickness]
set data(pw:client) $data(pw:f1)
}
proc tixScrolledWindow:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:hsb) config -command "tixScrolledWindow:ScrollBarCB $w x"
$data(w:vsb) config -command "tixScrolledWindow:ScrollBarCB $w y"
tixManageGeometry $data(w:window) "tixScrolledWindow:WindowGeomProc $w"
}
# This guy just keeps asking for a same size as the w:window
#
proc tixScrolledWindow:WindowGeomProc {w args} {
upvar #0 $w data
set rw [winfo reqwidth $data(w:window)]
set rh [winfo reqheight $data(w:window)]
if {$rw != [winfo reqwidth $data(pw:f2)] ||
$rh != [winfo reqheight $data(pw:f2)]} {
tixGeometryRequest $data(pw:f2) $rw $rh
}
}
proc tixScrolledWindow:Scroll {w axis total window first args} {
upvar #0 $w data
case [lindex $args 0] {
"scroll" {
set amt [lindex $args 1]
set unit [lindex $args 2]
case $unit {
"units" {
set incr $axis\scrollincrement
if {$data(-$incr) != ""} {
set by $data(-$incr)
} else {
set by [expr $window / 16]
}
set first [expr $first + $amt * $by]
}
"pages" {
set first [expr $first + $amt * $window]
}
}
}
"moveto" {
set to [lindex $args 1]
set first [expr int($to * $total)]
}
}
if {[expr $first + $window] > $total} {
set first [expr $total - $window]
}
if {$first < 0} {
set first 0
}
return $first
}
proc tixScrolledWindow:ScrollBarCB {w axis args} {
upvar #0 $w data
set bd \
[expr [$data(pw:f1) cget -bd] + [$data(pw:f1) cget -highlightthickness]]
set fw [expr [winfo width $data(pw:f1)] - 2*$bd]
set fh [expr [winfo height $data(pw:f1)] - 2*$bd]
set ww [winfo reqwidth $data(w:window)]
set wh [winfo reqheight $data(w:window)]
if {$axis == "x"} {
set data(dx) \
[eval tixScrolledWindow:Scroll $w $axis $ww $fw $data(dx) $args]
} else {
set data(dy) \
[eval tixScrolledWindow:Scroll $w $axis $wh $fh $data(dy) $args]
}
tixWidgetDoWhenIdle tixScrolledWindow:PlaceWindow $w
}
proc tixScrolledWindow:PlaceWindow {w} {
upvar #0 $w data
set bd \
[expr [$data(pw:f1) cget -bd] + [$data(pw:f1) cget -highlightthickness]]
set fw [expr [winfo width $data(pw:f1)] - 2*$bd]
set fh [expr [winfo height $data(pw:f1)] - 2*$bd]
set ww [winfo reqwidth $data(w:window)]
set wh [winfo reqheight $data(w:window)]
tixMapWindow $data(w:window)
if {$data(-expandmode) == "expand"} {
if {$ww < $fw} {
set ww $fw
}
if {$wh < $fh} {
set wh $fh
}
}
if {$data(-shrink) == "x"} {
if {$fw < $ww} {
set ww $fw
}
}
tixMoveResizeWindow $data(w:window) -$data(dx) -$data(dy) $ww $wh
set first [expr $data(dx).0 / $ww.0]
set last [expr $first + ($fw.0 / $ww.0)]
$data(w:hsb) set $first $last
set first [expr $data(dy).0 / $wh.0]
set last [expr $first + ($fh.0 / $wh.0)]
$data(w:vsb) set $first $last
}
#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#
# When this function is called, the scrolled window is going to be
# mapped, if it is still unmapped. Also, it is going to change its
# size. Therefore, it is a good time to check whether the w:window needs
# to be re-positioned due to the new parent window size.
#----------------------------------------------------------------------
proc tixScrolledWindow:GeometryInfo {w mW mH} {
upvar #0 $w data
set bd \
[expr [$data(pw:f1) cget -bd] + [$data(pw:f1) cget -highlightthickness]]
set fw [expr $mW -2*$bd]
set fh [expr $mH -2*$bd]
set ww [winfo reqwidth $data(w:window)]
set wh [winfo reqheight $data(w:window)]
# Calculate the X info
#
if {$fw >= $ww} {
if {$data(dx) > 0} {
set data(dx) 0
}
set xinfo [list 0.0 1.0]
} else {
set maxdx [expr $ww - $fw]
if {$data(dx) > $maxdx} {
set data(dx) $maxdx
}
set first [expr $data(dx).0 / $ww.0]
set last [expr $first + ($fw.0 / $ww.0)]
set xinfo [list $first $last]
}
# Calculate the Y info
#
if {$fh >= $wh} {
if {$data(dy) > 0} {
set data(dy) 0
}
set yinfo [list 0.0 1.0]
} else {
set maxdy [expr $wh - $fh]
if {$data(dy) > $maxdy} {
set data(dy) $maxdy
}
set first [expr $data(dy).0 / $wh.0]
set last [expr $first + ($fh.0 / $wh.0)]
set yinfo [list $first $last]
}
return [list $xinfo $yinfo]
}
Tix8.4.3/NoteBook.tcl 0000644 00000014020 15173441414 0010130 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: NoteBook.tcl,v 1.7 2004/03/28 02:44:57 hobbs Exp $
#
# NoteBook.tcl --
#
# tixNoteBook: NoteBook type of window.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixNoteBook {
-classname TixNoteBook
-superclass tixVStack
-method {
}
-flag {
}
-configspec {
{-takefocus takeFocus TakeFocus 0 tixVerifyBoolean}
}
-default {
{.nbframe.tabPadX 8}
{.nbframe.tabPadY 5}
{.nbframe.borderWidth 2}
{*nbframe.relief raised}
}
}
proc tixNoteBook:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(pad-x1) 0
set data(pad-x2) 0
set data(pad-y1) 20
set data(pad-y2) 0
}
proc tixNoteBook:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:top) [tixNoteBookFrame $w.nbframe -slave 1 -takefocus 1]
set data(w:nbframe) $data(w:top)
bind $data(w:top) <ButtonPress-1> [list tixNoteBook:MouseDown $w %x %y]
bind $data(w:top) <ButtonRelease-1> [list tixNoteBook:MouseUp $w %x %y]
bind $data(w:top) <B1-Motion> [list tixNoteBook:MouseDown $w %x %y]
bind $data(w:top) <Left> [list tixNoteBook:FocusNext $w prev]
bind $data(w:top) <Right> [list tixNoteBook:FocusNext $w next]
bind $data(w:top) <Return> [list tixNoteBook:SetFocusByKey $w]
bind $data(w:top) <space> [list tixNoteBook:SetFocusByKey $w]
}
#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
proc tixNoteBook:add {w child args} {
upvar #0 $w data
set ret [eval tixChainMethod $w add $child $args]
set new_args ""
foreach {flag value} $args {
if {$flag ne "-createcmd" && $flag ne "-raisecmd"} {
lappend new_args $flag
lappend new_args $value
}
}
eval [linsert $new_args 0 $data(w:top) add $child]
return $ret
}
proc tixNoteBook:raise {w child} {
upvar #0 $w data
tixChainMethod $w raise $child
if {[$data(w:top) pagecget $child -state] eq "normal"} {
$data(w:top) activate $child
}
}
proc tixNoteBook:delete {w child} {
upvar #0 $w data
tixChainMethod $w delete $child
$data(w:top) delete $child
}
#----------------------------------------------------------------------
# Private methods
#----------------------------------------------------------------------
proc tixNoteBook:Resize {w} {
upvar #0 $w data
# We have to take care of the size of the tabs so that
#
set rootReq [$data(w:top) geometryinfo]
set tW [lindex $rootReq 0]
set tH [lindex $rootReq 1]
set data(pad-x1) 2
set data(pad-x2) 2
set data(pad-y1) [expr {$tH + $data(-ipadx) + 1}]
set data(pad-y2) 2
set data(minW) [expr {$tW}]
set data(minH) [expr {$tH}]
# Now that we know data(pad-y1), we can chain the call
#
tixChainMethod $w Resize
}
proc tixNoteBook:MouseDown {w x y} {
upvar #0 $w data
focus $data(w:top)
set name [$data(w:top) identify $x $y]
$data(w:top) focus $name
set data(w:down) $name
}
proc tixNoteBook:MouseUp {w x y} {
upvar #0 $w data
#it could happen (using the tk/menu) that a MouseUp
#proceeds without a MouseDown event!!
if {![info exists data(w:down)] || ![info exists data(w:top)]} {
return
}
set name [$data(w:top) identify $x $y]
if {$name ne "" && $name eq $data(w:down)
&& [$data(w:top) pagecget $name -state] eq "normal"} {
$data(w:top) activate $name
tixCallMethod $w raise $name
} else {
$data(w:top) focus ""
}
}
#----------------------------------------------------------------------
#
# Section for keyboard bindings
#
#----------------------------------------------------------------------
proc tixNoteBook:FocusNext {w dir} {
upvar #0 $w data
if {[$data(w:top) info focus] == ""} {
set name [$data(w:top) info active]
$data(w:top) focus $name
if {$name ne ""} {
return
}
} else {
set name [$data(w:top) info focus$dir]
$data(w:top) focus $name
}
}
proc tixNoteBook:SetFocusByKey {w} {
upvar #0 $w data
set name [$data(w:top) info focus]
if {$name ne "" && [$data(w:top) pagecget $name -state] eq "normal"} {
tixCallMethod $w raise $name
$data(w:top) activate $name
}
}
#----------------------------------------------------------------------
# Automatic bindings for alt keys
#----------------------------------------------------------------------
proc tixNoteBookFind {w char} {
set char [string tolower $char]
foreach child [winfo child $w] {
if {![winfo ismapped $w]} {
continue
}
switch -exact -- [winfo class $child] {
Toplevel { continue }
TixNoteBook {
set nbframe [$child subwidget nbframe]
foreach page [$nbframe info pages] {
set char2 [string index [$nbframe pagecget $page -label] \
[$nbframe pagecget $page -underline]]
if {($char eq [string tolower $char2] || $char eq "")
&& [$nbframe pagecget $page -state] ne "disabled"} {
return [list $child $page]
}
}
}
}
# Well, this notebook doesn't match with the key, but maybe
# it contains a "subnotebook" that will match ..
set match [tixNoteBookFind $child $char]
if {$match ne ""} {
return $match
}
}
return ""
}
proc tixTraverseToNoteBook {w char} {
if {$char eq ""} {
return 0
}
if {![winfo exists $w]} {
return 0
}
set list [tixNoteBookFind [winfo toplevel $w] $char]
if {$list ne ""} {
[lindex $list 0] raise [lindex $list 1]
return 1
}
return 0
}
#----------------------------------------------------------------------
# Set default class bindings
#----------------------------------------------------------------------
bind all <Alt-KeyPress> "+tixTraverseToNoteBook %W %A"
bind all <Meta-KeyPress> "+tixTraverseToNoteBook %W %A"
Tix8.4.3/HList.tcl 0000644 00000043344 15173441414 0007446 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: HList.tcl,v 1.6 2004/03/28 02:44:57 hobbs Exp $
#
# HList.tcl --
#
# This file defines the default bindings for Tix Hierarchical Listbox
# widgets.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
global tkPriv
if {![llength [info globals tkPriv]]} {
tk::unsupported::ExposePrivateVariable tkPriv
}
#--------------------------------------------------------------------------
# tkPriv elements used in this file:
#
# afterId - Token returned by "after" for autoscanning.
# fakeRelease - Cancel the ButtonRelease-1 after the user double click
#--------------------------------------------------------------------------
#
foreach fun {tkCancelRepeat} {
if {![llength [info commands $fun]]} {
tk::unsupported::ExposePrivateCommand $fun
}
}
unset fun
proc tixHListBind {} {
tixBind TixHList <ButtonPress-1> {
tixHList:Button-1 %W %x %y ""
}
tixBind TixHList <Shift-ButtonPress-1> {
tixHList:Button-1 %W %x %y s
}
tixBind TixHList <Control-ButtonPress-1> {
tixHList:Button-1 %W %x %y c
}
tixBind TixHList <ButtonRelease-1> {
tixHList:ButtonRelease-1 %W %x %y
}
tixBind TixHList <Double-ButtonPress-1> {
tixHList:Double-1 %W %x %y
}
tixBind TixHList <B1-Motion> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixHList:B1-Motion %W %x %y
}
tixBind TixHList <B1-Leave> {
set tkPriv(x) %x
set tkPriv(y) %y
set tkPriv(X) %X
set tkPriv(Y) %Y
tixHList:B1-Leave %W
}
tixBind TixHList <B1-Enter> {
tixHList:B1-Enter %W %x %y
}
# Keyboard bindings
#
tixBind TixHList <Up> {
tixHList:UpDown %W prev ""
}
tixBind TixHList <Down> {
tixHList:UpDown %W next ""
}
tixBind TixHList <Shift-Up> {
tixHList:UpDown %W prev s
}
tixBind TixHList <Shift-Down> {
tixHList:UpDown %W next s
}
tixBind TixHList <Left> {
tixHList:LeftRight %W left
}
tixBind TixHList <Right> {
tixHList:LeftRight %W right
}
tixBind TixHList <Prior> {
%W yview scroll -1 pages
}
tixBind TixHList <Next> {
%W yview scroll 1 pages
}
tixBind TixHList <Return> {
tixHList:Keyboard-Activate %W
}
tixBind TixHList <space> {
tixHList:Keyboard-Browse %W
}
# Under Windows <Home> moves up, clears the sel and sets the selection
# Under Windows <Control-Home> moves up, leaves the selection, and sets the anchor
tixBind TixHList <Home> {
set w %W
$w yview moveto 0; # $w xview moveto 0
set sel [lindex [$w info children] 0]
# should be first not disabled
$w anchor set $sel
tixHList:Keyboard-Browse $w
}
tixBind TixHList <End> {
set w %W
$w yview moveto 1; # $w xview moveto 0
$w select clear
# should be last not disabled
set sel [lindex [$w info children .] end]
while {[set next [$w info next $sel]] ne "" && \
![$w info hidden $next] && \
[llength [set kids [$w info child $sel]]]} {
set sel [lindex $kids end]
}
$w anchor set $sel
tixHList:Keyboard-Browse $w
}
tixBind TixHList <Control-Home> {
set w %W
$w yview moveto 0; # $w xview moveto 0
set sel [lindex [$w info children] 0]
# should be first not disabled
$w anchor set $sel
}
tixBind TixHList <Control-End> {
set w %W
$w yview moveto 1; # $w xview moveto 0
# should be last not disabled
set sel [lindex [$w info children .] end]
while {[set next [$w info next $sel]] ne "" && \
![$w info hidden $next] && \
[llength [set kids [$w info child $sel]]]} {
set sel [lindex $kids end]
}
$w anchor set $sel
}
#
# Don't use tixBind because %A causes Tk 8.3.2 to crash
#
bind TixHList <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 2}] units
}
}
#----------------------------------------------------------------------
#
#
# Key bindings
#
#
#----------------------------------------------------------------------
proc tixHList:Keyboard-Activate {w} {
if {[tixHList:GetState $w] != 0} {
return
}
set ent [$w info anchor]
if {$ent eq ""} {
return
}
if {[$w cget -selectmode] eq "single"} {
$w select clear
}
$w select set $ent
set command [$w cget -command]
if {$command ne ""} {
set bind(specs) {%V}
set bind(%V) $ent
tixEvalCmdBinding $w $command bind $ent
}
}
proc tixHList:Keyboard-Browse {w} {
if {[tixHList:GetState $w] != 0} {
return
}
set ent [$w info anchor]
if {$ent eq ""} {
return
}
if {[$w cget -selectmode] eq "single"} {
$w select clear
}
$w select set $ent
tixHList:Browse $w $ent
}
proc tixHList:LeftRight {w spec} {
catch {
uplevel #0 unset $w:priv:shiftanchor
}
if {[tixHList:GetState $w] != 0} {
return
}
set anchor [$w info anchor]
if {$anchor eq ""} {
set anchor [lindex [$w info children] 0]
}
if {$anchor eq ""} {
return
}
set ent $anchor
while {1} {
set e $ent
if {$spec eq "left"} {
set ent [$w info parent $e]
if {$ent eq "" || [$w entrycget $ent -state] eq "disabled"} {
set ent [$w info prev $e]
}
} else {
set ent [lindex [$w info children $e] 0]
if {$ent eq "" || [$w entrycget $ent -state] eq "disabled"} {
set ent [$w info next $e]
}
}
if {$ent eq ""} {
break
}
if {[$w entrycget $ent -state] eq "disabled"} {
continue
}
if {[$w info hidden $ent]} {
continue
}
break
}
if {$ent eq ""} {
return
}
$w anchor set $ent
$w see $ent
if {[$w cget -selectmode] ne "single"} {
$w select clear
$w selection set $ent
tixHList:Browse $w $ent
}
}
proc tixHList:UpDown {w spec mod} {
if {[tixHList:GetState $w] ne 0} {
return
}
set anchor [$w info anchor]
set done 0
if {$anchor eq ""} {
set anchor [lindex [$w info children] 0]
if {$anchor eq ""} {
return
}
if {[$w entrycget $anchor -state] ne "disabled"} {
# That's a good anchor
set done 1
} else {
# We search for the first non-disabled entry (downward)
set spec next
}
}
set ent $anchor
# mike - bulletproofing
if {![$w info exists $ent]} {return}
# Find the prev/next non-disabled entry
#
while {!$done} {
set ent [$w info $spec $ent]
if {$ent eq ""} {
break
}
if {[$w entrycget $ent -state] eq "disabled"} {
continue
}
if {[$w info hidden $ent]} {
continue
}
break
}
if {$ent eq ""} {
return
} else {
$w see $ent
$w anchor set $ent
set selMode [$w cget -selectmode]
if {$mod eq "s" && ($selMode eq "extended" || $selMode eq "multiple")} {
global $w:priv:shiftanchor
if {![info exists $w:priv:shiftanchor]} {
set $w:priv:shiftanchor $anchor
}
$w selection clear
# mike - bulletproofing
if {![catch {$w selection set $ent [set $w:priv:shiftanchor]}]} {
tixHList:Browse $w $ent
}
} else {
catch {
uplevel #0 unset $w:priv:shiftanchor
}
if {[$w cget -selectmode] ne "single"} {
$w select clear
$w selection set $ent
tixHList:Browse $w $ent
}
}
}
}
#----------------------------------------------------------------------
#
#
# Mouse bindings
#
#
#----------------------------------------------------------------------
proc tixHList:Button-1 {w x y mod} {
# if {[$w cget -state] eq "disabled"} {
# return
# }
if {[$w cget -takefocus]} {
focus $w
}
set selMode [$w cget -selectmode]
case [tixHList:GetState $w] {
{0} {
if {$mod eq "s" && $selMode eq "multiple"} {
tixHList:GoState 28 $w $x $y
return
}
if {$mod eq "s" && $selMode eq "extended"} {
tixHList:GoState 28 $w $x $y
return
}
if {$mod eq "c" && $selMode eq "extended"} {
tixHList:GoState 33 $w $x $y
return
}
tixHList:GoState 1 $w $x $y
}
}
}
proc tixHList:ButtonRelease-1 {w x y} {
case [tixHList:GetState $w] {
{5 16} {
tixHList:GoState 6 $w $x $y
}
{15} {
tixHList:GoState 17 $w $x $y
}
{10 11} {
tixHList:GoState 18 $w
}
{13 20} {
tixHList:GoState 14 $w $x $y
}
{21} {
tixHList:GoState 22 $w
}
{24} {
tixHList:GoState 25 $w
}
{26 28 33} {
tixHList:GoState 27 $w
}
{30} {
tixHList:GoState 32 $w
}
}
}
proc tixHList:Double-1 {w x y} {
case [tixHList:GetState $w] {
{0} {
tixHList:GoState 23 $w $x $y
}
}
}
proc tixHList:B1-Motion {w x y} {
case [tixHList:GetState $w] {
{1} {
tixHList:GoState 5 $w $x $y
}
{5 16} {
tixHList:GoState 5 $w $x $y
}
{13 20 21} {
tixHList:GoState 20 $w $x $y
}
{24 26 28} {
tixHList:GoState 26 $w $x $y
}
}
}
proc tixHList:B1-Leave {w} {
case [tixHList:GetState $w] {
{5} {
tixHList:GoState 10 $w
}
{26} {
tixHList:GoState 29 $w
}
}
}
proc tixHList:B1-Enter {w x y} {
case [tixHList:GetState $w] {
{10 11} {
tixHList:GoState 12 $w $x $y
}
{29 30} {
tixHList:GoState 31 $w $x $y
}
}
}
proc tixHList:AutoScan {w} {
case [tixHList:GetState $w] {
{29 30} {
tixHList:GoState 30 $w
}
}
}
#----------------------------------------------------------------------
#
# STATE MANIPULATION
#
#
#----------------------------------------------------------------------
proc tixHList:GetState {w} {
global $w:priv:state
if {![info exists $w:priv:state]} {
set $w:priv:state 0
}
return [set $w:priv:state]
}
proc tixHList:SetState {w n} {
global $w:priv:state
set $w:priv:state $n
}
proc tixHList:GoState {n w args} {
# puts "going from [tixHList:GetState $w] --> $n"
tixHList:SetState $w $n
eval tixHList:GoState-$n $w $args
}
#----------------------------------------------------------------------
# States
#----------------------------------------------------------------------
proc tixHList:GoState-0 {w} {
}
proc tixHList:GoState-1 {w x y} {
set oldEnt [$w info anchor]
set ent [tixHList:SetAnchor $w $x $y 1]
if {$ent eq ""} {
tixHList:GoState 0 $w
return
}
set info [$w info item $x $y]
if {[lindex $info 1] eq "indicator"} {
tixHList:GoState 13 $w $ent $oldEnt
} else {
if {[$w entrycget $ent -state] eq "disabled"} {
tixHList:GoState 0 $w
} else {
case [$w cget -selectmode] {
{single browse} {
tixHList:GoState 16 $w $ent
}
default {
tixHList:GoState 24 $w $ent
}
}
}
}
}
proc tixHList:GoState-5 {w x y} {
set oldEnt [$w info anchor]
set ent [tixHList:SetAnchor $w $x $y]
if {$ent eq "" || $oldEnt eq $ent} {
return
}
if {[$w cget -selectmode] ne "single"} {
tixHList:Select $w $ent
tixHList:Browse $w $ent
}
}
proc tixHList:GoState-6 {w x y} {
set ent [tixHList:SetAnchor $w $x $y]
if {$ent eq ""} {
tixHList:GoState 0 $w
return
}
tixHList:Select $w $ent
tixHList:Browse $w $ent
tixHList:GoState 0 $w
}
proc tixHList:GoState-10 {w} {
tixHList:StartScan $w
}
proc tixHList:GoState-11 {w} {
global tkPriv
tixHList:DoScan $w
set oldEnt [$w info anchor]
set ent [tixHList:SetAnchor $w $tkPriv(x) $tkPriv(y)]
if {$ent eq "" || $oldEnt eq $ent} {
return
}
if {[$w cget -selectmode] ne "single"} {
tixHList:Select $w $ent
tixHList:Browse $w $ent
}
}
proc tixHList:GoState-12 {w x y} {
tkCancelRepeat
tixHList:GoState 5 $w $x $y
}
proc tixHList:GoState-13 {w ent oldEnt} {
global tkPriv
set tkPriv(tix,indicator) $ent
set tkPriv(tix,oldEnt) $oldEnt
tixHList:CallIndicatorCmd $w <Arm> $ent
}
proc tixHList:GoState-14 {w x y} {
global tkPriv
if {[tixHList:InsideArmedIndicator $w $x $y]} {
$w anchor set $tkPriv(tix,indicator)
$w select clear
$w select set $tkPriv(tix,indicator)
tixHList:CallIndicatorCmd $w <Activate> $tkPriv(tix,indicator)
} else {
tixHList:CallIndicatorCmd $w <Disarm> $tkPriv(tix,indicator)
}
unset tkPriv(tix,indicator)
tixHList:GoState 0 $w
}
proc tixHList:GoState-16 {w ent} {
if {$ent ne "" && [$w cget -selectmode] ne "single"} {
tixHList:Select $w $ent
tixHList:Browse $w $ent
}
}
proc tixHList:GoState-18 {w} {
global tkPriv
tkCancelRepeat
tixHList:GoState 6 $w $tkPriv(x) $tkPriv(y)
}
proc tixHList:GoState-20 {w x y} {
global tkPriv
if {![tixHList:InsideArmedIndicator $w $x $y]} {
tixHList:GoState 21 $w $x $y
} else {
tixHList:CallIndicatorCmd $w <Arm> $tkPriv(tix,indicator)
}
}
proc tixHList:GoState-21 {w x y} {
global tkPriv
if {[tixHList:InsideArmedIndicator $w $x $y]} {
tixHList:GoState 20 $w $x $y
} else {
tixHList:CallIndicatorCmd $w <Disarm> $tkPriv(tix,indicator)
}
}
proc tixHList:GoState-22 {w} {
global tkPriv
if {$tkPriv(tix,oldEnt) ne ""} {
$w anchor set $tkPriv(tix,oldEnt)
} else {
$w anchor clear
}
tixHList:GoState 0 $w
}
proc tixHList:GoState-23 {w x y} {
set ent [tixHList:GetNearest $w $y]
if {$ent ne ""} {
set info [$w info item $x $y]
if {[lindex $info 1] eq "indicator"} {
tixHList:CallIndicatorCmd $w <Activate> $ent
} else {
$w select set $ent
set command [$w cget -command]
if {$command ne ""} {
set bind(specs) {%V}
set bind(%V) $ent
tixEvalCmdBinding $w $command bind $ent
}
}
}
tixHList:GoState 0 $w
}
proc tixHList:GoState-24 {w ent} {
if {$ent ne ""} {
tixHList:Select $w $ent
tixHList:Browse $w $ent
}
}
proc tixHList:GoState-25 {w} {
set ent [$w info anchor]
if {$ent ne ""} {
tixHList:Select $w $ent
tixHList:Browse $w $ent
}
tixHList:GoState 0 $w
}
proc tixHList:GoState-26 {w x y} {
set anchor [$w info anchor]
if {$anchor eq ""} {
set first [lindex [$w info children ""] 0]
if {$first ne ""} {
$w anchor set $first
set anchor $first
} else {
return
}
}
set ent [tixHList:GetNearest $w $y 1]
if {$ent ne ""} {
$w selection clear
$w selection set $anchor $ent
tixHList:Browse $w $ent
}
}
proc tixHList:GoState-27 {w} {
set ent [$w info anchor]
if {$ent ne ""} {
tixHList:Browse $w $ent
}
tixHList:GoState 0 $w
}
proc tixHList:GoState-28 {w x y} {
set anchor [$w info anchor]
if {$anchor eq ""} {
set first [lindex [$w info children ""] 0]
if {$first ne ""} {
$w anchor set $first
set anchor $first
} else {
return
}
}
set ent [tixHList:GetNearest $w $y 1]
if {$ent ne ""} {
$w selection clear
$w selection set $anchor $ent
tixHList:Browse $w $ent
}
}
proc tixHList:GoState-29 {w} {
tixHList:StartScan $w
}
proc tixHList:GoState-30 {w} {
global tkPriv
tixHList:DoScan $w
set anchor [$w info anchor]
if {$anchor eq ""} {
set first [lindex [$w info children ""] 0]
if {$first ne ""} {
$w anchor set $first
set anchor $first
} else {
return
}
}
set ent [tixHList:GetNearest $w $tkPriv(y) 1]
if {$ent ne ""} {
$w selection clear
$w selection set $anchor $ent
tixHList:Browse $w $ent
}
}
proc tixHList:GoState-31 {w x y} {
tkCancelRepeat
tixHList:GoState 26 $w $x $y
}
proc tixHList:GoState-32 {w} {
tkCancelRepeat
tixHList:GoState 0 $w
}
proc tixHList:GoState-33 {w x y} {
set ent [tixHList:GetNearest $w $y]
if {$ent ne ""} {
$w anchor set $ent
if {[lsearch [$w selection get] $ent] > -1} {
# This was missing - mike
$w selection clear $ent
} else {
$w selection set $ent
}
tixHList:Browse $w $ent
}
}
#----------------------------------------------------------------------
#
# Common actions
#
#----------------------------------------------------------------------
proc tixHList:GetNearest {w y {disableOK 0}} {
set ent [$w nearest $y]
if {$ent ne ""} {
if {!$disableOK && [$w entrycget $ent -state] eq "disabled"} {
return ""
}
}
return $ent
}
proc tixHList:SetAnchor {w x y {disableOK 0}} {
set ent [tixHList:GetNearest $w $y $disableOK]
if {$ent ne ""} {
if {[$w entrycget $ent -state] ne "disabled"} {
$w anchor set $ent
# mike This is non-standard and has a wierd effect: too much motion
# $w see $ent
return $ent
} elseif $disableOK {
return $ent
}
}
return ""
}
proc tixHList:Select {w ent} {
if {[$w info selection] ne $ent} {
$w selection clear
$w select set $ent
}
}
#----------------------------------------------------------------------
#
# Auto scan
#
#----------------------------------------------------------------------
proc tixHList:StartScan {w} {
global tkPriv
set tkPriv(afterId) [after 50 tixHList:AutoScan $w]
}
proc tixHList:DoScan {w} {
global tkPriv
set x $tkPriv(x)
set y $tkPriv(y)
set X $tkPriv(X)
set Y $tkPriv(Y)
if {$y >= [winfo height $w]} {
$w yview scroll 1 units
} elseif {$y < 0} {
$w yview scroll -1 units
} elseif {$x >= [winfo width $w]} {
$w xview scroll 2 units
} elseif {$x < 0} {
$w xview scroll -2 units
} else {
return
}
set tkPriv(afterId) [after 50 tixHList:AutoScan $w]
}
#----------------------------------------------------------------------
#
# Indicator handling
#
#----------------------------------------------------------------------
proc tixHList:CallIndicatorCmd {w event ent} {
set cmd [$w cget -indicatorcmd]
if {$cmd ne ""} {
set bind(type) $event
set bind(specs) {%V}
set bind(%V) $ent
tixEvalCmdBinding $w $cmd bind $ent
}
}
proc tixHList:InsideArmedIndicator {w x y} {
global tkPriv
set ent [tixHList:GetNearest $w $y 1]
if {$ent eq "" || $ent ne $tkPriv(tix,indicator)} {
return 0
}
set info [$w info item $x $y]
if {[lindex $info 1] eq "indicator"} {
return 1
} else {
return 0
}
}
proc tixHList:Browse {w ent} {
set browsecmd [$w cget -browsecmd]
if {$browsecmd ne ""} {
set bind(specs) {%V}
set bind(%V) $ent
tixEvalCmdBinding $w $browsecmd bind $ent
}
}
Tix8.4.3/Event.tcl 0000644 00000012157 15173441414 0007502 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Event.tcl,v 1.6 2004/04/09 21:37:01 hobbs Exp $
#
# Event.tcl --
#
# Handles the event bindings of the -command and -browsecmd options
# (and various of others such as -validatecmd).
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#----------------------------------------------------------------------
# Evaluate high-level bindings (-command, -browsecmd, etc):
# with % subsitution or without (compatibility mode)
#
#
# BUG : if a -command is intercepted by a hook, the hook must use
# the same record name as the issuer of the -command. For the time
# being, you must use the name "bind" as the record name!!!!!
#
#----------------------------------------------------------------------
namespace eval ::tix {
variable event_flags ""
set evs [list % \# a b c d f h k m o p s t w x y A B E K N R S T W X Y]
foreach ev $evs {
lappend event_flags "%$ev"
}
# This is a "name stack" for storing the "bind" structures
#
# The bottom of the event stack is usually a raw event (generated by
# tixBind) but it may also be a programatically triggered (caused by
# tixEvalCmdBinding)
variable EVENT
set EVENT(nameStack) ""
set EVENT(stackLevel) 0
}
proc tixBind {tag event action} {
set cmd [linsert $::tix::event_flags 0 _tixRecordFlags $event]
append cmd "; $action; _tixDeleteFlags;"
bind $tag $event $cmd
}
proc tixPushEventStack {} {
variable ::tix::EVENT
set lastEvent [lindex $EVENT(nameStack) 0]
incr EVENT(stackLevel)
set thisEvent ::tix::_event$EVENT(stackLevel)
set EVENT(nameStack) [list $thisEvent $EVENT(nameStack)]
if {$lastEvent == ""} {
upvar #0 $thisEvent this
set this(type) <Application>
} else {
upvar #0 $lastEvent last
upvar #0 $thisEvent this
foreach name [array names last] {
set this($name) $last($name)
}
}
return $thisEvent
}
proc tixPopEventStack {varName} {
variable ::tix::EVENT
if {$varName ne [lindex $EVENT(nameStack) 0]} {
error "unmatched tixPushEventStack and tixPopEventStack calls"
}
incr EVENT(stackLevel) -1
set EVENT(nameStack) [lindex $EVENT(nameStack) 1]
global $varName
unset $varName
}
# Events triggered by tixBind
#
proc _tixRecordFlags [concat event $::tix::event_flags] {
set thisName [tixPushEventStack]; upvar #0 $thisName this
set this(type) $event
foreach f $::tix::event_flags {
set this($f) [set $f]
}
}
proc _tixDeleteFlags {} {
variable ::tix::EVENT
tixPopEventStack [lindex $EVENT(nameStack) 0]
}
# programatically trigged events
#
proc tixEvalCmdBinding {w cmd {subst ""} args} {
global tixPriv tix
variable ::tix::EVENT
set thisName [tixPushEventStack]; upvar #0 $thisName this
if {$subst != ""} {
upvar $subst bind
if {[info exists bind(specs)]} {
foreach spec $bind(specs) {
set this($spec) $bind($spec)
}
}
if {[info exists bind(type)]} {
set this(type) $bind(type)
}
}
if {[catch {
if {![info exists tix(-extracmdargs)]
|| [string is true -strict $tix(-extracmdargs)]} {
# Compatibility mode
set ret [uplevel \#0 $cmd $args]
} else {
set ret [uplevel 1 $cmd]
}
} error]} {
if {[catch {tixCmdErrorHandler $error} error]} {
# double fault: just print out
tixBuiltInCmdErrorHandler $error
}
tixPopEventStack $thisName
return ""
} else {
tixPopEventStack $thisName
return $ret
}
}
proc tixEvent {option args} {
global tixPriv
variable ::tix::EVENT
set varName [lindex $EVENT(nameStack) 0]
if {$varName == ""} {
error "tixEvent called when no event is being processed"
} else {
upvar #0 $varName event
}
switch -exact -- $option {
type {
return $event(type)
}
value {
if {[info exists event(%V)]} {
return $event(%V)
} else {
return ""
}
}
flag {
set f %[lindex $args 0]
if {[info exists event($f)]} {
return $event($f)
}
error "The flag \"[lindex $args 0]\" does not exist"
}
match {
return [string match [lindex $args 0] $event(type)]
}
default {
error "unknown option \"$option\""
}
}
}
# tixBuiltInCmdErrorHandler --
#
# Default method to report command handler errors. This procedure is
# also called if double-fault happens (command handler causes error,
# then tixCmdErrorHandler causes error).
#
proc tixBuiltInCmdErrorHandler {errorMsg} {
global errorInfo tcl_platform
if {![info exists errorInfo]} {
set errorInfo "???"
}
if {$tcl_platform(platform) eq "windows"} {
bgerror "Tix Error: $errorMsg"
} else {
puts "Error:\n $errorMsg\n$errorInfo"
}
}
# tixCmdErrorHandler --
#
# You can redefine this command to handle the errors that occur
# in the command handlers. See the programmer's documentation
# for details
#
if {![llength [info commands tixCmdErrorHandler]]} {
proc tixCmdErrorHandler {errorMsg} {
tixBuiltInCmdErrorHandler $errorMsg
}
}
Tix8.4.3/DtlList.tcl 0000644 00000001752 15173441414 0007777 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: DtlList.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# DtlList.tcl --
#
# This file implements DetailList widgets
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixDetailList {
-classname TixDetailList
-superclass tixScrolledGrid
-method {
}
-flag {
-hdrbackground
}
-configspec {
{-hdrbackground hdrBackground HdrBackground #606060}
}
-alias {
{-hdrbg -hdrbackground}
}
-default {
{*grid.topMargin 1}
{*grid.leftMargin 0}
}
}
proc tixDetailList:FormatCmd {w area x1 y1 x2 y2} {
upvar #0 $w data
case $area {
main {
}
default {
$data(w:grid) format border $x1 $y1 $x2 $y2 \
-filled 1 \
-relief raised -bd 1 -bg $data(-hdrbackground)
}
}
}
Tix8.4.3/Tix.tcl 0000644 00000023011 15173441414 0007154 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Tix.tcl,v 1.14 2008/03/17 23:01:10 hobbs Exp $
#
# Tix.tcl --
#
# This file implements the Tix application context class
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixClass tixAppContext {
-superclass {}
-classname TixAppContext
-method {
cget configure addbitmapdir filedialog getbitmap getimage
option platform resetoptions setbitmap initstyle
}
-flag {
-binding -debug -extracmdargs -filedialog -fontset -grabmode
-haspixmap -libdir -scheme -schemepriority -percentsubst
}
-readonly {
-haspixmap
}
-configspec {
{-binding TK}
{-debug 0}
{-extracmdargs 1}
{-filedialog ""}
{-fontset WmDefault}
{-grabmode global}
{-haspixmap 0}
{-libdir ""}
{-percentsubst 0}
{-scheme WmDefault}
{-schemepriority 21}
}
-alias {
}
}
proc tixAppContext:Constructor {w} {
upvar #0 $w data
global tix_priv tix_library tixOption
if {[info exists data(initialized)]} {
error "tixAppContext has already be initialized"
} else {
set data(initialized) 1
}
set data(et) [string equal $tix_library ""]
set data(image) 0
# These options were set when Tix was loaded
#
set data(-binding) $tix_priv(-binding)
set data(-debug) $tix_priv(-debug)
set data(-fontset) $tix_priv(-fontset)
set data(-scheme) $tix_priv(-scheme)
set data(-schemepriority) $tix_priv(-schemepriority)
if {![info exists tix_priv(isSafe)]} {
set data(-libdir) [file normalize $tix_library]
}
set tixOption(prioLevel) $tix_priv(-schemepriority)
# Compatibility stuff: the obsolete name courier_font has been changed to
# fixed_font
set tixOption(fixed_font) Courier
set tixOption(courier_font) $tixOption(fixed_font)
# Enable/Disable Intrinsics debugging
#
set tix_priv(debug) [string is true -strict $data(-debug)]
tixAppContext:BitmapInit $w
tixAppContext:FileDialogInit $w
# Clean up any error message generated by the above loop
set ::errorInfo ""
}
proc tixAppContext:initstyle {w} {
# Do the init stuff here that affects styles
upvar #0 $w data
global tix_priv
if {![info exists tix_priv(isSafe)]} {
tixAppContext:config-fontset $w $data(-fontset)
tixAppContext:config-scheme $w $data(-scheme)
}
tixAppContext:BitmapInit $w
tixAppContext:FileDialogInit $w
# Force the "." window to accept the new Tix options
#
set noconfig [list -class -colormap -container -menu -screen -use -visual]
set noconfig [lsort $noconfig]
foreach spec [. configure] {
set flag [lindex $spec 0]
if {[llength $spec] != 5
|| [lsearch -exact -sorted $noconfig $flag] != -1} {
continue
}
set name [lindex $spec 1]
set class [lindex $spec 2]
set value [option get . $name $class]
catch {. configure $flag $value}
}
}
#----------------------------------------------------------------------
# Configurations
#
#----------------------------------------------------------------------
proc tixAppContext:resetoptions {w scheme fontset {schemePrio ""}} {
upvar #0 $w data
if {! $data(et)} {
global tixOption
option clear
if {$schemePrio != ""} {
set tixOption(prioLevel) $schemePrio
}
tixAppContext:config-scheme $w $scheme
tixAppContext:config-fontset $w $fontset
}
}
proc tixAppContext:StartupError {args} {
bgerror [join $args "\n"]
}
proc tixAppContext:config-fontset {w value} {
upvar #0 $w data
global tix_priv tixOption
set data(-fontset) $value
#-----------------------------------
# Initialization of options database
#-----------------------------------
# Load the fontset
#
if {!$data(et)} {
set prefDir [file join $data(-libdir) pref]
set fontSetFile [file join $prefDir $data(-fontset).fsc]
if {[file exists $fontSetFile]} {
source $fontSetFile
tixPref:InitFontSet:$data(-fontset)
tixPref:SetFontSet:$data(-fontset)
} else {
tixAppContext:StartupError \
" Error: cannot use fontset \"$data(-fontset)\"" \
" Using default fontset "
tixSetDefaultFontset
}
} else {
if [catch {
tixPref:InitFontSet:$data(-fontset)
tixPref:SetFontSet:$data(-fontset)
}] {
# User chose non-existent fontset
#
tixAppContext:StartupError \
" Error: cannot use fontset \"$data(-fontset)\"" \
" Using default fontset "
tixSetDefaultFontset
}
}
}
proc tixAppContext:config-scheme {w value} {
upvar #0 $w data
global tix_priv
set data(-scheme) $value
# Load the color scheme
#
if {!$data(et)} {
set schemeName [file join [file join $data(-libdir) pref] \
$data(-scheme).csc]
if {[file exists $schemeName]} {
source $schemeName
tixPref:SetScheme-Color:$data(-scheme)
} else {
tixAppContext:StartupError \
" Error: cannot use color scheme \"$data(-scheme)\"" \
" Using default color scheme"
tixSetDefaultScheme-Color
}
} else {
if [catch {tixPref:SetScheme-Color:$data(-scheme)}] {
# User chose non-existent color scheme
#
tixAppContext:StartupError \
" Error: cannot use color scheme \"$data(-scheme)\"" \
" Using default color scheme"
tixSetDefaultScheme-Color
}
}
}
#----------------------------------------------------------------------
# Private methods
#
#----------------------------------------------------------------------
proc tixAppContext:BitmapInit {w} {
upvar #0 $w data
# See whether we have pixmap extension
#
set data(-haspixmap) true
# Dynamically set the bitmap directory
#
if {! $data(et)} {
set data(bitmapdirs) [list [file join $data(-libdir) bitmaps]]
} else {
set data(bitmapdirs) ""
}
}
proc tixAppContext:FileDialogInit {w} {
upvar #0 $w data
if {$data(-filedialog) == ""} {
set data(-filedialog) [option get . fileDialog FileDialog]
}
if {$data(-filedialog) == ""} {
set data(-filedialog) tixFileSelectDialog
}
}
#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
proc tixAppContext:addbitmapdir {w bmpdir} {
upvar #0 $w data
if {[lsearch $data(bitmapdirs) $bmpdir] == -1} {
lappend data(bitmapdirs) $bmpdir
}
}
proc tixAppContext:getimage {w name} {
upvar #0 $w data
global tix_priv
if {[info exists data(img:$name)]} {
return $data(img:$name)
}
if {![info exists tix_priv(isSafe)]} {
foreach dir $data(bitmapdirs) {
foreach {ext type} {
.xpm pixmap
.gif photo
.ppm photo
.xbm bitmap
"" bitmap
} {
set file [file join $dir $name$ext]
if {[file exists $file]
&& ![catch {
set img tiximage$data(image)
set data(img:$name) \
[image create $type $img -file $file]
}]} {
incr data(image)
break
}
}
if {[info exists data(img:$name)]} {
return $data(img:$name)
}
}
}
if {![info exists data(img:$name)]} {
catch {
set img tiximage$data(image)
# This is for compiled-in images
set data(img:$name) [image create pixmap $img -id $name]
} err
if {[string match internal* $err]} {
error $err
} else {
incr data(image)
}
}
if {[info exists data(img:$name)]} {
return $data(img:$name)
} else {
error "image file \"$name\" cannot be found"
}
}
proc tixAppContext:getbitmap {w bitmapname} {
upvar #0 $w data
global tix_priv
if {[info exists data(bmp:$bitmapname)]} {
return $data(bmp:$bitmapname)
} else {
set ext [file extension $bitmapname]
if {$ext == ""} {
set ext .xbm
}
# This is the fallback value. If we can't find the bitmap in
# the bitmap directories, then use the name of the bitmap
# as the default value.
#
set data(bmp:$bitmapname) $bitmapname
if {[info exists tix_priv(isSafe)]} {
return $data(bmp:$bitmapname)
}
foreach dir $data(bitmapdirs) {
if {$ext eq ".xbm" &&
[file exists [file join $dir $bitmapname.xbm]]} {
set data(bmp:$bitmapname) \
@[file join $dir $bitmapname.xbm]
break
}
if {[file exists [file join $dir $bitmapname]]} {
set data(bmp:$bitmapname) @[file join $dir $bitmapname]
break
}
}
return $data(bmp:$bitmapname)
}
}
proc tixAppContext:filedialog {w {type tixFileSelectDialog}} {
upvar #0 $w data
if {$type == ""} {
set type $data(-filedialog)
}
if {![info exists data(filedialog,$type)]} {
set data(filedialog,$type) ""
}
if {$data(filedialog,$type) == "" || \
![winfo exists $data(filedialog,$type)]} {
set data(filedialog,$type) [$type .tixapp_filedialog_$type]
}
return $data(filedialog,$type)
}
proc tixAppContext:option {w action {option ""} {value ""}} {
global tixOption
if {$action eq "get"} {
if {$option == ""} {return [lsort [array names tixOption]]}
return $tixOption($option)
}
}
proc tixAppContext:platform {w} {
return $::tcl_platform(platform)
}
proc tixDebug {message {level "1"}} {
set debug [tix cget -debug]
if {![string is true -strict $debug]} { return }
if {$debug > 0} {
# use $level here
if {[catch {fconfigure stderr}]} {
# This will happen under PYTHONW.EXE or frozen Windows apps
proc tixDebug args {}
} else {
puts stderr $message
}
}
}
if {![llength [info commands toplevel]]} {
interp alias {} toplevel {} frame
}
Tix8.4.3/FileCbx.tcl 0000644 00000004663 15173441414 0007740 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: FileCbx.tcl,v 1.5 2004/03/28 02:44:57 hobbs Exp $
#
# tixFileCombobox --
#
# A combobox widget for entering file names, directory names, file
# patterns, etc.
#
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# tixFileComboBox displays and accepts the DOS pathnames only. It doesn't
# recognize UNC file names or Tix VPATHS.
#
tixWidgetClass tixFileComboBox {
-classname TixFileComboBox
-superclass tixPrimitive
-method {
invoke
}
-flag {
-command -defaultfile -directory -text
}
-forcecall {
-directory
}
-configspec {
{-defaultfile defaultFile DefaultFile ""}
{-directory directory Directory ""}
{-command command Command ""}
{-text text Text ""}
}
-default {
}
}
proc tixFileComboBox:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
if {$data(-directory) eq ""} {
set data(-directory) [pwd]
}
}
proc tixFileComboBox:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(w:combo) [tixComboBox $w.combo -editable true -dropdown true]
pack $data(w:combo) -expand yes -fill both
}
proc tixFileComboBox:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:combo) config -command [list tixFileComboBox:OnComboCmd $w]
}
proc tixFileComboBox:OnComboCmd {w args} {
upvar #0 $w data
set text [string trim [tixEvent value]]
set path [tixFSJoin $data(-directory) $text]
if {[file isdirectory $path]} {
set path [tixFSJoin $path $data(-defaultfile)]
set tail $data(-defaultfile)
} else {
set tail [file tail $path]
}
set norm [tixFSNormalize $path]
tixSetSilent $data(w:combo) $norm
if {[llength $data(-command)]} {
set bind(specs) {%V}
set bind(%V) [list $norm $path $tail ""]
tixEvalCmdBinding $w $data(-command) bind $bind(%V)
}
}
proc tixFileComboBox:config-text {w val} {
upvar #0 $w data
tixSetSilent $data(w:combo) $val
}
proc tixFileComboBox:config-directory {w val} {
upvar #0 $w data
set data(-directory) [tixFSNormalize $val]
return $data(-directory)
}
proc tixFileComboBox:invoke {w} {
upvar #0 $w data
$data(w:combo) invoke
}
Tix8.4.3/VTree.tcl 0000644 00000010472 15173441414 0007444 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: VTree.tcl,v 1.6 2004/03/28 02:44:57 hobbs Exp $
#
# VTree.tcl --
#
# Virtual base class for Tree widgets.
#
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixVTree {
-virtual true
-classname TixVTree
-superclass tixScrolledHList
-method {
}
-flag {
-ignoreinvoke
}
-configspec {
{-ignoreinvoke ignoreInvoke IgnoreInvoke false tixVerifyBoolean}
}
-default {
}
}
proc tixVTree:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
}
proc tixVTree:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
set data(indStyle) \
[tixDisplayStyle image -refwindow $data(w:hlist) -padx 0 -pady 0]
}
proc tixVTree:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:hlist) config \
-indicatorcmd [list tixVTree:IndicatorCmd $w] \
-browsecmd [list tixVTree:BrowseCmdHook $w] \
-command [list tixVTree:CommandHook $w]
}
proc tixVTree:IndicatorCmd {w args} {
upvar #0 $w data
set event [tixEvent type]
set ent [tixEvent flag V]
set type [tixVTree:GetType $w $ent]
set plus [tix getimage plus]
set plusarm [tix getimage plusarm]
set minus [tix getimage minus]
set minusarm [tix getimage minusarm]
if {![$data(w:hlist) info exists $ent]} {return}
switch -exact -- $event {
<Arm> {
if {![$data(w:hlist) indicator exists $ent]} {return}
$data(w:hlist) indicator config $ent \
-image [expr {$type eq "open" ? $plusarm : $minusarm}]
}
<Disarm> {
if {![$data(w:hlist) indicator exists $ent]} {return}
$data(w:hlist) indicator config $ent \
-image [expr {$type eq "open" ? $plus : $minus}]
}
<Activate> {
upvar bind bind
tixCallMethod $w Activate $ent $type
set bind(%V) $ent
tixVTree:BrowseCmdHook $w
}
}
}
proc tixVTree:GetType {w ent} {
upvar #0 $w data
if {![$data(w:hlist) indicator exists $ent]} {
return none
}
set img [$data(w:hlist) indicator cget $ent -image]
if {$img eq [tix getimage plus] || $img eq [tix getimage plusarm]} {
return open
}
return close
}
proc tixVTree:Activate {w ent type} {
upvar #0 $w data
if {$type eq "open"} {
tixCallMethod $w OpenCmd $ent
$data(w:hlist) indicator config $ent -image [tix getimage minus]
} else {
tixCallMethod $w CloseCmd $ent
$data(w:hlist) indicator config $ent -image [tix getimage plus]
}
}
proc tixVTree:CommandHook {w args} {
upvar #0 $w data
upvar bind bind
tixCallMethod $w Command bind
}
proc tixVTree:BrowseCmdHook {w args} {
upvar #0 $w data
upvar bind bind
tixCallMethod $w BrowseCmd bind
}
proc tixVTree:SetMode {w ent mode} {
upvar #0 $w data
switch -exact -- $mode {
open {
$data(w:hlist) indicator create $ent -itemtype image \
-image [tix getimage plus] -style $data(indStyle)
}
close {
$data(w:hlist) indicator create $ent -itemtype image \
-image [tix getimage minus] -style $data(indStyle)
}
none {
if {[$data(w:hlist) indicator exist $ent]} {
$data(w:hlist) indicator delete $ent
}
}
}
}
#----------------------------------------------------------------------
#
# Virtual Methods
#
#----------------------------------------------------------------------
proc tixVTree:OpenCmd {w ent} {
upvar #0 $w data
# The default action
foreach kid [$data(w:hlist) info children $ent] {
$data(w:hlist) show entry $kid
}
}
proc tixVTree:CloseCmd {w ent} {
upvar #0 $w data
# The default action
foreach kid [$data(w:hlist) info children $ent] {
$data(w:hlist) hide entry $kid
}
}
proc tixVTree:Command {w B} {
upvar #0 $w data
upvar $B bind
if {$data(-ignoreinvoke)} {
return
}
set ent [tixEvent flag V]
if {[$data(w:hlist) indicator exist $ent]} {
tixVTree:Activate $w $ent [tixVTree:GetType $w $ent]
}
}
proc tixVTree:BrowseCmd {w B} {
}
#----------------------------------------------------------------------
#
# Widget commands
#
#----------------------------------------------------------------------
Tix8.4.3/pref/TkWin.csc 0000644 00000053436 15173441414 0010404 0 ustar 00 #
# $Id: TkWin.csc,v 1.2 2002/01/24 09:16:22 idiscovery Exp $
#
proc tixPref:SetScheme-Color:TkWin {} {
global tixOption
set tixOption(bg) SystemButtonFace
set tixOption(fg) SystemButtonText
set tixOption(dark1_bg) SystemScrollbar
set tixOption(dark1_fg) SystemButtonText
# set tixOption(dark2_bg) SystemDisabledText
# set tixOption(dark2_fg) black
set tixOption(inactive_bg) SystemButtonFace
set tixOption(inactive_fg) SystemButtonText
set tixOption(light1_bg) SystemButtonFace
# set tixOption(light1_fg) white
# set tixOption(light2_bg) #fcfcfc
# set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) SystemDisabledText
set tixOption(input1_bg) SystemWindow
# set tixOption(input2_bg)
# set tixOption(output1_bg) $tixOption(dark1_bg)
# set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) SystemHighlightText
set tixOption(select_bg) SystemHighlight
set tixOption(selector) SystemHighlight
option add *TixBalloon*background "#ffff60" $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.separatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground SystemWindowText $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground SystemWindowText $tixOption(prioLevel)
option add *TixComboBox*Entry.selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *TixComboBox*TixScrolledListBox.selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *TixComboBox*TixScrolledListBox.selectForeground $tixOption(select_fg) $tixOption(prioLevel)
}
# Leave the standard widgets alone
if {0} {
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:TkWin {} {
global tixOption
set tixOption(bg) SystemButtonFace
set tixOption(fg) SystemButtonText
set tixOption(dark1_bg) SystemScrollbar
set tixOption(dark1_fg) SystemButtonText
# set tixOption(dark2_bg) SystemDisabledText
# set tixOption(dark2_fg) black
set tixOption(inactive_bg) SystemButtonFace
set tixOption(inactive_fg) SystemButtonText
set tixOption(light1_bg) SystemButtonFace
# set tixOption(light1_fg) white
# set tixOption(light2_bg) #fcfcfc
# set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) SystemDisabledText
set tixOption(input1_bg) white
# set tixOption(input2_bg)
# set tixOption(output1_bg) $tixOption(dark1_bg)
# set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) SystemHighlightText
set tixOption(select_bg) SystemHighlight
set tixOption(selector) SystemHighlight
option add *TixBalloon*background "#ffff60" $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.separatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground SystemWindowText $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground SystemWindowText $tixOption(prioLevel)
option add *TixComboBox*Entry.selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *TixComboBox*TixScrolledListBox.selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *TixComboBox*TixScrolledListBox.selectForeground $tixOption(select_fg) $tixOption(prioLevel)
}
# Leave the standard widgets alone
if {0} {
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
}
Tix8.4.3/pref/TixGray.csc 0000644 00000054013 15173441414 0010727 0 ustar 00 #
# $Id: TixGray.csc,v 1.2 2000/10/12 02:00:25 idiscovery Exp $
#
proc tixPref:SetScheme-Color:TixGray {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray86
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray77
set tixOption(dark2_fg) black
set tixOption(inactive_bg) gray77
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray92
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) gray95
set tixOption(input2_bg) gray95
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) lightblue
set tixOption(selector) yellow
option add *background $tixOption(bg) 10
option add *Background $tixOption(bg) $tixOption(prioLevel)
option add *background $tixOption(bg) $tixOption(prioLevel)
option add *Foreground $tixOption(fg) $tixOption(prioLevel)
option add *foreground $tixOption(fg) $tixOption(prioLevel)
option add *activeBackground $tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground $tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth 0 $tixOption(prioLevel)
option add *Menu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Checkbutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
option add *TixBalloon*background #ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground black $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:TixGray {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray70
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray60
set tixOption(dark2_fg) white
set tixOption(inactive_bg) lightgray
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) gray90
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) $tixOption(light1_bg)
set tixOption(input2_bg) $tixOption(light1_bg)
set tixOption(output1_bg) $tixOption(light1_bg)
set tixOption(output2_bg) $tixOption(light1_bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) black
option add *background $tixOption(bg) 10
option add *Background $tixOption(bg) $tixOption(prioLevel)
option add *background $tixOption(bg) $tixOption(prioLevel)
option add *Foreground $tixOption(fg) $tixOption(prioLevel)
option add *foreground $tixOption(fg) $tixOption(prioLevel)
option add *activeBackground $tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground $tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth 0 $tixOption(prioLevel)
option add *Menu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Checkbutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
option add *TixBalloon*background #ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground black $tixOption(prioLevel)
}
Tix8.4.3/pref/TK.csc 0000644 00000003747 15173441414 0007666 0 ustar 00 #
# $Id: TK.csc,v 1.1.1.1 2000/05/17 11:08:47 idiscovery Exp $
#
proc tixPref:SetScheme-Color:TK {} {
global tixOption
set tixOption(bg) #d9d9d9
set tixOption(fg) black
set tixOption(dark1_bg) #c3c3c3
set tixOption(dark1_fg) black
set tixOption(dark2_bg) #a3a3a3
set tixOption(dark2_fg) black
set tixOption(inactive_bg) #a3a3a3
set tixOption(inactive_fg) black
set tixOption(light1_bg) #ececec
set tixOption(light1_fg) white
set tixOption(light2_bg) #fcfcfc
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) #d9d9d9
set tixOption(input2_bg) #d9d9d9
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) #c3c3c3
set tixOption(selector) #b03060
}
proc tixPref:SetScheme-Mono:TK {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray70
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray60
set tixOption(dark2_fg) white
set tixOption(inactive_bg) lightgray
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) gray90
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) $tixOption(light1_bg)
set tixOption(input2_bg) $tixOption(light1_bg)
set tixOption(output1_bg) $tixOption(light1_bg)
set tixOption(output2_bg) $tixOption(light1_bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) black
}
Tix8.4.3/pref/SGIGray.cs 0000644 00000002002 15173441414 0010431 0 ustar 00 #
# $Id: SGIGray.cs,v 1.1.1.1 2000/05/17 11:08:47 idiscovery Exp $
#
proc tixSetScheme-Color {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray50
set tixOption(dark2_fg) black
set tixOption(inactive_bg) gray50
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray35
set tixOption(input1_bg) rosybrown
set tixOption(input2_bg) rosybrown
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) lightblue
set tixOption(selector) yellow
}
Tix8.4.3/pref/TK.cs 0000644 00000002000 15173441414 0007500 0 ustar 00 #
# $Id: TK.cs,v 1.1.1.1 2000/05/17 11:08:47 idiscovery Exp $
#
proc tixSetScheme-Color {} {
global tixOption
set tixOption(bg) #d9d9d9
set tixOption(fg) black
set tixOption(dark1_bg) #c3c3c3
set tixOption(dark1_fg) black
set tixOption(dark2_bg) #a3a3a3
set tixOption(dark2_fg) black
set tixOption(inactive_bg) #a3a3a3
set tixOption(inactive_fg) black
set tixOption(light1_bg) #ececec
set tixOption(light1_fg) white
set tixOption(light2_bg) #fcfcfc
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) #d9d9d9
set tixOption(input2_bg) #d9d9d9
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) #c3c3c3
set tixOption(selector) #b03060
}
Tix8.4.3/pref/WmDefault.cs 0000644 00000002654 15173441414 0011071 0 ustar 00 # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: WmDefault.cs,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixSetScheme-Color {} {
global tixOption
package require wm_default
if {![info exists ::wm_default::wm]} {
wm_default::setup
wm_default::addoptions
}
set tixOption(bg) $::wm_default::background
set tixOption(fg) $::wm_default::foreground
set tixOption(dark1_bg) #808080
set tixOption(inactive_bg) $::wm_default::disabledbackground
set tixOption(inactive_fg) black; # unused
# light1 was used for listbox widgets and trough colors
set tixOption(light1_bg) $::wm_default::scrollbars
set tixOption(light1_fg) white; # unused
# text is now used for listbox widgets
set tixOption(list_bg) $::wm_default::textbackground
set tixOption(active_bg) $::wm_default::activebackground
set tixOption(active_fg) $::wm_default::activeforeground
set tixOption(disabled_fg) $::wm_default::disabledforeground
# new
set tixOption(disabled_bg) $::wm_default::disabledtextbackground
set tixOption(input1_bg) $::wm_default::textbackground
set tixOption(input1_fg) $::wm_default::textforeground
set tixOption(select_fg) $::wm_default::selectforeground
set tixOption(select_bg) $::wm_default::selectbackground
set tixOption(selector) $::wm_default::selectcolor
}
Tix8.4.3/pref/Gray.csc 0000644 00000054030 15173441414 0010241 0 ustar 00 #
# $Id: Gray.csc,v 1.2 2000/10/12 01:59:44 idiscovery Exp $
#
proc tixPref:SetScheme-Color:Gray {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray50
set tixOption(dark2_fg) black
set tixOption(inactive_bg) gray50
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) $tixOption(dark1_bg)
set tixOption(input2_bg) $tixOption(bg)
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) lightblue
set tixOption(selector) yellow
option add *background $tixOption(bg) 10
option add *Background $tixOption(bg) $tixOption(prioLevel)
option add *background $tixOption(bg) $tixOption(prioLevel)
option add *Foreground $tixOption(fg) $tixOption(prioLevel)
option add *foreground $tixOption(fg) $tixOption(prioLevel)
option add *activeBackground $tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground $tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth 0 $tixOption(prioLevel)
option add *Menu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Checkbutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
option add *TixBalloon*background #ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground black $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:Gray {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray70
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray60
set tixOption(dark2_fg) white
set tixOption(inactive_bg) lightgray
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) gray90
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) $tixOption(light1_bg)
set tixOption(input2_bg) $tixOption(light1_bg)
set tixOption(output1_bg) $tixOption(light1_bg)
set tixOption(output2_bg) $tixOption(light1_bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) black
option add *background $tixOption(bg) 10
option add *Background $tixOption(bg) $tixOption(prioLevel)
option add *background $tixOption(bg) $tixOption(prioLevel)
option add *Foreground $tixOption(fg) $tixOption(prioLevel)
option add *foreground $tixOption(fg) $tixOption(prioLevel)
option add *activeBackground $tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground $tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth 0 $tixOption(prioLevel)
option add *Menu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Checkbutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
option add *TixBalloon*background #ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground black $tixOption(prioLevel)
}
Tix8.4.3/pref/pkgIndex.tcl 0000644 00000000406 15173441414 0011120 0 ustar 00 # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# Tcl package index file, version 1.0
#
# $Id: pkgIndex.tcl,v 1.2 2002/01/24 09:17:02 idiscovery Exp $
#
package ifneeded wm_default 1.0 [list source [file join $dir WmDefault.tcl]]
Tix8.4.3/pref/Gray.cs 0000644 00000002025 15173441414 0010073 0 ustar 00 #
# $Id: Gray.cs,v 1.1.1.1 2000/05/17 11:08:47 idiscovery Exp $
#
proc tixSetScheme-Color {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray50
set tixOption(dark2_fg) black
set tixOption(inactive_bg) gray50
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) $tixOption(dark1_bg)
set tixOption(input2_bg) $tixOption(bg)
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) lightblue
set tixOption(selector) yellow
}
Tix8.4.3/pref/14Point.fsc 0000644 00000004071 15173441414 0010600 0 ustar 00 #
# $Id: 14Point.fsc,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixPref:InitFontSet:14Point {} {
global tixOption tcl_platform
switch -- $tcl_platform(platform) "windows" {
if {$tcl_platform(osVersion) < 5} {
set font "MS Sans Serif"
} else {
set font "Tahoma"
}
set fixedfont "Courier New"
set bd 1
} unix {
set font "helvetica"
set fixedfont "courier"
set bd 2
}
set tixOption(font) [list $font -14]
set tixOption(bold_font) [list $font -14 bold]
set tixOption(menu_font) [list $font -14]
set tixOption(italic_font) [list $font -14 bold italic]
set tixOption(fixed_font) [list $fixedfont -14]
set tixOption(border1) $bd
}
proc tixPref:SetFontSet:14Point {} {
global tixOption
option add *Font $tixOption(font) $tixOption(prioLevel)
option add *font $tixOption(font) $tixOption(prioLevel)
option add *Menu.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixMenu.font $tixOption(menu_font) $tixOption(prioLevel)
option add *Menubutton.font $tixOption(menu_font) $tixOption(prioLevel)
option add *Label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *Scale.font $tixOption(italic_font) $tixOption(prioLevel)
option add *TixBalloon*Label.font $tixOption(font) $tixOption(prioLevel)
option add *TixBitmapButton*label.font $tixOption(font) $tixOption(prioLevel)
option add *TixControl*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelEntry*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelFrame*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixMwmClient*title.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixOptionMenu*menubutton.font $tixOption(font) $tixOption(prioLevel)
option add *TixComboBox*Entry.font $tixOption(font) $tixOption(prioLevel)
option add *TixFileSelectBox*Label.font $tixOption(bold_font) $tixOption(prioLevel)
}
Tix8.4.3/pref/TK.fs 0000644 00000000772 15173441414 0007521 0 ustar 00 #
# $Id: TK.fs,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixSetFontset {} {
global tixOption
set tixOption(font) -Adobe-Helvetica-Medium-R-Normal--*-120-*
set tixOption(bold_font) -Adobe-Helvetica-Bold-R-Normal--*-120-*
set tixOption(menu_font) -Adobe-Helvetica-Bold-R-Normal--*-120-*
set tixOption(italic_font) -Adobe-Helvetica-Bold-O-Normal--*-120-*
set tixOption(fixed_font) -*-courier-medium-r-*-*-14-*-*-*-*-*-*-*
set tixOption(border1) 1
}
Tix8.4.3/pref/TK.fsc 0000644 00000001071 15173441414 0007655 0 ustar 00 #
# $Id: TK.fsc,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixPref:InitFontSet:TK {} {
global tixOption
set tixOption(font) -Adobe-Helvetica-Medium-R-Normal--*-120-*
set tixOption(bold_font) -Adobe-Helvetica-Bold-R-Normal--*-120-*
set tixOption(menu_font) -Adobe-Helvetica-Bold-R-Normal--*-120-*
set tixOption(italic_font) -Adobe-Helvetica-Bold-O-Normal--*-120-*
set tixOption(fixed_font) -*-courier-medium-r-*-*-14-*-*-*-*-*-*-*
set tixOption(border1) 1
}
proc tixPref:SetFontSet:TK {} {
global tixOption
}
Tix8.4.3/pref/TkWin.fsc 0000644 00000003212 15173441414 0010372 0 ustar 00 #
# $Id: TkWin.fsc,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixPref:InitFontSet:TkWin {} {
global tixOption
set tixOption(font) "windows-message"
set tixOption(bold_font) "windows-status"
set tixOption(menu_font) "windows-menu"
set tixOption(italic_font) "windows-message"
set tixOption(fixed_font) "systemfixed"
set tixOption(border1) 1
}
proc tixPref:SetFontSet:TkWin {} {
global tixOption
option add *Menu.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixMenu.font $tixOption(menu_font) $tixOption(prioLevel)
option add *Menubutton.font $tixOption(menu_font) $tixOption(prioLevel)
option add *Label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *Scale.font $tixOption(italic_font) $tixOption(prioLevel)
option add *TixBalloon*Label.font $tixOption(font) $tixOption(prioLevel)
option add *TixBitmapButton*label.font $tixOption(font) $tixOption(prioLevel)
option add *TixControl*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelEntry*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelFrame*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixMwmClient*title.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixOptionMenu*menubutton.font $tixOption(font) $tixOption(prioLevel)
option add *TixComboBox*Entry.font $tixOption(font) $tixOption(prioLevel)
option add *TixFileSelectBox*Label.font $tixOption(bold_font) $tixOption(prioLevel)
}
Tix8.4.3/pref/WmDefault.fsc 0000644 00000004210 15173441414 0011225 0 ustar 00 # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: WmDefault.fsc,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
#
proc tixPref:InitFontSet:WmDefault {} {
global tixOption
package require wm_default
if {1 || ![info exists ::wm_default::wm]} {
wm_default::setup
wm_default::addoptions
}
set tixOption(font) $::wm_default::system_font
set tixOption(bold_font) [concat $::wm_default::system_font bold]
set tixOption(menu_font) $::wm_default::menu_font
set tixOption(italic_font) [concat $::wm_default::system_font italic]
set tixOption(fixed_font) $::wm_default::fixed_font
set tixOption(border1) $::wm_default::borderwidth
}
proc tixPref:SetFontSet:WmDefault {} {
global tixOption
package require wm_default
if {1 || ![info exists ::wm_default::wm]} {
wm_default::setup
wm_default::addoptions
}
set pri $tixOption(prioLevel)
set tixOption(font) $::wm_default::system_font
set tixOption(bold_font) [concat $::wm_default::system_font bold]
set tixOption(menu_font) $::wm_default::menu_font
set tixOption(italic_font) [concat $::wm_default::system_font italic]
set tixOption(fixed_font) $::wm_default::fixed_font
set tixOption(text_font) $::wm_default::text_font
set tixOption(border1) $::wm_default::borderwidth
option add *TixBalloon*Label.font $tixOption(font) $pri
option add *TixBitmapButton*label.font $tixOption(font) $pri
option add *TixControl*label.font $tixOption(font) $pri
option add *TixLabelEntry*label.font $tixOption(font) $pri
option add *TixLabelFrame*label.font $tixOption(font) $pri
option add *TixMenu.font $tixOption(menu_font) $pri
option add *TixMwmClient*title.font $tixOption(font) $pri
option add *TixNoteBook.nbframe.font $tixOption(font) $pri
# Although its a menubutton, it's more like a button than a menu IMHO
option add *TixOptionMenu*menubutton.font $tixOption(font) $pri
option add *TixComboBox*Entry.font $tixOption(font) $pri
option add *TixFileSelectBox*Label.font $tixOption(font) $pri
}
Tix8.4.3/pref/TkWin.fs 0000644 00000000606 15173441414 0010233 0 ustar 00 #
# $Id: TkWin.fs,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixSetFontset {} {
global tixOption
set tixOption(font) "windows-message"
set tixOption(bold_font) "windows-status"
set tixOption(menu_font) "windows-menu"
set tixOption(italic_font) "windows-message"
set tixOption(fixed_font) "systemfixed"
set tixOption(border1) 1
}
Tix8.4.3/pref/WmDefault.py 0000644 00000006655 15173441414 0011121 0 ustar 00 # -*- mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: WmDefault.py,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
"""One of the bad things about Tk/Tkinter is that it does not pick up
the current color and font scheme from the prevailing CDE/KDE/GNOME/Windows
window manager scheme.
One of the good things about Tk/Tkinter is that it is not tied to one
particular widget set so it could pick up the current color and font scheme
from the prevailing CDE/KDE/GNOME/Windows window manager scheme.
The WmDefault package is for making Tk/Tkinter applications use the
prevailing CDE/KDE/GNOME/Windows scheme. It tries to find the files
and/or settings that the current window manager is using, and then
sets the Tk options database accordingly.
Download the latest version of wm_default from http://tix.sourceforge.net
either as a part of the standard Tix distribution, or as a part of the
Tix Applications: http://tix.sourceforge.net/Tide. wm_default does not
require Tix, but is Tix enabled.
"""
import os, sys, traceback, string
import tkMessageBox
def setup(root, wm=''):
"""1) find the files and/or settings (::wm_default::setup).
Takes one optional argument: wm, the name of the window manager
as a string, if known. One of: windows gnome kde1 kde2 cde kde.
"""
try:
try:
# Make sure Tcl/Tk knows wm_default is installed
root.tk.eval("package require wm_default")
except:
# Try again with this directory on the Tcl/Tk path
dir = os.path.dirname (self.__file__)
root.tk.eval('global auto_path; lappend auto_path {%s}' % dir)
root.tk.eval("package require wm_default")
except:
t, v, tb = sys.exc_info()
text = "Error loading WmDefault\n"
for line in traceback.format_exception(t,v,tb): text = text + line + '\n'
try:
tkMessageBox.showerror ('WmDefault Error', text)
except:
sys.stderr.write( text )
return root.tk.call('::wm_default::setup', wm)
def addoptions(root, cnf=None, **kw):
"""2) Setting the Tk options database (::wm_default::addoptions).
You can override the settings in 1) by adding your values to the
call to addoptions().
"""
if cnf is None:
return root.tk.splitlist(root.tk.call('::wm_default::addoptions'))
return root.tk.splitlist(
apply(root.tk.call,
('::wm_default::addoptions',) + root._options(cnf,kw)))
def getoptions(root):
"""Returns the current settings, as a dictionary.
"""
words = root.tk.splitlist(root.tk.call('::wm_default::getoptions'))
dict = {}
for i in range(0, len(words), 2):
key = words[i]
value = words[i+1]
dict[key] = value
return dict
def parray(root):
"""Returns a string of the current settings, one value-pair per line.
"""
return root.tk.call('::wm_default::parray')
if __name__ == "__main__":
dir = ""
if len(sys.argv) > 0:
# Assume the name of the file containing the tixinspect Tcl source
# is the same as argument on the command line with .tcl
dir = os.path.dirname(sys.argv[0])
if not dir or not os.path.isdir(dir) or not os.path.isabs(dir):
# Or, assume it's in the same directory as this one:
dir = os.getcwd()
import Tkinter
root = Tkinter.Tk()
setup(root)
addoptions(root, {'foreground': 'red'})
retval = getoptions(root)
print retval
Tix8.4.3/pref/WmDefault.csc 0000644 00000034346 15173441414 0011237 0 ustar 00 # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: WmDefault.csc,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
#
proc tixPref:SetScheme-Color:WmDefault {args} {
global tixOption
package require wm_default
if {![info exists ::wm_default::wm]} {
wm_default::setup
wm_default::addoptions
}
set tixOption(bg) $::wm_default::background
set tixOption(fg) $::wm_default::foreground
# was "#808080"
set tixOption(dark1_bg) $::wm_default::disabledbackground
set tixOption(inactive_bg) $::wm_default::disabledbackground
set tixOption(inactive_fg) black; # unused
# light1 was used for listbox widgets and trough colors
set tixOption(light1_bg) $::wm_default::scrollbars
set tixOption(light1_fg) white; #unused
# text is now used for listbox widgets
set tixOption(list_bg) $::wm_default::textbackground
set tixOption(active_bg) $::wm_default::activebackground
set tixOption(active_fg) $::wm_default::activeforeground
set tixOption(disabled_fg) $::wm_default::disabledforeground
# new
set tixOption(disabled_bg) $::wm_default::disabledtextbackground
set tixOption(textbackground) $::wm_default::textbackground
set tixOption(input1_fg) $::wm_default::textforeground
set tixOption(select_fg) $::wm_default::selectforeground
set tixOption(select_bg) $::wm_default::selectbackground
set tixOption(selector) $::wm_default::selectcolor
set pri $tixOption(prioLevel)
# Try to give the subwidget (hlist) the highlightThickness
foreach pref {*TixDirTree *TixDirList *TixTree \
*TixScrolledListBox \
*TixScrolledTList *TixScrolledText} {
option add $pref.highlightThickness 0 $pri
}
# necessary:
option add *TixBalloon*background white $pri
option add *TixBalloon*foreground black $pri
option add *TixBalloon.background black $pri
# necessary: but should be restricted
# was - option add *Label.anchor w $pri
option add *TixBalloon*Label.anchor w $pri
option add *TixComboBox*Label.anchor w $pri
option add *TixFileEntry*Label.anchor w $pri
option add *TixLabelEntry*Label.anchor w $pri
option add *TixOptionMenu*Label.anchor w $pri
option add *TixComboBox*background $tixOption(background) $pri
option add *TixFileEntry*Entry.borderWidth 0 $pri
option add *TixFileEntry.frame.background $tixOption(textbackground) $pri
option add *TixFileEntry*Entry.highlightBackground $::wm_default::highlightbackground $pri
option add *TixOptionMenu*menubutton.relief raised $pri
option add *TixOptionMenu*menubutton.borderWidth $::wm_default::borderwidth $pri
option add *TixResizeHandle*background $tixOption(disabledbackground) $pri
option add *handleActiveBg $::wm_default::selectbackground $pri
# These may already have been covered by wm_default
option add *TixControl*entry.insertBackground $tixOption(textforeground) $pri
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $pri
option add *TixDirTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
option add *TixDirTree*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixDirTree*f1.relief sunken $pri
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $pri
option add *TixDirList*hlist.disabledBackground $tixOption(disabled_bg) $pri
option add *TixDirList*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixDirList*f1.relief sunken $pri
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $pri
option add *TixScrolledHList*hlist.disabledBackground $tixOption(disabled_bg) $pri
option add *TixScrolledHList*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixScrolledHList*f1.relief sunken $pri
option add *TixTree*hlist.background $tixOption(textbackground) $pri
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $pri
option add *TixTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
option add *TixTree*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixTree*f1.relief sunken $pri
option add *TixFileEntry.background $tixOption(background) $pri
option add *TixHList.activeBackground $tixOption(light1_bg) $pri
option add *TixHList.disabledBackground $tixOption(disabled_bg) $pri
option add *TixLabelEntry*entry.background $tixOption(textbackground) $pri
option add *TixLabelEntry*entry.foreground $tixOption(textforeground) $pri
option add *TixLabelEntry*entry.insertBackground $tixOption(textforeground) $pri
option add *TixMultiView*Listbox.borderWidth 0 $pri
option add *TixMultiView*Listbox.highlightThickness 0 $pri
option add *TixMultiView*Scrollbar.relief sunken $pri
option add *TixMultiView*Scrollbar.width 15 $pri
option add *TixMultiView*f1.borderWidth 2 $pri
option add *TixMultiView*f1.relief sunken $pri
option add *TixMultiView*f1.highlightThickness 2 $pri
option add *TixNoteBook.Background $tixOption(background) $pri
option add *TixNoteBook.nbframe.Background $tixOption(background) $pri
option add *TixNoteBook.nbframe.backPageColor $tixOption(background) $pri
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(disabledbackground) $pri
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $pri
# option add *TixPanedWindow.seperatorBg $tixOption(disabledbackground) $pri
# option add *TixPanedWindow.handleBg $tixOption(disabledbackground) $pri
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $pri
option add *TixScrolledTList*tlist.background $tixOption(textbackground) $pri
option add *TixScrolledListBox*listbox.background $tixOption(textbackground) $pri
option add *TixScrolledWindow.frame.background $tixOption(list_bg) $pri
option add *TixTree*hlist.highlightBackground $tixOption(background) $pri
option add *TixTree*hlist.background $tixOption(textbackground) $pri
option add *TixTree*hlist.borderWidth $::wm_default::borderwidth $pri
option add *TixComboBox*Entry.highlightBackground $tixOption(background) $pri
option add *TixComboBox*Entry.background $tixOption(textbackground) $pri
option add *TixComboBox*Entry.foreground $tixOption(textforeground) $pri
option add *TixComboBox*Entry.insertBackground $tixOption(textforeground) $pri
}
proc tixPref:SetScheme-Mono:Gray {} {
global tixOption
package require wm_default
if {![info exists ::wm_default::wm]} {
wm_default::setup
wm_default::addoptions
}
set tixOption(background) lightgray
set tixOption(foreground) black
set tixOption(dark1_bg) gray70
set tixOption(inactive_bg) lightgray
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(active_bg) gray90
set tixOption(active_fg) $tixOption(foreground)
set tixOption(disabled_fg) gray55
set tixOption(textbackground) $tixOption(light1_bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) black
set pri $tixOption(prioLevel)
# Override what you want with optional arguments to wm_default::adoptions
# necessary:
option add *TixBalloon*background white $pri
option add *TixBalloon*foreground black $pri
option add *TixBalloon.background black $pri
# necessary: but should be restricted
# was - option add *Label.anchor w $pri
option add *TixBalloon*Label.anchor w $pri
option add *TixComboBox*Label.anchor w $pri
option add *TixFileEntry*Label.anchor w $pri
option add *TixLabelEntry*Label.anchor w $pri
# option add *TixDirTree*hlist.highlightBackground $tixOption(background) $pri
# option add *TixDirTree*hlist.background $tixOption(light1_bg) $pri
# option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $pri
# option add *TixDirTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
# option add *TixDirTree*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixDirTree*f1.relief sunken $pri
# option add *TixDirList*hlist.highlightBackground $tixOption(background) $pri
# option add *TixDirList*hlist.background $tixOption(light1_bg) $pri
# option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $pri
# option add *TixDirList*hlist.disabledBackground $tixOption(disabled_bg) $pri
# option add *TixDirList*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixDirList*f1.relief sunken $pri
# option add *TixScrolledHList*hlist.highlightBackground $tixOption(background) $pri
# option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $pri
# option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $pri
# option add *TixScrolledHList*hlist.disabledBackground $tixOption(disabled_bg) $pri
# option add *TixScrolledHList*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixScrolledHList*f1.relief sunken $pri
# option add *TixTree*hlist.highlightBackground $tixOption(background) $pri
# option add *TixTree*hlist.background $tixOption(light1_bg) $pri
# option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $pri
# option add *TixTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
# option add *TixTree*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixTree*f1.relief sunken $pri
# option add *TixHList.background $tixOption(light1_bg) $pri
# option add *TixHList.activeBackground $tixOption(light1_bg) $pri
# option add *TixHList.disabledBackground $tixOption(light1_bg) $pri
# option add *TixMultiView*Listbox.borderWidth 0 $pri
# option add *TixMultiView*Listbox.highlightThickness 0 $pri
option add *TixMultiView*Scrollbar.relief sunken $pri
# option add *TixMultiView*f1.borderWidth 2 $pri
option add *TixMultiView*f1.relief sunken $pri
# option add *TixMultiView*f1.highlightThickness 2 $pri
# option add *TixMDIMenuBar*menubar.relief raised $pri
# option add *TixMDIMenuBar*menubar.borderWidth 2 $pri
# option add *TixMDIMenuBar*Menubutton.padY 2 $pri
# option add *TixNoteBook.Background $tixOption(background) $pri
# option add *TixNoteBook.nbframe.Background $tixOption(background) $pri
# option add *TixNoteBook.nbframe.backPageColor $tixOption(background) $pri
# option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $pri
# option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $pri
# option add *TixPanedWindow.seperatorBg $tixOption(disabledbackground) $pri
# option add *TixPanedWindow.handleBg $tixOption(disabledbackground) $pri
# option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $pri
# option add *TixScrolledHList*hlist.highlightBackground $tixOption(background) $pri
# option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $pri
# option add *TixScrolledTList*tlist.highlightBackground $tixOption(background) $pri
# option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $pri
# option add *TixScrolledListBox*listbox.highlightBackground $tixOption(background) $pri
# option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $pri
# option add *TixTree*hlist.highlightBackground $tixOption(background) $pri
# option add *TixTree*hlist.background $tixOption(light1_bg) $pri
# option add *TixTree*hlist.borderWidth $::wm_default::borderwidth $pri
# These were missing
# option add *TixMenu*Menu.selectColor $NIMLook(foreground) $pri
# option add *TixMDIMenuBar*Menubutton.padY 2 $pri
# option add *TixMDIMenuBar*menubar.borderWidth 2 $pri
# option add *TixMDIMenuBar*menubar.relief raised $pri
# option add *TixMultiView*Listbox.borderWidth 0 $pri
# option add *TixMultiView*Listbox.highlightThickness 0 $pri
# option add *TixMultiView*Scrollbar.relief sunken $pri
# option add *TixMultiView*f1.borderWidth 2 $pri
# option add *TixMultiView*f1.highlightThickness 2 $pri
option add *TixMultiView*f1.relief sunken $pri
}
# Leave the standard widgets alone
if {0} {
option add *Background $tixOption(background) $pri
option add *background $tixOption(background) $pri
option add *Foreground $tixOption(foreground) $pri
option add *foreground $tixOption(foreground) $pri
option add *activeBackground $tixOption(active_bg) $pri
option add *activeForeground $tixOption(active_fg) $pri
option add *HighlightBackground $tixOption(background) $pri
option add *selectBackground $tixOption(select_bg) $pri
option add *selectForeground $tixOption(select_fg) $pri
option add *selectBorderWidth 0 $pri
option add *Menu.selectColor $tixOption(foreground) $pri
option add *TixMenu.selectColor $tixOption(foreground) $pri
option add *Menubutton.padY 5 $pri
option add *Button.borderWidth 2 $pri
option add *Button.anchor c $pri
option add *Checkbutton.selectColor $tixOption(selector) $pri
option add *Radiobutton.selectColor $tixOption(selector) $pri
option add *Entry.relief sunken $pri
option add *Entry.highlightBackground $tixOption(background) $pri
option add *Entry.background $tixOption(textbackground) $pri
option add *Entry.foreground $tixOption(textforeground) $pri
option add *Entry.insertBackground $tixOption(textforeground) $pri
option add *Label.anchor w $pri
option add *Label.borderWidth 0 $pri
option add *Listbox.background $tixOption(textbackground) $pri
option add *Listbox.relief sunken $pri
option add *Scale.foreground $tixOption(foreground) $pri
option add *Scale.activeForeground $tixOption(background) $pri
option add *Scale.background $tixOption(background) $pri
option add *Scale.sliderForeground $tixOption(background) $pri
option add *Scale.sliderBackground $tixOption(light1_bg) $pri
option add *Scrollbar.relief sunken $pri
option add *Scrollbar.borderWidth $::wm_default::borderwidth $pri
option add *Scrollbar.width 15 $pri
option add *Text.background $tixOption(textbackground) $pri
option add *Text.relief sunken $pri
}
Tix8.4.3/pref/Bisque.csc 0000644 00000054013 15173441414 0010570 0 ustar 00 #
# $Id: Bisque.csc,v 1.2 2000/10/12 01:59:13 idiscovery Exp $
#
proc tixPref:SetScheme-Color:Bisque {} {
global tixOption
set tixOption(bg) bisque1
set tixOption(fg) black
set tixOption(dark1_bg) bisque2
set tixOption(dark1_fg) black
set tixOption(dark2_bg) bisque3
set tixOption(dark2_fg) black
set tixOption(inactive_bg) bisque3
set tixOption(inactive_fg) black
set tixOption(light1_bg) bisque1
set tixOption(light1_fg) white
set tixOption(light2_bg) bisque1
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) bisque2
set tixOption(input2_bg) bisque2
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) bisque2
set tixOption(selector) #b03060
option add *background $tixOption(bg) 10
option add *Background $tixOption(bg) $tixOption(prioLevel)
option add *background $tixOption(bg) $tixOption(prioLevel)
option add *Foreground $tixOption(fg) $tixOption(prioLevel)
option add *foreground $tixOption(fg) $tixOption(prioLevel)
option add *activeBackground $tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground $tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth 0 $tixOption(prioLevel)
option add *Menu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Checkbutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
option add *TixBalloon*background #ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground black $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:Bisque {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray70
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray60
set tixOption(dark2_fg) white
set tixOption(inactive_bg) lightgray
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) gray90
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) $tixOption(light1_bg)
set tixOption(input2_bg) $tixOption(light1_bg)
set tixOption(output1_bg) $tixOption(light1_bg)
set tixOption(output2_bg) $tixOption(light1_bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) black
option add *background $tixOption(bg) 10
option add *Background $tixOption(bg) $tixOption(prioLevel)
option add *background $tixOption(bg) $tixOption(prioLevel)
option add *Foreground $tixOption(fg) $tixOption(prioLevel)
option add *foreground $tixOption(fg) $tixOption(prioLevel)
option add *activeBackground $tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground $tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth 0 $tixOption(prioLevel)
option add *Menu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Checkbutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
option add *TixBalloon*background #ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground black $tixOption(prioLevel)
}
Tix8.4.3/pref/Blue.csc 0000644 00000054030 15173441414 0010226 0 ustar 00 #
# $Id: Blue.csc,v 1.2 2000/10/12 01:59:28 idiscovery Exp $
#
proc tixPref:SetScheme-Color:Blue {} {
global tixOption
set tixOption(bg) #9090f0
set tixOption(fg) black
set tixOption(dark1_bg) #8080d0
set tixOption(dark1_fg) black
set tixOption(dark2_bg) #7070c0
set tixOption(dark2_fg) black
set tixOption(inactive_bg) #8080da
set tixOption(inactive_fg) black
set tixOption(light1_bg) #a8a8ff
set tixOption(light1_fg) black
set tixOption(light2_bg) #c0c0ff
set tixOption(light2_fg) black
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray25
set tixOption(input1_bg) $tixOption(light1_bg)
set tixOption(input2_bg) $tixOption(bg)
set tixOption(output1_bg) $tixOption(light1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) yellow
option add *background $tixOption(bg) 10
option add *Background $tixOption(bg) $tixOption(prioLevel)
option add *background $tixOption(bg) $tixOption(prioLevel)
option add *Foreground $tixOption(fg) $tixOption(prioLevel)
option add *foreground $tixOption(fg) $tixOption(prioLevel)
option add *activeBackground $tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground $tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth 0 $tixOption(prioLevel)
option add *Menu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Checkbutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
option add *TixBalloon*background #ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground black $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:Blue {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray70
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray60
set tixOption(dark2_fg) white
set tixOption(inactive_bg) lightgray
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) gray90
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) $tixOption(light1_bg)
set tixOption(input2_bg) $tixOption(light1_bg)
set tixOption(output1_bg) $tixOption(light1_bg)
set tixOption(output2_bg) $tixOption(light1_bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) black
option add *background $tixOption(bg) 10
option add *Background $tixOption(bg) $tixOption(prioLevel)
option add *background $tixOption(bg) $tixOption(prioLevel)
option add *Foreground $tixOption(fg) $tixOption(prioLevel)
option add *foreground $tixOption(fg) $tixOption(prioLevel)
option add *activeBackground $tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground $tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth 0 $tixOption(prioLevel)
option add *Menu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Checkbutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
option add *TixBalloon*background #ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground black $tixOption(prioLevel)
}
Tix8.4.3/pref/SGIGray.csc 0000644 00000054011 15173441414 0010603 0 ustar 00 #
# $Id: SGIGray.csc,v 1.2 2000/10/12 02:00:00 idiscovery Exp $
#
proc tixPref:SetScheme-Color:SGIGray {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray50
set tixOption(dark2_fg) black
set tixOption(inactive_bg) gray50
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray35
set tixOption(input1_bg) rosybrown
set tixOption(input2_bg) rosybrown
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) lightblue
set tixOption(selector) yellow
option add *background $tixOption(bg) 10
option add *Background $tixOption(bg) $tixOption(prioLevel)
option add *background $tixOption(bg) $tixOption(prioLevel)
option add *Foreground $tixOption(fg) $tixOption(prioLevel)
option add *foreground $tixOption(fg) $tixOption(prioLevel)
option add *activeBackground $tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground $tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth 0 $tixOption(prioLevel)
option add *Menu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Checkbutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
option add *TixBalloon*background #ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground black $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:SGIGray {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray70
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray60
set tixOption(dark2_fg) white
set tixOption(inactive_bg) lightgray
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) gray90
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) $tixOption(light1_bg)
set tixOption(input2_bg) $tixOption(light1_bg)
set tixOption(output1_bg) $tixOption(light1_bg)
set tixOption(output2_bg) $tixOption(light1_bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) black
option add *background $tixOption(bg) 10
option add *Background $tixOption(bg) $tixOption(prioLevel)
option add *background $tixOption(bg) $tixOption(prioLevel)
option add *Foreground $tixOption(fg) $tixOption(prioLevel)
option add *foreground $tixOption(fg) $tixOption(prioLevel)
option add *activeBackground $tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground $tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *selectBackground $tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground $tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth 0 $tixOption(prioLevel)
option add *Menu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY 5 $tixOption(prioLevel)
option add *Button.borderWidth 2 $tixOption(prioLevel)
option add *Button.anchor c $tixOption(prioLevel)
option add *Checkbutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor $tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief sunken $tixOption(prioLevel)
option add *Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground black $tixOption(prioLevel)
option add *Entry.insertBackground black $tixOption(prioLevel)
option add *Label.anchor w $tixOption(prioLevel)
option add *Label.borderWidth 0 $tixOption(prioLevel)
option add *Listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief sunken $tixOption(prioLevel)
option add *Scale.foreground $tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.background $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground $tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth 1 $tixOption(prioLevel)
option add *Scrollbar.width 15 $tixOption(prioLevel)
option add *Text.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief sunken $tixOption(prioLevel)
option add *TixBalloon*background #ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground black $tixOption(prioLevel)
option add *TixBalloon.background black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor w $tixOption(prioLevel)
option add *TixControl*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixDirList*f1.relief sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth 1 $tixOption(prioLevel)
option add *TixTree*f1.relief sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth 0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness 0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width 15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth 2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth 2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 2 $tixOption(prioLevel)
option add *TixNoteBook.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor $tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg $tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background $tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth 1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBackground $tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background $tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground black $tixOption(prioLevel)
}
Tix8.4.3/pref/12Point.fs 0000644 00000001200 15173441414 0010422 0 ustar 00 #
# $Id: 12Point.fs,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixSetFontset {} {
global tixOption tcl_platform
switch -- $tcl_platform(platform) "windows" {
# This should be Tahoma for Win2000/XP
set font "MS Sans Serif"
set fixedfont "Courier New"
} unix {
set font "helvetica"
set fixedfont "courier"
}
set tixOption(font) [list $font -12]
set tixOption(bold_font) [list $font -12 bold]
set tixOption(menu_font) [list $font -12]
set tixOption(italic_font) [list $font -12 bold italic]
set tixOption(fixed_font) [list $fixedfont -12]
set tixOption(border1) 1
}
Tix8.4.3/pref/10Point.fsc 0000644 00000003776 15173441414 0010607 0 ustar 00 #
# $Id: 10Point.fsc,v 1.2 2002/01/24 09:17:02 idiscovery Exp $
#
proc tixPref:InitFontSet:10Point {} {
global tixOption tcl_platform
switch -- $tcl_platform(platform) "windows" {
# This should be Tahoma for Win2000/XP
set font "MS Sans Sherif"
set fixedfont "Courier New"
} unix {
set font "helvetica"
set fixedfont "courier"
}
set tixOption(font) [list $font -10]
set tixOption(bold_font) [list $font -10 bold]
set tixOption(menu_font) [list $font -10]
set tixOption(italic_font) [list $font -10 bold italic]
set tixOption(fixed_font) [list $fixedfont -10]
set tixOption(border1) 1
}
proc tixPref:SetFontSet:10Point {} {
global tixOption
option add *Font $tixOption(font) $tixOption(prioLevel)
option add *font $tixOption(font) $tixOption(prioLevel)
option add *Menu.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixMenu.font $tixOption(menu_font) $tixOption(prioLevel)
option add *Menubutton.font $tixOption(menu_font) $tixOption(prioLevel)
option add *Label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *Scale.font $tixOption(italic_font) $tixOption(prioLevel)
option add *TixBalloon*Label.font $tixOption(font) $tixOption(prioLevel)
option add *TixBitmapButton*label.font $tixOption(font) $tixOption(prioLevel)
option add *TixControl*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelEntry*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelFrame*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixMwmClient*title.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixOptionMenu*menubutton.font $tixOption(font) $tixOption(prioLevel)
option add *TixComboBox*Entry.font $tixOption(font) $tixOption(prioLevel)
option add *TixFileSelectBox*Label.font $tixOption(bold_font) $tixOption(prioLevel)
}
Tix8.4.3/pref/Bisque.cs 0000644 00000002004 15173441414 0010416 0 ustar 00 #
# $Id: Bisque.cs,v 1.1.1.1 2000/05/17 11:08:47 idiscovery Exp $
#
proc tixSetScheme-Color {} {
global tixOption
set tixOption(bg) bisque1
set tixOption(fg) black
set tixOption(dark1_bg) bisque2
set tixOption(dark1_fg) black
set tixOption(dark2_bg) bisque3
set tixOption(dark2_fg) black
set tixOption(inactive_bg) bisque3
set tixOption(inactive_fg) black
set tixOption(light1_bg) bisque1
set tixOption(light1_fg) white
set tixOption(light2_bg) bisque1
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) bisque2
set tixOption(input2_bg) bisque2
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) bisque2
set tixOption(selector) #b03060
}
Tix8.4.3/pref/14Point.fs 0000644 00000001177 15173441414 0010441 0 ustar 00 #
# $Id: 14Point.fs,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixSetFontset {} {
global tixOption tcl_platform
switch -- $tcl_platform(platform) "windows" {
# This should be Tahoma for Win2000/XP
set font "MS Sans Serif"
set fixedfont "Courier New"
} unix {
set font "helvetica"
set fixedfont "courier"
}
set tixOption(font) [list $font -14]
set tixOption(bold_font) [list $font -14 bold]
set tixOption(menu_font) [list $font -14]
set tixOption(italic_font) [list $font -14 bold italic]
set tixOption(fixed_font) [list $fixedfont -14]
set tixOption(border1) 1
}
Tix8.4.3/pref/Blue.cs 0000644 00000002025 15173441414 0010060 0 ustar 00 #
# $Id: Blue.cs,v 1.1.1.1 2000/05/17 11:08:47 idiscovery Exp $
#
proc tixSetScheme-Color {} {
global tixOption
set tixOption(bg) #9090f0
set tixOption(fg) black
set tixOption(dark1_bg) #8080d0
set tixOption(dark1_fg) black
set tixOption(dark2_bg) #7070c0
set tixOption(dark2_fg) black
set tixOption(inactive_bg) #8080da
set tixOption(inactive_fg) black
set tixOption(light1_bg) #a8a8ff
set tixOption(light1_fg) black
set tixOption(light2_bg) #c0c0ff
set tixOption(light2_fg) black
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray25
set tixOption(input1_bg) $tixOption(light1_bg)
set tixOption(input2_bg) $tixOption(bg)
set tixOption(output1_bg) $tixOption(light1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) yellow
}
Tix8.4.3/pref/TixGray.cs 0000644 00000002002 15173441414 0010553 0 ustar 00 #
# $Id: TixGray.cs,v 1.1.1.1 2000/05/17 11:08:47 idiscovery Exp $
#
proc tixSetScheme-Color {} {
global tixOption
set tixOption(bg) lightgray
set tixOption(fg) black
set tixOption(dark1_bg) gray86
set tixOption(dark1_fg) black
set tixOption(dark2_bg) gray77
set tixOption(dark2_fg) black
set tixOption(inactive_bg) gray77
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray92
set tixOption(light1_fg) white
set tixOption(light2_bg) gray95
set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) gray55
set tixOption(input1_bg) gray95
set tixOption(input2_bg) gray95
set tixOption(output1_bg) $tixOption(dark1_bg)
set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) black
set tixOption(select_bg) lightblue
set tixOption(selector) yellow
}
Tix8.4.3/pref/10Point.fs 0000644 00000001201 15173441414 0010421 0 ustar 00 #
# $Id: 10Point.fs,v 1.2 2002/01/24 09:17:02 idiscovery Exp $
#
proc tixSetFontset {} {
global tixOption tcl_platform
switch -- $tcl_platform(platform) "windows" {
# This should be Tahoma for Win2000/XP
set font "MS Sans Sherif"
set fixedfont "Courier New"
} unix {
set font "helvetica"
set fixedfont "courier"
}
set tixOption(font) [list $font -10]
set tixOption(bold_font) [list $font -10 bold]
set tixOption(menu_font) [list $font -10]
set tixOption(italic_font) [list $font -10 bold italic]
set tixOption(fixed_font) [list $fixedfont -10]
set tixOption(border1) 1
}
Tix8.4.3/pref/Old14Pt.fs 0000644 00000000763 15173441414 0010372 0 ustar 00 #
# $Id: Old14Pt.fs,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixSetFontset {} {
global tixOption
set tixOption(font) -*-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*
set tixOption(bold_font) -*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*
set tixOption(menu_font) -*-helvetica-bold-o-normal-*-14-*-*-*-*-*-*-*
set tixOption(italic_font) -*-helvetica-bold-o-normal-*-14-*-*-*-*-*-*-*
set tixOption(fixed_font) -*-courier-medium-r-*-*-14-*-*-*-*-*-*-*
}
Tix8.4.3/pref/WmDefault.tcl 0000644 00000102065 15173441414 0011243 0 ustar 00 # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
#
# $Id: WmDefault.tcl,v 1.7 2008/03/17 22:47:00 hobbs Exp $
#
# Description: Package for making Tk apps use the CDE/KDE/Gnome/Windows scheme
# Prefix: wm_default::
# Url: http://tix.sourceforge.net/Tixapps/
#
# Usage:
# It should be sufficient at the beginning of a wish app to simply:
#
# package require wm_default
# wm_default::setup
# wm_default::addoptions
#
# wm_default::setup takes an optional argument - the scheme if already
# known, one of: windows gnome kde1 kde2 cde kde
# wm_default::addoptions takes optional arguments - pairs of variables
# and values to override the kde settings. e.g.
# wm_default::addoptions -background blue
#
# Description:
# package for making Tk apps look nice under CDE or KDE or Windows
#
# The stuff below attempts to use the options database and the
# various files under ~/.dt, $DTHOME, and /usr/dt to figure out
# the user's current font and color set. It then uses tk's
# palette routines to set sensible defaults, and then override
# some of the options to try to make them look like CDE.
#
# There really *must* be an easier way to get text background
# colors and the radiobutton highlight colors out of the
# options database or winfo atom... Unfortunately, I can't
# figure out how...
# This package is based on the cde package by D. J. Hagberg, Jr.:
# dhagberg@glatmos.com
########################################################################
#
#
# Copyright 1998 D. J. Hagberg, Jr. and Global Atmospherics, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies.
# D. J. Hagberg, Jr. and Global Atmospherics, Inc. make no representations
# about the suitability of this software for any It is provided "as is"
# without express or implied warranty. By use of this software the user
# agrees to indemnify and hold harmless D. J. Hagberg, Jr. and Global
# Atmospherics, Inc. from any claims or liability for loss arising out
# of such use.
########################################################################
package require Tk
proc tixDetermineWM {} {
# Returns one of cde kde1 kde2 gnome windows or ""
global tcl_platform env
set type ""
if {$tcl_platform(platform) eq "windows"} {
set type windows
} else {
# The most definitive way is to check the X atoms
# I'm not sure if we can determine this using regular Tk wm calls
# I don't want to intern these symbols if they're not there.
if {![catch {exec xlsatoms} xatoms]} {
if {[string match *GNOME_SESSION_CORBA_COOKIE* $xatoms]} {
set type gnome
} elseif {[string match *KDEChangeStyle* $xatoms]} {
set type kde1
} elseif {[string match *KDE_DESKTOP_WINDOW* $xatoms]} {
set type kde2
}
}
if {$type != ""} {
# drop through
} elseif {[info exists env(KDEDIR)] && [file isdir $env(KDEDIR)]} {
# one or two?
set type kde2
} elseif {[info exists env(DTHOME)] && [file isdir $env(DTHOME)]} {
set type cde
} else {
# Maybe look for other Unix window managers?
# if {[file isfile $env(HOME)/.fwm2rc]} {}
# if {[file isfile $env(HOME)/.fwmrc]} {}
# if {[file isfile $env(HOME)/.twmrc]} {}
# But twm and fwm don't color applications; mwm maybe?
# Hope someone comes up with the code for openlook :-)
return ""
}
}
return $type
}
namespace eval ::wm_default {
global tcl_platform env
set _usetix [llength [info commands "tix"]]
variable wm ""
variable _frame_widgets {*Frame *Toplevel}
#what about tixGrid?
if {$_usetix} {
lappend _frame_widgets *TixLabelFrame *TixButtonBox *TixCObjView \
*TixListNoteBook *TixPanedWindow *TixStdButtonBox \
*TixExFileSelectBox
}
variable _menu_font_widgets {*Menu *Menubutton}
if {$_usetix} {lappend _menu_font_widgets *TixMenu}
variable _button_font_widgets {*Button}
variable _system_font_widgets {*Label \
*Message \
*Scale *Radiobutton *Checkbutton
}
if {$_usetix} {
lappend _system_font_widgets \
*TixBalloon*message *TixLabelFrame*Label \
*TixControl*label *TixControl*Label \
*TixLabelEntry*label *TixNoteBook.nbframe \
*TixFileEntry*label *TixComboBox*label \
*TixOptionMenu*menubutton *TixBitmapButton*label \
*TixMwmClient*title *TixFileSelectBox*Label
}
variable _text_type_widgets {*Canvas *Entry *Listbox *Text}
if {$_usetix} {
lappend _text_type_widgets \
*TixComboBox*Entry *TixControl*entry *TixScrolledHList*hlist \
*TixDirTree*hlist *TixDirList*hlist *TixTree*hlist \
*TixMultiList*Listbox *TixScrolledListBox*listbox \
*TixFileEntry*Entry *TixLabelEntry*Entry \
*TixFileEntry*entry *TixLabelEntry*entry \
*TixScrolledTList*tlist *TixScrolledText*text \
*TixHList *TixCheckList*hlist
# These arent working yet
lappend _text_type_widgets \
*TixDirTree*f1 *TixDirList*f1 \
*TixFileSelectBox*file*listbox \
*TixFileSelectBox*directory*listbox \
*TixExFileSelectBox*filelist*listbox
}
variable _insert_type_widgets {*Entry *Text}
if {$_usetix} {
lappend _insert_type_widgets \
*TixControl*entry *TixComboBox*Entry
}
variable _select_type_widgets {*Checkbutton \
*Radiobutton \
*Menu}
variable _active_borderwidth_widgets {*Button *Radiobutton *Checkbutton}
# Other Widgets that are given a borderwidth of $wm_default::borderwidth
variable _nonzero_borderwidth_widgets {}
# Widgets that are given a borderwidth of 0
# must not be *Entry
variable _null_borderwidth_widgets {*Menubutton *Label}
variable _scrollbar_widgets {}
variable _scrollbar_widgets {*Scrollbar}
if {$_usetix} {
lappend _scrollbar_widgets \
*TixTree*Scrollbar *TixDirTree*Scrollbar *TixDirList*Scrollbar \
*TixScrolledTList*Scrollbar *TixScrolledListBox*Scrollbar \
*TixScrolledHList*Scrollbar *TixMultiView*Scrollbar \
*TixScrolledText*Scrollbar *TixScrolledWindow*Scrollbar \
*TixCObjView*Scrollbar
}
proc debug {str} {
if {[llength [info commands "tix"]] &&
[string is true -strict [tix cget -debug]]} {
puts $str
}
}
# Return the array of what we have deduced
proc getoptions {} {
set retval {}
set len [string length "::wm_default::"]
foreach variable [lsort [info vars ::wm_default::*]] {
if {[string match ::wm_default::_* $variable]} {continue}
set key [string range $variable $len end]
lappend retval $key [set $variable]
}
return $retval
}
# Print out the array of what we have deduced
proc parray {} {
set retval ""
foreach {key val} [::wm_default::getoptions] {
append retval [join [list $key $val]] "\n"
}
debug $retval
return $retval
}
# Pick a default borderwidth in pixels
set _bd 2
# Pick a default font size in pixels
set _screenheight [winfo screenheight .]
if {$_screenheight < 500} {
# for 800x600 or smaller
set _pixel 10
set _point 8
# Pick a default borderwidth which smaller
set _bd 1
} elseif {$_screenheight < 800} {
# for 1024x768
set _pixel 12
set _point 8
} elseif {$_screenheight < 1100} {
# for 1200x1000
set _pixel 12
set _point 8
} else {
set _pixel 12
set _point 10
}
# setup defaults depending on the OS and Window Manager
# Really should do another version for mono
if {$tcl_platform(platform) eq "windows"} {
if {$tcl_platform(osVersion) < 5} {
set _prop_default "MS Sans Serif"
} else {
set _prop_default "Tahoma"
}
# make sure this font is installed
set _allowed [string tolow [font families]]
foreach font [list $_prop_default "MS Sans Serif" Tahoma Arial System] {
if {[lsearch -exact $_allowed [string tolow $font]] > -1} {
set _prop_default $font
break
}
}
set _fixed_default {Courier New}
# make sure this font is installed
foreach font [list $_fixed_default Courier System] {
if {[lsearch -exact $_allowed [string tolow $font]] > -1} {
set _fixed_default $font
break
}
}
# Windows colors:
# "3dDarkShadow", COLOR_3DDKSHADOW,
# "3dLight", COLOR_3DLIGHT,
# "ActiveBorder", COLOR_ACTIVEBORDER,
# "ActiveCaption", COLOR_ACTIVECAPTION,
# "AppWorkspace", COLOR_APPWORKSPACE,
# "Background", COLOR_BACKGROUND,
# "ButtonFace", COLOR_BTNFACE,
# "ButtonHighlight", COLOR_BTNHIGHLIGHT,
# "ButtonShadow", COLOR_BTNSHADOW,
# "ButtonText", COLOR_BTNTEXT,
# "CaptionText", COLOR_CAPTIONTEXT,
# "DisabledText", COLOR_GRAYTEXT,
# "GrayText", COLOR_GRAYTEXT,
# "Highlight", COLOR_HIGHLIGHT,
# "HighlightText", COLOR_HIGHLIGHTTEXT,
# "InactiveBorder", COLOR_INACTIVEBORDER,
# "InactiveCaption", COLOR_INACTIVECAPTION,
# "InactiveCaptionText", COLOR_INACTIVECAPTIONTEXT,
# "InfoBackground", COLOR_INFOBK,
# "InfoText", COLOR_INFOTEXT,
# "Menu", COLOR_MENU,
# "MenuText", COLOR_MENUTEXT,
# "Scrollbar", COLOR_SCROLLBAR,
# "Window", COLOR_WINDOW,
# "WindowFrame", COLOR_WINDOWFRAME,
# "WindowText", COLOR_WINDOWTEXT,
variable \
background "SystemButtonFace" \
foreground "SystemButtonText" \
disabledforeground "SystemDisabledText" \
disabledbackground "SystemButtonShadow" \
textfamily $_prop_default \
systemfamily $_prop_default \
menufamily $_prop_default \
fixedfamily $_fixed_default \
fontsize $_point \
textbackground "SystemWindow" \
textforeground "SystemWindowText" \
disabledtextbackground "SystemDisabledText" \
selectbackground "SystemHighlight" \
selectforeground "SystemHighlightText" \
selectcolor "SystemWindow" \
highlightcolor "SystemWindowFrame" \
highlightbackground "SystemButtonFace" \
scrollbars "SystemScrollbar" \
borderwidth $_bd \
menubackground "SystemMenu" \
menuforeground "SystemMenuText"
variable highlightthickness 1
# Windows does not have an activebackground, but Tk does
variable activebackground $background
variable activeforeground $foreground
} else {
# intended for Unix
# Tk uses the following defaults:
#define NORMAL_BG "#d9d9d9"
#define ACTIVE_BG "#ececec"
#define SELECT_BG "#c3c3c3"
#define TROUGH "#c3c3c3"
#define INDICATOR "#b03060"
#define DISABLED "#a3a3a3"
# We know . exists and it has a background
# This should be "#d9d9d9" under default Tk
set _bg [. cget -background]
set _prop_default helvetica
# make sure this font is installed
set _allowed [string tolow [font families]]
foreach font [list $_prop_default times fixed] {
if {[lsearch -exact $_allowed [string tolow $font]] > -1} {
set _prop_default $font
break
}
}
set _fixed_default courier
# make sure this font is installed
foreach font [list $_fixed_default fixed] {
if {[lsearch -exact $_allowed [string tolow $font]] > -1} {
set _fixed_default $font
break
}
}
variable \
background $_bg \
foreground Black \
disabledforeground #808080 \
disabledbackground #a3a3a3 \
textfamily $_prop_default \
systemfamily $_prop_default \
menufamily $_prop_default \
fixedfamily $_fixed_default \
fontsize $_pixel \
textbackground white \
textforeground Black \
disabledtextbackground $_bg \
selectbackground #000080 \
selectforeground white \
selectcolor yellow \
highlightcolor Black \
highlightbackground $_bg \
scrollbars "#c3c3c3" \
borderwidth $_bd \
menubackground $_bg \
menuforeground Black
variable highlightthickness 1
# Windows does not have an activebackground, but Tk does
variable activebackground "#ececec"
variable activeforeground $foreground
}
# priority should be userDefault?
if {$_usetix} {
variable priority [tix cget -schemepriority]
} else {
variable priority 75
}
# variables that will be derived during addoptions - set to null for now
variable system_font {}
variable menu_font {}
variable fixed_font {}
variable text_font {}
# Different desktops have different visible regions
# This is not working properly yet.
variable geometry 0+0+[winfo screenwidth .]+$_screenheight
# Different desktops have different focusmodels: clicktofocus or
# followsmouse This is not working properly yet
variable focusmodel clicktofocus
# Some desktops have standardized link colors
# This is not working properly yet
variable linkcolor "#0000ff" vlinkcolor "#800000" alinkcolor "#800080"
proc default {args} {
# Override the defaults with any optional arguments
foreach {var val} $args {
set $var $val
}
}
proc setup {{type ""}} {
# type is one of the recognized window managers
# one of: cde kde win
global tcl_platform env
if {$type == ""} {
if {[set type [::tixDetermineWM]] == ""} {
set ::wm_default::wm ""
# Generic unix
return
}
}
setup-$type
set ::wm_default::wm $type
# todo - make the menubutton enter and leave events more compatible
}
proc setup-windows {args} {
# Already done by Tk above.
# Should find out the useable window region
}
proc setup-gnome {args} {
# GNOME is still barely supported because of the difficulty
# of finding and parsing sawfish definition files.
# First you have to find what window manager, then what theme,
# then find the files, then parse them according to each Wm's syntax.
global env
set bg $wm_default::background
set fg $wm_default::foreground
set txtFont $wm_default::textfamily
set btnFont $wm_default::systemfamily
debug "Setting up Gnome environment"
set file ~/.gnome/theme-switcher-capplet
if {![file exists $file] || \
[catch {open $file} fd] || $fd == ""} {
debug "Skipping $file"
} else {
debug "Reading $file"
set contents [read $fd]
catch {close $fd}
if {![regexp -- "use_theme_font=true" $contents]} {
# not activated
} elseif {[regexp -- "\nfont=(\[-a-zA-Z0-9,\]+)" $contents \
foo font]} {
set_unix_font $font
}
}
}
proc set_unix_font {font} {
set list [split $font "-"]
set font [lindex $list 2]
set font [string tolow $font]
if {$font != "" && [lsearch -exact [font families] $font] > -1} {
set wm_default::textfamily $font
debug "Setting textfamily to $font"
set wm_default::systemfamily $font
set wm_default::menufamily $font
} else {
debug "Unable to set font: '$list'"
}
if {[set size [lindex $list 7]] != "" && \
[string is integer -strict $size]} {
debug "Setting fontsize to '$size'"
set wm_default::fontsize $size
} elseif {[set size [lindex $list 8]] != "" && \
[string is integer -strict $size]} {
if {$size > 100} {set size [expr {$size / 10}]}
debug "Setting fontsize to '$size'"
set wm_default::fontsize $size
} else {
debug "Unable to set fontsize: '$list'"
}
}
# Common to KDE1 and KDE2
proc setup-kde {args} {
global env
set file ~/.kderc
if {![file exists $file] || [catch {open $file} fd] || $fd == ""} {
debug "Skipping $file"
} else {
debug "Reading $file"
set contents [read $fd]
catch {close $fd}
if {[regexp -- "\nfixedfamily=(\[-a-zA-Z0-9, \]+)" $contents \
foo font]} {
set list [split $font ","]
set font [lindex $list 0]
set wm_default::fixedfamily $font
debug "Setting fixedfamily to $font"
}
if {[regexp -- "\nfont=(\[-a-zA-Z0-9, \]+)" $contents \
foo font]} {
set list [split $font ","]
set font [lindex $list 0]
set wm_default::textfamily $font
debug "Setting textfamily to $font"
set wm_default::systemfamily $font
set wm_default::menufamily $font
}
}
}
proc setup-kde1 {args} {
# Shortcut for the moment
return [eval setup-kde $args]
}
proc set-kde2-color {str contents var} {
if {[regexp -- "\n${str}=(\[0-9,\]+)" $contents -> color]} {
set color [eval [list format "#%02x%02x%02x"] [split $color ","]]
set ::wm_default::$var $color
debug "setting $var to $color"
}
}
proc setup-kde2 {args} {
global env
set bg $wm_default::background
set fg $wm_default::foreground
set txtFont $wm_default::textfamily
set btnFont $wm_default::systemfamily
debug "Setting up KDE environment"
# Look for system the user settings
set dirs ~/.kde
if {[info exists env(KDEDIR)] && [file isdir $env(KDEDIR)]} {
lappend dirs $env(KDEDIR)
}
# read them sequentially and overwrite the previous values
foreach dir $dirs {
set file $dir/share/config/kdeglobals
if {![file exists $file] || [catch {open $file} fd] || $fd == ""} {
debug "Skipping $file"
} else {
debug "Reading $file"
set contents [read $fd]
catch {close $fd}
set-kde2-color background $contents background
set-kde2-color foreground $contents foreground
set-kde2-color selectBackground $contents selectbackground
set-kde2-color selectForeground $contents selectforeground
set-kde2-color windowBackground $contents textbackground
set-kde2-color visitedLinkColor $contents vlinkcolor
set-kde2-color linkColor $contents linkcolor
if {[regexp -- "\nactiveFont=(\[-a-zA-Z0-9, \]+)" $contents \
foo font]} {
set list [split $font ","]
set font [lindex $list 0]
set wm_default::textfamily $font
set size [lindex $list 1]
if {[string is integer -strict $size]} {
set wm_default::fontsize $size
}
debug "Setting textfamily to $font"
set wm_default::systemfamily $font
set wm_default::menufamily $font
}
}
# should pick up visitedLinkColor
set file $dir/share/config/kwmrc
if {![file exists $file] || [catch {open $file} fd] || $fd == ""} {
debug "Skipping $file"
} else {
debug "Reading $file"
set contents [read $fd]
catch {close $fd}
if {[regexp -- "\nDesktop1Region=(\[0-9+\]+)" $contents \
foo region]} {
set wm_default::geometry $region
debug "Setting geometry to $region"
}
if {[regexp -- "\nFocusPolicy=ClickToFocus" $contents \
foo region]} {
set wm_default::focusmodel clicktofocus
debug "Setting focusmodel to clicktofocus"
} else {
# followsmouse
}
}
}
return [eval setup-kde $args]
}
proc setup-cde {args} {
namespace import wm_default::*
set bg $wm_default::background
set fg $wm_default::foreground
set txtFont $wm_default::textfamily
set sysFont $wm_default::systemfamily
debug "Setting up CDE environment"
# if any of these options are missing, we must not be under CDE
set txtFont [option get . textfamilyList textfamilyList]
set sysFont [option get . systemfamilyList systemfamilyList]
if {$txtFont ne "" && $sysFont ne ""} {
set txtFont [lindex [split $txtFont :] 0]
set sysFont [lindex [split $sysFont :] 0]
if {$txtFont ne ""} {set textfamily $txtFont}
if {$sysFont ne ""} {set systemfamily $sysFont}
#
# If we can find the user's dt.resources file, we can find out the
# palette and text background/foreground colors
#
set txtBg $bg
set txtFg $fg
set selFg $selectforeground
set selBg $selectbackground
set selCol $selectcolor
set fh ""
set palf ""
set cur_rsrc ~/.dt/sessions/current/dt.resources
set hom_rsrc ~/.dt/sessions/home/dt.resources
if {[file readable $cur_rsrc] && [file readable $hom_rsrc]} {
if {[file mtime $cur_rsrc] > [file mtime $hom_rsrc]} {
if {[catch {open $cur_rsrc r} fh]} {set fh ""}
} else {
if {[catch {open $hom_rsrc r} fh]} {set fh ""}
}
} elseif {[file readable $cur_rsrc]} {
if {[catch {open $cur_rsrc r} fh]} {set fh ""}
} elseif {[file readable $hom_rsrc]} {
if {[catch {open $hom_rsrc r} fh]} {set fh ""}
}
if {[string length $fh] > 0} {
while {[gets $fh ln] != -1} {
regexp -- "^\\*0\\*ColorPalette:\[ \t]*(.*)\$" $ln nil palf
regexp -- "^Window.Color.Background:\[ \t]*(.*)\$" $ln nil txtBg
regexp -- "^Window.Color.Foreground:\[ \t]*(.*)\$" $ln nil txtFg
}
catch {close $fh}
if {$txtBg ne $bg} {
set selBg $txtFg
set selFg $txtBg
}
}
#
# If the *0*ColorPalette setting was found above, try to find the
# indicated file in ~/.dt, $DTHOME, or /usr/dt. The 3rd line in the
# file will be the radiobutton/checkbutton selectColor.
#
if {[string length $palf]} {
set dtdir /usr/dt
if [info exists env(DTHOME)] {
set dtdir $env(DTHOME)
}
if {[file readable ~/.dt/palettes/$palf]} {
set palf ~/.dt/palettes/$palf
} elseif {[file readable $dtdir/palettes/$palf]} {
set palf $dtdir/palettes/$palf
} else {
set palf ""
}
if {[string length $palf]} {
if {![catch {open $palf r} fh]} {
# selectColor will be the 3rd line in the file --
set ln ""; catch {gets $fh; gets $fh; gets $fh ln}
set ln [string trim $ln]
if {[string length $ln]} {set selCol $ln}
close $fh
}
}
}
set wm_default::background $bg
set wm_default::foreground $fg
set wm_default::textfamily $txtFont
set wm_default::systemfamily $sysFont
set wm_default::menufamily $sysFont
set wm_default::textbackground $txtBg
set wm_default::textforeground $txtFg
set wm_default::selectbackground $selBg
set wm_default::selectforeground $selFg
set wm_default::selectcolor $selCol
}
}
proc derivefonts {} {
global tcl_platform env
# variables that will be derived
variable system_font
variable menu_font
variable fixed_font
variable text_font
#
# Set default fonts
#
global tcl_platform env
switch -exact -- $tcl_platform(platform) windows {
set system_font [list $::wm_default::systemfamily $::wm_default::fontsize]
set menu_font [list $::wm_default::menufamily $::wm_default::fontsize]
set text_font [list $::wm_default::textfamily $::wm_default::fontsize]
set fixed_font [list $::wm_default::fixedfamily $::wm_default::fontsize]
} default {
set system_font [list $::wm_default::systemfamily -$::wm_default::fontsize]
if {[set type $::wm_default::wm] == ""} {
# Generic unix
# some Unix Wms seem to make Menu fonts bold - ugly IMHO
set menu_font [list $::wm_default::menufamily -$::wm_default::fontsize bold]
} else {
# gnome kde1 kde2 cde kde don't
set menu_font [list $::wm_default::menufamily -$::wm_default::fontsize]
}
set text_font [list $::wm_default::textfamily -$::wm_default::fontsize]
set fixed_font [list $::wm_default::fixedfamily -$::wm_default::fontsize]
}
}
proc addoptions {args} {
global tcl_platform env tix_version
# variables that will be derived
variable system_font
variable menu_font
variable fixed_font
variable text_font
if {[info commands "tix"] != ""} {set _usetix 1} {set _usetix 0}
# Override what you have found with any optional arguments
foreach {var val} $args {
set var [string trimleft $var "-"]
set ::wm_default::$var $val
}
set pri $::wm_default::priority
# If you are running under Tix, set the colorscheme now
# The options below will then override the Tix settings
if {$_usetix} {
# Tix's focus model is very non-standard
bind TixComboBox <FocusIn> ""
bind TixComboBox <FocusOut> ""
if {$tix_version < "8.2"} {
# works??
option add *TixNoteBook.nbframe.inactiveBackground \
$::wm_default::disabledbackground $pri
} else {
# works??
option add *TixNoteBook.nbframe.inactiveBackground \
$::wm_default::background $pri
}
# works??
option add *TixPanedWindow.seperatorBg \
$::wm_default::disabledbackground $pri
option add *TixPanedWindow.handleBg \
$::wm_default::disabledbackground $pri
# works??
option add *TixPanedWindow.separatorActiveBg \
$::wm_default::activebackground $pri
option add *TixPanedWindow.handleActiveBg \
$::wm_default::activebackground $pri
option add *TixPanedWindow.Background \
$::wm_default::disabledbackground $pri
# works??
option add *TixResizeHandle*background \
$::wm_default::disabledbackground $pri
}
foreach pref $wm_default::_frame_widgets {
option add $pref.background $::wm_default::background $pri
}
option add *Background $::wm_default::background $pri
derivefonts
# Set the global defaults to the system font
foreach pref [list *Font *font] {
option add $pref $system_font $pri
}
# Set the "system" type defaults to the system font
foreach pref $wm_default::_menu_font_widgets {
option add $pref.font $menu_font $pri
}
foreach pref $wm_default::_button_font_widgets {
option add $pref.font $system_font $pri
option add $pref.disabledForeground $::wm_default::disabledforeground $pri
option add $pref.background $::wm_default::background $pri
option add $pref.foreground $::wm_default::foreground $pri
option add $pref.highlightBackground $::wm_default::highlightbackground $pri
}
foreach pref $wm_default::_system_font_widgets {
option add $pref.font $system_font $pri
option add $pref.background $::wm_default::background $pri
option add $pref.foreground $::wm_default::foreground $pri
option add $pref.highlightBackground $::wm_default::highlightbackground $pri
}
foreach pref $wm_default::_text_type_widgets {
option add $pref.font $text_font $pri
option add $pref.relief sunken $pri
option add $pref.borderWidth $::wm_default::borderwidth $pri
option add $pref.background $::wm_default::textbackground $pri
option add $pref.foreground $::wm_default::textforeground $pri
option add $pref.selectBackground $::wm_default::selectbackground $pri
option add $pref.selectForeground $::wm_default::selectforeground $pri
option add $pref.highlightThickness $::wm_default::highlightthickness $pri
option add $pref.disabledBackground $::wm_default::disabledtextbackground $pri
}
foreach pref $wm_default::_insert_type_widgets {
option add $pref.relief sunken $pri
option add $pref.insertBackground $::wm_default::textforeground $pri
option add $pref.highlightThickness $::wm_default::highlightthickness $pri
}
#
# Set the Selector color for radiobuttons, checkbuttons, et. al
#
foreach pref $wm_default::_select_type_widgets {
option add $pref.selectColor $::wm_default::selectcolor $pri
option add $pref.background $::wm_default::background $pri
option add $pref.foreground $::wm_default::foreground $pri
option add $pref.activeBackground $::wm_default::activebackground $pri
option add $pref.activeForeground $::wm_default::activeforeground $pri
}
# Set the "active" defaults - this could be controversial
foreach pref $wm_default::_menu_font_widgets {
option add $pref.activeBackground $::wm_default::activebackground $pri
option add $pref.activeForeground $::wm_default::activeforeground $pri
option add $pref.background $::wm_default::background $pri
option add $pref.foreground $::wm_default::foreground $pri
option add $pref.disabledForeground $::wm_default::disabledforeground $pri
option add $pref.highlightThickness $::wm_default::highlightthickness $pri
}
switch -exact -- $tcl_platform(platform) windows {
# Make sure this is set to foreground - check marks on menus
set _menu_select_color $::wm_default::foreground
} default {
# On unix there are recessed check boxes not check marks
set _menu_select_color $::wm_default::selectcolor
}
option add *Menu.selectColor $_menu_select_color $pri
if {$_usetix} {
option add *TixMenu.selectColor $_menu_select_color $pri
option add *TixBalloon*message.background $::wm_default::textbackground $pri
}
# Windows does not have an activebackground, but Tk does
foreach pref $wm_default::_button_font_widgets {
option add $pref.activeBackground $::wm_default::activebackground $pri
option add $pref.activeForeground $::wm_default::activeforeground $pri
}
#
# Set the default *button borderwidth
#
# option add *.borderWidth $::wm_default::borderwidth $pri
foreach pref $wm_default::_active_borderwidth_widgets {
option add $pref.activeBorderWidth $::wm_default::borderwidth $pri
option add $pref.borderWidth $::wm_default::borderwidth $pri
}
foreach pref $wm_default::_nonzero_borderwidth_widgets {
option add $pref.borderWidth $::wm_default::borderwidth $pri
}
foreach pref $wm_default::_null_borderwidth_widgets {
option add $pref.borderWidth 0 $pri
}
if {$_usetix} {
if {$tix_version < "8.2"} {
option add *TixNoteBook.nbframe.inactiveBackground \
$::wm_default::disabledbackground $pri
option add *TixNoteBook*nbframe.inactiveBackground \
$::wm_default::disabledbackground $pri
} else {
option add *TixNoteBook.nbframe.inactiveBackground \
$::wm_default::background $pri
option add *TixNoteBook*nbframe.inactiveBackground \
$::wm_default::background $pri
}
}
foreach pref $wm_default::_scrollbar_widgets {
option add $pref.background $::wm_default::background $pri
option add $pref.foreground $::wm_default::foreground $pri
# Tix 8.1.1 had these wrong
option add $pref.troughColor $::wm_default::scrollbars $pri
option add $pref.borderWidth $::wm_default::borderwidth $pri
}
option add *Scale.borderWidth $::wm_default::borderwidth $pri
option add *Scale.troughColor $::wm_default::scrollbars $pri
option add *highlightColor $::wm_default::highlightcolor $pri
option add *highlightBackground $::wm_default::highlightbackground $pri
option add *HighlightBackground $::wm_default::highlightbackground $pri
# not _system_font_widgets
set _focus_widgets [concat \
$::wm_default::_frame_widgets \
$::wm_default::_menu_font_widgets \
$::wm_default::_text_type_widgets \
$::wm_default::_insert_type_widgets \
$::wm_default::_select_type_widgets \
$::wm_default::_active_borderwidth_widgets \
$::wm_default::_nonzero_borderwidth_widgets \
$::wm_default::_null_borderwidth_widgets ]
if {$_usetix} {
set _tix_hl_widgets [list *TixBitmapButton*label \
*TixComboBox*Entry \
*TixControl*entry \
*TixDirList*hlist \
*TixDirTree*hlist \
*TixFileEntry*Entry \
*TixFileEntry*entry \
*TixMultiList*Listbox \
*TixNoteBook.nbframe \
*TixOptionMenu*menubutton \
*TixScrolledHList*hlist \
*TixScrolledListBox*listbox\
*TixScrolledTList*tlist \
*TixTree*hlist]
eval lappend _focus_widgets $_tix_hl_widgets
}
foreach pref [lsort -uniq $_focus_widgets] {
option add $pref.highlightBackground $::wm_default::highlightbackground $pri
}
# Now for some things to make it look more like the WM
# todo - look for and call
if {$::wm_default::focusmodel eq "followsmouse"} {
tk_focusFollowsMouse
}
if {$_usetix} {
tixSetDefaultOptions
if {[lsearch -exact {windows kde1 kde2} $::wm_default::wm] > -1} {
# Fix the way Button boxes are packed
if {![llength [info procs ::tixButtonBox:add]]} {
uplevel #0 auto_load tixButtonBox
}
proc ::tixButtonBox:add {w name args} {
upvar #0 $w data
eval [linsert $args 0 button $w.$name]
if {![info exists data(-padx)]} {set data(-padx) 5}
if {![info exists data(-pady)]} {set data(-pady) 10}
if {$data(-orientation) eq "horizontal"} {
# Push the Buttons to the right
if {[info commands $w.pad] == ""} {
label $w.pad
pack $w.pad -side left -expand yes -fill both
}
pack $w.$name -side left \
-expand no \
-padx $data(-padx) -pady $data(-pady)
} else {
pack $w.$name -side top \
-expand no -fill x \
-padx $data(-padx) -pady $data(-pady)
}
lappend data(g:buttons) $name
set data(w:$name) $w.$name
return $w.$name
}
option add *TixButtonBox.relief flat $::wm_default::priority
option add *TixButtonBox.borderwidth 2 $::wm_default::priority
}
}
return [getoptions]
}
namespace export setup addoptions getoptions parray
}
package provide wm_default 1.0
proc tixSetDefaultOptions {} {
# Returns one of cde kde1 kde2 gnome windows or ""
global tcl_platform env tixOption
# There is no overlap between the wm_default variable names and
# the old style tixOption names. So we can add the wm_default variable
# names to the array tixOption, and allow people to upgrade in time.
foreach variable {
wm
linkcolor
vlinkcolor
alinkcolor
background
foreground
disabledforeground
disabledbackground
textfamily
systemfamily
menufamily
fixedfamily
fontsize
textbackground
textforeground
disabledtextbackground
selectbackground
selectforeground
selectcolor
highlightcolor
highlightbackground
scrollbars
borderwidth
priority
menubackground
menuforeground
activebackground
activeforeground
system_font
menu_font
fixed_font
text_font
} {
set tixOption($variable) [set ::wm_default::$variable]
}
}
Tix8.4.3/pref/Old12Pt.fs 0000644 00000001035 15173441414 0010361 0 ustar 00 #
# $Id: Old12Pt.fs,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixSetFontset:12Point {} {
global tixOption
set tixOption(font) -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*
set tixOption(bold_font) -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*
set tixOption(menu_font) -*-helvetica-bold-o-normal-*-12-*-*-*-*-*-*-*
set tixOption(italic_font) -*-helvetica-bold-o-normal-*-12-*-*-*-*-*-*-*
set tixOption(fixed_font) -*-courier-medium-r-*-*-12-*-*-*-*-*-*-*
set tixOption(border1) 1
}
Tix8.4.3/pref/WmDefault.fs 0000644 00000001363 15173441414 0011070 0 ustar 00 # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: WmDefault.fs,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixSetFontset {} {
global tixOption
package require wm_default
if {![info exists ::wm_default::wm]} {
wm_default::setup
wm_default::addoptions
}
set tixOption(font) $::wm_default::system_font
set tixOption(bold_font) [concat $::wm_default::system_font bold]
set tixOption(menu_font) $::wm_default::menu_font
set tixOption(italic_font) [concat $::wm_default::system_font italic]
set tixOption(fixed_font) $::wm_default::fixed_font
set tixOption(text_font) $::wm_default::text_font
set tixOption(border1) $::wm_default::borderwidth
}
Tix8.4.3/pref/WmDefault.txt 0000644 00000010344 15173441414 0011276 0 ustar 00 One of the bad things about Tk/Tkinter is that it does not pick up
the current color and font scheme from the prevailing CDE/KDE/GNOME/Windows
window manager scheme.
One of the good things about Tk/Tkinter is that it is not tied to one
particular widget set so it could pick up the current color and font scheme
from the prevailing CDE/KDE/GNOME/Windows window manager scheme.
The WmDefault package is for making Tk/Tkinter applications use the
prevailing CDE/KDE/GNOME/Windows scheme. It tries to find the files
and/or settings that the current window manager is using, and then
sets the Tk options database accordingly (plus a few other things as well).
DOWNLOAD
--------
Download the latest version of wm_default from http://tix.sourceforge.net
either as a part of the standard Tix distribution, or as a part of the
Tix Applications: http://tix.sourceforge.net/Tide. wm_default does not
require Tix, but is Tix enabled.
USAGE:
------
For Tix versions 8.1.2 and above from http://tix.sourceforge.net,
WmDefault is the default Tix scheme, so there is nothing else to do.
For Tk applications, it should be sufficent at the beginning of a wish
app to simply:
package require wm_default
wm_default::setup
wm_default::addoptions
The process is divided into 2 steps:
1) find the files and/or settings (::wm_default::setup).
This is complete for Windows, pretty good for KDE and CDE, and
still barely supported for GNOME because of the difficulty
of finding and parsing sawfish definition files.
setup takes one optional argument: wm, the name of the window manager
as a string, if known. One of: windows gnome kde1 kde2 cde.
2) Setting the Tk options database (::wm_default::addoptions).
You can override the settings in 1) by adding your values to the call
to addoptions:
::wm_default::addoptions -foreground red -background blue
You can examine the settings with
::wm_default::getoptions
which returns a Tcl array of the current settings, and
::wm_default::parray
which returns a string of the current settings, one value-pair per line.
There are a number of assumptions built into the heuristics of addoptions,
that may need fine tuning. Post patches to http://tix.sourceforge.net.
PYTHON
______
If you are using Tix versions 8.1.2 and above from http://tix.sourceforge.net
with Python 2.1 and above, WmDefault is the default Tix scheme,
so there is nothing else you need to do.
The easiest way to install WmDefault for Tkinter is to copy the WmDefault.*
AND THE FILE pkgIndex.tcl from lib/tix8.1/pref to a directory on your
PYTHONPATH. Then the following should work:
import Tkinter
root = Tkinter.Tk()
import WmDefault
WmDefault.setup(root)
WmDefault.addoptions(root, {'foreground': 'red'})
print WmDefault.getoptions(root)
SETTINGS
--------
Here is a list of all the settings controlled by WmDefault:
wm - one of windows gnome kde1 kde2 cde kde
background
foreground
disabledforeground
disabledbackground
textfamily
systemfamily
menufamily
fixedfamily
fontsize - in pixels under Unix, in points under Windows
textbackground
textforeground
disabledtextbackground
selectbackground
selectforeground
selectcolor
highlightcolor
highlightbackground
scrollbars - scrollbar trough color
borderwidth
priority
menubackground
menuforeground
activebackground
activeforeground
system_font - a Tcl font spec, a list of family size weight
menu_font
fixed_font
text_font
linkcolor - not working completely yet
vlinkcolor
alinkcolor
TO MAKE A PREVIOUS TIX USE THIS AS THE DEFAULT SCHEME:
------------------------------------------------------
1) Compile Tix with
-DTIX_DEF_SCHEME "WmDefault"
-DTIX_DEF_FONTSET "WmDefault"
or change the defines in generic/tixInit.c
#define TIX_DEF_SCHEME "WmDefault"
#define TIX_DEF_FONTSET "WmDefault"
2) Edit the installed lib/8.1/Tix.tcl and change the -configspec
in tixClass tixAppContext with the following
{-fontset WmDefault}
{-scheme WmDefault}
3) Copy the files WmDefault.* AND pkgIndex.tcl to the installed
lib/tix8.1/pref
4) Make or edit the file lib/tix8.1/pkgIndex.tcl and add the lines
package ifneeded wm_default 1.0 \
[list source [file join $dir pref WmDefault.tcl]]
Tix8.4.3/pref/12Point.fsc 0000644 00000003775 15173441414 0010610 0 ustar 00 #
# $Id: 12Point.fsc,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
proc tixPref:InitFontSet:12Point {} {
global tixOption tcl_platform
switch -- $tcl_platform(platform) "windows" {
# This should be Tahoma for Win2000/XP
set font "MS Sans Serif"
set fixedfont "Courier New"
} unix {
set font "helvetica"
set fixedfont "courier"
}
set tixOption(font) [list $font -12]
set tixOption(bold_font) [list $font -12 bold]
set tixOption(menu_font) [list $font -12]
set tixOption(italic_font) [list $font -12 bold italic]
set tixOption(fixed_font) [list $fixedfont -12]
set tixOption(border1) 1
}
proc tixPref:SetFontSet:12Point {} {
global tixOption
option add *Font $tixOption(font) $tixOption(prioLevel)
option add *font $tixOption(font) $tixOption(prioLevel)
option add *Menu.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixMenu.font $tixOption(menu_font) $tixOption(prioLevel)
option add *Menubutton.font $tixOption(menu_font) $tixOption(prioLevel)
option add *Label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *Scale.font $tixOption(italic_font) $tixOption(prioLevel)
option add *TixBalloon*Label.font $tixOption(font) $tixOption(prioLevel)
option add *TixBitmapButton*label.font $tixOption(font) $tixOption(prioLevel)
option add *TixControl*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelEntry*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelFrame*label.font $tixOption(bold_font) $tixOption(prioLevel)
option add *TixMwmClient*title.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.font $tixOption(menu_font) $tixOption(prioLevel)
option add *TixOptionMenu*menubutton.font $tixOption(font) $tixOption(prioLevel)
option add *TixComboBox*Entry.font $tixOption(font) $tixOption(prioLevel)
option add *TixFileSelectBox*Label.font $tixOption(bold_font) $tixOption(prioLevel)
}
Tix8.4.3/pref/TkWin.cs 0000644 00000004306 15173441414 0010231 0 ustar 00 #
# $Id: TkWin.cs,v 1.1 2000/10/12 01:41:04 idiscovery Exp $
#
proc tixSetScheme-Color {} {
global tixOption
set tixOption(bg) SystemButtonFace
set tixOption(fg) SystemButtonText
set tixOption(dark1_bg) SystemScrollbar
set tixOption(dark1_fg) SystemButtonText
# set tixOption(dark2_bg) SystemDisabledText
# set tixOption(dark2_fg) black
set tixOption(inactive_bg) SystemButtonFace
set tixOption(inactive_fg) SystemButtonText
set tixOption(light1_bg) SystemButtonFace
# set tixOption(light1_fg) white
# set tixOption(light2_bg) #fcfcfc
# set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) SystemDisabledText
set tixOption(input1_bg) SystemWindow
# set tixOption(input2_bg)
# set tixOption(output1_bg) $tixOption(dark1_bg)
# set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) SystemHighlightText
set tixOption(select_bg) SystemHighlight
set tixOption(selector) SystemHighlight
}
proc tixSetScheme-Mono {} {
global tixOption
set tixOption(bg) SystemButtonFace
set tixOption(fg) SystemButtonText
set tixOption(dark1_bg) SystemScrollbar
set tixOption(dark1_fg) SystemButtonText
# set tixOption(dark2_bg) SystemDisabledText
# set tixOption(dark2_fg) black
set tixOption(inactive_bg) SystemButtonFace
set tixOption(inactive_fg) SystemButtonText
set tixOption(light1_bg) SystemButtonFace
# set tixOption(light1_fg) white
# set tixOption(light2_bg) #fcfcfc
# set tixOption(light2_fg) white
set tixOption(active_bg) $tixOption(dark1_bg)
set tixOption(active_fg) $tixOption(fg)
set tixOption(disabled_fg) SystemDisabledText
set tixOption(input1_bg) white
# set tixOption(input2_bg)
# set tixOption(output1_bg) $tixOption(dark1_bg)
# set tixOption(output2_bg) $tixOption(bg)
set tixOption(select_fg) SystemHighlightText
set tixOption(select_bg) SystemHighlight
set tixOption(selector) SystemHighlight
}
Tix8.4.3/OptMenu.tcl 0000644 00000022260 15173441414 0010004 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: OptMenu.tcl,v 1.3 2001/12/09 05:04:02 idiscovery Exp $
#
# OptMenu.tcl --
#
# This file implements the TixOptionMenu widget.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixOptionMenu {
-classname TixOptionMenu
-superclass tixLabelWidget
-method {
add delete disable enable entrycget entryconfigure entries
}
-flag {
-command -disablecallback -dynamicgeometry -value -variable
-validatecmd -state
}
-forcecall {
-variable -state
}
-configspec {
{-command command Command ""}
{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
{-dynamicgeometry dynamicGeometry DynamicGeometry 0 tixVerifyBoolean}
{-state state State normal}
{-value value Value ""}
{-validatecmd validateCmd ValidateCmd ""}
{-variable variable Variable ""}
}
-default {
{.highlightThickness 0}
{.takeFocus 0}
{.frame.menubutton.relief raised}
{.frame.menubutton.borderWidth 2}
{.frame.menubutton.anchor w}
{.frame.menubutton.highlightThickness 2}
{.frame.menubutton.takeFocus 1}
}
}
proc tixOptionMenu:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(nItems) 0
set data(items) ""
set data(posted) 0
set data(varInited) 0
set data(maxWidth) 0
}
proc tixOptionMenu:ConstructFramedWidget {w frame} {
upvar #0 $w data
tixChainMethod $w ConstructFramedWidget $frame
set data(w:menubutton) [menubutton $frame.menubutton -indicatoron 1]
set data(w:menu) [menu $frame.menubutton.menu -tearoff 0]
pack $data(w:menubutton) -side left -expand yes -fill both
$data(w:menubutton) config -menu $data(w:menu)
bind $data(w:menubutton) <Up> [bind Menubutton <space>]
bind $data(w:menubutton) <Down> [bind Menubutton <space>]
tixSetMegaWidget $data(w:menubutton) $w
}
proc tixOptionMenu:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
}
#----------------------------------------------------------------------
# Private methods
#----------------------------------------------------------------------
proc tixOptionMenu:Invoke {w name} {
upvar #0 $w data
if {"$data(-state)" == "normal"} {
tixOptionMenu:SetValue $w $name
}
}
proc tixOptionMenu:SetValue {w value {noUpdate 0}} {
upvar #0 $w data
if {$data(-validatecmd) != ""} {
set value [tixEvalCmdBinding $w $data(-validatecmd) "" $value]
}
set name $value
if {$name == "" || [info exists data(varInited)]} {
# variable may contain a bogus value
if {![info exists data($name,index)]} {
set data(-value) ""
tixVariable:UpdateVariable $w
$data(w:menubutton) config -text ""
return
}
}
if {[info exists data($name,index)]} {
$data(w:menubutton) config -text $data($name,label)
set data(-value) $value
if {! $noUpdate} {
tixVariable:UpdateVariable $w
}
if {$data(-command) != "" && !$data(-disablecallback)} {
if {![info exists data(varInited)]} {
set bind(specs) ""
tixEvalCmdBinding $w $data(-command) bind $value
}
}
} else {
error "item \"$value\" does not exist"
}
}
proc tixOptionMenu:SetMaxWidth {w} {
upvar #0 $w data
foreach name $data(items) {
set len [string length $data($name,label)]
if {$data(maxWidth) < $len} {
set data(maxWidth) $len
}
}
if {$data(maxWidth) > 0} {
$data(w:menubutton) config -width $data(maxWidth)
}
}
#----------------------------------------------------------------------
# Configuration
#----------------------------------------------------------------------
proc tixOptionMenu:config-state {w value} {
upvar #0 $w data
if {![info exists data(w:label)]} {
return
}
if {$value == "normal"} {
catch {
$data(w:label) config -fg \
[$data(w:menubutton) cget -foreground]
}
$data(w:menubutton) config -state $value
} else {
catch {
$data(w:label) config -fg \
[$data(w:menubutton) cget -disabledforeground]
}
$data(w:menubutton) config -state $value
}
}
proc tixOptionMenu:config-value {w value} {
upvar #0 $w data
tixOptionMenu:SetValue $w $value
# This will tell the Intrinsics: "Please use this value"
# because "value" might be altered by SetValues
#
return $data(-value)
}
proc tixOptionMenu:config-variable {w arg} {
upvar #0 $w data
if {[tixVariable:ConfigVariable $w $arg]} {
# The value of data(-value) is changed if tixVariable:ConfigVariable
# returns true
tixOptionMenu:SetValue $w $data(-value) 1
}
catch {
unset data(varInited)
}
set data(-variable) $arg
}
#----------------------------------------------------------------------
# Public Methdos
#----------------------------------------------------------------------
proc tixOptionMenu:add {w type name args} {
upvar #0 $w data
if {[info exists data($name,index)]} {
error "item $name already exists in the option menu $w"
}
case $type {
"command" {
set validOptions {
-command -label
}
set opt(-command) ""
set opt(-label) $name
tixHandleOptions -nounknown opt $validOptions $args
if {$opt(-command) != ""} {
error "option -command cannot be specified"
}
# Create a new item inside the menu
#
eval $data(w:menu) add command $args \
[list -label $opt(-label) \
-command "tixOptionMenu:Invoke $w \{$name\}"]
set index $data(nItems)
# Store info about this item
#
set data($index,name) $name
set data($name,type) cmd
set data($name,label) $opt(-label)
set data($name,index) $index
if {$index == 0} {
$data(w:menubutton) config -text $data($name,label)
tixOptionMenu:SetValue $w $name
}
incr data(nItems)
lappend data(items) $name
if $data(-dynamicgeometry) {
tixOptionMenu:SetMaxWidth $w
}
}
"separator" {
$data(w:menu) add separator
set index $data(nItems)
# Store info about this item
#
set data($index,name) $name
set data($name,type) sep
set data($name,label) ""
set data($name,index) $index
incr data(nItems)
lappend data(items) $name
}
default {
error "only types \"separator\" and \"command\" are allowed"
}
}
return ""
}
proc tixOptionMenu:delete {w item} {
upvar #0 $w data
if {![info exists data($item,index)]} {
error "item $item does not exist in $w"
}
# Rehash the item list
set newItems ""
set oldIndex 0
set newIndex 0
foreach name $data(items) {
if {$item == $name} {
unset data($name,label)
unset data($name,index)
unset data($name,type)
$data(w:menu) delete $oldIndex
} else {
set data($name,index) $newIndex
set data($newIndex,name) $name
incr newIndex
lappend newItems $name
}
incr oldIndex
}
incr oldIndex -1; unset data($oldIndex,name)
set data(nItems) $newIndex
set data(items) $newItems
if {$data(-value) == $item} {
set newVal ""
foreach item $data(items) {
if {$data($item,type) == "cmd"} {
set newVal $item
}
}
tixOptionMenu:SetValue $w $newVal
}
return ""
}
proc tixOptionMenu:disable {w item} {
upvar #0 $w data
if {![info exists data($item,index)]} {
error "item $item does not exist in $w"
} else {
catch {$data(w:menu) entryconfig $data($item,index) -state disabled}
}
}
proc tixOptionMenu:enable {w item} {
upvar #0 $w data
if {![info exists data($item,index)]} {
error "item $item does not exist in $w"
} else {
catch {$data(w:menu) entryconfig $data($item,index) -state normal}
}
}
proc tixOptionMenu:entryconfigure {w item args} {
upvar #0 $w data
if {![info exists data($item,index)]} {
error "item $item does not exist in $w"
} else {
return [eval $data(w:menu) entryconfig $data($item,index) $args]
}
}
proc tixOptionMenu:entrycget {w item arg} {
upvar #0 $w data
if {![info exists data($item,index)]} {
error "item $item does not exist in $w"
} else {
return [$data(w:menu) entrycget $data($item,index) $arg]
}
}
proc tixOptionMenu:entries {w} {
upvar #0 $w data
return $data(items)
}
proc tixOptionMenu:Destructor {w} {
tixVariable:DeleteVariable $w
# Chain this to the superclass
#
tixChainMethod $w Destructor
}
#----------------------------------------------------------------------
# Obsolete
# These have been replaced by new commands in Tk 4.0
#
proc tixOptionMenu:Post {w} {
upvar #0 $w data
set rootx [winfo rootx $data(w:frame)]
set rooty [winfo rooty $data(w:frame)]
# adjust for the border of the menu and frame
#
incr rootx [lindex [$data(w:menu) config -border] 4]
incr rooty [lindex [$data(w:frame) config -border] 4]
incr rooty [lindex [$data(w:menu) config -border] 4]
set value $data(-value)
set y [$data(w:menu) yposition $data($value,index)]
$data(w:menu) post $rootx [expr $rooty - $y]
$data(w:menu) activate $data($value,index)
grab -global $data(w:menubutton)
set data(posted) 1
}
Tix8.4.3/DragDrop.tcl 0000644 00000007671 15173441414 0010130 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: DragDrop.tcl,v 1.4 2001/12/09 05:04:02 idiscovery Exp $
#
# DragDrop.tcl ---
#
# Implements drag+drop for Tix widgets.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixClass tixDragDropContext {
-superclass {}
-classname TixDragDropContext
-method {
cget configure drag drop set startdrag
}
-flag {
-command -source
}
-configspec {
{-command ""}
{-source ""}
}
}
proc tixDragDropContext:Constructor {w} {
upvar #0 $w data
}
#----------------------------------------------------------------------
# Private methods
#
#----------------------------------------------------------------------
proc tixDragDropContext:CallCommand {w target command X Y} {
upvar #0 $w data
set x [expr $X-[winfo rootx $target]]
set y [expr $Y-[winfo rooty $target]]
regsub %x $command $x command
regsub %y $command $y command
regsub %X $command $X command
regsub %Y $command $Y command
regsub %W $command $target command
regsub %S $command [list $data(-command)] command
eval $command
}
proc tixDragDropContext:Send {w target event X Y} {
upvar #0 $w data
global tixDrop
foreach tag [tixDropBindTags $target] {
if {[info exists tixDrop($tag,$event)]} {
tixDragDropContext:CallCommand $w $target \
$tixDrop($tag,$event) $X $Y
}
}
}
#----------------------------------------------------------------------
# set --
#
# Set the "small data" of the type supported by the source widget
#----------------------------------------------------------------------
proc tixDragDropContext:set {w type data} {
}
#----------------------------------------------------------------------
# startdrag --
#
# Start the dragging action
#----------------------------------------------------------------------
proc tixDragDropContext:startdrag {w x y} {
upvar #0 $w data
set data(oldTarget) ""
$data(-source) config -cursor "[tix getbitmap drop] black"
tixDragDropContext:drag $w $x $y
}
#----------------------------------------------------------------------
# drag --
#
# Continue the dragging action
#----------------------------------------------------------------------
proc tixDragDropContext:drag {w X Y} {
upvar #0 $w data
global tixDrop
set target [winfo containing -displayof $w $X $Y]
if {$target != $data(oldTarget)} {
if {$data(oldTarget) != ""} {
tixDragDropContext:Send $w $data(oldTarget) <Out> $X $Y
}
if {$target != ""} {
tixDragDropContext:Send $w $target <In> $X $Y
}
set data(oldTarget) $target
}
if {$target != ""} {
tixDragDropContext:Send $w $target <Over> $X $Y
}
}
proc tixDragDropContext:drop {w X Y} {
upvar #0 $w data
global tixDrop
set target [winfo containing -displayof $w $X $Y]
if {$target != ""} {
tixDragDropContext:Send $w $target <Drop> $X $Y
}
if {$data(-source) != ""} {
$data(-source) config -cursor ""
}
set data(-source) ""
}
#----------------------------------------------------------------------
# Public Procedures -- This is NOT a member of the tixDragDropContext
# class!
#
# parameters :
# $w: who wants to start dragging? (currently ignored)
#----------------------------------------------------------------------
proc tixGetDragDropContext {w} {
global tixDD
if {[info exists tixDD]} {
return tixDD
}
return [tixDragDropContext tixDD]
}
proc tixDropBind {w event command} {
global tixDrop
set tixDrop($w) 1
set tixDrop($w,$event) $command
}
proc tixDropBindTags {w args} {
global tixDropTags
if {$args == ""} {
if {[info exists tixDropTags($w)]} {
return $tixDropTags($w)
} else {
return [list [winfo class $w] $w]
}
} else {
set tixDropTags($w) $args
}
}
Tix8.4.3/IconView.tcl 0000644 00000013736 15173441414 0010150 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: IconView.tcl,v 1.2 2001/12/09 05:04:02 idiscovery Exp $
#
# IconView.tcl --
#
# This file implements the Icon View widget: the "icon" view mode of
# the MultiView widget. It implements:
#
# (1) Creation of the icons in the canvas subwidget.
# (2) Automatic arrangement of the objects
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixIconView {
-classname TixIconView
-superclass tixCObjView
-method {
add arrange
}
-flag {
-autoarrange
}
-static {
}
-configspec {
{-autoarrange autoArrange AutoArrange 0 tixVerifyBoolean}
}
-default {
{.scrollbar auto}
{*borderWidth 1}
{*canvas.background #c3c3c3}
{*canvas.highlightBackground #d9d9d9}
{*canvas.relief sunken}
{*canvas.takeFocus 1}
{*Scrollbar.takeFocus 0}
}
-forcecall {
}
}
proc tixIconView:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
}
proc tixIconView:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
set c $data(w:canvas)
bind $c <1> "tixIconView:StartDrag $w %x %y"
bind $c <B1-Motion> "tixIconView:Drag $w %x %y"
bind $c <ButtonRelease-1> "tixIconView:EndDrag $w"
}
proc tixIconView:StartDrag {w x y} {
upvar #0 $w data
global lastX lastY
set c $data(w:canvas)
$c raise current
set lastX [$c canvasx $x]
set lastY [$c canvasy $y]
}
proc tixIconView:Drag {w x y} {
upvar #0 $w data
global lastX lastY
set c $data(w:canvas)
set x [$c canvasx $x]
set y [$c canvasy $y]
$c move current [expr $x-$lastX] [expr $y-$lastY]
set lastX $x
set lastY $y
}
proc tixIconView:EndDrag {w} {
upvar #0 $w data
tixCallMethod $w adjustscrollregion
}
#----------------------------------------------------------------------
#
# option configs
#----------------------------------------------------------------------
proc tixIconView:add {w tag image text} {
upvar #0 $w data
set cmp [image create compound -window $data(w:canvas)]
$cmp add image -image $image
$cmp add line
$cmp add text -text $text
set id [$data(w:canvas) create image 0 0 -image $cmp -anchor nw]
$data(w:canvas) addtag $tag withtag $id
if {$data(-autoarrange)} {
tixWidgetDoWhenIdle tixIconView:Arrange $w 1
}
}
# Do it in an idle handler, so that Arrange is not called before the window
# is properly mapped.
#
proc tixIconView:arrange {w} {
tixWidgetDoWhenIdle tixIconView:Arrange $w 1
}
proc tixIconView:PackOneRow {w row y maxH bd padX padY} {
upvar #0 $w data
set iX [expr $bd+$padX]
foreach i $row {
set box [$data(w:canvas) bbox $i]
set W [expr [lindex $box 2]-[lindex $box 0]+1]
set H [expr [lindex $box 3]-[lindex $box 1]+1]
set iY [expr $y + $maxH - $H]
$data(w:canvas) coords $i $iX $iY
incr iX [expr $W+$padX]
}
}
# virtual method
#
proc tixIconView:PlaceWindow {w} {
upvar #0 $w data
if {$data(-autoarrange)} {
tixWidgetDoWhenIdle tixIconView:Arrange $w 0
}
tixChainMethod $w PlaceWindow
}
proc tixIconView:Arrange {w adjust} {
upvar #0 $w data
set padX 2
set padY 2
tixIconView:ArrangeGrid $w $padX $padY
if {$adjust} {
tixCallMethod $w adjustscrollregion
}
}
# the items are not packed
#
proc tixIconView:ArrangeGrid {w padX padY} {
upvar #0 $w data
set maxW 0
set maxH 0
foreach item [$data(w:canvas) find all] {
set box [$data(w:canvas) bbox $item]
set itemW [expr [lindex $box 2]-[lindex $box 0]+1]
set itemH [expr [lindex $box 3]-[lindex $box 1]+1]
if {$maxW < $itemW} {
set maxW $itemW
}
if {$maxH < $itemH} {
set maxH $itemH
}
}
if {$maxW == 0 || $maxH == 0} {
return
}
set winW [tixWinWidth $data(w:canvas)]
set bd [expr [$data(w:canvas) cget -bd]+\
[$data(w:canvas) cget -highlightthickness]]
set cols [expr $winW / ($maxW+$padX)]
if {$cols < 1} {
set cols 1
}
set y $bd
set c 0
set x $bd
foreach item [$data(w:canvas) find all] {
set box [$data(w:canvas) bbox $item]
set itemW [expr [lindex $box 2]-[lindex $box 0]+1]
set itemH [expr [lindex $box 3]-[lindex $box 1]+1]
set iX [expr $x + $padX + ($maxW-$itemW)/2]
set iY [expr $y + $padY + ($maxH-$itemH) ]
$data(w:canvas) coords $item $iX $iY
incr c
incr x [expr $maxW + $padY]
if {$c == $cols} {
set c 0
incr y [expr $maxH + $padY]
set x $bd
}
}
}
# the items are packed
#
proc tixIconView:ArrangePack {w padX padY} {
upvar #0 $w data
set winW [tixWinWidth $data(w:canvas)]
set bd [expr [$data(w:canvas) cget -bd]+\
[$data(w:canvas) cget -highlightthickness]]
set y [expr $bd + $padY]
set maxH 0
set usedW $padX
set row ""
foreach item [$data(w:canvas) find all] {
set box [$data(w:canvas) bbox $item]
set itemW [expr [lindex $box 2]-[lindex $box 0]+1]
set itemH [expr [lindex $box 3]-[lindex $box 1]+1]
if {[expr $usedW + $itemW] > $winW} {
if {$row == ""} {
# only one item in this row
#
$data(w:canvas) coords $item [expr $bd + $padX] $y
incr y [expr $itemH+$padY]
continue
} else {
# this item is not in this row. Arrange the previous items
# first
#
tixIconView:PackOneRow $w $row $y $maxH $bd $padX $padY
incr y $maxH
set row ""
set maxH 0
set usedW $padX
}
}
lappend row $item
if {$maxH < $itemH} {
set maxH $itemH
}
incr usedW [expr $padX+$itemW]
}
if {$row != ""} {
tixIconView:PackOneRow $w $row $y $maxH $bd $padX $padY
}
}
#----------------------------------------------------------------------
#
# Widget commands
#----------------------------------------------------------------------
#----------------------------------------------------------------------
#
# Private Methods
#----------------------------------------------------------------------
Tix8.4.3/ResizeH.tcl 0000644 00000031677 15173441414 0010002 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: ResizeH.tcl,v 1.3 2001/12/09 05:04:02 idiscovery Exp $
#
# ResizeH.tcl --
#
# tixResizeHandle: A general purpose "resizing handle"
# widget. You can use it to resize pictures, widgets, etc. When
# using it to resize a widget, you can use the "attachwidget"
# command to attach it to a widget and it will handle all the
# events for you.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
#
tixWidgetClass tixResizeHandle {
-classname TixResizeHandle
-superclass tixVResize
-method {
attachwidget detachwidget hide show
}
-flag {
-command -cursorfg -cursorbg -handlesize -hintcolor -hintwidth -x -y
}
-configspec {
{-command command Command ""}
{-cursorfg cursorFg CursorColor white}
{-cursorbg cursorBg CursorColor red}
{-handlesize handleSize HandleSize 6}
{-hintcolor hintColor HintColor red}
{-hintwidth hintWidth HintWidth 1}
{-x x X 0}
{-y y Y 0}
}
}
proc tixResizeHandle:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(shown) 0
set data(widget) ""
}
proc tixResizeHandle:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
# Create the hints
#
set data(w_ht) $w:tix_priv_ht
set data(w_hb) $w:tix_priv_hb
set data(w_hl) $w:tix_priv_hl
set data(w_hr) $w:tix_priv_hr
frame $data(w_ht) -height $data(-hintwidth) -bg $data(-background)
frame $data(w_hb) -height $data(-hintwidth) -bg $data(-background)
frame $data(w_hl) -width $data(-hintwidth) -bg $data(-background)
frame $data(w_hr) -width $data(-hintwidth) -bg $data(-background)
# Create the corner resize handles
#
set data(w_r00) $w
# Windows don't like this
# $data(rootCmd) config\
# -cursor "top_left_corner $data(-cursorbg) $data(-cursorfg)"
$data(rootCmd) config -cursor top_left_corner
set data(w_r01) $w:tix_priv_01
set data(w_r10) $w:tix_priv_10
set data(w_r11) $w:tix_priv_11
frame $data(w_r01) -relief $data(-relief) -bd $data(-borderwidth) \
-cursor "bottom_left_corner"\
-bg $data(-background)
frame $data(w_r10) -relief $data(-relief) -bd $data(-borderwidth) \
-cursor "top_right_corner"\
-bg $data(-background)
frame $data(w_r11) -relief $data(-relief) -bd $data(-borderwidth) \
-cursor "bottom_right_corner"\
-bg $data(-background)
# Create the border resize handles
#
set data(w_bt) $w:tix_priv_bt
set data(w_bb) $w:tix_priv_bb
set data(w_bl) $w:tix_priv_bl
set data(w_br) $w:tix_priv_br
frame $data(w_bt) -relief $data(-relief) -bd $data(-borderwidth) \
-cursor "top_side"\
-bg $data(-background)
frame $data(w_bb) -relief $data(-relief) -bd $data(-borderwidth) \
-cursor "bottom_side"\
-bg $data(-background)
frame $data(w_bl) -relief $data(-relief) -bd $data(-borderwidth) \
-cursor "left_side"\
-bg $data(-background)
frame $data(w_br) -relief $data(-relief) -bd $data(-borderwidth) \
-cursor "right_side"\
-bg $data(-background)
}
proc tixResizeHandle:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
bind $data(w_r00) <1> \
"tixResizeHandle:dragstart $w $data(w_r00) 1 %X %Y {1 1 -1 -1}"
bind $data(w_r01) <1> \
"tixResizeHandle:dragstart $w $data(w_r01) 1 %X %Y {1 0 -1 1}"
bind $data(w_r10) <1> \
"tixResizeHandle:dragstart $w $data(w_r10) 1 %X %Y {0 1 1 -1}"
bind $data(w_r11) <1> \
"tixResizeHandle:dragstart $w $data(w_r11) 1 %X %Y {0 0 1 1}"
bind $data(w_bt) <1> \
"tixResizeHandle:dragstart $w $data(w_bt) 1 %X %Y {0 1 0 -1}"
bind $data(w_bb) <1> \
"tixResizeHandle:dragstart $w $data(w_bb) 1 %X %Y {0 0 0 1}"
bind $data(w_bl) <1> \
"tixResizeHandle:dragstart $w $data(w_bl) 1 %X %Y {1 0 -1 0}"
bind $data(w_br) <1> \
"tixResizeHandle:dragstart $w $data(w_br) 1 %X %Y {0 0 1 0}"
foreach win [list \
$data(w_r00)\
$data(w_r01)\
$data(w_r10)\
$data(w_r11)\
$data(w_bt)\
$data(w_bb)\
$data(w_bl)\
$data(w_br)\
] {
bind $win <B1-Motion> "tixVResize:drag $w %X %Y"
bind $win <ButtonRelease-1> "tixVResize:dragend $w $win 0 %X %Y"
bind $win <Any-Escape> "tixVResize:dragend $w $win 1 0 0"
}
}
#----------------------------------------------------------------------
# Config Methods
#----------------------------------------------------------------------
proc tixResizeHandle:config-width {w value} {
tixWidgetDoWhenIdle tixResizeHandle:ComposeWindow $w
}
proc tixResizeHandle:config-height {w value} {
tixWidgetDoWhenIdle tixResizeHandle:ComposeWindow $w
}
proc tixResizeHandle:config-x {w value} {
tixWidgetDoWhenIdle tixResizeHandle:ComposeWindow $w
}
proc tixResizeHandle:config-y {w value} {
tixWidgetDoWhenIdle tixResizeHandle:ComposeWindow $w
}
#----------------------------------------------------------------------
# Public Methods
#----------------------------------------------------------------------
proc tixResizeHandle:dragstart {w win depress rootx rooty mrect} {
upvar #0 $w data
set wx $data(-x)
set wy $data(-y)
set ww $data(-width)
set wh $data(-height)
tixVResize:dragstart $w $win $depress $rootx $rooty \
[list $wx $wy $ww $wh] $mrect
}
# tixDeleteBindTag --
#
# Delete the bindtag(s) in the args list from the bindtags of the widget
#
proc tixDeleteBindTag {w args} {
if {![winfo exists $w]} {
return
}
set newtags ""
foreach tag [bindtags $w] {
if {[lsearch $args $tag] == -1} {
lappend newtags $tag
}
}
bindtags $w $newtags
}
proc tixAddBindTag {w args} {
bindtags $w [concat [bindtags $w] $args]
}
proc tixResizeHandle:attachwidget {w widget args} {
upvar #0 $w data
set opt(-move) 0
tixHandleOptions opt {-move} $args
if {$data(widget) != ""} {
tixDeleteBindTag $data(widget) TixResizeHandleTag:$w
}
set data(widget) $widget
if {$data(widget) != ""} {
# Just in case TixResizeHandleTag was already there
tixDeleteBindTag $data(widget) TixResizeHandleTag:$w
tixAddBindTag $data(widget) TixResizeHandleTag:$w
set data(-x) [winfo x $data(widget)]
set data(-y) [winfo y $data(widget)]
set data(-width) [winfo width $data(widget)]
set data(-height) [winfo height $data(widget)]
tixResizeHandle:show $w
tixResizeHandle:ComposeWindow $w
# Now set the bindings
#
if {$opt(-move)} {
bind TixResizeHandleTag:$w <1> \
"tixResizeHandle:Attach $w %X %Y"
bind TixResizeHandleTag:$w <B1-Motion> \
"tixResizeHandle:BMotion $w %X %Y"
bind TixResizeHandleTag:$w <Any-Escape> \
"tixResizeHandle:BRelease $w 1 %X %Y"
bind TixResizeHandleTag:$w <ButtonRelease-1>\
"tixResizeHandle:BRelease $w 0 %X %Y"
} else {
# if "move" is false, then the widget won't be moved as a whole --
# ResizeHandle will only move its sides
bind TixResizeHandleTag:$w <1> {;}
bind TixResizeHandleTag:$w <B1-Motion> {;}
bind TixResizeHandleTag:$w <Any-Escape> {;}
bind TixResizeHandleTag:$w <ButtonRelease-1> {;}
}
}
}
proc tixResizeHandle:detachwidget {w} {
upvar #0 $w data
if {$data(widget) != ""} {
tixDeleteBindTag $data(widget) TixResizeHandleTag:$w
}
tixResizeHandle:hide $w
}
proc tixResizeHandle:show {w} {
upvar #0 $w data
set data(shown) 1
raise $data(w_ht)
raise $data(w_hb)
raise $data(w_hl)
raise $data(w_hr)
raise $data(w_r00)
raise $data(w_r01)
raise $data(w_r10)
raise $data(w_r11)
raise $data(w_bt)
raise $data(w_bb)
raise $data(w_bl)
raise $data(w_br)
# tixCancleIdleTask tixResizeHandle:ComposeWindow $w
tixResizeHandle:ComposeWindow $w
}
proc tixResizeHandle:hide {w} {
upvar #0 $w data
if {!$data(shown)} {
return
}
set data(shown) 0
place forget $data(w_r00)
place forget $data(w_r01)
place forget $data(w_r10)
place forget $data(w_r11)
place forget $data(w_bt)
place forget $data(w_bb)
place forget $data(w_bl)
place forget $data(w_br)
place forget $data(w_ht)
place forget $data(w_hb)
place forget $data(w_hl)
place forget $data(w_hr)
}
proc tixResizeHandle:Destructor {w} {
upvar #0 $w data
if {$data(widget) != ""} {
tixDeleteBindTag $data(widget) TixResizeHandleTag:$w
}
catch {destroy $data(w_r01)}
catch {destroy $data(w_r10)}
catch {destroy $data(w_r11)}
catch {destroy $data(w_bt)}
catch {destroy $data(w_bb)}
catch {destroy $data(w_bl)}
catch {destroy $data(w_br)}
catch {destroy $data(w_ht)}
catch {destroy $data(w_hb)}
catch {destroy $data(w_hl)}
catch {destroy $data(w_hr)}
tixChainMethod $w Destructor
}
#----------------------------------------------------------------------
# Private Methods Dealing With Attached Widgets
#----------------------------------------------------------------------
proc tixResizeHandle:Attach {w rx ry} {
upvar #0 $w data
tixResizeHandle:dragstart $w $data(widget) 0 $rx $ry {1 1 0 0}
}
proc tixResizeHandle:BMotion {w rx ry} {
tixVResize:drag $w $rx $ry
}
proc tixResizeHandle:BRelease {w isAbort rx ry} {
upvar #0 $w data
tixVResize:dragend $w $data(widget) $isAbort $rx $ry
}
#----------------------------------------------------------------------
# Private Methods
#----------------------------------------------------------------------
proc tixResizeHandle:DrawTmpLines {w} {
upvar #0 $w data
# I've seen this error - mike
if {![info exists data(hf:x1)]} {return}
set x1 $data(hf:x1)
if {![info exists data(hf:y1)]} {return}
set y1 $data(hf:y1)
if {![info exists data(hf:x2)]} {return}
set x2 $data(hf:x2)
if {![info exists data(hf:y2)]} {return}
set y2 $data(hf:y2)
tixTmpLine $x1 $y1 $x2 $y1 $w
tixTmpLine $x1 $y2 $x2 $y2 $w
tixTmpLine $x1 $y1 $x1 $y2 $w
tixTmpLine $x2 $y1 $x2 $y2 $w
}
# Place the hint frame to indicate the changes
#
proc tixResizeHandle:SetHintFrame {w x1 y1 width height} {
upvar #0 $w data
# The four sides of the window
#
set x2 [expr "$x1+$width"]
set y2 [expr "$y1+$height"]
set rx [winfo rootx [winfo parent $w]]
set ry [winfo rooty [winfo parent $w]]
incr x1 $rx
incr y1 $ry
incr x2 $rx
incr y2 $ry
if {[info exists data(hf:x1)]} {
tixResizeHandle:DrawTmpLines $w
}
set data(hf:x1) $x1
set data(hf:y1) $y1
set data(hf:x2) $x2
set data(hf:y2) $y2
tixResizeHandle:DrawTmpLines $w
}
proc tixResizeHandle:ShowHintFrame {w} {
upvar #0 $w data
place forget $data(w_ht)
place forget $data(w_hb)
place forget $data(w_hl)
place forget $data(w_hr)
update
}
proc tixResizeHandle:HideHintFrame {w} {
upvar #0 $w data
tixResizeHandle:DrawTmpLines $w
unset data(hf:x1)
unset data(hf:y1)
unset data(hf:x2)
unset data(hf:y2)
}
proc tixResizeHandle:UpdateSize {w x y width height} {
upvar #0 $w data
set data(-x) $x
set data(-y) $y
set data(-width) $width
set data(-height) $height
tixResizeHandle:ComposeWindow $w
if {$data(widget) != ""} {
place $data(widget) -x $x -y $y -width $width -height $height
}
if {$data(-command) != ""} {
eval $data(-command) $x $y $width $height
}
}
proc tixResizeHandle:ComposeWindow {w} {
upvar #0 $w data
set px $data(-x)
set py $data(-y)
set pw $data(-width)
set ph $data(-height)
# Show the hint frames
#
set x1 $px
set y1 $py
set x2 [expr "$px+$pw"]
set y2 [expr "$py+$ph"]
place $data(w_ht) -x $x1 -y $y1 -width $pw -bordermode outside
place $data(w_hb) -x $x1 -y $y2 -width $pw -bordermode outside
place $data(w_hl) -x $x1 -y $y1 -height $ph -bordermode outside
place $data(w_hr) -x $x2 -y $y1 -height $ph -bordermode outside
# Set the four corner resize handles
#
set sz_2 [expr $data(-handlesize)/2]
set x1 [expr "$px - $sz_2"]
set y1 [expr "$py - $sz_2"]
set x2 [expr "$px - $sz_2" + $pw]
set y2 [expr "$py - $sz_2" + $ph]
place $data(w_r00) -x $x1 -y $y1 \
-width $data(-handlesize) -height $data(-handlesize)
place $data(w_r01) -x $x1 -y $y2\
-width $data(-handlesize) -height $data(-handlesize)
place $data(w_r10) -x $x2 -y $y1\
-width $data(-handlesize) -height $data(-handlesize)
place $data(w_r11) -x $x2 -y $y2\
-width $data(-handlesize) -height $data(-handlesize)
# Set the four border resize handles
#
set mx [expr "$px + $pw/2 - $sz_2"]
set my [expr "$py + $ph/2 - $sz_2"]
place $data(w_bt) -x $mx -y $y1 \
-width $data(-handlesize) -height $data(-handlesize)
place $data(w_bb) -x $mx -y $y2 \
-width $data(-handlesize) -height $data(-handlesize)
place $data(w_bl) -x $x1 -y $my \
-width $data(-handlesize) -height $data(-handlesize)
place $data(w_br) -x $x2 -y $my \
-width $data(-handlesize) -height $data(-handlesize)
}
Tix8.4.3/DirTree.tcl 0000644 00000021414 15173441414 0007753 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: DirTree.tcl,v 1.4 2004/03/28 02:44:57 hobbs Exp $
#
# DirTree.tcl --
#
# Implements directory tree for Unix file systems
#
# What the indicators mean:
#
# (+): There are some subdirectories in this directory which are not
# currently visible.
# (-): This directory has some subdirectories and they are all visible
#
# none: The dir has no subdirectori(es).
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
##
## The tixDirTree require special FS handling due to it's limited
## separator idea (instead of real tree).
##
tixWidgetClass tixDirTree {
-classname TixDirTree
-superclass tixVTree
-method {
activate chdir refresh
}
-flag {
-browsecmd -command -directory -disablecallback -showhidden -value
}
-configspec {
{-browsecmd browseCmd BrowseCmd ""}
{-command command Command ""}
{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
{-showhidden showHidden ShowHidden 0 tixVerifyBoolean}
{-value value Value ""}
}
-alias {
{-directory -value}
}
-default {
{.scrollbar auto}
{*Scrollbar.takeFocus 0}
{*borderWidth 1}
{*hlist.indicator 1}
{*hlist.background #c3c3c3}
{*hlist.drawBranch 1}
{*hlist.height 10}
{*hlist.highlightBackground #d9d9d9}
{*hlist.indent 20}
{*hlist.itemType imagetext}
{*hlist.padX 3}
{*hlist.padY 0}
{*hlist.relief sunken}
{*hlist.takeFocus 1}
{*hlist.wideSelection 0}
{*hlist.width 20}
}
}
proc tixDirTree:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
if {$data(-value) == ""} {
set data(-value) [pwd]
}
tixDirTree:SetDir $w [file normalize $data(-value)]
}
proc tixDirTree:ConstructWidget {w} {
upvar #0 $w data
tixChainMethod $w ConstructWidget
tixDoWhenMapped $w [list tixDirTree:StartUp $w]
$data(w:hlist) config -separator [tixFSSep] \
-selectmode "single" -drawbranch 1
# We must creat an extra copy of these images to avoid flashes on
# the screen when user changes directory
#
set data(images) [image create compound -window $data(w:hlist)]
$data(images) add image -image [tix getimage act_fold]
$data(images) add image -image [tix getimage folder]
$data(images) add image -image [tix getimage openfold]
}
proc tixDirTree:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
}
# Add one dir into the node (parent directory), sorted alphabetically
#
proc tixDirTree:AddToList {w fsdir image} {
upvar #0 $w data
set dir [tixFSInternal $fsdir]
if {[$data(w:hlist) info exists $dir]} { return }
set parent [file dirname $fsdir]
if {$fsdir eq $parent} {
# root node
set node ""
} else {
# regular node
set node [tixFSInternal $parent]
}
set added 0
set text [tixFSDisplayFileName $fsdir]
foreach sib [$data(w:hlist) info children $node] {
if {[string compare $dir $sib] < 0} {
$data(w:hlist) add $dir -before $sib -text $text -image $image
set added 1
break
}
}
if {!$added} {
$data(w:hlist) add $dir -text $text -image $image
}
# Check to see if we have children (%% optimize!)
if {[llength [tixFSListDir $fsdir 1 0 0 $data(-showhidden)]]} {
tixVTree:SetMode $w $dir open
}
}
proc tixDirTree:LoadDir {w fsdir {mode toggle}} {
if {![winfo exists $w]} { return }
upvar #0 $w data
# Add the directory and set it to the active directory
#
set fsdir [tixFSNormalize $fsdir]
set dir [tixFSInternal $fsdir]
if {![$data(w:hlist) info exists $dir]} {
# Add $dir and all ancestors of $dir into the HList widget
set fspath ""
set imgopenfold [tix getimage openfold]
foreach part [tixFSAncestors $fsdir] {
set fspath [file join $fspath $part]
tixDirTree:AddToList $w $fspath $imgopenfold
}
}
$data(w:hlist) entryconfig $dir -image [tix getimage act_fold]
if {$mode eq "toggle"} {
if {[llength [$data(w:hlist) info children $dir]]} {
set mode flatten
} else {
set mode expand
}
}
if {$mode eq "expand"} {
# Add all the sub directories of fsdir into the HList widget
tixBusy $w on $data(w:hlist)
set imgfolder [tix getimage folder]
foreach part [tixFSListDir $fsdir 1 0 0 $data(-showhidden)] {
tixDirTree:AddToList $w [file join $fsdir $part] $imgfolder
}
tixWidgetDoWhenIdle tixBusy $w off $data(w:hlist)
# correct indicator to represent children status (added above)
if {[llength [$data(w:hlist) info children $dir]]} {
tixVTree:SetMode $w $dir close
} else {
tixVTree:SetMode $w $dir none
}
} else {
$data(w:hlist) delete offsprings $dir
tixVTree:SetMode $w $dir open
}
}
proc tixDirTree:ToggleDir {w value mode} {
upvar #0 $w data
tixDirTree:LoadDir $w $value $mode
tixDirTree:CallCommand $w
}
proc tixDirTree:CallCommand {w} {
upvar #0 $w data
if {[llength $data(-command)] && !$data(-disablecallback)} {
set bind(specs) {%V}
set bind(%V) $data(-value)
tixEvalCmdBinding $w $data(-command) bind $data(-value)
}
}
proc tixDirTree:CallBrowseCmd {w ent} {
upvar #0 $w data
if {[llength $data(-browsecmd)] && !$data(-disablecallback)} {
set bind(specs) {%V}
set bind(%V) $data(-value)
tixEvalCmdBinding $w $data(-browsecmd) bind [list $data(-value)]
}
}
proc tixDirTree:StartUp {w} {
if {![winfo exists $w]} { return }
upvar #0 $w data
# make sure that all the basic volumes are listed
set imgopenfold [tix getimage openfold]
foreach fspath [tixFSVolumes] {
tixDirTree:AddToList $w $fspath $imgopenfold
}
tixDirTree:LoadDir $w [tixFSExternal $data(i-directory)]
}
proc tixDirTree:ChangeDir {w fsdir {forced 0}} {
upvar #0 $w data
set dir [tixFSInternal $fsdir]
if {!$forced && $data(i-directory) eq $dir} {
return
}
if {!$forced && [$data(w:hlist) info exists $dir]} {
# Set the old directory to "non active"
#
if {[$data(w:hlist) info exists $data(i-directory)]} {
$data(w:hlist) entryconfig $data(i-directory) \
-image [tix getimage folder]
}
$data(w:hlist) entryconfig $dir -image [tix getimage act_fold]
} else {
if {$forced} {
if {[llength [$data(w:hlist) info children $dir]]} {
set mode expand
} else {
set mode flatten
}
} else {
set mode toggle
}
tixDirTree:LoadDir $w $fsdir $mode
tixDirTree:CallCommand $w
}
tixDirTree:SetDir $w $fsdir
}
proc tixDirTree:SetDir {w path} {
upvar #0 $w data
set data(i-directory) [tixFSInternal $path]
set data(-value) [tixFSNativeNorm $path]
}
#----------------------------------------------------------------------
#
# Virtual Methods
#
#----------------------------------------------------------------------
proc tixDirTree:OpenCmd {w ent} {
set fsdir [tixFSExternal $ent]
tixDirTree:ToggleDir $w $fsdir expand
tixDirTree:ChangeDir $w $fsdir
tixDirTree:CallBrowseCmd $w $fsdir
}
proc tixDirTree:CloseCmd {w ent} {
set fsdir [tixFSExternal $ent]
tixDirTree:ToggleDir $w $fsdir flatten
tixDirTree:ChangeDir $w $fsdir
tixDirTree:CallBrowseCmd $w $fsdir
}
proc tixDirTree:Command {w B} {
upvar #0 $w data
upvar $B bind
set ent [tixEvent flag V]
tixChainMethod $w Command $B
if {[llength $data(-command)]} {
set fsdir [tixFSExternal $ent]
tixEvalCmdBinding $w $data(-command) bind $fsdir
}
}
# This is a virtual method
#
proc tixDirTree:BrowseCmd {w B} {
upvar #0 $w data
upvar 1 $B bind
set ent [tixEvent flag V]
set fsdir [tixFSExternal $ent]
# This is a hack because %V may have been modified by callbrowsecmd
set fsdir [file normalize $fsdir]
tixDirTree:ChangeDir $w $fsdir
tixDirTree:CallBrowseCmd $w $fsdir
}
#----------------------------------------------------------------------
#
# Public Methods
#
#----------------------------------------------------------------------
proc tixDirTree:chdir {w value} {
tixDirTree:ChangeDir $w [file normalize $value]
}
proc tixDirTree:refresh {w {dir ""}} {
upvar #0 $w data
if {$dir eq ""} {
set dir $data(-value)
}
set dir [file normalize $dir]
tixDirTree:ChangeDir $w $dir 1
# Delete any stale directories that no longer exist
#
foreach child [$data(w:hlist) info children [tixFSInternal $dir]] {
if {![file exists [tixFSExternal $child]]} {
$data(w:hlist) delete entry $child
}
}
}
proc tixDirTree:config-directory {w value} {
tixDirTree:ChangeDir $w [file normalize $value]
}
Tix8.4.3/OldUtil.tcl 0000644 00000005760 15173441414 0007777 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: OldUtil.tcl,v 1.5 2004/03/28 02:44:57 hobbs Exp $
#
# OldUtil.tcl -
#
# This is an undocumented file.
# Are these features used in Tix : NO.
# Should I use these features : NO.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
proc setenv {name args} {
global env
if {[llength $args] == 1} {
return [set env($name) [lindex $args 0]]
} else {
if {[info exists env($ename)] == 0} {
bgerror "Error in setenv: "
"environment variable \"$name\" does not exist"
} else {
return $env($name)
}
}
}
#----------------------------------------------------------------------
#
#
# U T I L I T Y F U N C T I O N S F O R T I X
#
#
#----------------------------------------------------------------------
# RESET THE STRING IN THE ENTRY
proc tixSetEntry {entry string} {
set oldstate [lindex [$entry config -state] 4]
$entry config -state normal
$entry delete 0 end
$entry insert 0 $string
$entry config -state $oldstate
}
# GET THE FIRST SELECTED ITEM IN A LIST
proc tixListGetSingle {lst} {
set indices [$lst curselection]
if {$indices != ""} {
return [$lst get [lindex $indices 0]]
} else {
return ""
}
}
#----------------------------------------------------------------------
# RECORD A DIALOG'S POSITION AND RESTORE IT THE NEXT TIME IT IS OPENED
#----------------------------------------------------------------------
proc tixDialogRestore {w {flag -geometry}} {
global tixDPos
if {[info exists tixDPos($w)]} {
if {![winfo ismapped $w]} {
wm geometry $w $tixDPos($w)
wm deiconify $w
}
} elseif {$flag eq "-geometry"} {
update
set tixDPos($w) [winfo geometry $w]
} else {
update
set tixDPos($w) +[winfo rootx $w]+[winfo rooty $w]
}
}
#----------------------------------------------------------------------
# RECORD A DIALOG'S POSITION AND RESTORE IT THE NEXT TIME IT IS OPENED
#----------------------------------------------------------------------
proc tixDialogWithdraw {w {flag -geometry}} {
global tixDPos
if {[winfo ismapped $w]} {
if {$flag eq "-geometry"} {
set tixDPos($w) [winfo geometry $w]
} else {
set tixDPos($w) +[winfo rootx $w]+[winfo rooty $w]
}
wm withdraw $w
}
}
#----------------------------------------------------------------------
# RECORD A DIALOG'S POSITION AND RESTORE IT THE NEXT TIME IT IS OPENED
#----------------------------------------------------------------------
proc tixDialogDestroy {w {flag -geometry}} {
global tixDPos
if {[winfo ismapped $w]} {
if {$flag eq "-geometry"} {
set tixDPos($w) [winfo geometry $w]
} else {
set tixDPos($w) +[winfo rootx $w]+[winfo rooty $w]
}
}
destroy $w
}
Tix8.4.3/VResize.tcl 0000644 00000011715 15173441414 0010007 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: VResize.tcl,v 1.3 2004/03/28 02:44:57 hobbs Exp $
#
# VResize.tcl --
#
# tixVResize:
# Virtual base class for all classes that provide resize capability,
# such as the resize handle and the MDI client window.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
# Copyright (c) 2004 ActiveState
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixVResize {
-virtual true
-classname TixVResize
-superclass tixPrimitive
-method {
drag dragend dragstart
}
-flag {
-gridded -gridx -gridy -minwidth -minheight
}
-configspec {
{-gridded gridded Gridded false}
{-gridx gridX Grid 10}
{-gridy gridY Grid 10}
{-minwidth minWidth MinWidth 0}
{-minheight minHeight MinHeight 0}
}
}
proc tixVResize:InitWidgetRec {w} {
upvar #0 $w data
tixChainMethod $w InitWidgetRec
set data(movePending) 0
set data(aborted) 0
set data(depress) 0
}
#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
# Start dragging a window
#
proc tixVResize:dragstart {w win depress rootx rooty wrect mrect} {
upvar #0 $w data
set data(rootx) $rootx
set data(rooty) $rooty
set data(mx) [lindex $mrect 0]
set data(my) [lindex $mrect 1]
set data(mw) [lindex $mrect 2]
set data(mh) [lindex $mrect 3]
set data(fx) [lindex $wrect 0]
set data(fy) [lindex $wrect 1]
set data(fw) [lindex $wrect 2]
set data(fh) [lindex $wrect 3]
set data(old_x) [lindex $wrect 0]
set data(old_y) [lindex $wrect 1]
set data(old_w) [lindex $wrect 2]
set data(old_h) [lindex $wrect 3]
if {$data(mw) < 0} {
set data(maxx) [expr {$data(fx) + $data(old_w) - $data(-minwidth)}]
} else {
set data(maxx) 32000
}
if {$data(mh) < 0} {
set data(maxy) [expr {$data(fy) + $data(old_h) - $data(-minheight)}]
} else {
set data(maxy) 32000
}
set data(aborted) 0
tixCallMethod $w ShowHintFrame
tixCallMethod $w SetHintFrame $data(fx) $data(fy) $data(fw) $data(fh)
# Grab so that all button events are captured
#
grab $win
focus $win
set data(depress) $depress
if {$depress} {
set data(oldRelief) [$win cget -relief]
$win config -relief sunken
}
}
proc tixVResize:drag {w rootx rooty} {
upvar #0 $w data
if {$data(aborted) == 0} {
set data(newrootx) $rootx
set data(newrooty) $rooty
if {$data(movePending) == 0} {
set data(movePending) 1
after 2 tixVResize:DragCompressed $w
}
}
}
proc tixVResize:dragend {w win isAbort rootx rooty} {
upvar #0 $w data
if {$data(aborted)} {
if {$isAbort == 0} {
grab release $win
}
return
}
# Just in case some draggings are not applied.
#
update
tixCallMethod $w HideHintFrame
if {$isAbort} {
set data(aborted) 1
} else {
# Apply the changes
#
tixCallMethod $w UpdateSize $data(fx) $data(fy) $data(fw) $data(fh)
# Release the grab
#
grab release $win
}
if {$data(depress)} {
$win config -relief $data(oldRelief)
}
}
#----------------------------------------------------------------------
# Internal methods
#----------------------------------------------------------------------
proc tixVResize:DragCompressed {w} {
if {![winfo exists $w]} {
return
}
upvar #0 $w data
if {$data(aborted) == 1 || $data(movePending) == 0} {
return
}
set dx [expr {$data(newrootx) - $data(rootx)}]
set dy [expr {$data(newrooty) - $data(rooty)}]
set data(fx) [expr {$data(old_x) + ($dx * $data(mx))}]
set data(fy) [expr {$data(old_y) + ($dy * $data(my))}]
set data(fw) [expr {$data(old_w) + ($dx * $data(mw))}]
set data(fh) [expr {$data(old_h) + ($dy * $data(mh))}]
if {$data(fw) < $data(-minwidth)} {
set data(fw) $data(-minwidth)
}
if {$data(fh) < $data(-minheight)} {
set data(fh) $data(-minheight)
}
if {$data(fx) > $data(maxx)} {
set data(fx) $data(maxx)
}
if {$data(fy) > $data(maxy)} {
set data(fy) $data(maxy)
}
# If we need grid, set x,y,w,h to fit the grid
#
# *note* grid overrides minwidth and maxwidth ...
#
if {$data(-gridded)} {
set data(fx) [expr {round(double($data(fx))/$data(-gridx)) * $data(-gridx)}]
set data(fy) [expr {round(double($data(fy))/$data(-gridy)) * $data(-gridy)}]
set fx2 [expr {$data(fx) + $data(fw) - 2}]
set fy2 [expr {$data(fy) + $data(fh) - 2}]
set fx2 [expr {round(double($fx2)/$data(-gridx)) * $data(-gridx)}]
set fy2 [expr {round(double($fy2)/$data(-gridy)) * $data(-gridy)}]
set data(fw) [expr {$fx2 - $data(fx) + 1}]
set data(fh) [expr {$fy2 - $data(fy) + 1}]
}
tixCallMethod $w SetHintFrame $data(fx) $data(fy) $data(fw) $data(fh)
update idletasks
set data(movePending) 0
}
Tix8.4.3/FileDlg.tcl 0000644 00000004211 15173441414 0007717 0 ustar 00 # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: FileDlg.tcl,v 1.3 2001/12/09 05:04:02 idiscovery Exp $
#
# FileDlg.tcl --
#
# Implements the File Selection Dialog widget.
#
# Copyright (c) 1993-1999 Ioi Kim Lam.
# Copyright (c) 2000-2001 Tix Project Group.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
tixWidgetClass tixFileSelectDialog {
-classname TixFileSelectDialog
-superclass tixStdDialogShell
-method {
}
-flag {
-command
}
-configspec {
{-command command Command ""}
{-title title Title "Select A File"}
}
}
proc tixFileSelectDialog:ConstructTopFrame {w frame} {
upvar #0 $w data
tixChainMethod $w ConstructTopFrame $frame
set data(w:fsbox) [tixFileSelectBox $frame.fsbox \
-command [list tixFileSelectDialog:Invoke $w]]
pack $data(w:fsbox) -expand yes -fill both
}
proc tixFileSelectDialog:SetBindings {w} {
upvar #0 $w data
tixChainMethod $w SetBindings
$data(w:btns) subwidget ok config -command "$data(w:fsbox) invoke" \
-underline 0
$data(w:btns) subwidget apply config -command "$data(w:fsbox) filter" \
-text Filter -underline 0
$data(w:btns) subwidget cancel config -command "wm withdraw $w" \
-underline 0
$data(w:btns) subwidget help config -underline 0
bind $w <Alt-Key-l> "focus [$data(w:fsbox) subwidget filelist]"
bind $w <Alt-Key-d> "focus [$data(w:fsbox) subwidget dirlist]"
bind $w <Alt-Key-s> "focus [$data(w:fsbox) subwidget selection]"
bind $w <Alt-Key-t> "focus [$data(w:fsbox) subwidget filter]"
bind $w <Alt-Key-o> "tkButtonInvoke [$data(w:btns) subwidget ok]"
bind $w <Alt-Key-f> "tkButtonInvoke [$data(w:btns) subwidget apply]"
bind $w <Alt-Key-c> "tkButtonInvoke [$data(w:btns) subwidget cancel]"
bind $w <Alt-Key-h> "tkButtonInvoke [$data(w:btns) subwidget help]"
}
proc tixFileSelectDialog:Invoke {w filename} {
upvar #0 $w data
wm withdraw $w
if {$data(-command) != ""} {
set bind(specs) "%V"
set bind(%V) $filename
tixEvalCmdBinding $w $data(-command) bind $filename
}
}
libTix.so 0000755 00001252460 15173441414 0006363 0 ustar 00 ELF >