3 # Revision 1.32 1995-06-07 09:16:37 adam
4 # New presentation format.
6 # Revision 1.31 1995/06/06 16:31:09 adam
7 # Bug fix: target names couldn't contain blanks.
10 # Revision 1.30 1995/06/06 11:35:41 adam
11 # Work on scan. Display of old sets.
13 # Revision 1.29 1995/06/05 14:11:18 adam
14 # Bug fix in present-more.
16 # Revision 1.28 1995/06/02 14:52:13 adam
17 # Minor changes really.
19 # Revision 1.27 1995/06/02 14:29:42 adam
20 # Work on scan interface - up/down buttons.
22 # Revision 1.26 1995/06/01 16:36:46 adam
23 # About buttons. Minor bug fixes.
25 # Revision 1.25 1995/05/31 13:09:57 adam
26 # Client searches/presents may be interrupted.
27 # New moving book-logo.
29 # Revision 1.24 1995/05/31 08:36:24 adam
30 # Bug fix in client.tcl: didn't save options on clientrc.tcl.
31 # New method: referenceId. More work on scan.
33 # Revision 1.23 1995/05/29 10:33:41 adam
34 # README and rename of startup script.
36 # Revision 1.22 1995/05/26 11:44:09 adam
37 # Bugs fixed. More work on MARC utilities and queries. Test
38 # client is up-to-date again.
40 # Revision 1.21 1995/05/11 15:34:46 adam
41 # Scan request changed a bit. This version works with RLG.
43 # Revision 1.20 1995/04/21 16:31:57 adam
44 # New radiobutton: protocol (z39v2/SR).
46 # Revision 1.19 1995/04/18 16:11:50 adam
47 # First version of graphical Scan. Some work on query-by-form.
49 # Revision 1.18 1995/04/10 10:50:22 adam
50 # Result-set name defaults to suffix of ir-set name.
51 # Started working on scan. Not finished at this point.
53 # Revision 1.17 1995/03/31 09:34:57 adam
54 # Search-button disabled when there is no connection.
56 # Revision 1.16 1995/03/31 08:56:36 adam
57 # New button "Search".
59 # Revision 1.15 1995/03/28 12:45:22 adam
60 # New ir method failback: called on disconnect/protocol error.
61 # New ir set/get method: protocol: SR / Z3950.
62 # Simple popup and disconnect when failback is invoked.
64 # Revision 1.14 1995/03/22 16:07:55 adam
67 # Revision 1.13 1995/03/21 17:27:26 adam
68 # Short-hand keys in setup.
70 # Revision 1.12 1995/03/21 13:41:03 adam
71 # Comstack cs_create not used too often. Non-blocking connect.
73 # Revision 1.11 1995/03/21 10:39:06 adam
74 # Diagnostic error message displayed with tkerror.
76 # Revision 1.10 1995/03/20 15:24:06 adam
77 # Diagnostic records saved on searchResponse.
79 # Revision 1.9 1995/03/17 18:26:16 adam
80 # Non-blocking i/o used now. Database names popup as cascade items.
82 # Revision 1.8 1995/03/17 15:45:00 adam
83 # Improved target/database setup.
85 # Revision 1.7 1995/03/16 17:54:03 adam
86 # Minor changes really.
88 # Revision 1.6 1995/03/15 19:10:20 adam
89 # Database setup in protocol-setup (rather target setup).
91 # Revision 1.5 1995/03/15 13:59:23 adam
94 # Revision 1.4 1995/03/14 17:32:29 adam
95 # Presentation of full Marc record in popup window.
97 # Revision 1.3 1995/03/12 19:31:52 adam
98 # Pattern matching implemented when retrieving MARC records. More
99 # diagnostic functions.
101 # Revision 1.2 1995/03/10 18:00:15 adam
102 # Actual presentation in line-by-line format. RPN query support.
104 # Revision 1.1 1995/03/09 16:15:07 adam
105 # First presentRequest attempts. Hot-target list.
112 set profile(Default) {{} {} {210} {} 16384 8192 tcpip {} 1 {} {} z39v2}
114 set settingsChanged 0
119 set displayFormat nice
121 set queryTypes {Simple}
122 set queryButtons { { {I 0} {I 1} {I 2} } }
123 set queryInfo { { {Title {1=4}} {Author {1=1}} \
124 {Subject {1=21}} {Any {1=1016}} } }
128 if {[file readable "clientrc.tcl"]} {
129 source "clientrc.tcl"
132 set queryButtonsFind [lindex $queryButtons 0]
133 set queryInfoFind [lindex $queryInfo 0]
135 proc top-down-window {w} {
136 frame $w.top -relief raised -border 1
137 frame $w.bot -relief raised -border 1
139 pack $w.top -side top -fill both -expand yes
140 pack $w.bot -fill both
143 proc top-down-ok-cancel {w ok-action g} {
144 frame $w.bot.left -relief sunken -border 1
145 pack $w.bot.left -side left -expand yes -ipadx 2 -ipady 2 -padx 5 -pady 5
146 button $w.bot.left.ok -width 6 -text {Ok} \
147 -command ${ok-action}
148 pack $w.bot.left.ok -expand yes -ipadx 2 -ipady 2 -padx 3 -pady 3
149 button $w.bot.cancel -width 6 -text {Cancel} \
150 -command "destroy $w"
151 pack $w.bot.cancel -side left -expand yes
159 proc bottom-buttons {w buttonList g} {
161 set l [llength $buttonList]
163 frame $w.bot.$i -relief sunken -border 1
164 pack $w.bot.$i -side left -expand yes -padx 5 -pady 5
165 button $w.bot.$i.ok -text [lindex $buttonList $i] \
166 -command [lindex $buttonList [expr $i+1]]
167 pack $w.bot.$i.ok -expand yes -ipadx 2 -ipady 2 -padx 3 -pady 3 -side left
171 button $w.bot.$i -text [lindex $buttonList $i] \
172 -command [lindex $buttonList [expr $i+1]]
173 pack $w.bot.$i -expand yes -ipadx 2 -ipady 2 -padx 3 -pady 3 -side left
183 proc cancel-operation {} {
189 show-status Cancelled 0 {}
193 proc show-target {target} {
194 .bot.a.target configure -text "$target"
197 proc show-logo {v1} {
204 .bot.logo configure -bitmap @book${v1}
205 after 140 [list show-logo $v1]
209 .bot.logo configure -bitmap @book1
218 proc show-status {status b sb} {
222 .bot.a.status configure -text "$status"
224 if {$busy == 0} {set busy 1}
232 .top.service configure -state normal
233 .mid.search configure -state normal
234 .mid.scan configure -state normal
235 .mid.present configure -state normal
236 if {[winfo exists .scan-window]} {
237 .scan-window.bot.2 configure -state normal
238 .scan-window.bot.4 configure -state normal
242 .top.service configure -state disabled
243 .mid.search configure -state disabled
244 .mid.scan configure -state disabled
245 .mid.present configure -state disabled
247 if {[winfo exists .scan-window]} {
248 .scan-window.bot.2 configure -state disabled
249 .scan-window.bot.4 configure -state disabled
255 proc show-message {msg} {
256 .bot.a.message configure -text "$msg"
259 proc insertWithTags {w text args} {
260 set start [$w index insert]
261 $w insert insert $text
262 foreach tag [$w tag names $start] {
263 $w tag remove $tag $start insert
266 $w tag add $i $start insert
270 proc about-target {} {
271 set w .about-target-w
275 wm title $w "About target"
279 set i [z39 targetImplementationName]
280 label $w.top.in -text "Implementation name: $i"
281 set i [z39 targetImplementationId]
282 label $w.top.ii -text "Implementation id: $i"
283 set i [z39 targetImplementationVersion]
284 label $w.top.iv -text "Implementation version: $i"
286 label $w.top.op -text "Protocol options: $i"
288 pack $w.top.in $w.top.ii $w.top.iv $w.top.op -side top -anchor nw
290 bottom-buttons $w [list {Close} [list destroy $w]] 1
293 proc about-origin {} {
294 set w .about-origin-w
298 wm title $w "About IrTcl"
302 set i [z39 implementationName]
303 label $w.top.in -text "Implementation name: $i"
304 set i [z39 implementationId]
305 label $w.top.ii -text "Implementation id: $i"
307 pack $w.top.in $w.top.ii -side top -anchor nw
309 bottom-buttons $w [list {Close} [list destroy $w]] 1
312 proc display-raw {sno no w} {
314 set r [z39.$sno getMarc $no list * * *]
316 set tag [lindex $line 0]
317 set indicator [lindex $line 1]
318 set fields [lindex $line 2]
320 if {$indicator != ""} {
321 insertWithTags $w "$tag $indicator" marc-tag
323 insertWithTags $w "$tag " marc-tag
325 foreach field $fields {
326 set id [lindex $field 0]
327 set data [lindex $field 1]
329 insertWithTags $w " $id " marc-id
331 set start [$w index insert]
332 insertWithTags $w $data {}
338 proc display-nice {sno no w} {
340 set i [z39.$sno getMarc $no field 245 * a]
343 insertWithTags $w "Title: " marc-tag
344 insertWithTags $w $i marc-data
345 set i [z39.$sno getMarc $no field 245 * b]
347 insertWithTags $w [lindex $i 0] marc-data
351 set i [z39.$sno getMarc $no field 700 * a]
353 set i [z39.$sno getMarc $no field 100 * a]
356 if {[llength $i] > 1} {
357 insertWithTags $w "Authors: " marc-tag
359 insertWithTags $w "Author: " marc-tag
362 insertWithTags $w $x marc-data
366 set i [z39.$sno getMarc $no field 110 * *]
368 insertWithTags $w "Co-Author: " marc-tag
370 insertWithTags $w $x marc-data
375 set i [z39.$sno getMarc $no field 650 * *]
378 insertWithTags $w "Keywords: " marc-tag
383 insertWithTags $w $x marc-data
388 set i [concat [z39.$sno getMarc $no field 260 * a] \
389 [z39.$sno getMarc $no field 260 * b]]
391 insertWithTags $w "Publisher: " marc-tag
393 insertWithTags $w $x marc-data
397 set i [z39.$sno getMarc $no field 020 * a]
399 insertWithTags $w "ISBN: " marc-tag
401 insertWithTags $w $x marc-data
405 set i [z39.$sno getMarc $no field 022 * a]
407 insertWithTags $w "ISSN: " marc-tag
409 insertWithTags $w $x marc-data
413 set i [z39.$sno getMarc $no field 030 * a]
415 insertWithTags $w "CODEN: " marc-tag
417 insertWithTags $w $x marc-data
421 set i [z39.$sno getMarc $no field 015 * a]
423 insertWithTags $w "Ctl number: " marc-tag
425 insertWithTags $w $x marc-data
429 set i [z39.$sno getMarc $no field 010 * a]
431 insertWithTags $w "LC number: " marc-tag
433 insertWithTags $w $x marc-data
439 proc show-full-marc {sno no b} {
443 if {[z39.$sno type $no] != "DB"} {
447 set w .full-marc-$fullMarcSeq
452 if {[winfo exists $w]} {
460 frame $w.top -relief raised -border 1
461 frame $w.bot -relief raised -border 1
463 pack $w.top -side top -fill both -expand yes
464 pack $w.bot -fill both
466 text $w.top.record -width 60 -height 12 -wrap word \
467 -yscrollcommand [list $w.top.s set]
468 scrollbar $w.top.s -command [list $w.top.record yview]
472 $w.top.record tag configure marc-tag -foreground blue
473 $w.top.record tag configure marc-data -foreground black
474 $w.top.record tag configure marc-id -foreground red
476 if {$displayFormat == "nice"} {
477 display-nice $sno $no $w.top.record
479 display-raw $sno $no $w.top.record
482 bind $w.top.record <Return> {destroy .full-marc}
484 pack $w.top.s -side right -fill y
485 pack $w.top.record -expand yes -fill both
487 bottom-buttons $w [list \
488 {Close} [list destroy $w] \
489 {Raw} [list display-raw $sno $no $w.top.record] \
490 {Duplicate} [list show-full-marc $sno $no 1]] 0
492 $w.bot.2 configure -command [list display-raw $sno $no $w.top.record]
493 $w.bot.4 configure -command [list show-full-marc $sno $no 1]
497 proc update-target-hotlist {target} {
500 set len [llength $hotTargets]
502 .top.target.m delete 6 [expr 6+[llength $hotTargets]]
504 set indx [lsearch $hotTargets $target]
506 set hotTargets [lreplace $hotTargets $indx $indx]
508 set hotTargets [linsert $hotTargets 0 $target]
512 proc set-target-hotlist {} {
516 foreach target $hotTargets {
517 .top.target.m add command -label "$i $target" -command \
518 [list reopen-target $target {}]
526 proc reopen-target {target base} {
528 open-target $target $base
529 update-target-hotlist $target
532 proc define-target-action {} {
535 set target [.target-define.top.target.entry get]
539 update-target-hotlist $target
540 foreach n [array names profile] {
546 set seq [lindex $profile(Default) 12]
548 set profile($target) $profile(Default)
549 set profile(Default) [lreplace $profile(Default) 12 12 [incr seq]]
551 protocol-setup $target
552 destroy .target-define
555 proc fail-response {target} {
557 tkerror "Target connection closed or protocol error"
560 proc connect-response {target} {
561 puts "connect-response"
566 proc open-target {target base} {
571 z39 comstack [lindex $profile($target) 6]
572 z39 idAuthentication [lindex $profile($target) 3]
573 z39 maximumRecordSize [lindex $profile($target) 4]
574 z39 preferredMessageSize [lindex $profile($target) 5]
575 puts -nonewline "maximumRecordSize="
576 puts [z39 maximumRecordSize]
577 puts -nonewline "preferredMessageSize="
578 puts [z39 preferredMessageSize]
579 show-status {Connecting} 0 0
581 z39 databaseNames [lindex [lindex $profile($target) 7] 0]
583 z39 databaseNames $base
585 z39 failback [list fail-response $target]
586 z39 callback [list connect-response $target]
587 z39 connect [lindex $profile($target) 1]:[lindex $profile($target) 2]
588 # z39 options search present scan namedResultSets triggerResourceCtrl
589 show-status {Connecting} 1 {}
591 .top.target.m disable 0
592 .top.target.m enable 1
593 .top.target.m enable 2
596 proc close-target {} {
604 show-status {Not connected} 0 0
606 .top.target.m disable 1
607 .top.target.m disable 2
608 .top.target.m enable 0
611 proc load-set-action {} {
615 ir-set z39.$setNo z39
617 set fname [.load-set.top.filename.entry get]
620 show-status {Loading} 1 {}
621 z39.$setNo loadFile $fname
623 set no [z39.$setNo numberOfRecordsReturned]
624 add-title-lines $setNo $no 1
626 set l [format "%-4d %7d" $setNo $no]
627 .top.rset.m add command -label $l \
628 -command [list add-title-lines $setNo 10000 1]
629 show-status {Ready} 0 {}
642 frame $w.top.filename
644 pack $w.top.filename -side top -anchor e -pady 2
646 entry-fields $w.top {filename} \
648 {load-set-action} {destroy .load-set}
650 top-down-ok-cancel $w {load-set-action} 1
654 proc init-request {} {
662 z39 callback {init-response}
663 show-status {Initializing} 1 {}
667 proc init-response {} {
674 show-status {Ready} 0 1
675 if {![z39 initResult]} {
676 set u [z39 userInformationField]
678 tkerror "Connection rejected by target: $u"
682 proc search-request {} {
692 if {$searchEnable == 0} {
695 set query [index-query]
700 ir-set z39.$setNo z39
702 if {[lindex $profile($target) 10] == 1} {
703 z39.$setNo setName $setNo
704 puts "setName=${setNo}"
706 z39.$setNo setName Default
707 puts "setName=Default"
709 if {[lindex $profile($target) 8] == 1} {
710 z39.$setNo queryType rpn
712 if {[lindex $profile($target) 9] == 1} {
713 z39.$setNo queryType ccl
715 z39 callback {search-response}
716 z39.$setNo search $query
717 show-status {Search} 1 0
720 proc scan-request {attr} {
734 if {![winfo exists $w]} {
743 entry $w.top.entry -relief sunken
744 pack $w.top.entry -fill x -padx 4 -pady 2
745 bind $w.top.entry <KeyRelease> [list scan-term-h $attr]
747 listbox $w.top.list -yscrollcommand [list $w.top.scroll set] \
748 -font fixed -geometry 50x14
749 scrollbar $w.top.scroll -orient vertical -border 1
750 pack $w.top.list -side left -fill both -expand yes
751 pack $w.top.scroll -side right -fill y
752 $w.top.scroll config -command [list $w.top.list yview]
754 listbox $w.top.list -font fixed -geometry 60x14
755 pack $w.top.list -side left -fill both -expand yes
758 bottom-buttons $w [list {Close} [list destroy $w] \
759 {Up} [list scan-up $attr] \
760 {Down} [list scan-down $attr]] 0
761 bind $w.top.list <Up> [list scan-up $attr]
762 bind $w.top.list <Down> [list scan-down $attr]
765 z39 callback [list scan-response $attr 0 35]
766 z39.scan numberOfTermsRequested 5
767 z39.scan preferredPositionInResponse 1
768 z39.scan scan "${attr} 0"
770 show-status {Scan} 1 0
773 proc scan-term-h {attr} {
781 set nScanTerm [$w.top.entry get]
782 if {$nScanTerm == $scanTerm} {
785 set scanTerm $nScanTerm
786 z39 callback [list scan-response $attr 0 35]
787 z39.scan numberOfTermsRequested 5
788 z39.scan preferredPositionInResponse 1
789 puts "${attr} \{${scanTerm}\}"
790 if {$scanTerm == ""} {
791 z39.scan scan "${attr} 0"
793 z39.scan scan "${attr} \{${scanTerm}\}"
795 show-status {Scan} 1 0
798 proc scan-response {attr start toget} {
804 puts "In scan-response"
805 set m [z39.scan numberOfEntriesReturned]
811 if {![winfo exists .scan-window]} {
812 show-status {Ready} 0 1
816 set nScanTerm [$w.top.entry get]
817 if {$nScanTerm != $scanTerm} {
818 z39 callback [list scan-response $attr 0 35]
819 z39.scan numberOfTermsRequested 5
820 z39.scan preferredPositionInResponse 1
821 set scanTerm $nScanTerm
822 puts "${attr} \{${scanTerm}\}"
823 if {$scanTerm == ""} {
824 z39.scan scan "${attr} 0"
826 z39.scan scan "${attr} \{${scanTerm}\}"
828 show-status {Scan} 1 0
831 set status [z39.scan scanStatus]
834 show-status {Ready} 0 1
839 for {set i 0} {$i < $m} {incr i} {
840 set term [lindex [z39.scan scanLine $i] 1]
841 set nostr [format " %-6d" [lindex [z39.scan scanLine $i] 2]]
842 $w.top.list insert $i "$nostr $term"
845 $w.top.list yview $scanView
847 $w.top.list delete $start end
848 for {set i 0} {$i < $m} {incr i} {
849 set term [lindex [z39.scan scanLine $i] 1]
850 set nostr [format " %-6d" [lindex [z39.scan scanLine $i] 2]]
851 $w.top.list insert end "$nostr $term"
855 show-status {Ready} 0 1
859 if {$toget > 0 && $m > 1 && $m < $toget} {
860 set ntoget [expr $toget - $m + 1]
862 z39 callback [list scan-response $attr [expr $start + $m - 1] $ntoget]
864 puts "down continue: $q"
866 z39.scan numberOfTermsRequested 10
868 z39.scan numberOfTermsRequested $ntoget
870 z39.scan preferredPositionInResponse 1
871 puts "${attr} \{$q\}"
872 z39.scan scan "${attr} \{$q\}"
875 if {$toget < 0 && $m > 1 && $m < [expr - $toget]} {
876 set ntoget [expr - $toget - $m]
878 z39 callback [list scan-response $attr 0 -$ntoget]
879 set q [string range [$w.top.list get 0] 8 end]
880 puts "up continue: $q"
882 z39.scan numberOfTermsRequested 10
883 z39.scan preferredPositionInResponse 11
885 z39.scan numberOfTermsRequested $ntoget
886 z39.scan preferredPositionInResponse [incr ntoget]
888 puts "${attr} \{$q\}"
889 z39.scan scan "${attr} \{$q\}"
892 show-status {Ready} 0 1
895 proc scan-down {attr} {
899 set scanView [expr $scanView + 5]
900 set s [$w.top.list size]
901 if {$scanView > $s} {
902 z39 callback [list scan-response $attr [expr $s - 1] 25]
903 set q [string range [$w.top.list get [expr $s - 1]] 8 end]
905 z39.scan numberOfTermsRequested 10
906 z39.scan preferredPositionInResponse 1
907 show-status {Scan} 1 0
908 puts "${attr} \{$q\}"
909 z39.scan scan "${attr} \{$q\}"
912 $w.top.list yview $scanView
915 proc scan-up {attr} {
919 set scanView [expr $scanView - 5]
921 z39 callback [list scan-response $attr 0 -25]
922 set q [string range [$w.top.list get 0] 8 end]
924 z39.scan numberOfTermsRequested 10
925 z39.scan preferredPositionInResponse 11
926 show-status {Scan} 1 0
927 z39.scan scan "${attr} \{$q\}"
930 $w.top.list yview $scanView
933 proc search-response {} {
940 puts "In search-response"
942 show-status {Ready} 0 1
943 set setMax [z39.$setNo resultCount]
944 show-message "${setMax} hits"
945 set l [format "%-4d %7d" $setNo $setMax]
946 .top.rset.m add command -label $l \
947 -command [list add-title-lines $setNo 10000 1]
949 set status [z39.$setNo responseStatus]
950 if {[lindex $status 0] == "NSD"} {
951 set code [lindex $status 1]
952 set msg [lindex $status 2]
953 set addinfo [lindex $status 3]
954 tkerror "NSD$code: $msg: $addinfo"
966 z39 callback {present-response}
967 z39.$setNo present $setOffset 1
968 show-status {Retrieve} 1 0
971 proc present-more {number} {
976 puts "setOffset=$setOffset"
982 set max [z39.$setNo resultCount]
983 if {$max <= $setOffset} {
985 puts "setOffset=$setOffset"
992 if {$setMax > $max} {
996 z39 callback {present-response}
998 set toGet [expr $setMax - $setOffset + 1]
1005 z39.$setNo present $setOffset $toGet
1006 show-status {Retrieve} 1 0
1009 proc init-title-lines {} {
1010 .data.list delete 0 end
1013 proc title-press {y setno} {
1014 show-full-marc $setno [expr 1 + [.data.list nearest $y]] 0
1017 proc add-title-lines {setno no offset} {
1019 .bot.a.set configure -text $setno
1020 .data.list delete 0 end
1022 bind .data.list <Double-Button-1> [list title-press %y $setno]
1023 bind .data.list <Button-2> [list title-press %y $setno]
1024 for {set i 0} {$i < $no} {incr i} {
1025 set o [expr $i + $offset]
1026 set type [z39.$setno type $o]
1027 if {$type == "DB"} {
1028 set title [lindex [z39.$setno getMarc $o field 245 * a] 0]
1029 set year [lindex [z39.$setno getMarc $o field 260 * c] 0]
1030 set nostr [format "%5d" $o]
1031 .data.list insert end "$nostr $title - $year"
1032 } elseif {$type == "SD"} {
1033 set err [lindex [z39.$setno diag $o] 1]
1034 set add [lindex [z39.$setno diag $o] 2]
1038 .data.list insert end "Error ${err}${add}"
1039 } elseif {$type == ""} {
1045 proc present-response {} {
1051 puts "In present-response"
1052 set no [z39.$setNo numberOfRecordsReturned]
1053 puts "Returned $no records, setOffset $setOffset"
1054 add-title-lines $setNo $no $setOffset
1055 set setOffset [expr $setOffset + $no]
1056 set status [z39.$setNo responseStatus]
1057 if {[lindex $status 0] == "NSD"} {
1058 show-status {Ready} 0 1
1059 set code [lindex $status 1]
1060 set msg [lindex $status 2]
1061 set addinfo [lindex $status 3]
1062 tkerror "NSD$code: $msg: $addinfo"
1066 show-status {Ready} 0 1
1070 if {$no > 0 && $setOffset <= $setMax} {
1071 puts "present from ${setOffset}"
1072 set toGet [expr $setMax - $setOffset + 1]
1076 z39.$setNo present $setOffset $toGet
1078 show-status {Finished} 0 1
1082 proc left-cursor {w} {
1083 set i [$w index insert]
1090 proc right-cursor {w} {
1091 set i [$w index insert]
1096 proc bind-fields {list returnAction escapeAction} {
1097 set max [expr [llength $list]-1]
1098 for {set i 0} {$i < $max} {incr i} {
1099 bind [lindex $list $i] <Return> $returnAction
1100 bind [lindex $list $i] <Escape> $escapeAction
1101 bind [lindex $list $i] <Tab> [list focus [lindex $list [expr $i+1]]]
1102 bind [lindex $list $i] <Left> [list left-cursor [lindex $list $i]]
1103 bind [lindex $list $i] <Right> [list right-cursor [lindex $list $i]]
1105 bind [lindex $list $i] <Return> $returnAction
1106 bind [lindex $list $i] <Escape> $escapeAction
1107 bind [lindex $list $i] <Tab> [list focus [lindex $list 0]]
1108 bind [lindex $list $i] <Left> [list left-cursor [lindex $list $i]]
1109 bind [lindex $list $i] <Right> [list right-cursor [lindex $list $i]]
1110 focus [lindex $list 0]
1113 proc entry-fields {parent list tlist returnAction escapeAction} {
1116 foreach field $list {
1117 set label ${parent}.${field}.label
1118 set entry ${parent}.${field}.entry
1119 label $label -text [lindex $tlist $i] -anchor e
1120 entry $entry -width 32 -relief sunken
1121 pack $label -side left
1122 pack $entry -side right
1123 lappend alist $entry
1126 bind-fields $alist $returnAction $escapeAction
1129 proc define-target-dialog {} {
1130 set w .target-define
1136 pack $w.top.target \
1137 -side top -anchor e -pady 2
1138 entry-fields $w.top {target} \
1140 {define-target-action} {destroy .target-define}
1141 top-down-ok-cancel $w {define-target-action} 1
1144 proc protocol-setup-action {target} {
1147 global protocolRadioType
1148 global settingsChanged
1151 global ResultSetCheck
1153 set wno [lindex $profile($target) 12]
1157 set settingsChanged 1
1158 set len [$w.top.databases.list size]
1159 for {set i 0} {$i < $len} {incr i} {
1160 lappend b [$w.top.databases.list get $i]
1162 set profile($target) [list [$w.top.description.entry get] \
1163 [$w.top.host.entry get] \
1164 [$w.top.port.entry get] \
1165 [$w.top.idAuthentication.entry get] \
1166 [$w.top.maximumRecordSize.entry get] \
1167 [$w.top.preferredMessageSize.entry get] \
1173 $protocolRadioType \
1177 puts $profile($target)
1181 proc place-force {window parent} {
1182 set g [wm geometry $parent]
1184 set p1 [string first + $g]
1185 set p2 [string last + $g]
1187 set x [expr 40+[string range $g [expr $p1 +1] [expr $p2 -1]]]
1188 set y [expr 60+[string range $g [expr $p2 +1] end]]
1189 wm geometry $window +${x}+${y}
1192 proc add-database-action {target} {
1195 set wno [lindex $profile($target) 12]
1198 $w.top.databases.list insert end \
1199 [.database-select.top.database.entry get]
1200 destroy .database-select
1203 proc add-database {target} {
1206 set w .database-select
1208 set oldFocus [focus]
1211 set wno [lindex $profile($target) 12]
1212 place-force $w .setup-${wno}
1216 frame $w.top.database
1218 pack $w.top.database -side top -anchor e -pady 2
1220 entry-fields $w.top {database} \
1221 {{Database to add:}} \
1222 [list add-database-action $target] {destroy .database-select}
1224 top-down-ok-cancel $w [list add-database-action $target] 1
1228 proc delete-database {target} {
1231 set wno [lindex $profile($target) 12]
1234 foreach i [lsort -decreasing \
1235 [$w.top.databases.list curselection]] {
1236 $w.top.databases.list delete $i
1240 proc protocol-setup {target} {
1244 global protocolRadioType
1247 global ResultSetCheck
1249 set wno [lindex $profile($target) 12]
1254 wm title $w "Setup $target"
1259 if {$target == ""} {
1263 puts $profile($target)
1267 frame $w.top.description
1268 frame $w.top.idAuthentication
1269 frame $w.top.maximumRecordSize
1270 frame $w.top.preferredMessageSize
1271 frame $w.top.cs-type -relief ridge -border 2
1272 frame $w.top.protocol -relief ridge -border 2
1273 frame $w.top.query -relief ridge -border 2
1274 frame $w.top.databases -relief ridge -border 2
1276 # Maximum/preferred/idAuth ...
1277 pack $w.top.description $w.top.host $w.top.port \
1278 $w.top.idAuthentication $w.top.maximumRecordSize \
1279 $w.top.preferredMessageSize -side top -anchor e -pady 2
1281 entry-fields $w.top {description host port idAuthentication \
1282 maximumRecordSize preferredMessageSize} \
1283 {{Description:} {Host:} {Port:} {Id Authentication:} \
1284 {Maximum Record Size:} {Preferred Message Size:}} \
1285 [list protocol-setup-action $target] [list destroy $w]
1287 foreach sub {description host port idAuthentication \
1288 maximumRecordSize preferredMessageSize} {
1290 bind $w.top.$sub.entry <Control-a> [list add-database $target]
1291 bind $w.top.$sub.entry <Control-d> [list delete-database $target]
1293 $w.top.description.entry insert 0 [lindex $profile($target) 0]
1294 $w.top.host.entry insert 0 [lindex $profile($target) 1]
1295 $w.top.port.entry insert 0 [lindex $profile($target) 2]
1296 $w.top.idAuthentication.entry insert 0 [lindex $profile($target) 3]
1297 $w.top.maximumRecordSize.entry insert 0 [lindex $profile($target) 4]
1298 $w.top.preferredMessageSize.entry insert 0 [lindex $profile($target) 5]
1299 set csRadioType [lindex $profile($target) 6]
1300 set RPNCheck [lindex $profile($target) 8]
1301 set CCLCheck [lindex $profile($target) 9]
1302 set ResultSetCheck [lindex $profile($target) 10]
1303 set protocolRadioType [lindex $profile($target) 11]
1304 if {$protocolRadioType == ""} {
1305 set protocolRadioType z39v2
1309 pack $w.top.databases -side left -pady 6 -padx 6 -expand yes -fill both
1311 label $w.top.databases.label -text "Databases"
1312 button $w.top.databases.add -text "Add" \
1313 -command [list add-database $target]
1314 button $w.top.databases.delete -text "Delete" \
1315 -command [list delete-database $target]
1316 listbox $w.top.databases.list -geometry 20x6 \
1317 -yscrollcommand "$w.top.databases.scroll set"
1318 scrollbar $w.top.databases.scroll -orient vertical -border 1
1319 pack $w.top.databases.label -side top -fill x \
1321 pack $w.top.databases.add $w.top.databases.delete -side top -fill x \
1323 pack $w.top.databases.list -side left -fill both -expand yes \
1325 pack $w.top.databases.scroll -side right -fill y \
1327 $w.top.databases.scroll config -command "$w.top.databases.list yview"
1329 foreach b [lindex $profile($target) 7] {
1330 $w.top.databases.list insert end $b
1334 pack $w.top.cs-type -pady 6 -padx 6 -side top -fill x
1336 label $w.top.cs-type.label -text "Transport"
1337 radiobutton $w.top.cs-type.tcpip -text "TCP/IP" -anchor w \
1338 -command {puts tcp/ip} -variable csRadioType -value tcpip
1339 radiobutton $w.top.cs-type.mosi -text "MOSI" -anchor w\
1340 -command {puts mosi} -variable csRadioType -value mosi
1342 pack $w.top.cs-type.label $w.top.cs-type.tcpip $w.top.cs-type.mosi \
1343 -padx 4 -side top -fill x
1346 pack $w.top.protocol -pady 6 -padx 6 -side top -fill x
1348 label $w.top.protocol.label -text "Protocol"
1349 radiobutton $w.top.protocol.z39v2 -text "Z39.50" -anchor w \
1350 -command {puts z39v2} -variable protocolRadioType -value z39v2
1351 radiobutton $w.top.protocol.sr -text "SR" -anchor w \
1352 -command {puts sr} -variable protocolRadioType -value sr
1354 pack $w.top.protocol.label $w.top.protocol.z39v2 $w.top.protocol.sr \
1355 -padx 4 -side top -fill x
1358 pack $w.top.query -pady 6 -padx 6 -side top -fill x
1360 label $w.top.query.label -text "Query support"
1361 checkbutton $w.top.query.c1 -text "RPN query" -anchor w -variable RPNCheck
1362 checkbutton $w.top.query.c2 -text "CCL query" -anchor w -variable CCLCheck
1363 checkbutton $w.top.query.c3 -text "Result sets" -anchor w -variable ResultSetCheck
1365 pack $w.top.query.label -side top
1366 pack $w.top.query.c1 $w.top.query.c2 $w.top.query.c3 \
1367 -padx 4 -side top -fill x
1370 top-down-ok-cancel $w [list protocol-setup-action $target] 0
1373 proc database-select-action {} {
1374 set w .database-select.top
1376 foreach indx [$w.databases.list curselection] {
1377 lappend b [$w.databases.list get $indx]
1380 z39 databaseNames $b
1382 destroy .database-select
1385 proc database-select {} {
1386 set w .database-select
1396 frame $w.top.databases -relief ridge -border 2
1398 pack $w.top.databases -side left -pady 6 -padx 6 -expand yes -fill x
1400 label $w.top.databases.label -text "List"
1401 listbox $w.top.databases.list -geometry 20x6 \
1402 -yscrollcommand "$w.top.databases.scroll set"
1403 scrollbar $w.top.databases.scroll -orient vertical -border 1
1404 pack $w.top.databases.label -side top -fill x \
1406 pack $w.top.databases.list -side left -fill both -expand yes \
1408 pack $w.top.databases.scroll -side right -fill y \
1410 $w.top.databases.scroll config -command "$w.top.databases.list yview"
1412 foreach b [lindex $profile($hostid) 7] {
1413 $w.top.databases.list insert end $b
1415 top-down-ok-cancel $w {database-select-action} 1
1418 proc cascade-target-list {} {
1421 foreach sub [winfo children .top.target.m.clist] {
1422 puts "deleting $sub"
1425 .top.target.m.clist delete 0 last
1426 foreach n [array names profile] {
1427 if {$n != "Default"} {
1428 set nl [string tolower $n]
1429 if {[llength [lindex $profile($n) 7]] > 1} {
1430 .top.target.m.clist add cascade -label $n \
1431 -menu .top.target.m.clist.$nl
1432 menu .top.target.m.clist.$nl
1433 foreach b [lindex $profile($n) 7] {
1434 .top.target.m.clist.$nl add command -label $b \
1435 -command [list reopen-target $n $b]
1438 .top.target.m.clist add command -label $n \
1439 -command [list reopen-target $n {}]
1443 .top.target.m.slist delete 0 last
1444 foreach n [array names profile] {
1445 if {$n != "Default"} {
1446 .top.target.m.slist add command -label $n \
1447 -command [list protocol-setup $n]
1452 proc cascade-query-list {} {
1456 .top.options.m.slist delete 0 last
1457 foreach n $queryTypes {
1458 .top.options.m.slist add command -label $n \
1459 -command [list query-setup $i]
1464 .top.options.m.clist delete 0 last
1465 foreach n $queryTypes {
1466 .top.options.m.clist add command -label $n \
1467 -command [list query-select $i]
1472 proc save-settings {} {
1475 global settingsChanged
1480 set f [open "clientrc.tcl" w]
1481 puts $f "# Setup file"
1482 puts $f "set hotTargets \{ $hotTargets \}"
1484 foreach n [array names profile] {
1485 puts -nonewline $f "set \{profile($n)\} \{"
1486 puts -nonewline $f $profile($n)
1489 puts -nonewline $f "set queryTypes \{"
1490 puts -nonewline $f $queryTypes
1493 puts -nonewline $f "set queryButtons \{"
1494 puts -nonewline $f $queryButtons
1497 puts -nonewline $f "set queryInfo \{"
1498 puts -nonewline $f $queryInfo
1502 set settingsChanged 0
1514 message $w.top.message -text $ask
1516 pack $w.top.message -side left -pady 6 -padx 20 -expand yes -fill x
1519 top-down-ok-cancel $w {alert-action} 1
1523 proc alert-action {} {
1529 proc exit-action {} {
1530 global settingsChanged
1532 if {$settingsChanged} {
1533 set a [alert "you havent saved your settings. Do you wish to save?"]
1541 proc listbuttonaction {w name h user i} {
1542 $w configure -text [lindex $name 0]
1543 $h [lindex $name 1] $user $i
1546 proc listbuttonx {button no names handle user} {
1547 if {[winfo exists $button]} {
1548 $button configure -text [lindex [lindex $names $no] 0]
1549 ${button}.m delete 0 last
1551 menubutton $button -text [lindex [lindex $names $no] 0] \
1552 -width 10 -menu ${button}.m -relief raised -border 1
1556 foreach name $names {
1557 ${button}.m add command -label [lindex $name 0] \
1558 -command [list listbuttonaction ${button} $name \
1564 proc listbutton {button no names} {
1565 menubutton $button -text [lindex $names $no] -width 10 -menu ${button}.m \
1566 -relief raised -border 1
1568 foreach name $names {
1569 ${button}.m add command -label $name \
1570 -command [list ${button} configure -text $name]
1574 proc query-add-index-action {queryNo} {
1575 set w .setup-query-$queryNo
1578 global queryButtonsTmp
1580 lappend queryInfoTmp [list [.query-add-index.top.index.entry get] {}]
1582 destroy .query-add-index
1583 #destroy $w.top.lines
1584 #frame $w.top.lines -relief ridge -border 2
1585 index-lines $w.top.lines 0 $queryButtonsTmp $queryInfoTmp activate-e-index
1586 #pack $w.top.lines -side left -pady 6 -padx 6 -fill y
1589 proc query-add-line {queryNo} {
1590 set w .setup-query-$queryNo
1593 global queryButtonsTmp
1595 lappend queryButtonsTmp {I 0}
1597 #destroy $w.top.lines
1598 #frame $w.top.lines -relief ridge -border 2
1599 index-lines $w.top.lines 0 $queryButtonsTmp $queryInfoTmp activate-e-index
1600 #pack $w.top.lines -side left -pady 6 -padx 6 -fill y
1603 proc query-del-line {queryNo} {
1604 set w .setup-query-$queryNo
1607 global queryButtonsTmp
1609 set l [llength $queryButtonsTmp]
1614 set queryButtonsTmp [lreplace $queryButtonsTmp $l $l]
1615 index-lines $w.top.lines 0 $queryButtonsTmp $queryInfoTmp activate-e-index
1618 proc query-add-index {queryNo} {
1619 set w .query-add-index
1622 place-force $w .setup-query-$queryNo
1626 -side top -anchor e -pady 2
1627 entry-fields $w.top {index} \
1629 [list query-add-index-action $queryNo] {destroy .query-add-index}
1630 top-down-ok-cancel $w [list query-add-index-action $queryNo] 1
1633 proc query-setup-action {queryNo} {
1636 global queryButtonsTmp
1638 global queryButtonsFind
1639 global queryInfoFind
1641 set queryInfo [lreplace $queryInfo $queryNo $queryNo \
1643 set queryButtons [lreplace $queryButtons $queryNo $queryNo \
1645 set queryInfoFind $queryInfoTmp
1646 set queryButtonsFind $queryButtonsTmp
1650 destroy .setup-query-$queryNo
1652 index-lines .lines 1 $queryButtonsFind $queryInfoFind activate-index
1655 proc activate-e-index {value no i} {
1656 global queryButtonsTmp
1658 puts $queryButtonsTmp
1659 set queryButtonsTmp [lreplace $queryButtonsTmp $no $no [list I $i]]
1660 puts $queryButtonsTmp
1666 proc activate-index {value no i} {
1667 global queryButtonsFind
1669 set queryButtonsFind [lreplace $queryButtonsFind $no $no [list I $i]]
1671 puts "queryButtonsFind $queryButtonsFind"
1677 proc query-setup {queryNo} {
1678 set w .setup-query-$queryNo
1680 set queryTypes {Simple}
1683 global queryButtonsTmp
1686 set queryName [lindex $queryTypes $queryNo]
1687 set queryInfoTmp [lindex $queryInfo $queryNo]
1688 set queryButtonsTmp [lindex $queryButtons $queryNo]
1690 #set queryButtons { {I 0 I 1 I 2} }
1691 #set queryInfo { { {Title ti} {Author au} {Subject sh} } }
1695 wm title $w "Query setup $queryName"
1700 frame $w.top.lines -relief ridge -border 2
1701 frame $w.top.use -relief ridge -border 2
1702 frame $w.top.relation -relief ridge -border 2
1703 frame $w.top.position -relief ridge -border 2
1704 frame $w.top.structure -relief ridge -border 2
1705 frame $w.top.truncation -relief ridge -border 2
1706 frame $w.top.completeness -relief ridge -border 2
1710 index-lines $w.top.lines 0 $queryButtonsTmp $queryInfoTmp activate-e-index
1712 pack $w.top.lines -side left -pady 6 -padx 6 -fill y
1715 pack $w.top.use -side left -pady 6 -padx 6 -fill y
1717 label $w.top.use.label -text "Use"
1718 listbox $w.top.use.list -geometry 20x10 \
1719 -yscrollcommand "$w.top.use.scroll set"
1720 scrollbar $w.top.use.scroll -orient vertical -border 1
1721 pack $w.top.use.label -side top -fill x \
1723 pack $w.top.use.list -side left -fill both -expand yes \
1725 pack $w.top.use.scroll -side right -fill y \
1727 $w.top.use.scroll config -command "$w.top.use.list yview"
1729 foreach u {{Personal name} {Corporate name}} {
1730 $w.top.use.list insert end $u
1732 # Relation Attributes
1733 pack $w.top.relation -pady 6 -padx 6 -side top
1735 label $w.top.relation.label -text "Relation" -width 18
1737 listbutton $w.top.relation.b 0\
1738 {{None} {Less than} {Greater than or equal} \
1739 {Equal} {Greater than or equal} {Greater than} {Not equal} \
1741 {Stem} {Relevance} {AlwaysMatches}}
1743 pack $w.top.relation.label $w.top.relation.b -fill x
1745 # Position Attributes
1746 pack $w.top.position -pady 6 -padx 6 -side top
1748 label $w.top.position.label -text "Position" -width 18
1750 listbutton $w.top.position.b 0 {{None} {First in field} {First in subfield}
1751 {Any position in field}}
1753 pack $w.top.position.label $w.top.position.b -fill x
1755 # Structure Attributes
1757 pack $w.top.structure -pady 6 -padx 6 -side top
1759 label $w.top.structure.label -text "Structure" -width 18
1761 listbutton $w.top.structure.b 0 {{None} {Phrase} {Word} {Key} {Year}
1762 {Date (norm)} {Word list} {Date (un-norm)} {Name (norm)} {Date (un-norm)}
1763 {Structure} {urx} {free-form} {doc-text} {local-number} {string}
1766 pack $w.top.structure.label $w.top.structure.b -fill x
1768 # Truncation Attributes
1770 pack $w.top.truncation -pady 6 -padx 6 -side top
1772 label $w.top.truncation.label -text "Truncation" -width 18
1774 listbutton $w.top.truncation.b 0 {{Auto} {Right} {Left} {Left and right} \
1775 {No truncation} {Process #} {Re-1} {Re-2}}
1776 pack $w.top.truncation.label $w.top.truncation.b -fill x
1778 # Completeness Attributes
1780 pack $w.top.completeness -pady 6 -padx 6 -side top
1782 label $w.top.completeness.label -text "Truncation" -width 18
1784 listbutton $w.top.completeness.b 0 {{None} {Incomplete subfield} \
1785 {Complete subfield} {Complete field}}
1786 pack $w.top.completeness.label $w.top.completeness.b -fill x
1789 bottom-buttons $w [list \
1790 {Ok} [list query-setup-action $queryNo] \
1791 {Add index} [list query-add-index $queryNo] \
1792 {Add line} [list query-add-line $queryNo] \
1793 {Delete line} [list query-del-line $queryNo] \
1794 {Cancel} [list destroy $w]] 0
1797 proc index-clear {} {
1798 global queryButtonsFind
1801 foreach b $queryButtonsFind {
1802 .lines.$i.e delete 0 end
1807 proc index-query {} {
1808 global queryButtonsFind
1809 global queryInfoFind
1814 foreach b $queryButtonsFind {
1815 set term [string trim [.lines.$i.e get]]
1817 set attr [lindex [lindex $queryInfoFind [lindex $b 1]] 1]
1819 set term "\{${term}\}"
1821 set term "@attr $a ${term}"
1824 set qs "@and ${qs} ${term}"
1835 proc index-lines {w realOp buttonInfo queryInfo handle} {
1837 foreach b $buttonInfo {
1838 if {! [winfo exists $w.$i]} {
1839 frame $w.$i -background white -border 1
1841 listbuttonx $w.$i.l [lindex $b 1] $queryInfo $handle $i
1844 if {! [winfo exists $w.$i.e]} {
1845 entry $w.$i.e -width 32 -relief sunken -border 1
1846 bind $w.$i.e <FocusIn> [list $w.$i configure \
1848 bind $w.$i.e <FocusOut> [list $w.$i configure \
1850 pack $w.$i.l -side left
1851 pack $w.$i.e -side left -fill x -expand yes
1852 pack $w.$i -side top -fill x -padx 2 -pady 2
1853 bind $w.$i.e <Left> [list left-cursor $w.$i.e]
1854 bind $w.$i.e <Right> [list right-cursor $w.$i.e]
1855 bind $w.$i.e <Return> search-request
1858 pack $w.$i.l -side left
1859 pack $w.$i -side top -fill x -padx 2 -pady 2
1864 while {[winfo exists $w.$j]} {
1875 bind $w.$j.e <Tab> "focus $w.$k.e"
1879 bind $w.$i.e <Tab> "focus $w.0.e"
1884 proc search-fields {w buttondefs} {
1886 foreach buttondef $buttondefs {
1887 frame $w.$i -background white
1889 listbutton $w.$i.l 0 $buttondef
1890 entry $w.$i.e -width 32 -relief sunken
1892 pack $w.$i.l -side left
1893 pack $w.$i.e -side left -fill x -expand yes
1895 pack $w.$i -side top -fill x -padx 2 -pady 2
1897 bind $w.$i.e <Left> [list left-cursor $w.$i.e]
1898 bind $w.$i.e <Right> [list right-cursor $w.$i.e]
1906 bind $w.$j.e <Tab> "focus $w.$k.e \n
1907 $w.$k configure -background red \n
1908 $w.$j configure -background white"
1911 bind $w.$i.e <Tab> "focus $w.0.e \n
1912 $w.0 configure -background red \n
1913 $w.$i configure -background white"
1915 $w.0 configure -background red
1918 frame .top -border 1 -relief raised
1919 frame .lines -border 1 -relief raised
1920 frame .mid -border 1 -relief raised
1921 frame .data -border 1 -relief raised
1922 frame .bot -border 1 -relief raised
1923 pack .top .lines .mid -side top -fill x
1924 pack .data -side top -fill both -expand yes
1927 menubutton .top.file -text "File" -underline 0 -menu .top.file.m
1929 .top.file.m add command -label "Save settings" -command {save-settings}
1930 .top.file.m add separator
1931 .top.file.m add command -label "Exit" -command {exit-action}
1932 .top.file.m add separator
1933 .top.file.m add command -label "About" -command {about-origin}
1935 menubutton .top.target -text "Target" -underline 0 -menu .top.target.m
1937 .top.target.m add cascade -label "Connect" -menu .top.target.m.clist
1938 .top.target.m add command -label "Disconnect" -command {close-target}
1939 .top.target.m add command -label "About" -command {about-target}
1940 .top.target.m add cascade -label "Setup" -menu .top.target.m.slist
1941 .top.target.m add command -label "Setup new" -command {define-target-dialog}
1942 .top.target.m add separator
1945 .top.target.m disable 1
1946 .top.target.m disable 2
1948 menu .top.target.m.clist
1949 menu .top.target.m.slist
1952 menubutton .top.service -text "Service" -underline 0 -menu .top.service.m
1954 .top.service.m add command -label "Database" -command {database-select}
1955 .top.service.m add cascade -label "Query type" -menu .top.service.m.querytype
1956 menu .top.service.m.querytype
1957 .top.service.m.querytype add radiobutton -label "RPN"
1958 .top.service.m.querytype add radiobutton -label "CCL"
1959 .top.service.m add cascade -label "Present" -menu .top.service.m.present
1960 menu .top.service.m.present
1961 .top.service.m.present add command -label "More" \
1962 -command [list present-more 10]
1963 .top.service.m.present add command -label "All" \
1964 -command [list present-more {}]
1965 .top.service configure -state disabled
1967 menubutton .top.rset -text "Set" -menu .top.rset.m
1969 .top.rset.m add command -label "Load" -command {load-set}
1970 .top.rset.m add separator
1972 menubutton .top.options -text "Options" -underline 0 -menu .top.options.m
1974 .top.options.m add cascade -label "Choose query" -menu .top.options.m.clist
1975 .top.options.m add command -label "Define query" -command {new-query-dialog}
1976 .top.options.m add cascade -label "Edit query" -menu .top.options.m.slist
1977 menu .top.options.m.clist
1978 menu .top.options.m.slist
1981 menubutton .top.help -text "Help" -menu .top.help.m
1984 .top.help.m add command -label "Help on help" \
1985 -command {tkerror "Help on help not available. Sorry"}
1986 .top.help.m add command -label "About" \
1987 -command {tkerror "About not available. Sorry"}
1989 pack .top.file .top.target .top.service .top.rset .top.options -side left
1990 pack .top.help -side right
1992 index-lines .lines 1 $queryButtonsFind [lindex $queryInfo 0] activate-index
1994 button .mid.search -width 7 -text {Search} -command search-request \
1996 button .mid.scan -width 7 -text {Scan} \
1997 -command [list scan-request "@attr 1=4 @attr 5=1 @attr 4=1"] -state disabled
1998 button .mid.present -width 7 -text {Present} -command [list present-more 10] \
2001 button .mid.clear -width 7 -text {Clear} -command index-clear
2002 pack .mid.search .mid.scan .mid.present .mid.clear -side left \
2003 -fill y -padx 5 -pady 3
2005 listbox .data.list -yscrollcommand {.data.scroll set} -font fixed -geometry 20x2
2006 scrollbar .data.scroll -orient vertical -border 1
2007 pack .data.list -side left -fill both -expand yes
2008 pack .data.scroll -side right -fill y
2009 .data.scroll config -command {.data.list yview}
2011 button .bot.logo -bitmap @book1 -command cancel-operation
2013 pack .bot.a -side left -fill x
2014 pack .bot.logo -side right -padx 2 -pady 2
2016 message .bot.a.target -text "" -aspect 1000 -border 1
2018 label .bot.a.status -text "Not connected" -width 15 -relief \
2019 sunken -anchor w -border 1
2020 label .bot.a.set -text "" -width 5 -relief \
2021 sunken -anchor w -border 1
2022 label .bot.a.message -text "" -width 15 -relief \
2023 sunken -anchor w -border 1
2025 pack .bot.a.target -side top -anchor nw -padx 2 -pady 2
2026 pack .bot.a.status .bot.a.set .bot.a.message \
2027 -side left -padx 2 -pady 2