mouse
TCL/TK UseCase1
Abstract : First attempt at user interaction
           
Comments : This file was replaced by bindings.tcl after Use Case 1.
           It only allowed construction and alternation verities
           and edges to be created and that's it. You couldn't do anything
           else like move objects around, delete, rename, etc.  Plus when
           an object was created, Tcl/Tk was the only one that knew about
           it. The .pp files for user interaction had not been created yet,
           so there was no way to pass the new information. This file was
           replaced by the bindings.tcl which turned out to be more
           adaptive and easier to maintain and added new functions.
           
proc whattodo { x y } {
    global tool_type
    global INCLUDE
    global name
    global passx
    global passy
    switch $tool_type {
	Select
	{ .area itemconfigure node -background red }
	Constr {
	    asklabel "Enter Label Name:"
	    if {$name != ""} {
		tclCVert $name $x [expr $y - 20] $x $y
#Some PP stuff called here
	    }
	}
	Alter
	{
            asklabel "Enter Label Name:"
            if {$name != ""} {
                tclAVert $name $x [expr $y - 20] $x $y
#Some PP stuff called here
	    }
	}
	Req_Constr_Edge 
	{
	    set xcor1 $x
	    set ycor1 $y
	    nextcord "Please click at your destination."
	    set xcor2 $passx
	    set ycor2 $passy
	    tclCEdge $xcor1 $ycor1 $xcor2 $ycor2
#Some PP stuff called here
	}
	Req_Alter_Edge
	{
            set xcor1 $x
            set ycor1 $y
            nextcord "Please click at your destination."
            set xcor2 $passx
            set ycor2 $passy
            tclAEdge $xcor1 $ycor1 $xcor2 $ycor2
#Some PP stuff called here
	}
#	Opt_Constr_Edge
#	{ ask "Tool not yet ready..." }
#	Opt_Alter_Edge
#	{ ask "Tool not yet ready..." }
	Rename
	{ ask "Tool not yet ready..." }
	Delete
	{ ask "Tool not yet ready..." }
    }
}
proc setup_mouse {} {
bind .area  {whattodo %x %y}
}
 
 
 
 
 
 
 
 
