Browse Source

- added a header in the New Script

Marius Stanciu 6 years ago
parent
commit
9648bcd693
2 changed files with 12 additions and 3 deletions
  1. 11 2
      FlatCAMApp.py
  2. 1 1
      tclCommands/TclCommand.py

+ 11 - 2
FlatCAMApp.py

@@ -3876,8 +3876,6 @@ class App(QtCore.QObject):
         dialog.exec_()
 
     def handleTextChanged(self):
-        self.report_usage("handleTextChanged()")
-
         # enable = not self.ui.code_editor.document().isEmpty()
         # self.ui.buttonPrint.setEnabled(enable)
         # self.ui.buttonPreview.setEnabled(enable)
@@ -5770,6 +5768,7 @@ class App(QtCore.QObject):
 
         # first clear previous text in text editor (if any)
         self.ui.code_editor.clear()
+        self.ui.code_editor.setReadOnly(False)
         self.toggle_codeeditor = True
         self.ui.code_editor.completer_enable = False
 
@@ -5831,9 +5830,19 @@ class App(QtCore.QObject):
         flt = "FlatCAM Scripts (*.FlatScript);;All Files (*.*)"
         self.init_code_editor(name=_("Script Editor"))
         self.ui.code_editor.completer_enable = True
+        self.ui.code_editor.append(_(
+            "#\n"
+            "# CREATE A NEW FLATCAM TCL SCRIPT\n"
+            "# TCL Tutorial here: https://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html\n"
+            "#\n\n"
+        ))
+
         self.ui.buttonOpen.clicked.connect(lambda: self.handleOpen(filt=flt))
         self.ui.buttonSave.clicked.connect(lambda: self.handleSaveGCode(filt=flt))
 
+        self.handleTextChanged()
+        self.ui.code_editor.show()
+
     def on_fileopenscript(self):
         _filter_ = "TCL script (*.FlatScript);;TCL script (*.TCL);;TCL script (*.TXT);;All Files (*.*)"
         try:

+ 1 - 1
tclCommands/TclCommand.py

@@ -314,7 +314,7 @@ class TclCommandSignaled(TclCommand):
 
 
         This class is  child of  TclCommand and is used for commands  which create  new objects
-        it handles  all neccessary stuff about blocking and passing exeptions
+        it handles  all necessary stuff about blocking and passing exceptions
     """
 
     @abc.abstractmethod