2 #package require -exact Itcl 3.1
3 #package require -exact Itk 3.1
4 #namespace import -force itcl::*
5 #namespace import -force itk::*
7 source "boilerplate.tcl"
11 pg_sql
::Pg_sql sql
-dbname "testnett" -user ""
17 proc onselect_id
{row_id
} {
18 puts "Got onselect_id: ($row_id)"
20 set inf
[list id
$row_id]
21 set tmp
[sql getlist
"
28 id = '[sql quote $row_id]'
30 lappend inf data
[lindex [lindex $tmp 0] 0] \
31 path
[lindex [lindex $tmp 0] 1]
33 .f.details set_data
$inf
38 proc dump_selection
{} {
39 puts "current selection: ([.f.bt get_selected_items])"
42 set ds
[tlc
::Datasource_sql ::#auto -sql_obj sql \
44 Path
{path combobox
-choices {bank user
} -initial_choice bank
}
46 "Require match on all criteria" {boolean checkbox
}
60 -insert_query "insert into hconfig (
69 -update_query "update hconfig set
72 datatypes='%datatypes%'
82 "Require match on all criteria" {boolean checkbox
}
83 Leafnode
{leaf checkbox
}
87 -full_row_query "select
99 $ds set_criteria_values
"path user boolean or data {}"
100 $ds set_criteria_map
"boolean {1 and 0 or}"
101 frame .f
-relief groove
-borderwidth 4
103 set tv
[tlc
::Browse_treeview_flat .f.bt
\
106 -criteriapos {9,10 -pady {0 15} -anchor e
-padx {5 25}} \
107 -filterpos {8,10 -pady {0 15} -anchor e
-padx {5 25}}\
108 -filter_insensitive 1\
111 set sr
[$tv selected_ref
]
112 $tv action_add
"Print" print
113 $tv action_attach_signal
"Print" $sr
114 $tv action_add_supported
115 $tv filter_add
"Path" path
{[string first
$filter(path
) $row(path
)] > -1}
116 $tv filter_add_standard
"Data Types" datatypes
{match_left
}
117 #$tv filter_add "Path2" {path2} {1}
119 Form .f.details
-schema {
124 .f.details attach_signal
[.f.bt selected_ref
]
127 .f.bt
1,1 -fill both
\
129 table configure .f c2
-resize none
131 .f.bt register_handler onselect_id onselect_id
134 button .
exit -command "destroy ." -text "Exit"
135 button .style
-command "$tv style_tree web"
138 .style
2,1 -anchor w
\
140 table configure . c2 r2
-resize none
142 bind .
<Escape
> "destroy ."
143 . configure
-height 480 -width 640