set binder_filt_s 0
set binder_filt_f 2

proc binder_setFiltCL {tl} {
	global binder_browseMode

	if {$binder_browseMode=="iconMode"} {
		binder_reDraw
	} else {
		binder_reDraw2
	}

	destroy $tl
}

proc binder_setFilt {} {
	global binder_filt_s binder_filt_f

	set tl .filt

	if {[winfo exists $tl]} {
		raise $tl
		return
	} else {
		toplevel $tl -bd 5 -relief flat
	}

	wm title .filt "Filter setting"

	grid [frame $tl.f0] -padx 5 -column 0 -row 0 -sticky news

	pack [label $tl.f0.l0 -text "Sorting"] -fill both
	pack [radiobutton $tl.f0.rb0 -text "Folder -> File" \
		-variable binder_filt_s -value 0]
	pack [radiobutton $tl.f0.rb1 -text "File -> Folder" \
		-variable binder_filt_s -value 1] 

	grid [frame $tl.f1] -padx 5 -column 1 -row 0 -sticky news

	pack [label $tl.f1.l0 -text "Filtering"] -fill both
	pack [frame $tl.f1.f0] -fill both

	pack [radiobutton $tl.f1.f0.rb2 -text "Raw" \
		-variable binder_filt_f -value 0] -side left
	pack [frame $tl.f1.f1] -fill both
	pack [radiobutton $tl.f1.f1.rb3 -text "Hide dot file" \
		-variable binder_filt_f -value 1] -side left
	pack [frame $tl.f1.f2] -fill both
	pack [radiobutton $tl.f1.f2.rb4 -text "Hide dot and backup" \
		-variable binder_filt_f -value 2] -side left
	pack [frame $tl.f1.f3] -fill both
	pack [radiobutton $tl.f1.f3.rb5 -text "Show backup only" \
		-variable binder_filt_f -value 3] -side left

	grid [frame $tl.f2] \
		-column 0 -row 1 -columnspan 2 -sticky news

	pack [button $tl.f2.b0 -command "binder_setFiltCL $tl" -text "Accept"] \
		-side right -padx 10
}

