text $w.top.t -width 60 -height 10 -wrap word -relief flat -borderwidth 0 \
-font fixed -yscroll [list $w.top.s set]
pack $w.top.s -side right -fill y
text $w.top.t -width 60 -height 10 -wrap word -relief flat -borderwidth 0 \
-font fixed -yscroll [list $w.top.s set]
pack $w.top.s -side right -fill y
- global font
- set w .tkerrorw
-
- if {[winfo exists $w]} {
- destroy $w
- }
- toplevel $w
- wm title $w "Error"
-
- place-force $w .
- top-down-window $w
-
- label $w.top.b -bitmap error
- message $w.top.t -aspect 300 -text "Error: $err" -font $font(b,bold)
- pack $w.top.b $w.top.t -side left -padx 10 -pady 10
-
- bottom-buttons $w [list {Close} [list destroy $w]] 1
+ global font
+ set w .tkerrorw
+
+ if {[winfo exists $w]} {
+ destroy $w
+ }
+ toplevel $w
+ wm title $w "Error"
+
+ place-force $w .
+ top-down-window $w
+
+ label $w.top.b -bitmap error
+ message $w.top.t -aspect 300 -text "Error: $err" -font $font(b,bold)
+ pack $w.top.b $w.top.t -side left -padx 10 -pady 10
+
+ bottom-buttons $w [list {Close} [list destroy $w]] 1
foreach target [array names profile] {
set timedef [clock seconds]
if {[string first , $target] == -1} {
foreach target [array names profile] {
set timedef [clock seconds]
if {[string first , $target] == -1} {
- if {![info exists profile($target,port)]} {
- foreach n [array names profile Default,*] {
- set profile($target,[string range $n 8 end]) $profile($n)
- }
- set profile($target,description) [lindex $profile($target) 0]
- set profile($target,host) [lindex $profile($target) 1]
- set profile($target,port) [lindex $profile($target) 2]
- set profile($target,authentication) [lindex $profile($target) 3]
- set profile($target,maximumRecordSize) \
- [lindex $profile($target) 4]
- set profile($target,preferredMessageSize) \
- [lindex $profile($target) 5]
- set profile($target,comstack) [lindex $profile($target) 6]
- set profile($target,databases) [lindex $profile($target) 7]
- set profile($target,timeDefine) $timedef
- set profile($target,windowNumber) 1
- }
- unset profile($target)
+ if {![info exists profile($target,port)]} {
+ foreach n [array names profile Default,*] {
+ set profile($target,[string range $n 8 end]) $profile($n)
+ }
+ set profile($target,description) [lindex $profile($target) 0]
+ set profile($target,host) [lindex $profile($target) 1]
+ set profile($target,port) [lindex $profile($target) 2]
+ set profile($target,authentication) [lindex $profile($target) 3]
+ set profile($target,maximumRecordSize) \
+ [lindex $profile($target) 4]
+ set profile($target,preferredMessageSize) \
+ [lindex $profile($target) 5]
+ set profile($target,comstack) [lindex $profile($target) 6]
+ set profile($target,databases) [lindex $profile($target) 7]
+ set profile($target,timeDefine) $timedef
+ set profile($target,windowNumber) 1
+ }
+ unset profile($target)
scrollbar $w.top.s -command [list $w.top.t yview]
pack $w.top.s -side right -fill y
pack $w.top.t -expand yes -fill both
scrollbar $w.top.s -command [list $w.top.t yview]
pack $w.top.s -side right -fill y
pack $w.top.t -expand yes -fill both
frame $w.bot.$i -relief sunken -border 1
pack $w.bot.$i -side left -expand yes -padx 2 -pady 2
button $w.bot.$i.ok -text [lindex $buttonList $i] \
frame $w.bot.$i -relief sunken -border 1
pack $w.bot.$i -side left -expand yes -padx 2 -pady 2
button $w.bot.$i.ok -text [lindex $buttonList $i] \
$w.top.record tag configure marc-id -foreground red
$w.top.record tag configure marc-data -foreground black
$w.top.record tag configure marc-head -font $font(n,bold) \
$w.top.record tag configure marc-id -foreground red
$w.top.record tag configure marc-data -foreground black
$w.top.record tag configure marc-head -font $font(n,bold) \
$w.top.record tag configure marc-pref -font $font(n,normal) -foreground blue
$w.top.record tag configure marc-text -font $font(n,normal) -foreground black
$w.top.record tag configure marc-it -font $font(n,normal) -foreground black
$w.top.record tag configure marc-pref -font $font(n,normal) -foreground blue
$w.top.record tag configure marc-text -font $font(n,normal) -foreground black
$w.top.record tag configure marc-it -font $font(n,normal) -foreground black
- z39 databaseNames $base
- cascade-dblist $target $base
- show-target $target $base
+ z39 databaseNames $base
+ cascade-dblist $target $base
+ show-target $target $base
#proc ready-response-actions {target base}
#This procedure take care of all the actions that should start if connect is succesfull.
proc ready-response-actions {target base} {
#proc ready-response-actions {target base}
#This procedure take care of all the actions that should start if connect is succesfull.
proc ready-response-actions {target base} {
- global profile queryAuto
-# changeQueryButtons $target $base
- configureOptionsSyntax $target $base
- if {[info exists profile($target,AttributeDetails,$base,Bib1Use)] && $queryAuto == 1} {
- changeQueryButtons $target $base
- change-queryInfo $target $base
- query-select 2
- .top.options.m.query.slist entryconfigure 2 -state normal
-# listbuttonx
- } else {
- query-select 0
- .top.options.m.query.slist entryconfigure 2 -state disabled
- }
+ global profile queryAuto attributeTypeSelected
+ configureOptionsSyntax $target $base
+ if {[info exists profile($target,AttributeDetails,$base,Bib1Use)] && $queryAuto == 1} {
+ changeQueryButtons $target $base
+ change-queryInfo $target $base
+ query-select 2
+ .top.options.m.query.slist entryconfigure 2 -state normal
+ } else {
+ query-select 0
+ .top.options.m.query.slist entryconfigure 2 -state disabled
+ }
+ if {[info exists attributeTypeSelected]} {
+ global attribute[set attributeTypeSelected]
+ set attribute$attributeTypeSelected 1
+ } else {
+ global attributeBib1
+ set attributeBib1 1
+ }
- foreach db $profile($target,databases) {
- $w add command -label $db \
- -command [list cascade-dblist-select $target $db]
- }
+ foreach db $profile($target,databases) {
+ $w add command -label $db \
+ -command [list cascade-dblist-select $target $db]
+ }
- if {[string length $profile($nn)]} {
- set ll [expr {[string length $nn] - 6}]
- set n [string range $nn 0 $ll]
-
- set nl $profile($n,windowNumber)
- if {[info exists profile($n,databases)]} {
- set ndb [llength $profile($n,databases)]
- } else {
- set ndb 0
- }
- if {$ndb > 1} {
- .top.target.m.clist add cascade -label $n \
- -menu .top.target.m.clist.$nl
- irmenu .top.target.m.clist.$nl
- foreach b $profile($n,databases) {
- .top.target.m.clist.$nl add command -label $b \
- -command [list reopen-target $n $b]
- }
- } elseif {$ndb == 1} {
- .top.target.m.clist add command -label $n -command \
- [list reopen-target $n [lindex $profile($n,databases) 0]]
- } else {
- .top.target.m.clist add command -label $n -command \
- [list reopen-target $n {}]
- }
- }
+ if {[string length $profile($nn)]} {
+ set ll [expr {[string length $nn] - 6}]
+ set n [string range $nn 0 $ll]
+
+ set nl $profile($n,windowNumber)
+ if {[info exists profile($n,databases)]} {
+ set ndb [llength $profile($n,databases)]
+ } else {
+ set ndb 0
+ }
+ if {$ndb > 1} {
+ .top.target.m.clist add cascade -label $n \
+ -menu .top.target.m.clist.$nl
+ irmenu .top.target.m.clist.$nl
+ foreach b $profile($n,databases) {
+ .top.target.m.clist.$nl add command -label $b \
+ -command [list reopen-target $n $b]
+ }
+ } elseif {$ndb == 1} {
+ .top.target.m.clist add command -label $n -command \
+ [list reopen-target $n [lindex $profile($n,databases) 0]]
+ } else {
+ .top.target.m.clist add command -label $n -command \
+ [list reopen-target $n {}]
+ }
+ }
- set ll [expr {[string length $nn] - 6}]
- set n [string range $nn 0 $ll]
- .top.target.m.slist add command -label $n -command [list protocol-setup $n]
+ set ll [expr {[string length $nn] - 6}]
+ set n [string range $nn 0 $ll]
+ .top.target.m.slist add command -label $n -command [list protocol-setup $n]
}
if {$queryAutoOld == 0 && $queryAuto == 1 && [info exists profile($hostid,AttributeDetails,$currentDb,Bib1Use)] == 0} {
}
if {$queryAutoOld == 0 && $queryAuto == 1 && [info exists profile($hostid,AttributeDetails,$currentDb,Bib1Use)] == 0} {
}
# Procedure cascade-query-list
# Updates the entries below Options|Query to list all query types.
proc cascade-query-list {} {
}
# Procedure cascade-query-list
# Updates the entries below Options|Query to list all query types.
proc cascade-query-list {} {
- if {$n == "Auto"} {
- if {$hostid == "Default"} {
- $w.slist add command -label $n -state disabled -command [list query-setup $i]
- } else {
- $w.slist add command -label $n -command [list query-setup $i]
- }
+ if {$n == "Auto"} {
+ if {$hostid == "Default"} {
+ $w.slist add command -label $n -state disabled -command [list query-setup $i]
+ } else {
+ $w.slist add command -label $n -command [list query-setup $i]
+ }
puts $f "set queryTypes [list $queryTypes]"
puts $f "set queryButtons [list $queryButtons]"
puts $f "set queryInfo [list $queryInfo]"
puts $f "set queryTypes [list $queryTypes]"
puts $f "set queryButtons [list $queryButtons]"
puts $f "set queryInfo [list $queryInfo]"
# user user argument to the $handle function
# Makes an extended listbutton.
proc listbuttonx {button no names handle user} {
# user user argument to the $handle function
# Makes an extended listbutton.
proc listbuttonx {button no names handle user} {
- set width 10
- foreach name $names {
- set buttonName [lindex $name 0]
- if {[string length $buttonName] > $width} {
- set width [string length $buttonName]
- }
- }
+ set width 10
+ foreach name $names {
+ set buttonName [lindex $name 0]
+ if {[string length $buttonName] > $width} {
+ set width [string length $buttonName]
+ }
+ }
if {[winfo exists $button]} {
$button configure -width $width -text [lindex [lindex $names $no] 0]
${button}.m delete 0 last
} else {
menubutton $button -text [lindex [lindex $names $no] 0] \
if {[winfo exists $button]} {
$button configure -width $width -text [lindex [lindex $names $no] 0]
${button}.m delete 0 last
} else {
menubutton $button -text [lindex [lindex $names $no] 0] \
# the user commits the query setup changes by pressing button "Ok".
proc query-setup-action {queryNo} {
global queryButtons queryInfo queryButtonsTmp queryInfoTmp queryButtonsFind \
# the user commits the query setup changes by pressing button "Ok".
proc query-setup-action {queryNo} {
global queryButtons queryInfo queryButtonsTmp queryInfoTmp queryButtonsFind \
set settingsChanged 1
set queryInfo [lreplace $queryInfo $queryNo $queryNo $queryInfoTmp]
set queryButtons [lreplace $queryButtons $queryNo $queryNo $queryButtonsTmp]
if {[info exists profile($hostid,AttributeDetails,$currentDb,Bib1Use)]} {
set settingsChanged 1
set queryInfo [lreplace $queryInfo $queryNo $queryNo $queryInfoTmp]
set queryButtons [lreplace $queryButtons $queryNo $queryNo $queryButtonsTmp]
if {[info exists profile($hostid,AttributeDetails,$currentDb,Bib1Use)]} {
+#This procedure handles selection of what attribute set the user wants to use for searching.
+#queryNo index in the attributeTypes list (also the menu item number in Query|Type).
+proc attribute-select {queryNo} {
+ global attributeTypes attributeTypeSelected
+ set attributeTypeSelected [lindex $attributeTypes $queryNo]
+ foreach type $attributeTypes {
+ global attribute[set type]
+ set attribute$type 0
+ }
+ set attribute[lindex $attributeTypes $queryNo] 1
+}
+
#Substitutes the third element (the Auto element) in queryButtons with
#profile(target,queryButtons,base). The third element in queryInfo is also substituted with
#profile(target,AttributeDetails,base,Bib1Use)
proc changeQueryButtons {target base} {
#Substitutes the third element (the Auto element) in queryButtons with
#profile(target,queryButtons,base). The third element in queryInfo is also substituted with
#profile(target,AttributeDetails,base,Bib1Use)
proc changeQueryButtons {target base} {
- source bib-1.tcl
- global profile queryButtons queryInfo
- if {[info exists profile($target,queryButtons,$base)]} {
- set queryButtons [lreplace $queryButtons 2 2 $profile($target,queryButtons,$base)]
- foreach tag $profile($target,AttributeDetails,$base,Bib1Use) {
- if {$tag < 1037} {
- lappend tempList [list $bib1($tag) 1=$tag]
- }
- }
- set queryInfo [lreplace $queryInfo 2 2 $tempList]
- }
+ source bib-1.tcl
+ global profile queryButtons queryInfo
+ if {[info exists profile($target,queryButtons,$base)]} {
+ set queryButtons [lreplace $queryButtons 2 2 $profile($target,queryButtons,$base)]
+ foreach tag $profile($target,AttributeDetails,$base,Bib1Use) {
+ if {$tag < 1037} {
+ lappend tempList [list $bib1($tag) 1=$tag]
+ }
+ }
+ set queryInfo [lreplace $queryInfo 2 2 $tempList]
+ }
scrollbar $w.top.use.scroll -orient vertical -border 1
pack $w.top.use.label -side top -fill x -padx 2 -pady 2
pack $w.top.use.list -side left -fill both -expand yes -padx 2 -pady 2
scrollbar $w.top.use.scroll -orient vertical -border 1
pack $w.top.use.label -side top -fill x -padx 2 -pady 2
pack $w.top.use.list -side left -fill both -expand yes -padx 2 -pady 2
if {! [winfo exists $w.$i.e]} {
entry $w.$i.e -width 32 -relief sunken -border 1
bind $w.$i.e <FocusIn> [list index-focus-in $w $i]
if {! [winfo exists $w.$i.e]} {
entry $w.$i.e -width 32 -relief sunken -border 1
bind $w.$i.e <FocusIn> [list index-focus-in $w $i]
- global profile syntaxList recordSyntax
- set activate 0
- set i -1
- set w .top.options.m.syntax
- if {[info exists profile($target,RecordSyntaxes,$base)]} {
- foreach syntax $syntaxList {
- incr i
- if {$syntax == "sep"} {continue}
- if {[lsearch $profile($target,RecordSyntaxes,$base) $syntax] != -1} {
- configure-enable-e $w $i
- if {$activate == 0} {
- $w invoke $i
- set recordSyntax $syntax
- set activate 1
- }
- } else {
- configure-disable-e $w $i
- }
- }
- } else {
- foreach syntax $syntaxList {
- incr i
- if {$syntax == "sep"} {continue}
- configure-enable-e $w $i
- }
- $w invoke 0
- }
+ global profile syntaxList recordSyntax
+ set activate 0
+ set i -1
+ set w .top.options.m.syntax
+ if {[info exists profile($target,RecordSyntaxes,$base)]} {
+ foreach syntax $syntaxList {
+ incr i
+ if {$syntax == "sep"} {continue}
+ if {[lsearch $profile($target,RecordSyntaxes,$base) $syntax] != -1} {
+ configure-enable-e $w $i
+ if {$activate == 0} {
+ $w invoke $i
+ set recordSyntax $syntax
+ set activate 1
+ }
+ } else {
+ configure-disable-e $w $i
+ }
+ }
+ } else {
+ foreach syntax $syntaxList {
+ incr i
+ if {$syntax == "sep"} {continue}
+ configure-enable-e $w $i
+ }
+ $w invoke 0
+ }
# Init: Definition of the Options|Query menu.
irmenu .top.options.m.query
.top.options.m.query add cascade -label Select -menu .top.options.m.query.clist
# Init: Definition of the Options|Query menu.
irmenu .top.options.m.query
.top.options.m.query add cascade -label Select -menu .top.options.m.query.clist
.top.options.m.query add cascade -label Edit -menu .top.options.m.query.slist
.top.options.m.query add command -label New -command {query-new}
.top.options.m.query add cascade -label Delete -menu .top.options.m.query.dlist
irmenu .top.options.m.query.slist
.top.options.m.query add cascade -label Edit -menu .top.options.m.query.slist
.top.options.m.query add command -label New -command {query-new}
.top.options.m.query add cascade -label Delete -menu .top.options.m.query.dlist
irmenu .top.options.m.query.slist
- global syntaxList recordSyntax
- set w .top.options.m.syntax
- irmenu $w
- foreach syntax $syntaxList {
- if {$syntax == "sep"} {
- $w add separator
- } else {
- $w add radiobutton -label $syntax -value $syntax -variable recordSyntax
- }
- }
+ global syntaxList recordSyntax
+ set w .top.options.m.syntax
+ irmenu $w
+ foreach syntax $syntaxList {
+ if {$syntax == "sep"} {
+ $w add separator
+ } else {
+ $w add radiobutton -label $syntax -value $syntax -variable recordSyntax
+ }
+ }
irmenu .top.options.m.elements
.top.options.m.elements add radiobutton -label Unspecified \
-value None -variable elementSetNames
irmenu .top.options.m.elements
.top.options.m.elements add radiobutton -label Unspecified \
-value None -variable elementSetNames
scrollbar .data.scroll -command [list .data.record yview]
.data.record configure -takefocus 0
.data.scroll configure -takefocus 0
scrollbar .data.scroll -command [list .data.record yview]
.data.record configure -takefocus 0
.data.scroll configure -takefocus 0