소스 검색

FEATURE: adding "save as" command.

willie 4 년 전
부모
커밋
b0b03e537c
9개의 변경된 파일65개의 추가작업 그리고 35개의 파일을 삭제
  1. 2 2
      SPS_EMU.000
  2. 4 1
      SPS_EMU.001
  3. 3 0
      SPS_EMU.044
  4. 3 0
      SPS_EMU.049
  5. 1 1
      SPS_Emu.lpi
  6. BIN
      SPS_Emu.lsu
  7. 13 0
      tone.tps
  8. 30 26
      ugui.lfm
  9. 9 5
      ugui.pas

+ 2 - 2
SPS_EMU.000

@@ -2,8 +2,8 @@
 LSUTextFile=1
 Copyrigth=MCS Media Computer Software
 [LSUInfo]
-CompileDate=15.07.2020
-CompileTime=18:13:18
+CompileDate=22.07.2020
+CompileTime=13:40:24
 Name=Wilfried Klaas
 LSUBinFile=E:\daten\git-sourcen\SPS_Emulator\SPS_Emu.lsu
 LSUTextFile=E:\daten\git-sourcen\SPS_Emulator\SPS_Emu.

+ 4 - 1
SPS_EMU.001

@@ -6,6 +6,7 @@ ID_EXIT=&Exit
 ID_NEW=&New
 ID_OPEN=&Open
 ID_SAVE=&Save
+ID_SAVE_AS=S&ave as
 ID_NEWLINE=New &Line
 ID_DELLINE=Delete Line
 ID_PRGFILE=Prog. File
@@ -26,6 +27,7 @@ ID_EXIT=Exit the program
 ID_NEW=Create a new file
 ID_OPEN=open a file
 ID_SAVE=save the actual file
+ID_SAVE_AS=save as
 ID_NEWLINE=Add a new line to the program
 ID_DELLINE=Delete the actual line
 ID_PRGFILE=Show the programming file
@@ -73,6 +75,7 @@ ID_SAVE_TPS=File save as
 ID_SAVE_HEX=File save as
 ID_OPEN=Open program
 ID_SAVE=Save program
+ID_SAVE_AS=Save program as
 ID_CLICK_HERE= or click here.
  
 [form1Hints]
@@ -112,7 +115,7 @@ ID_CLOSE=&Close
 ID_CLOSE=Close window
 
 [form1Filter]
-ID_SAVE_TPS=TPS/PLC files (*.tps)|*.tps|all files (*.*)|*.*
+ID_SAVE_TPS=TPS/SPS files (*.tps)|*.tps|all files (*.*)|*.*
 ID_SAVE_HEX=Intel Hex file (*.hex)|*.hex|all files (*.*)|*.*
 ID_OPEN=TPS/SPS file (*.tps)|*.tps|all files (*.*)|*.*
 ID_SAVE=TPS/SPS file (*.tps)|*.tps|all files (*.*)|*.*

+ 3 - 0
SPS_EMU.044

@@ -6,6 +6,7 @@ ID_EXIT=&Exit
 ID_NEW=&New
 ID_OPEN=&Open
 ID_SAVE=&Save
+ID_SAVE_AS=&Save as
 ID_NEWLINE=New &Line
 ID_DELLINE=Delete Line
 ID_PRGFILE=Prog. File
@@ -26,6 +27,7 @@ ID_EXIT=Exit the program
 ID_NEW=Create a new file
 ID_OPEN=open a file
 ID_SAVE=save the actual file
+ID_SAVE_AS=save as
 ID_NEWLINE=Add a new line to the program
 ID_DELLINE=Delete the actual line
 ID_PRGFILE=Show the programming file
@@ -73,6 +75,7 @@ ID_SAVE_TPS=File save as
 ID_SAVE_HEX=File save as
 ID_OPEN=Open program
 ID_SAVE=Save program
+ID_SAVE_AS=Save program as
 ID_CLICK_HERE= or click here.
  
 [form1Hints]

+ 3 - 0
SPS_EMU.049

@@ -6,6 +6,7 @@ ID_EXIT=B&eenden
 ID_NEW=&Neu
 ID_OPEN=Ö&ffnen
 ID_SAVE=&Speichern
+ID_SAVE_AS=&Speichern als
 ID_NEWLINE=Neue &Zeile
 ID_DELLINE=Zeile löschen
 ID_PRGFILE=Programmierdatei
@@ -26,6 +27,7 @@ ID_EXIT=Beenden
 ID_NEW=Neue Datei erzeugen
 ID_OPEN=Datei öffnen
 ID_SAVE=Aktuelle Datei speichern
