Changeset 33 for trunk/Forms/UMainForm.pas
- Timestamp:
- Feb 18, 2012, 11:08:44 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UMainForm.pas
r32 r33 18 18 19 19 TMainForm = class(TForm) 20 AShowSourcePosition: TAction; 21 AShowTargetPosition: TAction; 20 22 AProgramCompile: TAction; 21 23 AAbout: TAction; … … 31 33 AProgramStepOver: TAction; 32 34 AProgramStepInto: TAction; 33 AViewCompiled: TAction;34 35 AViewInterpretter: TAction; 35 36 AProgramPause: TAction; … … 47 48 ImageList1: TImageList; 48 49 MainMenu1: TMainMenu; 50 MemoTarget: TMemo; 49 51 MemoSource: TMemo; 50 52 MenuItem1: TMenuItem; … … 76 78 MenuItem34: TMenuItem; 77 79 MenuItem35: TMenuItem; 80 MenuItem36: TMenuItem; 78 81 MenuItemOpenRecent: TMenuItem; 79 82 MenuItemTarget: TMenuItem; … … 86 89 MenuItem9: TMenuItem; 87 90 OpenDialog1: TOpenDialog; 91 PageControl1: TPageControl; 92 PopupMenuTarget: TPopupMenu; 88 93 PopupMenuSource: TPopupMenu; 89 94 SaveDialog1: TSaveDialog; 90 95 StatusBar1: TStatusBar; 91 TabControl1: TTabControl; 96 TabSheetSource: TTabSheet; 97 TabSheetTarget: TTabSheet; 92 98 ToolBar1: TToolBar; 93 99 ToolButton1: TToolButton; … … 121 127 procedure AProjectSaveExecute(Sender: TObject); 122 128 procedure AProgramRunExecute(Sender: TObject); 129 procedure AShowSourcePositionExecute(Sender: TObject); 130 procedure AShowTargetPositionExecute(Sender: TObject); 123 131 procedure AShrinkSourceExecute(Sender: TObject); 124 procedure AViewCompiledExecute(Sender: TObject);125 132 procedure AViewCompilersExecute(Sender: TObject); 126 133 procedure AViewInterpretterExecute(Sender: TObject); … … 167 174 168 175 uses 169 UInterpretterForm, UApplicationInfo, U CompiledForm, UOptionsForm,176 UInterpretterForm, UApplicationInfo, UOptionsForm, 170 177 UTargetDelphi, UTargetPHP, UTargetC, UCompilersForm; 171 178 … … 179 186 procedure TMainForm.FormShow(Sender: TObject); 180 187 begin 188 PageControl1.TabIndex := 0; 181 189 if OpenProjectOnStart and (LastOpenedList.Count > 0) then 182 190 ProjectOpen(LastOpenedList[0]) … … 188 196 begin 189 197 Modified := True; 198 CurrentTarget.Compiled := False; 190 199 UpdateInterface; 191 200 end; … … 236 245 UpdateInterface; 237 246 Modified := False; 247 CurrentTarget.Compiled := False; 238 248 end; 239 249 … … 247 257 TTarget(Targets[I]).OnChangeState := nil; 248 258 FCurrentTarget.OnChangeState := BrainFuckInterpreterChangeState; 259 UpdateInterface; 249 260 end; 250 261 … … 364 375 if CurrentTarget is TTargetInterpretter then 365 376 TTargetInterpretter(CurrentTarget).Input := InterpreterForm.MemoInput.Lines.Text; 366 CurrentTarget.Source := MemoSource.Text;377 CurrentTarget.SourceCode := MemoSource.Text; 367 378 CurrentTarget.Run; 379 end; 380 381 procedure TMainForm.AShowSourcePositionExecute(Sender: TObject); 382 var 383 DebugStep: TDebugStep; 384 begin 385 DebugStep := CurrentTarget.DebugSteps.SearchByTargetPos(MemoSource.SelStart); 386 MemoTarget.SelStart := DebugStep.SourcePosition; 387 PageControl1.TabIndex := 0; 388 end; 389 390 procedure TMainForm.AShowTargetPositionExecute(Sender: TObject); 391 var 392 DebugStep: TDebugStep; 393 begin 394 DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(MemoSource.SelStart); 395 MemoTarget.SelStart := DebugStep.TargetPosition; 396 PageControl1.TabIndex := 1; 368 397 end; 369 398 … … 384 413 SetLength(Source, Pos - 1); 385 414 MemoSource.Text := Source; 386 end;387 388 procedure TMainForm.AViewCompiledExecute(Sender: TObject);389 begin390 CompiledForm.Show;391 415 end; 392 416 … … 466 490 with CurrentTarget do begin 467 491 Optimization := coNormal; 468 Source := MemoSource.Text;492 SourceCode := MemoSource.Text; 469 493 ProgramName := ExtractFileNameOnly(ProjectFileName); 470 494 Compile; 471 CompiledForm.MemoCompiled.Text := Output; 472 CompiledForm.Show; 495 MemoTarget.Text := TargetCode; 473 496 end; 474 497 end; … … 483 506 with CurrentTarget do begin 484 507 Optimization := coNormal; 485 Source := MemoSource.Text;508 SourceCode := MemoSource.Text; 486 509 ProgramName := ExtractFileNameOnly(ProjectFileName); 487 510 ProjectFileName := Self.ProjectFileName; … … 515 538 MemoSource.Clear; 516 539 Modified := False; 540 CurrentTarget.Compiled := False; 517 541 UpdateInterface; 518 542 end;
Note:
See TracChangeset
for help on using the changeset viewer.