# interface generated by SpecTcl version 1.0 from /usr/people/ramsan/tmp/CopyMirror.ui
#   root     is the parent window for this user interface

proc CopyMirror_ui {root args} {

	# this treats "." as a special case

	if {$root == "."} {
	    set base ""
	} else {
	    set base $root
	}
    
	frame $base.frame#3 \
		-borderwidth 2 \
		-relief ridge

	frame $base.frame#5 \
		-borderwidth 2 \
		-relief ridge

	frame $base.frame#1 \
		-borderwidth 2 \
		-relief ridge

	label $base.label#1 \
		-text [_ "First point"]

	label $base.label#2 \
		-text [_ "Num"]:

	entry $base.entry#1 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(Num,1) \
		-width 4

	button $base.button#1 \
		-command {PickPointInMove 1} \
		-disabledforeground grey60 \
		-text [_ "Pick"] -bd 1 -width 2

	label $base.label#3 \
		-text x:

	entry $base.entry#2 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(x,1) \
		-width 8

	label $base.label#4 \
		-text y:

	entry $base.entry#3 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(y,1) \
		-width 8

	label $base.label#5 \
		-text z:

	entry $base.entry#4 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(z,1) \
		-width 8

	label $base.label#22 \
		-text [_ "Second point"]

	label $base.label#20 \
		-text [_ "Num"]:

	entry $base.entry#17 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(Num,2) \
		-width 4

	button $base.button#4 \
		-command {PickPointInMove 2} \
		-disabledforeground grey60 \
		-text [_ "Pick"] -bd 1 -width 2

	label $base.label#24 \
		-text x:

	entry $base.entry#16 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(x,2) \
		-width 8

	label $base.label#23 \
		-text y:

	entry $base.entry#15 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(y,2) \
		-width 8

	label $base.label#21 \
		-text z:

	entry $base.entry#14 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(z,2) \
		-width 8

	checkbutton $base.checkbutton#1 \
		-disabledforeground grey60 \
		-highlightthickness 0 \
		-takefocus 0 \
		-text [_ "Two dimensions"] \
		-variable CopyMoveInfo(TwoDim)

	label $base.label#14 \
		-text [_ "Third point"]

	label $base.label#15 \
		-text [_ "Num"]:

	entry $base.entry#11 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(Num,3) \
		-width 4

	button $base.button#3 \
		-command {PickPointInMove 3} \
		-disabledforeground grey60 \
		-text [_ "Pick"] -bd 1 -width 2
	
	label $base.label#13 \
		-text x:

	entry $base.entry#12 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(x,3) \
		-width 8

	label $base.label#12 \
		-text y:

	entry $base.entry#9 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(y,3) \
		-width 8

	label $base.label#11 \
		-text z:

	entry $base.entry#10 \
		-borderwidth 1 \
		-insertborderwidth 1 \
		-textvariable CopyMoveInfo(z,3) \
		-width 8


	# Geometry management

	grid $base.frame#3 -in $root	-row 5 -column 1  \
		-padx 2 -ipadx 1 \
		-pady 0 -ipady 0
	grid $base.frame#5 -in $root	-row 3 -column 1  \
		-padx 2 -ipadx 1 \
		-pady 0 -ipady 0
	grid $base.frame#1 -in $root	-row 2 -column 1  \
		-padx 2 -ipadx 1 \
		-pady 0 -ipady 0
	
	grid $base.label#1 -in $base.frame#1 -row 1 -column 1 -columnspan 3 \
		-sticky we -padx 2 -pady 0 -ipady 0

	grid $base.label#2 -in $base.frame#1 -row 2 -column 1 \
		-sticky w -padx 2 -pady 0 -ipady 0
	grid $base.entry#1 -in $base.frame#1 -row 3 -column 1 \
		-sticky w -padx 2 -pady 0 -ipady 0

	grid $base.button#1 -in $base.frame#1 -row 4 -column 1 \
		-sticky e -padx 2 -pady 0 -ipady 0

	grid $base.label#3 -in $base.frame#1 -row 2 -column 2 \
		-sticky e -padx 2 -pady 0 -ipady 0
	grid $base.entry#2 -in $base.frame#1 -row 2 -column 3 \
		-sticky w -padx 2 -pady 0 -ipady 0

	grid $base.label#4 -in $base.frame#1 -row 3 -column 2 \
		-sticky e -padx 2 -pady 0 -ipady 0
	grid $base.entry#3 -in $base.frame#1 -row 3 -column 3 \
		-sticky w -padx 2 -pady 0 -ipady 0

	grid $base.label#5 -in $base.frame#1 -row 4 -column 2 \
		-sticky e -padx 2 -pady 0 -ipady 0
	grid $base.entry#4 -in $base.frame#1 -row 4 -column 3 \
		-sticky w -padx 2 -pady 0 -ipady 0
	
	grid $base.label#22 -in $base.frame#5 -row 1 -column 1 -columnspan 3 \
		-sticky we -padx 2 -pady 0 -ipady 0

	grid $base.label#20 -in $base.frame#5 -row 2 -column 1 \
		-sticky w -padx 2 -pady 0 -ipady 0
	grid $base.entry#17 -in $base.frame#5 -row 3 -column 1 \
		-sticky w -padx 2 -pady 0 -ipady 0

	grid $base.button#4 -in $base.frame#5 -row 4 -column 1 \
		-sticky e -padx 2 -pady 0 -ipady 0

	grid $base.label#24 -in $base.frame#5 -row 2 -column 2 \
		-sticky e -padx 2 -pady 0 -ipady 0
	grid $base.entry#16 -in $base.frame#5 -row 2 -column 3 \
		-sticky w -padx 2 -pady 0 -ipady 0

	grid $base.label#23 -in $base.frame#5 -row 3 -column 2 \
		-sticky e -padx 2 -pady 0 -ipady 0
	grid $base.entry#15 -in $base.frame#5 -row 3 -column 3 \
		-sticky w -padx 2 -pady 0 -ipady 0

	grid $base.label#21 -in $base.frame#5 -row 4 -column 2 \
		-sticky e -padx 2 -pady 0 -ipady 0
	grid $base.entry#14 -in $base.frame#5 -row 4 -column 3 \
		-sticky w -padx 2 -pady 0 -ipady 0


	grid $base.checkbutton#1 -in $root	-row 1 -column 1  \
		-sticky w
	
	grid $base.label#14 -in $base.frame#3 -row 1 -column 1 -columnspan 3 \
		-sticky we -padx 2 -pady 0 -ipady 0

	grid $base.label#15 -in $base.frame#3 -row 2 -column 1 \
		-sticky w -padx 2 -pady 0 -ipady 0
	grid $base.entry#11 -in $base.frame#3 -row 3 -column 1 \
		-sticky w -padx 2 -pady 0 -ipady 0

	grid $base.button#3 -in $base.frame#3 -row 4 -column 1 \
		-sticky e -padx 2 -pady 0 -ipady 0

	grid $base.label#13 -in $base.frame#3 -row 2 -column 2 \
		-sticky e -padx 2 -pady 0 -ipady 0
	grid $base.entry#12 -in $base.frame#3 -row 2 -column 3 \
		-sticky w -padx 2 -pady 0 -ipady 0

	grid $base.label#12 -in $base.frame#3 -row 3 -column 2 \
		-sticky e -padx 2 -pady 0 -ipady 0
	grid $base.entry#9 -in $base.frame#3 -row 3 -column 3 \
		-sticky w -padx 2 -pady 0 -ipady 0

	grid $base.label#11 -in $base.frame#3 -row 4 -column 2 \
		-sticky e -padx 2 -pady 0 -ipady 0
	grid $base.entry#10 -in $base.frame#3 -row 4 -column 3 \
		-sticky w -padx 2 -pady 0 -ipady 0


	# Resize behavior management

	grid rowconfigure $base.frame#3 1 -weight 0 -minsize 1
	grid rowconfigure $base.frame#3 2 -weight 0 -minsize 1
	grid rowconfigure $base.frame#3 3 -weight 0 -minsize 1
	grid rowconfigure $base.frame#3 4 -weight 0 -minsize 1
	grid rowconfigure $base.frame#3 5 -weight 0 -minsize 1
	grid columnconfigure $base.frame#3 1 -weight 0 -minsize 1
	grid columnconfigure $base.frame#3 2 -weight 1 -minsize 1
	grid columnconfigure $base.frame#3 3 -weight 1 -minsize 1

	grid rowconfigure $root 2 -weight 0 -minsize 1
	grid rowconfigure $root 1 -weight 0 -minsize 1
	grid rowconfigure $root 3 -weight 0 -minsize 1
	grid rowconfigure $root 4 -weight 0 -minsize 1
	grid rowconfigure $root 5 -weight 0 -minsize 1
	grid columnconfigure $root 1 -weight 0 -minsize 1

	grid rowconfigure $base.frame#5 1 -weight 0 -minsize 1
	grid rowconfigure $base.frame#5 2 -weight 0 -minsize 1
	grid rowconfigure $base.frame#5 3 -weight 0 -minsize 1
	grid rowconfigure $base.frame#5 4 -weight 0 -minsize 1
	grid rowconfigure $base.frame#5 5 -weight 0 -minsize 1
	grid columnconfigure $base.frame#5 1 -weight 0 -minsize 1
	grid columnconfigure $base.frame#5 2 -weight 1 -minsize 1
	grid columnconfigure $base.frame#5 3 -weight 1 -minsize 1

	grid rowconfigure $base.frame#1 1 -weight 0 -minsize 1
	grid rowconfigure $base.frame#1 2 -weight 0 -minsize 1
	grid rowconfigure $base.frame#1 3 -weight 0 -minsize 1
	grid rowconfigure $base.frame#1 4 -weight 0 -minsize 1
	grid rowconfigure $base.frame#1 5 -weight 0 -minsize 1
	grid columnconfigure $base.frame#1 1 -weight 0 -minsize 1
	grid columnconfigure $base.frame#1 2 -weight 1 -minsize 1
	grid columnconfigure $base.frame#1 3 -weight 1 -minsize 1
# additional interface code


bind $base.entry#1 <Return>  "EnterNumInCopy 1"
bind $base.entry#1 <Tab> "EnterNumInCopy 1"

bind $base.entry#17 <Return>  "EnterNumInCopy 2"
bind $base.entry#17 <Tab> "EnterNumInCopy 2"

bind $base.entry#11 <Return>  "EnterNumInCopy 3"
bind $base.entry#11 <Tab> "EnterNumInCopy 3"

$base.checkbutton#1 conf -offvalue "0 $base.frame#3"
$base.checkbutton#1 conf -onvalue "1 $base.frame#3"

$base.checkbutton#1 conf -command {
    if { [lindex $CopyMoveInfo(TwoDim) 0] != 0 } { 
	set stt disabled
	set fgc grey60
    } else { 
	set stt normal 
	set fgc black
    }
    foreach i [grid slaves [lindex $CopyMoveInfo(TwoDim) 1]] {
	catch { $i conf -state $stt }
	if { [winfo class $i] != "Button" } {
	    catch { $i conf -fg $fgc }
	}
    }
}




# end additional interface code

}


# Allow interface to be run "stand-alone" for testing

catch {
    if {$argv0 == [info script]} {
	wm title . [_ "Testing CopyMirror"]
	CopyMirror_ui .
    }
}