+ID_SAVE_AS=Datei speichern unter
 ID_NEWLINE=Neue Zeile hinzufügen
 ID_DELLINE=Aktuelle Zeile löschen
 ID_PRGFILE=Programmierdatei anzeigen
@@ -73,6 +75,7 @@ ID_SAVE_TPS=Datei sichern als
 ID_SAVE_HEX=Datei sichern als
 ID_OPEN=Programm öffnen
 ID_SAVE=Programm speichern
+ID_SAVE_AS=Programm speichern untern
 ID_CLICK_HERE= oder clicken sie hier.
  
 [form1Hints]

+ 1 - 1
SPS_Emu.lpi

@@ -22,7 +22,7 @@
       <AutoIncrementBuild Value="True"/>
       <MinorVersionNr Value="2"/>
       <RevisionNr Value="1"/>
-      <BuildNr Value="61"/>
+      <BuildNr Value="62"/>
       <Language Value="0407"/>
       <StringTable CompanyName="MCS" FileDescription="TPS/SPS Emulator" InternalName="SPS_EMU" LegalCopyright="MCS (C) Wilfried Klaas" OriginalFilename="SPS_EMU.exe" ProductName="TPS/SPS Emulator" ProductVersion="0.2"/>
     </VersionInfo>

BIN
SPS_Emu.lsu


+ 13 - 0
tone.tps

@@ -0,0 +1,13 @@
+#TPS:Willies SPS Arduino
+0x00,4,4,""
+0x01,5,1,""
+0x02,4,F,""
+0x03,7,C,""
+0x04,F,8,""
+0x05,2,8,""
+0x06,4,0,""
+0x07,F,8,""
+0x08,2,8,""
+0x09,3,6,""
+0x0A,F,F,""
+0x0B,0,0,""

+ 30 - 26
ugui.lfm

@@ -626,32 +626,32 @@ object Form1: TForm1
       Caption = 'ID_SAVE'
     end
     object ToolButton4: TToolButton
-      Left = 257
+      Left = 281
       Height = 22
       Top = 2
       Caption = 'ToolButton4'
       Style = tbsSeparator
     end
     object ToolButton6: TToolButton
-      Left = 289
+      Left = 313
       Top = 2
       Action = acNextStep
       Caption = 'ID_EXEC_NEXT'
     end
     object ToolButton7: TToolButton
-      Left = 313
+      Left = 337
       Top = 2
       Action = acStop
       Caption = 'ID_EXEC_STOP'
     end
     object ToolButton5: TToolButton
-      Left = 337
+      Left = 361
       Top = 2
       Action = acDebug
       Caption = 'ID_EXEC_DEBUG'
     end
     object cbTPSVersion: TComboBox
-      Left = 456
+      Left = 480
       Height = 23
       Top = 2
       Width = 125
@@ -667,7 +667,7 @@ object Form1: TForm1
       TabOrder = 0
     end
     object Label3: TLabel
-      Left = 369
+      Left = 393
       Height = 15
       Top = 2
       Width = 87
@@ -677,33 +677,33 @@ object Form1: TForm1
       ParentColor = False
     end
     object ToolButton8: TToolButton
-      Left = 361
+      Left = 385
       Height = 22
       Top = 2
       Caption = 'ToolButton8'
       Style = tbsSeparator
     end
     object ToolButton9: TToolButton
-      Left = 265
+      Left = 289
       Top = 2
       Action = acThisStep
       Caption = 'ID_EXEC_STATEMENT'
     end
     object ToolButton10: TToolButton
-      Left = 185
+      Left = 209
       Top = 2
       Action = acShowHexFile
       Caption = 'ID_PRGFILE'
     end
     object ToolButton11: TToolButton
-      Left = 177
+      Left = 201
       Height = 22
       Top = 2
       Caption = 'ToolButton11'
       Style = tbsSeparator
     end
     object ToolButton12: TToolButton
-      Left = 209
+      Left = 233
       Top = 2
       Action = acUpload
       Caption = 'ID_PRGULOAD'
@@ -714,38 +714,38 @@ object Form1: TForm1
       Action = acNew
     end
     object ToolButton14: TToolButton
-      Left = 121
+      Left = 145
       Height = 22
       Top = 2
       Caption = 'ToolButton14'
       Style = tbsSeparator
     end
     object ToolButton15: TToolButton
-      Left = 129
+      Left = 153
       Top = 2
       Action = acNewRow
       Caption = 'ID_NEWLINE'
     end
     object ToolButton16: TToolButton
