/home/lnzliplg/www/tcl8.6.zip
PK ��\-ϟ� 8 8 Tix8.4.3/FileBox.tclnu �[��� # -*- 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
}
PK ��\�7ND: : Tix8.4.3/Shell.tclnu �[��� # -*- 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
}
PK ��\8�No
o
Tix8.4.3/BtnBox.tclnu �[��� # -*- 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
}
PK ��\�LmTx x Tix8.4.3/MultView.tclnu �[��� # -*- 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"
}
PK ��\���� � Tix8.4.3/SimpDlg.tclnu �[��� # -*- 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
}
PK ��\ʯn�* * Tix8.4.3/Meter.tclnu �[��� # -*- 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
}
PK ��\��i� � Tix8.4.3/StackWin.tclnu �[��� # -*- 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
}
PK ��\!�,�� � Tix8.4.3/bitmaps/plus.xpmnu �[��� /* XPM */
static char * plus_xpm[] = {
"9 9 2 1",
". s None c None",
" c black",
" ",
" ....... ",
" ... ... ",
" ... ... ",
" . . ",
" ... ... ",
" ... ... ",
" ....... ",
" "};
PK ��\�Ӳ�� � Tix8.4.3/bitmaps/plus.xbmnu �[��� #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};
PK ��\i~��� � Tix8.4.3/bitmaps/harddisk.xbmnu �[��� #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};
PK ��\o� O O Tix8.4.3/bitmaps/textfile.gifnu �[��� GIF89a � ��� ��� !� , D�k�X{� ��Ɔx\Wq ��䇝�^g ;PK ��\:ue)� � Tix8.4.3/bitmaps/act_fold.xpmnu �[��� /* 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.. ",
"............. "};
PK ��\z��>{ { Tix8.4.3/bitmaps/balarrow.xbmnu �[��� #define balarrow_width 6
#define balarrow_height 6
static char balarrow_bits[] = {
0x1f, 0x07, 0x07, 0x09, 0x11, 0x20};
PK ��\��� � Tix8.4.3/bitmaps/mktransgif.tclnu �[��� #
# $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"
}
}
PK ��\��KI� � Tix8.4.3/bitmaps/hourglas.xbmnu �[��� #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};
PK ��\�uM^� � Tix8.4.3/bitmaps/ck_off.xbmnu �[��� #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};
PK ��\m>�� � Tix8.4.3/bitmaps/minus.xpmnu �[��� /* XPM */
static char * minus_xpm[] = {
"9 9 2 1",
". s None c None",
" c black",
" ",
" ....... ",
" ....... ",
" ....... ",
" . . ",
" ....... ",
" ....... ",
" ....... ",
" "};
PK ��\��Dâ � Tix8.4.3/bitmaps/openfold.xpmnu �[��� /* 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.. ",
"............. "};
PK ��\���: : Tix8.4.3/bitmaps/plus.gifnu �[��� GIF89a � ��� !� , �����
"Ks�,�S ;PK ��\'�W�� � Tix8.4.3/bitmaps/minus.xbmnu �[��� #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};
PK ��\g��� � Tix8.4.3/bitmaps/srcfile.xbmnu �[��� #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};
PK ��\䷢P* * Tix8.4.3/bitmaps/file.xpmnu �[��� /* 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. ",
" .......... "};
PK ��\0
՝� � Tix8.4.3/bitmaps/ck_def.xbmnu �[��� #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};
PK ��\�ږ Tix8.4.3/bitmaps/restore.xbmnu �[��� #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};
PK ��\���<