#! /usr/bin/wish

# interface generated by SpecTcl version 1.2 from /home/msj/projects/SpecTcl/SpecTcl/rowcol.ui
#   root     is the parent window for this user interface

proc rowcol_ui {root args} {

	# this treats "." as a special case

	if {$root == "."} {
	    set base ""
	} else {
	    set base $root
	}
    
	frame $base.fRow

	frame $base.frame#2 \
		-borderwidth 1 \
		-relief sunken \
		-width 2

	frame $base.fColumn

	frame $base.frame#4 \
		-borderwidth 1 \
		-height 2 \
		-relief sunken

	frame $base.frame#5

	label $base.label#1 \
		-text {Row Properties}
	catch {
		$base.label#1 configure \
			-font -*-Helvetica-Bold-R-Normal-*-*-140-*-*-*-*-*-*
	}

	label $base.label#3 \
		-text {Column Properties}
	catch {
		$base.label#3 configure \
			-font -*-Helvetica-Bold-R-Normal-*-*-140-*-*-*-*-*-*
	}

	button $base.bApply \
		-default active \
		-text Apply \
		-width 8

	button $base.bDismiss \
		-command "destroy $root" \
		-text Dismiss \
		-width 8


	# Add contents to menus

	# Geometry management

	grid $base.fRow -in $root	-row 2 -column 1 
	grid $base.frame#2 -in $root	-row 1 -column 2  \
		-rowspan 2 \
		-sticky ns
	grid $base.fColumn -in $root	-row 2 -column 3 
	grid $base.frame#4 -in $root	-row 3 -column 1  \
		-columnspan 3 \
		-sticky ew
	grid $base.frame#5 -in $root	-row 4 -column 1  \
		-columnspan 3 \
		-sticky ew
	grid $base.label#1 -in $root	-row 1 -column 1 
	grid $base.label#3 -in $root	-row 1 -column 3 
	grid $base.bApply -in $base.frame#5	-row 1 -column 1 
	grid $base.bDismiss -in $base.frame#5	-row 1 -column 2 

	# Resize behavior management

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

	grid rowconfigure $base.frame#5 1 -weight 0 -minsize 30
	grid columnconfigure $base.frame#5 1 -weight 1 -minsize 63
	grid columnconfigure $base.frame#5 2 -weight 1 -minsize 30
# additional interface code
bind $root <Key-Return> "$base.bApply invoke"
bind $root <Key-Escape> "$base.bDismiss invoke"


# end additional interface code

}


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

catch {
    if [info exists embed_args] {
	# we are running in the plugin
	rowcol_ui .
    } else {
	# we are running in stand-alone mode
	if {$argv0 == [info script]} {
	    wm title . "Testing rowcol_ui"
	    rowcol_ui .
	}
    }
}