-      Left = 153
+      Left = 177
       Top = 2
       Action = acDeleteRow
       Caption = 'ID_DELLINE'
     end
     object ToolButton17: TToolButton
-      Left = 581
+      Left = 605
       Height = 22
       Top = 2
       Caption = 'ToolButton17'
       Style = tbsDivider
     end
     object ToolButton18: TToolButton
-      Left = 586
+      Left = 610
       Top = 2
       Action = acHelpAbout
     end
     object MCSLabel: TLabel
-      Left = 610
+      Left = 634
       Height = 22
       Top = 2
       Width = 20
@@ -756,7 +756,7 @@ object Form1: TForm1
       OnClick = MCSLabelClick
     end
     object ToolButton19: TToolButton
-      Left = 233
+      Left = 257
       Top = 2
       Action = acHexFile
       Caption = 'ID_HEXFILE'
@@ -768,6 +768,11 @@ object Form1: TForm1
       DropdownMenu = pmExamples
       ImageIndex = 75
     end
+    object ToolButton21: TToolButton
+      Left = 121
+      Top = 2
+      Action = acSaveAs
+    end
   end
   object StatusBar1: TStatusBar
     Left = 0
@@ -945,14 +950,6 @@ object Form1: TForm1
       ShortCut = 16463
       OnAccept = acFileOpenAccept
     end
-    object acFileSaveAs: TFileSaveAs
-      Category = 'File'
-      Caption = 'ID_SAVE'
-      Dialog.DefaultExt = '.tps'
-      Hint = 'Sichern als'
-      ImageIndex = 84
-      OnAccept = acFileSaveAsAccept
-    end
     object acDebug: TAction
       Caption = 'ID_DEBUG'
       Hint = 'Programm starten/stoppen'
@@ -1057,6 +1054,13 @@ object Form1: TForm1
       ImageIndex = 5
       OnExecute = acNextInsertExecute
     end
+    object acSaveAs: TAction
+      Category = 'File'
+      Caption = 'ID_SAVE_AS'
+      Hint = 'ID_SAVE_AS'
+      ImageIndex = 41
+      OnExecute = acSaveAsExecute
+    end
   end
   object ImageList1: TImageList
     Height = 20

+ 9 - 5
ugui.pas

@@ -30,10 +30,10 @@ type
     acHelpAbout: TAction;
     acHexFile: TAction;
     acNextInsert: TAction;
+    acSaveAs: TAction;
     acUpload: TAction;
     ActionList1: TActionList;
     acFileOpen: TFileOpen;
-    acFileSaveAs: TFileSaveAs;
     btnTone: TBitBtn;
     cbTPSVersion: TComboBox;
     cbAdrActual: TCheckBox;
@@ -131,6 +131,7 @@ type
     tbPreset7: TToolButton;
     tbPreset8: TToolButton;
     ToolButton20: TToolButton;
+    ToolButton21: TToolButton;
     ToolButton3: TToolButton;
     ToolButton4: TToolButton;
     ToolButton5: TToolButton;
@@ -144,7 +145,6 @@ type
     procedure acDeleteRowExecute(Sender: TObject);
     procedure acExitExecute(Sender: TObject);
     procedure acFileOpenAccept(Sender: TObject);
-    procedure acFileSaveAsAccept(Sender: TObject);
     procedure acDebugExecute(Sender: TObject);
     procedure acHelpAboutExecute(Sender: TObject);
     procedure acHexFileExecute(Sender: TObject);
@@ -154,6 +154,7 @@ type
     procedure acNextStepExecute(Sender: TObject);
     procedure acPresetLoadAccept(Sender: TObject);
     procedure acPresetSaveAccept(Sender: TObject);
+    procedure acSaveAsExecute(Sender: TObject);
     procedure acShowHexFileExecute(Sender: TObject);
     procedure acStopExecute(Sender: TObject);
     procedure acThisStepExecute(Sender: TObject);
@@ -531,12 +532,15 @@ begin
   end;
 end;
 
-procedure TForm1.acFileSaveAsAccept(Sender: TObject);
+procedure TForm1.acSaveAsExecute(Sender: TObject);
 var
   filename: string;
 begin
-  filename := (Sender as TFileSaveAs).Dialog.FileName;
-  saveFile(filename);
+  if SaveDialog1.Execute() then
+  begin
+    filename := SaveDialog1.FileName;
+    saveFile(filename);
+  end;
 end;
 
 procedure TForm1.saveFile(filename: string);