Ignore:
Timestamp:
Jan 17, 2015, 4:08:03 PM (10 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r65 r67  
    1111type
    1212
    13   { TMainForm }
    14 
    15   TMainForm = class(TForm)
     13  { TFormMain }
     14
     15  TFormMain = class(TForm)
    1616    AViewLog: TAction;
    1717    AProgramShowExecutionPoint: TAction;
     
    140140    procedure TimerRefreshTimer(Sender: TObject);
    141141  private
    142     FCurrentTarget: TTarget;
    143     procedure TargetLogExecute(Lines: TStrings);
    144     procedure SetCurrentTarget(AValue: TTarget);
    145142    procedure AProjectOpenRecentExecute(Sender: TObject);
    146     procedure TargetStateChanged(Sender: TObject);
    147     procedure MessagesChanged(Sender: TObject);
    148143    procedure MenuItemTargetClick(Sender: TObject);
    149144    procedure ProjectOpen(FileName: string);
     
    152147    procedure LastOpenedListChange(Sender: TObject);
    153148  public
     149    procedure MessagesChanged(Sender: TObject);
     150    procedure TargetLogExecute(Lines: TStrings);
     151    procedure TargetStateChanged(Sender: TObject);
    154152    procedure LoadFromRegistry(Root: HKEY; Key: string);
    155153    procedure SaveToRegistry(Root: HKEY; Key: string);
     
    157155    procedure UpdateStatusBar;
    158156    procedure UpdateTargetList;
    159     property CurrentTarget: TTarget read FCurrentTarget write SetCurrentTarget;
    160   end;
    161 
    162 var
    163   MainForm: TMainForm;
     157  end;
     158
     159var
     160  FormMain: TFormMain;
    164161
    165162
     
    184181  SCloseProjectFirst = 'Project need to be closed before it can be openned';
    185182
    186 { TMainForm }
    187 
    188 procedure TMainForm.SetCurrentTarget(AValue: TTarget);
    189 var
    190   I: Integer;
    191 begin
    192   if FCurrentTarget = AValue then Exit;
    193   FCurrentTarget := AValue;
    194   for I := 0 to Core.Targets.Count - 1 do
    195     TTarget(Core.Targets[I]).OnChangeState := nil;
    196   if Assigned(FCurrentTarget) then begin
    197     FCurrentTarget.OnChangeState := TargetStateChanged;
    198     FCurrentTarget.OnLog := TargetLogExecute;
    199     FCurrentTarget.OptimizationLevel := Core.OptimizationLevel;
    200     FCurrentTarget.Messages.OnChange := MessagesChanged;
    201   end;
    202   UpdateTargetList;
    203   UpdateInterface;
    204 end;
    205 
    206 procedure TMainForm.FormShow(Sender: TObject);
     183{ TFormMain }
     184
     185procedure TFormMain.FormShow(Sender: TObject);
    207186begin
    208187  with Core.ScaleDPI do begin
     
    222201end;
    223202
    224 procedure TMainForm.TimerRefreshTimer(Sender: TObject);
     203procedure TFormMain.TimerRefreshTimer(Sender: TObject);
    225204begin
    226205  FormCPU.Reload;
     
    229208end;
    230209
    231 procedure TMainForm.TargetLogExecute(Lines: TStrings);
     210procedure TFormMain.TargetLogExecute(Lines: TStrings);
    232211begin
    233212  FormLog.Memo1.Lines.AddStrings(Lines);
    234213end;
    235214
    236 procedure TMainForm.TargetStateChanged(Sender: TObject);
     215procedure TFormMain.TargetStateChanged(Sender: TObject);
    237216begin
    238217  UpdateInterface;
    239   if CurrentTarget.State = rsPaused then
     218  if Core.CurrentTarget.State = rsPaused then
    240219    AProgramShowExecutionPoint.Execute;
    241   if CurrentTarget.State = rsStopped then CurrentTarget.Messages.AddMessage(SProgramStopped);
    242 end;
    243 
    244 procedure TMainForm.MessagesChanged(Sender: TObject);
     220  if Core.CurrentTarget.State = rsStopped then
     221  Core.CurrentTarget.Messages.AddMessage(SProgramStopped);
     222end;
     223
     224procedure TFormMain.MessagesChanged(Sender: TObject);
    245225begin
    246226  FormMessages.Reload;
    247227end;
    248228
    249 procedure TMainForm.MenuItemTargetClick(Sender: TObject);
     229procedure TFormMain.MenuItemTargetClick(Sender: TObject);
    250230var
    251231  I: Integer;
     
    253233  if Sender is TMenuItem then
    254234  with TMenuItem(Sender) do begin
    255     CurrentTarget := TTarget(Core.Targets[MenuIndex]);
     235    Core.CurrentTarget := TTarget(Core.Targets[MenuIndex]);
    256236    Checked := True;
    257237    for I := 0 to Parent.Count - 1 do
     
    260240end;
    261241
    262 procedure TMainForm.ProjectOpen(FileName: string);
     242procedure TFormMain.ProjectOpen(FileName: string);
    263243begin
    264244  if Core.Project.Openned then
     
    268248  Core.Project.FileName := FileName;
    269249  Core.Project.Openned := True;
    270   CurrentTarget.Compiled := False;
     250  Core.CurrentTarget.Compiled := False;
    271251  UpdateInterface;
    272252end;
    273253
    274 procedure TMainForm.UpdateToolBarHints;
     254procedure TFormMain.UpdateToolBarHints;
    275255var
    276256  I: Integer;
     
    280260end;
    281261
    282 procedure TMainForm.DockInit;
     262procedure TFormMain.DockInit;
    283263begin
    284264  FormSourceCode.ManualDock(TabSheetSource, nil, alClient);
     
    303283  FormMessages.Align := alClient;
    304284  FormMessages.Show;
    305   PageControlRight.Width := MainForm.Width div 3;
    306   PageControlBottom.Height := MainForm.Height div 5;
    307 end;
    308 
    309 procedure TMainForm.LastOpenedListChange(Sender: TObject);
     285  PageControlRight.Width := FormMain.Width div 3;
     286  PageControlBottom.Height := FormMain.Height div 5;
     287end;
     288
     289procedure TFormMain.LastOpenedListChange(Sender: TObject);
    310290begin
    311291  Core.LastOpenedList.LoadToMenuItem(MenuItemOpenRecent, AProjectOpenRecentExecute);
     
    313293end;
    314294
    315 procedure TMainForm.LoadFromRegistry(Root: HKEY; Key: string);
     295procedure TFormMain.LoadFromRegistry(Root: HKEY; Key: string);
    316296var
    317297  TargetName: string;
     
    322302    OpenKey(Key, True);
    323303    TargetName := ReadStringWithDefault('TargetName', 'Interpretter');
    324     CurrentTarget := Core.Targets.FindByName(TargetName);
    325     if not Assigned(CurrentTarget) then CurrentTarget := TTarget(Core.Targets[0]);
     304    Core.CurrentTarget := Core.Targets.FindByName(TargetName);
     305    if not Assigned(Core.CurrentTarget) then
     306      Core.CurrentTarget := TTarget(Core.Targets[0]);
    326307  finally
    327308    Free;
     
    329310end;
    330311
    331 procedure TMainForm.SaveToRegistry(Root: HKEY; Key: string);
     312procedure TFormMain.SaveToRegistry(Root: HKEY; Key: string);
    332313begin
    333314  with TRegistryEx.Create do
     
    335316    RootKey := Root;
    336317    OpenKey(Key, True);
    337     WriteString('TargetName', CurrentTarget.Name);
     318    WriteString('TargetName', Core.CurrentTarget.Name);
    338319  finally
    339320    Free;
     
    341322end;
    342323
    343 procedure TMainForm.UpdateInterface;
     324procedure TFormMain.UpdateInterface;
    344325var
    345326  Title: string;
     
    354335  AProjectClose.Enabled := Core.Project.Openned;
    355336  AProjectSaveAs.Enabled := Core.Project.Openned;
    356   AProgramRun.Enabled := (tcRun in CurrentTarget.Capabilities) and
    357     Core.Project.Openned and (CurrentTarget.State = rsStopped) or (CurrentTarget.State = rsPaused);
    358   AProgramPause.Enabled := (tcPause in CurrentTarget.Capabilities) and
    359     Core.Project.Openned and (CurrentTarget.State = rsRunning);
    360   AProgramStop.Enabled := (tcStop in CurrentTarget.Capabilities) and
    361     Core.Project.Openned and (CurrentTarget.State <> rsStopped);
    362   AProgramCompile.Enabled := (tcCompile in CurrentTarget.Capabilities) and
     337  AProgramRun.Enabled := (tcRun in Core.CurrentTarget.Capabilities) and
     338    Core.Project.Openned and (Core.CurrentTarget.State = rsStopped) or (Core.CurrentTarget.State = rsPaused);
     339  AProgramPause.Enabled := (tcPause in Core.CurrentTarget.Capabilities) and
     340    Core.Project.Openned and (Core.CurrentTarget.State = rsRunning);
     341  AProgramStop.Enabled := (tcStop in Core.CurrentTarget.Capabilities) and
     342    Core.Project.Openned and (Core.CurrentTarget.State <> rsStopped);
     343  AProgramCompile.Enabled := (tcCompile in Core.CurrentTarget.Capabilities) and
    363344    Core.Project.Openned;
    364   AProgramStepInto.Enabled := (tcStepInto in CurrentTarget.Capabilities) and
    365     Core.Project.Openned and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped));
    366   AProgramStepOut.Enabled := (tcStepOut in CurrentTarget.Capabilities) and
    367     Core.Project.Openned and (CurrentTarget.State = rsPaused);
    368   AProgramRunToCursor.Enabled := (tcRunToCursor in CurrentTarget.Capabilities) and
    369     Core.Project.Openned and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped));
    370   AProgramStepOver.Enabled := (tcStepOver in CurrentTarget.Capabilities) and
    371     Core.Project.Openned and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped));
    372   AProgramShowExecutionPoint.Enabled := (tcPause in CurrentTarget.Capabilities) and
    373     Core.Project.Openned and (CurrentTarget.State = rsPaused);
    374   AShowSourcePosition.Enabled := CurrentTarget.Compiled;
    375   AShowTargetPosition.Enabled := CurrentTarget.Compiled;
     345  AProgramStepInto.Enabled := (tcStepInto in Core.CurrentTarget.Capabilities) and
     346    Core.Project.Openned and ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
     347  AProgramStepOut.Enabled := (tcStepOut in Core.CurrentTarget.Capabilities) and
     348    Core.Project.Openned and (Core.CurrentTarget.State = rsPaused);
     349  AProgramRunToCursor.Enabled := (tcRunToCursor in Core.CurrentTarget.Capabilities) and
     350    Core.Project.Openned and ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
     351  AProgramStepOver.Enabled := (tcStepOver in Core.CurrentTarget.Capabilities) and
     352    Core.Project.Openned and ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
     353  AProgramShowExecutionPoint.Enabled := (tcPause in Core.CurrentTarget.Capabilities) and
     354    Core.Project.Openned and (Core.CurrentTarget.State = rsPaused);
     355  AShowSourcePosition.Enabled := Core.CurrentTarget.Compiled;
     356  AShowTargetPosition.Enabled := Core.CurrentTarget.Compiled;
    376357  UpdateStatusBar;
    377358end;
    378359
    379 procedure TMainForm.UpdateStatusBar;
     360procedure TFormMain.UpdateStatusBar;
    380361begin
    381362  StatusBarMain.Panels[0].Text := IntToStr(FormSourceCode.MemoSource.CaretPos.X) +
     
    383364end;
    384365
    385 procedure TMainForm.UpdateTargetList;
     366procedure TFormMain.UpdateTargetList;
    386367var
    387368  I: Integer;
    388369begin
    389   Core.Targets.LoadToMenuItem(MenuItemTarget, MenuItemTargetClick, CurrentTarget);
    390   Core.Targets.LoadToMenuItem(PopupMenuTargets.Items, MenuItemTargetClick, CurrentTarget);
     370  Core.Targets.LoadToMenuItem(MenuItemTarget, MenuItemTargetClick, Core.CurrentTarget);
     371  Core.Targets.LoadToMenuItem(PopupMenuTargets.Items, MenuItemTargetClick, Core.CurrentTarget);
    391372
    392373  // Update toolbutton
    393   I := Core.Targets.IndexOf(CurrentTarget);
     374  I := Core.Targets.IndexOf(Core.CurrentTarget);
    394375  if I <> -1 then
    395376  with TTarget(Core.Targets[I]) do begin
     
    400381end;
    401382
    402 procedure TMainForm.FormCreate(Sender: TObject);
     383procedure TFormMain.FormCreate(Sender: TObject);
    403384begin
    404385  UpdateTargetList;
     
    406387end;
    407388
    408 procedure TMainForm.FormDestroy(Sender: TObject);
     389procedure TFormMain.FormDestroy(Sender: TObject);
    409390begin
    410391  SaveToRegistry(HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey);
    411392end;
    412393
    413 procedure TMainForm.AProgramRunExecute(Sender: TObject);
    414 begin
    415   if CurrentTarget is TTargetInterpretter then
    416     TTargetInterpretter(CurrentTarget).Input := FormInput.MemoInput.Lines.Text;
    417   if not CurrentTarget.Compiled then AProgramCompile.Execute;
    418   CurrentTarget.Run;
    419   CurrentTarget.Messages.AddMessage(SProgramStarted);
    420 end;
    421 
    422 procedure TMainForm.AShowSourcePositionExecute(Sender: TObject);
     394procedure TFormMain.AProgramRunExecute(Sender: TObject);
     395begin
     396  if Core.CurrentTarget is TTargetInterpretter then
     397    TTargetInterpretter(Core.CurrentTarget).Input := FormInput.MemoInput.Lines.Text;
     398  if not Core.CurrentTarget.Compiled then AProgramCompile.Execute;
     399  Core.CurrentTarget.Run;
     400  Core.CurrentTarget.Messages.AddMessage(SProgramStarted);
     401end;
     402
     403procedure TFormMain.AShowSourcePositionExecute(Sender: TObject);
    423404var
    424405  DebugStep: TDebugStep;
    425406begin
    426   DebugStep := CurrentTarget.DebugSteps.SearchByTargetPos(FormTargetCode.MemoTarget.SelStart);
     407  DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(FormTargetCode.MemoTarget.SelStart);
    427408  if Assigned(DebugStep) then begin
    428409    FormSourceCode.MemoSource.SelStart := DebugStep.SourcePosition;
     
    431412end;
    432413
    433 procedure TMainForm.AShowTargetPositionExecute(Sender: TObject);
     414procedure TFormMain.AShowTargetPositionExecute(Sender: TObject);
    434415var
    435416  DebugStep: TDebugStep;
    436417begin
    437   DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
     418  DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
    438419  if Assigned(DebugStep) then begin
    439420    FormTargetCode.MemoTarget.SelStart := DebugStep.TargetPosition;
     
    442423end;
    443424
    444 procedure TMainForm.AViewCompilersExecute(Sender: TObject);
     425procedure TFormMain.AViewCompilersExecute(Sender: TObject);
    445426begin
    446427  FormCompilers.Show;
    447428end;
    448429
    449 procedure TMainForm.AViewInterpretterExecute(Sender: TObject);
     430procedure TFormMain.AViewInterpretterExecute(Sender: TObject);
    450431begin
    451432  FormCPU.Show;
    452433end;
    453434
    454 procedure TMainForm.AViewLogExecute(Sender: TObject);
     435procedure TFormMain.AViewLogExecute(Sender: TObject);
    455436begin
    456437  FormLog.Show;
    457438end;
    458439
    459 procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: boolean);
     440procedure TFormMain.FormCloseQuery(Sender: TObject; var CanClose: boolean);
    460441begin
    461442  if Core.Project.Modified then begin
     
    465446end;
    466447
    467 procedure TMainForm.AExitExecute(Sender: TObject);
     448procedure TFormMain.AExitExecute(Sender: TObject);
    468449begin
    469450  Close;
    470451end;
    471452
    472 procedure TMainForm.AOptionsExecute(Sender: TObject);
     453procedure TFormMain.AOptionsExecute(Sender: TObject);
    473454begin
    474455  OptionsForm.Load;
     
    477458    //OptionsForm.SaveToInterpretter(CurrentTarget);
    478459    OptionsForm.Save;
    479     if Assigned(CurrentTarget) then
    480       CurrentTarget.OptimizationLevel := Core.OptimizationLevel;
    481   end;
    482 end;
    483 
    484 procedure TMainForm.AProgramCompileExecute(Sender: TObject);
    485 begin
    486   with CurrentTarget do begin
     460    if Assigned(Core.CurrentTarget) then
     461      Core.CurrentTarget.OptimizationLevel := Core.OptimizationLevel;
     462  end;
     463end;
     464
     465procedure TFormMain.AProgramCompileExecute(Sender: TObject);
     466begin
     467  with Core.CurrentTarget do begin
    487468    AProgramStop.Execute;
    488469    SourceCode := FormSourceCode.MemoSource.Text;
    489470    ProjectFileName := Core.Project.FileName;
    490471    ProgramName := ExtractFileNameOnly(Core.Project.FileName);
    491     CurrentTarget.Messages.AddMessage(SCompileStart);
     472    Core.CurrentTarget.Messages.AddMessage(SCompileStart);
    492473    Compile;
    493     CurrentTarget.Messages.AppendMessage(SDone);
     474    Core.CurrentTarget.Messages.AppendMessage(SDone);
    494475    FormTargetCode.MemoTarget.Text := TargetCode;
    495476    UpdateInterface;
     
    497478end;
    498479
    499 procedure TMainForm.ABreakpointToggleExecute(Sender: TObject);
     480procedure TFormMain.ABreakpointToggleExecute(Sender: TObject);
    500481var
    501482  DebugStep: TDebugStep;
    502483  BreakPoint: TBreakPoint;
    503484begin
    504   DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
     485  DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
    505486  if Assigned(DebugStep) then begin
    506     BreakPoint := CurrentTarget.BreakPoints.SearchByTargetPos(DebugStep.TargetPosition);
     487    BreakPoint := Core.CurrentTarget.BreakPoints.SearchByTargetPos(DebugStep.TargetPosition);
    507488    if Assigned(BreakPoint) then
    508       CurrentTarget.BreakPoints.Delete(CurrentTarget.BreakPoints.IndexOf(BreakPoint))
    509       else CurrentTarget.BreakPoints.AddItem(DebugStep.TargetPosition);
    510   end;
    511 end;
    512 
    513 procedure TMainForm.AProgramPauseExecute(Sender: TObject);
    514 begin
    515   CurrentTarget.Pause;
    516 end;
    517 
    518 procedure TMainForm.AProgramRunToCursorExecute(Sender: TObject);
     489      Core.CurrentTarget.BreakPoints.Delete(Core.CurrentTarget.BreakPoints.IndexOf(BreakPoint))
     490      else Core.CurrentTarget.BreakPoints.AddItem(DebugStep.TargetPosition);
     491  end;
     492end;
     493
     494procedure TFormMain.AProgramPauseExecute(Sender: TObject);
     495begin
     496  Core.CurrentTarget.Pause;
     497end;
     498
     499procedure TFormMain.AProgramRunToCursorExecute(Sender: TObject);
    519500var
    520501  DebugStep: TDebugStep;
    521502begin
    522   if CurrentTarget.State = rsStopped then begin
    523     if not CurrentTarget.Compiled then AProgramCompile.Execute;
    524     DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
    525     CurrentTarget.BreakPoints.SetSystem(DebugStep.TargetPosition);
     503  if Core.CurrentTarget.State = rsStopped then begin
     504    if not Core.CurrentTarget.Compiled then AProgramCompile.Execute;
     505    DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
     506    Core.CurrentTarget.BreakPoints.SetSystem(DebugStep.TargetPosition);
    526507    AProgramRun.Execute;
    527508  end else begin
    528     DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
    529     CurrentTarget.RunToCursor(DebugStep.TargetPosition);
    530   end;
    531 end;
    532 
    533 procedure TMainForm.AProgramShowExecutionPointExecute(Sender: TObject);
     509    DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
     510    Core.CurrentTarget.RunToCursor(DebugStep.TargetPosition);
     511  end;
     512end;
     513
     514procedure TFormMain.AProgramShowExecutionPointExecute(Sender: TObject);
    534515var
    535516  DebugStep: TDebugStep;
    536517begin
    537   DebugStep := CurrentTarget.DebugSteps.SearchByTargetPos(CurrentTarget.ExecutionPosition);
     518  DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(Core.CurrentTarget.ExecutionPosition);
    538519  FormSourceCode.MemoSource.SelStart := DebugStep.SourcePosition;
    539520  FormTargetCode.MemoTarget.SelStart := DebugStep.TargetPosition;
     
    542523end;
    543524
    544 procedure TMainForm.AProgramStepIntoExecute(Sender: TObject);
    545 begin
    546   if CurrentTarget.State = rsStopped then begin
    547     if not CurrentTarget.Compiled then AProgramCompile.Execute;
    548     CurrentTarget.BreakPoints.SetSystem(TDebugStep(CurrentTarget.DebugSteps.First).TargetPosition);
     525procedure TFormMain.AProgramStepIntoExecute(Sender: TObject);
     526begin
     527  if Core.CurrentTarget.State = rsStopped then begin
     528    if not Core.CurrentTarget.Compiled then AProgramCompile.Execute;
     529    Core.CurrentTarget.BreakPoints.SetSystem(TDebugStep(Core.CurrentTarget.DebugSteps.First).TargetPosition);
    549530    AProgramRun.Execute;
    550   end else CurrentTarget.StepInto;
    551 end;
    552 
    553 procedure TMainForm.AProgramStepOutExecute(Sender: TObject);
    554 begin
    555   CurrentTarget.StepOut;
    556 end;
    557 
    558 procedure TMainForm.AProgramStepOverExecute(Sender: TObject);
    559 begin
    560   if CurrentTarget.State = rsStopped then begin
    561     if not CurrentTarget.Compiled then AProgramCompile.Execute;
    562     CurrentTarget.BreakPoints.SetSystem(TDebugStep(CurrentTarget.DebugSteps.First).TargetPosition);
     531  end else Core.CurrentTarget.StepInto;
     532end;
     533
     534procedure TFormMain.AProgramStepOutExecute(Sender: TObject);
     535begin
     536  Core.CurrentTarget.StepOut;
     537end;
     538
     539procedure TFormMain.AProgramStepOverExecute(Sender: TObject);
     540begin
     541  if Core.CurrentTarget.State = rsStopped then begin
     542    if not Core.CurrentTarget.Compiled then AProgramCompile.Execute;
     543    Core.CurrentTarget.BreakPoints.SetSystem(TDebugStep(Core.CurrentTarget.DebugSteps.First).TargetPosition);
    563544    AProgramRun.Execute;
    564   end else CurrentTarget.StepOver;
    565 end;
    566 
    567 procedure TMainForm.AProgramStopExecute(Sender: TObject);
    568 begin
    569   CurrentTarget.Stop;
    570 end;
    571 
    572 procedure TMainForm.AProjectCloseExecute(Sender: TObject);
     545  end else Core.CurrentTarget.StepOver;
     546end;
     547
     548procedure TFormMain.AProgramStopExecute(Sender: TObject);
     549begin
     550  Core.CurrentTarget.Stop;
     551end;
     552
     553procedure TFormMain.AProjectCloseExecute(Sender: TObject);
    573554var
    574555  DialogResult: TModalResult;
     
    589570end;
    590571
    591 procedure TMainForm.AProjectNewExecute(Sender: TObject);
     572procedure TFormMain.AProjectNewExecute(Sender: TObject);
    592573begin
    593574  AProjectClose.Execute;
     
    596577  FormSourceCode.MemoSource.Clear;
    597578  Core.Project.Openned := True;
    598   CurrentTarget.Compiled := False;
     579  Core.CurrentTarget.Compiled := False;
    599580  UpdateInterface;
    600581end;
    601582
    602 procedure TMainForm.AProjectOpenRecentExecute(Sender: TObject);
     583procedure TFormMain.AProjectOpenRecentExecute(Sender: TObject);
    603584begin
    604585  AProjectClose.Execute;
     
    607588end;
    608589
    609 procedure TMainForm.AProjectOpenExecute(Sender: TObject);
     590procedure TFormMain.AProjectOpenExecute(Sender: TObject);
    610591begin
    611592  if Core.LastOpenedList.Items.Count > 0 then
     
    620601end;
    621602
    622 procedure TMainForm.AProjectSaveAsExecute(Sender: TObject);
     603procedure TFormMain.AProjectSaveAsExecute(Sender: TObject);
    623604begin
    624605  SaveDialog1.FileName := Core.Project.FileName;
     
    632613end;
    633614
    634 procedure TMainForm.AProjectSaveExecute(Sender: TObject);
     615procedure TFormMain.AProjectSaveExecute(Sender: TObject);
    635616begin
    636617  if Core.Project.Modified and FileExistsUTF8(Core.Project.FileName) then begin
Note: See TracChangeset for help on using the changeset viewer.