Changeset 230 for branches/xpascal/Forms
- Timestamp:
- Jun 26, 2023, 12:08:45 PM (17 months ago)
- Location:
- branches/xpascal/Forms
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xpascal/Forms/FormMain.lfm
r229 r230 1 1 object FormMain: TFormMain 2 Left = 4822 Left = 534 3 3 Height = 993 4 Top = 2 054 Top = 223 5 5 Width = 1491 6 6 Caption = 'Interpreter' … … 125 125 ShortCut = 122 126 126 end 127 object AConsole: TAction 128 Caption = 'Console' 129 OnExecute = AConsoleExecute 130 end 127 131 end 128 132 end -
branches/xpascal/Forms/FormMain.lrj
r227 r230 12 12 {"hash":315140,"name":"tformmain.aexit.caption","sourcebytes":[69,120,105,116],"value":"Exit"}, 13 13 {"hash":209392028,"name":"tformmain.ageneratexml.caption","sourcebytes":[71,101,110,101,114,97,116,101,32,88,77,76],"value":"Generate XML"}, 14 {"hash":371876,"name":"tformmain.atest.caption","sourcebytes":[84,101,115,116],"value":"Test"} 14 {"hash":371876,"name":"tformmain.atest.caption","sourcebytes":[84,101,115,116],"value":"Test"}, 15 {"hash":174433893,"name":"tformmain.aconsole.caption","sourcebytes":[67,111,110,115,111,108,101],"value":"Console"} 15 16 ]} -
branches/xpascal/Forms/FormMain.pas
r229 r230 6 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Menus, 7 7 ActnList, ExtCtrls, SynHighlighterPas, SynEdit, Source, Optimizer, 8 Generator, FormSource, FormMessages, FormOutput, Form Ex;8 Generator, FormSource, FormMessages, FormOutput, FormConsole, FormEx; 9 9 10 10 type … … 14 14 TFormMain = class(TFormEx) 15 15 ACompile: TAction; 16 AConsole: TAction; 16 17 ATest: TAction; 17 18 AGenerateXml: TAction; … … 40 41 Splitter1: TSplitter; 41 42 procedure ACompileExecute(Sender: TObject); 43 procedure AConsoleExecute(Sender: TObject); 42 44 procedure AExitExecute(Sender: TObject); 43 45 procedure AGenerateCSharpExecute(Sender: TObject); … … 58 60 FormMessages: TFormMessages; 59 61 FormOutput: TFormOutput; 62 FormConsole: TFormConsole; 60 63 procedure Generate(GeneratorClass: TGeneratorClass); 61 64 procedure ExecutorOutput(Text: string); 65 function ExecutorInput: string; 62 66 procedure InterpreterError(Pos: TPoint; Text: string); 63 67 procedure UpdateInterface; … … 83 87 if not Initialized then begin 84 88 Initialized := True; 85 FormSource.SynEditSource.Lines.LoadFromFile('Test.pas'); 89 FormSource.SynEditSource.Lines.LoadFromFile('Examples' + DirectorySeparator + 90 'Example.pas'); 86 91 ARun.Execute; 87 92 end; … … 94 99 if Assigned(FormMessages) then FreeAndNil(FormMessages); 95 100 if Assigned(FormOutput) then FreeAndNil(FormOutput); 101 if Assigned(FormConsole) then FreeAndNil(FormConsole); 96 102 end; 97 103 … … 107 113 FormOutput.Show; 108 114 DockForm(FormOutput, PanelOutput); 115 FormConsole := TFormConsole.Create(nil); 116 FormConsole.Show; 117 DockForm(FormConsole, PanelOutput); 109 118 UpdateInterface; 110 119 end; … … 121 130 FormOutput.SetText(Generator.Output); 122 131 TargetFileName := 'Generated' + DirectorySeparator + 123 Generator.Name + DirectorySeparator + ' Test' + Generator.FileExt;132 Generator.Name + DirectorySeparator + 'Example' + Generator.FileExt; 124 133 ForceDirectories(ExtractFileDir(TargetFileName)); 125 134 FormOutput.SynEditOutput.Lines.SaveToFile(TargetFileName); … … 152 161 end; 153 162 163 procedure TFormMain.AConsoleExecute(Sender: TObject); 164 begin 165 166 end; 167 154 168 procedure TFormMain.AGenerateCSharpExecute(Sender: TObject); 155 169 begin … … 161 175 Generate(TGeneratorCSharp); 162 176 end; 177 DockForm(FormOutput, PanelOutput); 163 178 end; 164 179 … … 171 186 Generate(TGeneratorPascal); 172 187 end; 188 DockForm(FormOutput, PanelOutput); 173 189 end; 174 190 … … 182 198 Generate(TGeneratorPhp); 183 199 end; 200 DockForm(FormOutput, PanelOutput); 184 201 end; 185 202 … … 192 209 Generate(TGeneratorXml); 193 210 end; 211 DockForm(FormOutput, PanelOutput); 194 212 end; 195 213 … … 236 254 Executor.Prog := Prog; 237 255 Executor.OnOutput := ExecutorOutput; 256 Executor.OnInput := ExecutorInput; 238 257 Executor.Run; 239 258 Executor.Free; 240 259 end; 260 DockForm(FormConsole, PanelOutput); 261 FormConsole.Memo1.SetFocus; 241 262 end; 242 263 … … 259 280 procedure TFormMain.ExecutorOutput(Text: string); 260 281 begin 261 FormOutput.SynEditOutput.Text := FormOutput.SynEditOutput.Text + Text; 282 FormConsole.Memo1.Text := FormConsole.Memo1.Text + Text; 283 end; 284 285 function TFormMain.ExecutorInput: string; 286 begin 287 Result := FormConsole.GetInputString; 262 288 end; 263 289 -
branches/xpascal/Forms/FormOutput.lfm
r227 r230 1 1 object FormOutput: TFormOutput 2 Left = 6072 Left = 563 3 3 Height = 544 4 Top = 2524 Top = 339 5 5 Width = 932 6 6 Caption = 'Output'
Note:
See TracChangeset
for help on using the changeset viewer.