1#   Copyright (C) 1987-2015 by Jeffery P. Hansen
2#
3#   This program is free software; you can redistribute it and/or modify
4#   it under the terms of the GNU General Public License as published by
5#   the Free Software Foundation; either version 2 of the License, or
6#   (at your option) any later version.
7#
8#   This program is distributed in the hope that it will be useful,
9#   but WITHOUT ANY WARRANTY; without even the implied warranty of
10#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11#   GNU General Public License for more details.
12#
13#   You should have received a copy of the GNU General Public License along
14#   with this program; if not, write to the Free Software Foundation, Inc.,
15#   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16#
17# Last edit by hansen on Mon Feb 23 20:30:42 2009
18#
19
20
21#############################################################################
22#
23# Use this for a basic action.  "name" is the name of the action that will
24# appear in the undo/redo listboxes, and "body" is the undoable code to
25# execute.
26#
27proc action {name body} {
28  set ok [gat_obBeginFrame $name]
29  uplevel $body
30  if {$ok} { gat_obEndFrame }
31}
32
33#############################################################################
34#
35# Use this for a action which will be appended to the most recent action.
36#
37proc continueAction {name body} {
38  gat_obAppendFrame $name
39#  namespace eval :: $body
40  uplevel $body
41  gat_obEndFrame
42}
43
44#############################################################################
45#
46# Use this for "transparent" actions.  Transparent actions are those
47# for which a frame record is kept and placed in the stack, but which
48# are not directly visible to the user.
49#
50proc transAction {name body} {
51  gat_obBeginFrame $name 1
52#  namespace eval :: $body
53  uplevel $body
54  gat_obEndFrame
55}
56
57#############################################################################
58#
59# Use this for "background" actions.  Background actions are actions taken
60# internally by tkgate and not directly by the user.
61#
62proc bgAction {name body} {
63  gat_obBeginFrame $name 5
64#  namespace eval :: $body
65  uplevel $body
66  gat_obEndFrame
67}
68
69#############################################################################
70#
71# Use this action for operations for which undo processing will
72# be suspended.
73#
74proc suspendAction {body} {
75  set m [gat_obMode]
76  gat_obMode 0
77#  namespace eval :: $body
78  uplevel $body
79  gat_obMode $m
80}
81
82#############################################################################
83#
84# Use this action for operations for which undo processing will
85# be suspended, and all undo data cleared.
86#
87proc clearAction {body} {
88  set m [gat_obMode]
89  gat_obMode 0
90  gat_obFlush
91#  namespace eval :: $body
92  uplevel $body
93  gat_obMode $m
94}
95
96#############################################################################
97#############################################################################
98##
99## Tkgate actions are defined below here.  All calls from the interface
100## go through an action function.
101##
102#############################################################################
103#############################################################################
104namespace eval Action  {
105  proc null {} { }
106
107  proc cancel {} {
108    transAction Cancel { tkg_cancel; gat_unselectGates }
109  }
110
111  #############################################################################
112  #
113  # Show debugging info about wires.
114  #
115  proc dumpWires {} {
116    gat_dumpWires
117  }
118
119  #############################################################################
120  #
121  # Run the internal datat structure verifier.
122  #
123  proc verify {} {
124    gat_verify
125  }
126
127  #############################################################################
128  #
129  # Add an input to the selected gate.
130  #
131  proc addPort {} {
132    action AddPort { gat_addPort }
133  }
134
135  #############################################################################
136  #
137  # Change the type of a port
138  #
139  proc editPort {} {
140    action EditPort { gat_changePinDir }
141  }
142
143
144  #############################################################################
145  #
146  # Set debugging mode
147  #
148  proc debugMode {} {
149    action Mode { ToolBar::selectTool 12 }
150  }
151
152  #############################################################################
153  #
154  # Put tkgate in standard edit mode
155  #
156  proc editMode {} {
157    action Mode { ToolBar::selectTool 1 }
158  }
159
160  #############################################################################
161  #
162  # Put tkgate in delete gate mode (obsolete, code '3' now used for scrolling)
163  #
164  proc deleteMode {} {
165    action Mode {ToolBar::selectTool 3 }
166  }
167
168  #############################################################################
169  #
170  # Put tkgate in delete gate mode
171  #
172  proc scrollMode {} {
173    action Mode {ToolBar::selectTool 3 }
174  }
175
176  #############################################################################
177  #
178  # Put tkgate in cut wire mode
179  #
180  proc cutMode {} {
181    action Mode {ToolBar::selectTool 0 }
182  }
183
184  #############################################################################
185  #
186  # Put tkgate in invert in/out mode
187  #
188  proc invertMode {} {
189    action Mode {ToolBar::selectTool 2 }
190  }
191
192  #############################################################################
193  #
194  # Put tkgate in set wire size mode
195  #
196  proc sizeMode {} {
197    action Mode {ToolBar::selectTool 9 }
198  }
199
200  #############################################################################
201  #
202  # Set gate rotation to 0 degrees
203  #
204  proc rot0 {} {
205    action Rotation { gat_setrot 0 }
206  }
207
208  #############################################################################
209  #
210  # Set gate rotation to 90 degrees
211  #
212  proc rot90 {} {
213    action Rotation { gat_setrot 1 }
214  }
215
216  #############################################################################
217  #
218  # Set gate rotation to 180 degrees
219  #
220  proc rot180 {} {
221    action Rotation { gat_setrot 2 }
222  }
223
224  #############################################################################
225  #
226  # Set gate rotation to 270 degrees
227  #
228  proc rot270 {} {
229    action Rotation { gat_setrot 3 }
230  }
231
232  #############################################################################
233  #
234  # Open a Tcl shell window
235  #
236  proc shellWindow {} {
237    ::shellWindow
238  }
239
240  #############################################################################
241  #
242  # Open the selected module.
243  #
244  proc openMod {} {
245    action Open { if { "%W" != ".scope"} { gat_openBox } else { .scope.main.frame.canvas zoom 1 } }
246  }
247
248  #############################################################################
249  #
250  # Close the current module.
251  #
252  proc closeMod {} {
253    action Close { if { "%W" != ".scope"} { gat_closeBox } else { .scope.main.frame.canvas zoom -1 } }
254  }
255
256  ######################################################################
257  #
258  # Replicate a gate.
259  #
260  proc replicate {} {
261    action Replicate { gat_replicate }
262  }
263
264  ######################################################################
265  #
266  # Delete the selected object.
267  #
268  proc delete {} {
269    action Delete { gat_deleteSelected }
270  }
271
272  ######################################################################
273  #
274  # Edit the properties of the selected object.
275  #
276  proc editProps {} {
277    action EditProps { gat_editProps }
278  }
279
280  ######################################################################
281  #
282  # Set/unset a probe on the selected wire.
283  #
284  proc toggleProbe {} {
285    gat_toggleProbe
286  }
287
288  ######################################################################
289  #
290  # Set/unset a probe on the selected wire.
291  #
292  proc delScopeProbe {} {
293    gat_delScopeProbe
294  }
295
296  ######################################################################
297  #
298  # Move to the previous error in the error box.
299  #
300  proc errBoxUp {} {
301    action ErrUp { ErrBox::selectUp }
302  }
303
304  ######################################################################
305  #
306  # Move to the next error in the error box.
307  #
308  proc errBoxDown {} {
309    action ErrDown { ErrBox::selectDown }
310  }
311
312  ######################################################################
313  #
314  # Align gates horizontally
315  #
316  proc hAlign {} {
317    action HAlign { gat_align 1 }
318  }
319
320  ######################################################################
321  #
322  # Counter clockwise rotation.
323  #
324  # The type of rotation depends on the current edit mode.  If en regular
325  # edit mode, selected gates are rotated.  If the symbol editor is active
326  # and we are in port mode, then the selected port is edited.  If the symbol
327  # editor is active and we are not in port mode, then the bits are rotated.
328  #
329  proc rotate {} {
330    action Rotate {
331      set mm [gat_getMajorMode]
332
333      switch $mm {
334	edit {
335	  gat_rotate
336	}
337	interface {
338	  if {[SymbolEdit::isactive]} {
339	    if { $SymbolEdit::emode == "port" } {
340	      SymbolEdit::rotatePort 1
341	    } else {
342	      SymbolEdit::rotateBits 1
343	    }
344	  }
345	}
346      }
347    }
348  }
349
350  ######################################################################
351  #
352  # Back rotate gates
353  #
354  proc backRotate {} {
355    action Rotate {
356      set mm [gat_getMajorMode]
357
358      switch $mm {
359	edit {
360	  gat_rotate -1
361	}
362	interface {
363	  if {[SymbolEdit::isactive]} {
364	    if { $SymbolEdit::emode == "port" } {
365	      SymbolEdit::rotatePort -1
366	    } else {
367	      SymbolEdit::rotateBits -1
368	    }
369	  }
370	}
371      }
372    }
373  }
374
375  ######################################################################
376  #
377  # Align gates vertically
378  #
379  proc vAlign {} {
380    action VAlign { gat_align 0 }
381  }
382
383  ######################################################################
384  #
385  # Clear the current circuit and start editing a new file.
386  #
387  proc newFile {} {
388    clearAction File::new
389  }
390
391  ######################################################################
392  #
393  # Load the specified file
394  #
395  proc loadFile {} {
396    clearAction File::load
397  }
398
399  ######################################################################
400  #
401  # Load the specified file
402  #
403  proc loadNamedFile {name} {
404    clearAction "gat_load $name"
405  }
406
407  ######################################################################
408  #
409  # Load modules from a library
410  #
411  proc loadLibrary {} {
412    clearAction File::loadLibrary
413  }
414
415  ######################################################################
416  #
417  # Unload the library selected in the module tree view
418  #
419  proc unloadSelectedLibrary {} {
420    set lib [BlockTree::getselection]
421    if {[string first "||" $lib] != 0} return
422    set lib [string range $lib 2 end]
423    clearAction { gat_unloadLibrary $lib }
424  }
425
426  ######################################################################
427  #
428  # Save the current circuit to the current file
429  #
430  proc saveFile {} {
431    transAction -Save File::saveCurrent
432  }
433
434  ######################################################################
435  #
436  # Save the current circuit to a new file.
437  #
438  proc saveAsFile {} {
439    clearAction File::saveAs
440  }
441
442  ######################################################################
443  #
444  # Import image
445  #
446  proc importImage {} {
447    SymbolEdit::importImage
448  }
449
450  ######################################################################
451  #
452  # Export image
453  #
454  proc exportImage {} {
455    SymbolEdit::exportImage
456  }
457
458  ######################################################################
459  #
460  # Print the current circuit
461  #
462  proc print {} {
463    suspendAction PrintDlg::post
464  }
465
466  ######################################################################
467  #
468  # Exit tkgate
469  #
470  proc exit {} {
471    File::closeApplication
472  }
473
474  ######################################################################
475  #
476  # Edit tkgate options
477  #
478  proc editOptions {} {
479    suspendAction OptionDlg::post
480  }
481
482  ######################################################################
483  #
484  # Select all gates in the current module
485  #
486  proc selectAll {} {
487    if {$HdlEditor::isActive} {
488      action SelectAll { HdlEditor::selectAll }
489    } else {
490      action SelectAll { gat_selectAll }
491    }
492  }
493
494  ######################################################################
495  #
496  # Edit circuit properties
497  #
498  proc editCProps {} {
499    action EditCProps { EditCircDB::post }
500  }
501
502  ######################################################################
503  #
504  # Set an anchor on the selected gate
505  #
506  proc anchor {} {
507    action Anchor { gat_anchor 1 }
508  }
509
510  ######################################################################
511  #
512  # Remove an anchor from the current gate.
513  #
514  proc unAnchor {} {
515    action UnAnchor { gat_anchor 0 }
516  }
517
518  ######################################################################
519  #
520  # Begin critical path analysis mode
521  #
522  proc cpathAnal {} {
523    tkg_cpathAnal
524  }
525
526  ######################################################################
527  #
528  # Copy selected region to cut buffer
529  #
530  proc copyToBuf {} {
531    if {$HdlEditor::isActive} {
532      HdlEditor::doCopy
533    } else {
534      action Copy { gat_copyToBuf }
535    }
536  }
537
538  ######################################################################
539  #
540  # Cut the selected objects and place them in the cut buffer
541  #
542  proc cutToBuf {} {
543    if {$HdlEditor::isActive} {
544      HdlEditor::doCut
545    } else {
546      action Cut gat_cutToBuf
547    }
548  }
549
550  ######################################################################
551  #
552  # Cut the selected objects and append them to the cut buffer
553  #
554  proc cutToBufAppend {} {
555    if {$HdlEditor::isActive} {
556      HdlEditor::startCommand -
557    }
558    action CutAppend gat_cutToBufAppend
559  }
560
561  ######################################################################
562  #
563  # Yank a copy of the cut buffer to the current module
564  #
565  proc yankFromBuf {} {
566    if {$HdlEditor::isActive} {
567      HdlEditor::doYank
568    } else {
569      action Yank gat_yankFromBuf
570    }
571  }
572
573  ######################################################################
574  #
575  # Duplicate
576  #
577  proc duplicate {} {
578    action Duplicate {
579      gat_copyToBuf
580      gat_yankFromBuf 30 30
581    }
582  }
583
584
585  ######################################################################
586  #
587  # Find an object
588  #
589  proc findObject {} {
590    transAction Find { Find::post }
591  }
592
593  ######################################################################
594  #
595  # Start the simulator
596  #
597  proc startSimulator {} {
598    gat_setMajorMode simulate
599  }
600
601  ######################################################################
602  #
603  # End the simulator
604  #
605  proc endSimulator {} {
606    gat_setMajorMode edit
607  }
608
609  ######################################################################
610  #
611  # Put simulator in "run" mode
612  #
613  proc simRun {} {
614    tkg_simRun
615  }
616
617  ######################################################################
618  #
619  # Put simulator in "stop" mode.
620  #
621  proc simStop {} {
622    tkg_simStop
623  }
624
625  ######################################################################
626  #
627  # Edit simulator breakpoints
628  #
629  proc editBreakpoints {} {
630    InfoPanel::notify Breakpoints -force 1
631    update
632    Breakpoint::add
633  }
634
635  ######################################################################
636  #
637  # Execute a simulation script
638  #
639  proc doSimScript {} {
640    tkg_doSimScript
641  }
642
643  ######################################################################
644  #
645  # Load a memory file
646  #
647  proc simLoadMem {} {
648    tkg_simLoadMem
649  }
650
651  ######################################################################
652  #
653  # Dump a memory file.
654  #
655  proc simDumpMem {} {
656    tkg_simDumpMem
657  }
658
659  ######################################################################
660  #
661  # View a memory file.
662  #
663  proc simViewMem {} {
664    set g [gat_simSelected ram rom]
665
666    if {$g != "" } {
667      MemView::new $g.m -title $g
668    } else {
669      errmsg [m err.nomemselect]
670    }
671  }
672
673  ######################################################################
674  #
675  # Print a scope trace
676  #
677  proc scopePrint {} {
678    ScopePrintDlg::post
679  }
680
681  ######################################################################
682  #
683  # Step the simulator one epoch
684  #
685  proc simStep {} {
686    Simulator::stepEpoch
687  }
688
689  ######################################################################
690  #
691  # Step the simulator one "clock cycle".
692  #
693  proc simCycle {} {
694    tkg_simCycle
695  }
696
697  ######################################################################
698  #
699  # If in simulator mode, step the simulator one "clock cycle".  If in
700  # edit mode, rotate the selected gates.
701  #
702  proc simCycleOrRotate {} {
703    set mm [gat_getMajorMode]
704
705    if { $mm == "simulate" } {
706      tkg_simCycle
707    } else {
708      rotate
709    }
710  }
711
712  ######################################################################
713  #
714  # Refresh the screen.
715  #
716  proc refreshScreen {} {
717    gat_refreshScreen
718  }
719
720  ######################################################################
721  #
722  # Create a new module
723  #
724  proc blockNew {} {
725    action NewMod BlockOp::new
726  }
727
728  ######################################################################
729  #
730  # Delete a module
731  #
732  proc blockDelete {} {
733    action DeleteMod BlockOp::delete
734  }
735
736  ######################################################################
737  #
738  # Copy a module
739  #
740  proc blockCopy {} {
741    action CopyMod BlockOp::copy
742  }
743
744  ######################################################################
745  #
746  # Set root module
747  #
748  proc blockSetRoot {} {
749    action SetRoot BlockOp::setroot
750  }
751
752  ######################################################################
753  #
754  # Rename a module
755  #
756  proc blockRename {} {
757    action RenameMod BlockOp::rename
758  }
759
760  ######################################################################
761  #
762  # Set the interface of the selected module
763  #
764  proc setBlockDesc {} {
765    action SetInterf { gat_setBlockDesc }
766  }
767
768  ######################################################################
769  #
770  # Edit the module interfaces
771  #
772  proc editBlockDesc {} {
773    action EditInterf gat_editBlockDesc
774  }
775
776  ######################################################################
777  #
778  # Autogenerate a module interface
779  #
780  proc autoGenerate {} {
781    IGen::post -which ipanel
782  }
783
784  ######################################################################
785  #
786  # Autogenerate a module interface from module list
787  #
788  proc autoGenerateSelected {} {
789    IGen::post -which selected
790  }
791
792  ######################################################################
793  #
794  # Autogenerate a module interface from direct canvas selection
795  #
796  proc autoGenerateCanvas {} {
797    IGen::post -which canvas
798  }
799
800  ######################################################################
801  #
802  # "Claim" a block (make it a non-library block)
803  #
804  proc blockClaim {} {
805    action Claim BlockOp::claim
806  }
807
808  ######################################################################
809  #
810  # Shows/edits properties of a module
811  #
812  proc blockProp {} {
813    action Props ModuleProps::postSelected
814  }
815
816  ######################################################################
817  #
818  # Shows/edits properties of a module
819  #
820  proc blockPropCanvas {} {
821    action Props { ModuleProps::postSelected -which canvas }
822  }
823
824  ######################################################################
825  #
826  # Zoom in
827  #
828  proc zoomIn {} {
829    action ZoomIn { gat_zoom 1 }
830  }
831
832  ######################################################################
833  #
834  # Zoom out
835  #
836  proc zoomOut {} {
837    action ZoomOut { gat_zoom -1 }
838  }
839
840  ######################################################################
841  #
842  # SymboleEdit Zoom in
843  #
844  proc seZoomIn {} {
845    SymbolEdit::zoom 1
846  }
847
848  ######################################################################
849  #
850  # SymboleEdit Zoom out
851  #
852  proc seZoomOut {} {
853    SymbolEdit::zoom -1
854  }
855
856  ######################################################################
857  #
858  # Nudge the selected objects left
859  #
860  proc nudgeLeft {} {
861    action NudgeL { gat_moveGate -1 0 }
862  }
863
864  ######################################################################
865  #
866  # Nudge the selected objects right
867  #
868  proc nudgeRight {} {
869    action NudgeR { gat_moveGate 1 0 }
870  }
871
872  ######################################################################
873  #
874  # Nudge the selected objects up
875  #
876  proc nudgeUp {} {
877    action NudgeU { gat_moveGate 0 -1 }
878  }
879
880  ######################################################################
881  #
882  # Nudge the selected objects down
883  #
884  proc nudgeDown {} {
885    action NudgeD { gat_moveGate 0 1 }
886  }
887
888  ######################################################################
889  #
890  # Show the about message
891  #
892  proc showAbout {} {
893    ::showAbout
894  }
895
896  ######################################################################
897  #
898  # Show the license message
899  #
900  proc showLicense {} {
901    ::showLicense
902  }
903
904  ######################################################################
905  #
906  # Show the documentation message
907  #
908  proc showDocumentation {} {
909    ::showDocumentation
910  }
911
912  ######################################################################
913  #
914  # Load example circuit 1
915  #
916  proc loadExample {} { global tkgate_exampledir; gat_load $tkgate_exampledir/index.v }
917
918
919  ######################################################################
920  #
921  # Load home page
922  #
923  proc loadWelcome {} { global tkgate_tutorialdir; gat_load $tkgate_tutorialdir/welcome.v }
924
925  ######################################################################
926  #
927  # Load tutorial index
928  #
929  proc loadTutorial {} { global tkgate_tutorialdir; gat_load $tkgate_tutorialdir/index.v }
930
931  #############################################################################
932  #
933  # Undo last action
934  #
935  proc undo {} {
936    HdlEditor::startCommand -
937    gat_undo
938  }
939
940  #############################################################################
941  #
942  # Redo last undone action
943  #
944  proc redo {} {
945    HdlEditor::startCommand -
946    gat_redo
947  }
948
949  ######################################################################
950  #
951  # Update the interface of a module instance  with the current interface
952  #
953  proc updateInterface {} {
954    action UpdIntf { gat_updateInterface }
955  }
956
957  ######################################################################
958  #
959  # Update the interface of all module instances with the current interface
960  #
961  proc updateAllInterfaces {} {
962    action UpdAllIntf { gat_updateInterface -all }
963  }
964
965  ######################################################################
966  #
967  # Update the interface of all module instances with the current interface
968  #
969  proc updateOpenInterface {} {
970    action UpdAllIntf { gat_updateInterface -open }
971  }
972
973  ######################################################################
974  #
975  # Edit wire properties through popup menu
976  #
977  proc popupWireProps {} { continueAction WireProp gat_popupWireProps }
978
979  ######################################################################
980  #
981  # Add a stub to a wire
982  #
983  proc popupWireAddStub {} { action AddStub gat_popupWireAddStub }
984
985  ######################################################################
986  #
987  # Hide/Show the bit size mark on a multi-bit wire
988  #
989  proc popupWireHideSize {} { action SizeDisp { gat_popupWireSize -hide }}
990  proc popupWireShowSize {} { action SizeDisp { gat_popupWireSize -show }}
991
992  ######################################################################
993  #
994  # Hide/Show the label on a wire
995  #
996  proc popupWireHideLabel {} { action SizeDisp { gat_popupWireLabel -hide } }
997  proc popupWireHideAllLabel {} { action SizeDisp { gat_popupWireLabel -hideall } }
998  proc popupWireClearAllLabel {} { action SizeDisp { gat_popupWireLabel -clearall } }
999  proc popupWireShowLabel {} { action SizeDisp { gat_popupWireLabel -show } }
1000
1001  ######################################################################
1002  #
1003  # Change the anchor status of an object
1004  #
1005  proc popupAnchor {} { action Anchor { global pop_anchor; gat_anchor $pop_anchor } }
1006
1007  ######################################################################
1008  #
1009  # Change the port type of a module port
1010  #
1011  proc popupPortMakeIn {} { action ChgPort { gat_popupPortCmd change-in } }
1012  proc popupPortMakeOut {} { action ChgPort { gat_popupPortCmd change-out } }
1013  proc popupPortMakeInOut {} { action ChgPort { gat_popupPortCmd change-inout } }
1014
1015
1016  ######################################################################
1017  #
1018  # Delete a port on a module through right-click
1019  #
1020  proc popupDeletePort {} { action DelPort { gat_popupPortCmd delete } }
1021
1022  ######################################################################
1023  #
1024  # Delete a port on a module through right-click
1025  #
1026  proc popupPortSize {n} { action SizePort { gat_popupPortCmd size $n } }
1027
1028  ######################################################################
1029  #
1030  # Add an input port to a module
1031  #
1032  proc popupBlockAddIn {} { action AddInPort { gat_popupPortCmd add-in } }
1033
1034  ######################################################################
1035  #
1036  # Add an output port to a module
1037  #
1038  proc popupBlockAddOut {} { action AddOutPort { gat_popupPortCmd add-out } }
1039
1040  ######################################################################
1041  #
1042  # Add an in/out port to a module
1043  #
1044  proc popupBlockAddInOut {} { action AddTriPort { gat_popupPortCmd add-inout } }
1045
1046  #############################################################################
1047  #
1048  # Edit the interface of the selected block.
1049  #
1050  #############################################################################
1051  proc openInterface {args} {
1052    action EditInterf {
1053      set name [gat_getSelected module]
1054      if { $name == "" } {
1055	set name [tkg_getSelectedBlock]
1056      }
1057      if { $name != "" } {
1058	gat_editBlockDesc $name
1059      }
1060    }
1061  }
1062
1063  proc hdlDeleteForward {} {
1064    HdlEditor::startCommand DelFwrd
1065    HdlEditor::doDelete 0
1066  }
1067  proc hdlDeleteBackward {} {
1068    HdlEditor::startCommand DelBack
1069    HdlEditor::doDelete -1
1070  }
1071  proc hdlCut {} {
1072    HdlEditor::startCommand -Cut
1073    HdlEditor::doCut
1074  }
1075  proc hdlYank {} {
1076    HdlEditor::startCommand Yank
1077    HdlEditor::doYank
1078  }
1079  proc hdlKillLine {} {
1080    HdlEditor::startCommand -KillLine
1081    HdlEditor::doKillLine
1082  }
1083  proc hdlTransposeChar {} {
1084    HdlEditor::startCommand CharSwap
1085    HdlEditor::doTransposeChar
1086  }
1087  proc hdlSearch {} {
1088    HdlEditor::doSearch
1089  }
1090  proc hdlReverseSearch {} {
1091    HdlEditor::doRSearch
1092  }
1093  proc hdlPageDown {} {
1094    HdlEditor::startCommand -
1095    HdlEditor::doPageMove 1
1096  }
1097  proc hdlPageUp {} {
1098    HdlEditor::startCommand -
1099    HdlEditor::doPageMove -1
1100  }
1101  proc hdlDeleteWord {} {
1102    HdlEditor::startCommand DelWord
1103    HdlEditor::doDeleteWord 1
1104  }
1105  proc hdlOpenLine {} {
1106    HdlEditor::startCommand OpenLine
1107    HdlEditor::doOpenLine
1108  }
1109  proc hdlGotoLineEnd {} {
1110    HdlEditor::startCommand -
1111    HdlEditor::doMoveTo "insert lineend"
1112  }
1113  proc hdlGotoLineStart {} {
1114    HdlEditor::startCommand -
1115    HdlEditor::doMoveTo "insert linestart"
1116  }
1117  proc hdlGotoTop {} {
1118    HdlEditor::startCommand -
1119    HdlEditor::doMoveTo "1.0" -setpoint 1
1120  }
1121  proc hdlGotoEnd {} {
1122    HdlEditor::startCommand -
1123    HdlEditor::doMoveTo "end" -setpoint 1
1124  }
1125  proc hdlForwardWord {} {
1126    HdlEditor::startCommand -
1127    HdlEditor::doWordMove 1
1128  }
1129  proc hdlBackwardWord {} {
1130    HdlEditor::startCommand -
1131    HdlEditor::doWordMove -1
1132  }
1133  proc hdlBackwardChar {} {
1134    HdlEditor::startCommand -
1135    HdlEditor::doHMove -1
1136  }
1137  proc hdlForwardChar {} {
1138    HdlEditor::startCommand -
1139    HdlEditor::doHMove 1
1140  }
1141  proc hdlUpLine {} {
1142    HdlEditor::startCommand -
1143    HdlEditor::doVMove 1
1144  }
1145  proc hdlDownLine {} {
1146    HdlEditor::startCommand -
1147    HdlEditor::doVMove -1
1148  }
1149  proc hdlSetMark {} {
1150    HdlEditor::startCommand -
1151    HdlEditor::doSetPoint
1152  }
1153  proc hdlExchangePointAndMark {} {
1154    HdlEditor::startCommand -
1155    HdlEditor::doPointSwap
1156  }
1157  proc hdlCancel {} {
1158    HdlEditor::startCommand -
1159    HdlEditor::doCancel
1160  }
1161  proc hdlIndent {} {
1162    HdlEditor::startCommand Indent
1163    HdlEditor::doIndent
1164  }
1165  proc hdlLowercaseWord {} {
1166    HdlEditor::startCommand ToLower
1167    HdlEditor::doLowercaseWord
1168  }
1169  proc hdlUppercaseWord {} {
1170    HdlEditor::startCommand ToUpper
1171    HdlEditor::doUppercaseWord
1172  }
1173  proc hdlCasefyWord {} {
1174    HdlEditor::startCommand Casefy
1175    HdlEditor::doCasefyWord
1176  }
1177  proc hdlSetArgument {} {
1178    HdlEditor::doSetArgument
1179  }
1180
1181  proc printTrace {} {
1182    ScopePrintDlg::post
1183  }
1184  proc scopeZoomIn {} {
1185    catch { .scope.main.frame.canvas zoom -1 }
1186  }
1187  proc scopeZoomOut {} {
1188    catch { .scope.main.frame.canvas zoom 1 }
1189  }
1190
1191  proc seRShiftBits {} {
1192    SymbolEdit::shiftBits 1 0
1193  }
1194
1195  proc seLShiftBits {} {
1196    SymbolEdit::shiftBits -1 0
1197  }
1198
1199  proc seUShiftBits {} {
1200    SymbolEdit::shiftBits 0 -1
1201  }
1202
1203  proc seDShiftBits {} {
1204    SymbolEdit::shiftBits 0 1
1205  }
1206
1207  proc seCWRotate {} {
1208    SymbolEdit::rotateBits 1
1209  }
1210
1211  proc seCCWRotate {} {
1212    SymbolEdit::rotateBits -1
1213  }
1214
1215  proc seCWRotPort {} {
1216    SymbolEdit::rotatePort -1
1217  }
1218
1219  proc seCCWRotPort {} {
1220    SymbolEdit::rotatePort 1
1221  }
1222
1223  proc seBoldBits {} {
1224    SymbolEdit::boldBits
1225  }
1226
1227  proc seResize	{} {
1228    SymbolEdit::resize
1229  }
1230
1231  proc seCutToBuf {} {
1232    SymbolEdit::cutRegion
1233  }
1234  proc seCopyToBuf {} {
1235    SymbolEdit::copyRegion
1236  }
1237  proc sePasteFromBuf {} {
1238    SymbolEdit::pasteRegion
1239  }
1240  proc seOverlayFromBuf {} {
1241    SymbolEdit::overlayRegion
1242  }
1243}
1244