#------------------------------------------------------------- # Copyright (c) 1995 Taligent, Inc. All rights reserved. # # $Revision: 1.2 $ # # File : GrafEditBAT.i # # Created by : Patience Chu 9/27/94: # Adopted by Amitabh for unit testing GrafEdit. # # Description: defines convenient functions to be used in GrafEditBAT.Event # #------------------------------------------------------------- ############################################## # # Popular functions # ############################################## # move object related to application's upper left resize button proc OMove { x y } { global marsapp GetRespond marsapp WContentUL xWUL yWUL set xNew [ expr $xWUL + $x ] set yNew [ expr $yWUL + $y ] Move $xNew $yNew } # Drag related to application's upper left resize button proc ODrag { x y } { global marsapp GetRespond marsapp WContentUL xWUL yWUL set xNew [ expr $xWUL + $x ] set yNew [ expr $yWUL + $y ] Drag $xNew $yNew } # Compare current image with standard image # index - image number # ignore - ignore the image failure and continue running proc CheckImage { index ignore } { } proc MouseUndo {} { global marsapp.MainMenu.Edit ClickOn marsapp.MainMenu.Edit Undo echo ">Mouse Undo" } proc MouseRedo {} { global marsapp.MainMenu.Edit ClickOn marsapp.MainMenu.Edit Redo echo ">Mouse Redo" } proc MouseCut {} { global marsapp.MainMenu.Edit ClickOn marsapp.MainMenu.Edit Cut echo ">Mouse Cut" } proc MouseCopy {} { global marsapp.MainMenu.Edit ClickOn marsapp.MainMenu.Edit Copy echo ">Mouse Copy" } proc MousePaste {} { global marsapp.MainMenu.Edit ClickOn marsapp.MainMenu.Edit Paste echo ">Mouse Paste" } proc MouseDelete {} { global marsapp.MainMenu.Edit ClickOn marsapp.MainMenu.Edit Delete echo ">Mouse Delete" } proc MouseSelectAll {} { global marsapp.MainMenu.Edit ClickOn marsapp.MainMenu.Edit "Select All" echo ">Mouse Select All" } proc SelectArrow {} { global marsapp.MainMenu.Tools ClickOn marsapp.MainMenu.Tools Arrow echo ">select arrow" } proc SelectLine {} { global marsapp.MainMenu.Tools ClickOn marsapp.MainMenu.Tools Line echo ">select line" } proc SelectRect {} { global marsapp.MainMenu.Tools ClickOn marsapp.MainMenu.Tools Rectangle echo ">select rectangle" } proc SelectEllipse {} { global marsapp.MainMenu.Tools ClickOn marsapp.MainMenu.Tools Ellipse echo ">select elipse" } proc SelectPolyline {} { global marsapp.MainMenu.Tools ClickOn marsapp.MainMenu.Tools Polyline echo ">select polyline" } proc SelectPolygon {} { global marsapp.MainMenu.Tools ClickOn marsapp.MainMenu.Tools Polygon echo ">select polygon" } proc SelectCurve {} { global marsapp.MainMenu.Tools ClickOn marsapp.MainMenu.Tools Curve echo ">select curve" } #set up color setting command proc SelectRedFrame {} { global marsapp.MainMenu.Color ClickOn marsapp.MainMenu.Color "Red Frame" echo ">select red frame" } proc SelectGreenFrame {} { global marsapp.MainMenu.Color ClickOn marsapp.MainMenu.Color "Green Frame" echo ">select green frame" } proc SelectBlueFrame {} { global marsapp.MainMenu.Color ClickOn marsapp.MainMenu.Color "Blue Frame" echo ">select blue frame" } proc SelectRedFill {} { global marsapp.MainMenu.Color ClickOn marsapp.MainMenu.Color "Red Fill" echo ">select red fill" } proc SelectGreenFill {} { global marsapp.MainMenu.Color ClickOn marsapp.MainMenu.Color "Green Fill" echo ">select green fill" } proc SelectBlueFill {} { global marsapp.MainMenu.Color ClickOn marsapp.MainMenu.Color "Blue Fill" echo ">select blue fill" } # Pens setting proc proc Point1Pen {} { global marsapp.MainMenu.Pen ClickOn marsapp.MainMenu.Pen "1 point" echo ">select point 1 pen" } proc Point2Pen {} { global marsapp.MainMenu.Pen ClickOn marsapp.MainMenu.Pen "2 point" echo ">select point 2 pen" } proc Point4Pen {} { global marsapp.MainMenu.Pen ClickOn marsapp.MainMenu.Pen "4 point" echo ">select point 4 pen" } proc Point6Pen {} { global marsapp.MainMenu.Pen ClickOn marsapp.MainMenu.Pen "6 point" echo ">select point 6 pen" } proc Point8Pen {} { global marsapp.MainMenu.Pen ClickOn marsapp.MainMenu.Pen "8 point" echo ">select point 8 pen" } proc Point10Pen {} { global marsapp.MainMenu.Pen ClickOn marsapp.MainMenu.Pen "10 point" echo ">select point 10 pen" } proc SelectTestAllClasses {} { Move 81 191 Click Move 128 189 Click echo ">select test" } proc SelectText {} { global marsapp.MainMenu.Tools ClickOn marsapp.MainMenu.Tools Text echo ">select text" }