Changeset 67 for trunk


Ignore:
Timestamp:
Jan 17, 2015, 4:08:03 PM (9 years ago)
Author:
chronos
Message:
Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormCPU.pas

    r52 r67  
    3434
    3535uses
    36   UFormMain, UTargetInterpretter;
     36  UCore, UTargetInterpretter;
    3737
    3838{$R *.lfm}
     
    4545procedure TFormCPU.Reload;
    4646begin
    47   if MainForm.CurrentTarget is TTargetInterpretter then
    48   with TTargetInterpretter(MainForm.CurrentTarget) do begin
     47  if Core.CurrentTarget is TTargetInterpretter then
     48  with TTargetInterpretter(Core.CurrentTarget) do begin
    4949    LabelProgramPointer.Caption := IntToStr(ProgramIndex);
    5050    LabelMemoryPointer.Caption := IntToStr(MemoryPosition);
  • trunk/Forms/UFormInput.pas

    r38 r67  
    3131
    3232uses
    33   UFormMain, UTargetInterpretter;
     33  UCore, UTargetInterpretter;
    3434
    3535procedure TFormInput.MemoInputKeyPress(Sender: TObject; var Key: char);
    3636begin
    37   if MainForm.CurrentTarget is TTargetInterpretter then
    38   with TTargetInterpretter(MainForm.CurrentTarget) do
     37  if Core.CurrentTarget is TTargetInterpretter then
     38  with TTargetInterpretter(Core.CurrentTarget) do
    3939    Input := Input + Key;
    4040end;
  • trunk/Forms/UFormMain.lfm

    r60 r67  
    1 object MainForm: TMainForm
     1object FormMain: TFormMain
    22  Left = 408
    33  Height = 586
     
    6464    object ToolButton5: TToolButton
    6565      Left = 128
     66      Height = 22
    6667      Top = 2
    6768      Width = 10
  • trunk/Forms/UFormMain.lrt

    r60 r67  
    1 TMAINFORM.CAPTION=LazFuck
    2 TMAINFORM.TOOLBUTTONTARGET.HINT=Target select
    3 TMAINFORM.TOOLBUTTONTARGET.CAPTION=Target select
    4 TMAINFORM.TABSHEETDEBUG.CAPTION=Debug
    5 TMAINFORM.TABSHEETSOURCE.CAPTION=Source code
    6 TMAINFORM.TABSHEETTARGET.CAPTION=Target code
    7 TMAINFORM.TABSHEETMESSAGES.CAPTION=Messages
    8 TMAINFORM.MENUITEM1.CAPTION=Project
    9 TMAINFORM.MENUITEMOPENRECENT.CAPTION=Open recent
    10 TMAINFORM.MENUITEM5.CAPTION=-
    11 TMAINFORM.MENUITEM9.CAPTION=Program
    12 TMAINFORM.MENUITEMTARGET.CAPTION=Target
    13 TMAINFORM.MENUITEM17.CAPTION=-
    14 TMAINFORM.MENUITEM24.CAPTION=Tools
    15 TMAINFORM.MENUITEM18.CAPTION=View
    16 TMAINFORM.MENUITEM10.CAPTION=Help
    17 TMAINFORM.APROJECTOPEN.CAPTION=Open
    18 TMAINFORM.APROJECTSAVE.CAPTION=Save
    19 TMAINFORM.APROJECTCLOSE.CAPTION=Close
    20 TMAINFORM.APROJECTSAVEAS.CAPTION=Save as...
    21 TMAINFORM.APROJECTNEW.CAPTION=New
    22 TMAINFORM.AEXIT.CAPTION=Exit
    23 TMAINFORM.APROGRAMCOMPILE.CAPTION=Compile
    24 TMAINFORM.APROGRAMRUN.CAPTION=Run
    25 TMAINFORM.AABOUT.CAPTION=About
    26 TMAINFORM.AHELP.CAPTION=Help
    27 TMAINFORM.APROGRAMPAUSE.CAPTION=Pause
    28 TMAINFORM.APROGRAMSTOP.CAPTION=Stop
    29 TMAINFORM.APROGRAMSTEPINTO.CAPTION=Step into
    30 TMAINFORM.APROGRAMSTEPOVER.CAPTION=Step over
    31 TMAINFORM.APROGRAMRUNTOCURSOR.CAPTION=Run to cursor
    32 TMAINFORM.APROGRAMSTEPOUT.CAPTION=Step out
    33 TMAINFORM.ABREAKPOINTTOGGLE.CAPTION=Toggle breakpoint
    34 TMAINFORM.AOPTIONS.CAPTION=Options
    35 TMAINFORM.AVIEWCOMPILERS.CAPTION=Compilers
    36 TMAINFORM.ASHOWTARGETPOSITION.CAPTION=Show position in target
    37 TMAINFORM.ASHOWSOURCEPOSITION.CAPTION=Show position in source
    38 TMAINFORM.APROGRAMSHOWEXECUTIONPOINT.CAPTION=Show execution point
    39 TMAINFORM.AVIEWLOG.CAPTION=Log
     1TFORMMAIN.CAPTION=LazFuck
     2TFORMMAIN.TOOLBUTTONTARGET.HINT=Target select
     3TFORMMAIN.TOOLBUTTONTARGET.CAPTION=Target select
     4TFORMMAIN.TABSHEETDEBUG.CAPTION=Debug
     5TFORMMAIN.TABSHEETSOURCE.CAPTION=Source code
     6TFORMMAIN.TABSHEETTARGET.CAPTION=Target code
     7TFORMMAIN.TABSHEETMESSAGES.CAPTION=Messages
     8TFORMMAIN.MENUITEM1.CAPTION=Project
     9TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent
     10TFORMMAIN.MENUITEM5.CAPTION=-
     11TFORMMAIN.MENUITEM9.CAPTION=Program
     12TFORMMAIN.MENUITEMTARGET.CAPTION=Target
     13TFORMMAIN.MENUITEM17.CAPTION=-
     14TFORMMAIN.MENUITEM24.CAPTION=Tools
     15TFORMMAIN.MENUITEM18.CAPTION=View
     16TFORMMAIN.MENUITEM10.CAPTION=Help
     17TFORMMAIN.APROJECTOPEN.CAPTION=Open
     18TFORMMAIN.APROJECTSAVE.CAPTION=Save
     19TFORMMAIN.APROJECTCLOSE.CAPTION=Close
     20TFORMMAIN.APROJECTSAVEAS.CAPTION=Save as...
     21TFORMMAIN.APROJECTNEW.CAPTION=New
     22TFORMMAIN.AEXIT.CAPTION=Exit
     23TFORMMAIN.APROGRAMCOMPILE.CAPTION=Compile
     24TFORMMAIN.APROGRAMRUN.CAPTION=Run
     25TFORMMAIN.AABOUT.CAPTION=About
     26TFORMMAIN.AHELP.CAPTION=Help
     27TFORMMAIN.APROGRAMPAUSE.CAPTION=Pause
     28TFORMMAIN.APROGRAMSTOP.CAPTION=Stop
     29TFORMMAIN.APROGRAMSTEPINTO.CAPTION=Step into
     30TFORMMAIN.APROGRAMSTEPOVER.CAPTION=Step over
     31TFORMMAIN.APROGRAMRUNTOCURSOR.CAPTION=Run to cursor
     32TFORMMAIN.APROGRAMSTEPOUT.CAPTION=Step out
     33TFORMMAIN.ABREAKPOINTTOGGLE.CAPTION=Toggle breakpoint
     34TFORMMAIN.AOPTIONS.CAPTION=Options
     35TFORMMAIN.AVIEWCOMPILERS.CAPTION=Compilers
     36TFORMMAIN.ASHOWTARGETPOSITION.CAPTION=Show position in target
     37TFORMMAIN.ASHOWSOURCEPOSITION.CAPTION=Show position in source
     38TFORMMAIN.APROGRAMSHOWEXECUTIONPOINT.CAPTION=Show execution point
     39TFORMMAIN.AVIEWLOG.CAPTION=Log
  • 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
  • trunk/Forms/UFormMemory.pas

    r61 r67  
    3434
    3535uses
    36   UFormMain, UTargetInterpretter;
     36  UCore, UTargetInterpretter;
    3737
    3838{ TFormMemory }
     
    4040procedure TFormMemory.Reload;
    4141begin
    42   if MainForm.CurrentTarget is TTargetInterpretter then
    43   with TTargetInterpretter(MainForm.CurrentTarget) do begin
     42  if Core.CurrentTarget is TTargetInterpretter then
     43  with TTargetInterpretter(Core.CurrentTarget) do begin
    4444    ListViewMemory.Items.Count := Trunc(Length(Memory) / RowSize);
    4545    ListViewMemory.Refresh;
     
    5252  I: Integer;
    5353begin
    54   if MainForm.CurrentTarget is TTargetInterpretter then
    55   with TTargetInterpretter(MainForm.CurrentTarget) do
     54  if Core.CurrentTarget is TTargetInterpretter then
     55  with TTargetInterpretter(Core.CurrentTarget) do
    5656  if (Item.Index >= 0) and (Item.Index < Trunc(Length(Memory) / RowSize)) then begin
    5757    Item.Caption := IntToHex(Item.Index * RowSize, 8);
  • trunk/Forms/UFormMessages.pas

    r40 r67  
    3131
    3232uses
    33   UFormMain, UTarget;
     33  UCore, UTarget;
    3434
    3535{ TFormMessages }
     
    3737procedure TFormMessages.ListView1Data(Sender: TObject; Item: TListItem);
    3838begin
    39   with MainForm.CurrentTarget do
     39  with Core.CurrentTarget do
    4040  if (Item.Index >= 0) and (Item.Index < Messages.Count) then
    4141  with TMessage(Messages[Item.Index]) do begin
     
    5252procedure TFormMessages.Reload;
    5353begin
    54   ListView1.Items.Count := MainForm.CurrentTarget.Messages.Count;
     54  ListView1.Items.Count := Core.CurrentTarget.Messages.Count;
    5555  ListView1.Refresh;
    5656end;
  • trunk/Forms/UFormOptions.lfm

    r64 r67  
    11object OptionsForm: TOptionsForm
    2   Left = 415
     2  Left = 665
    33  Height = 339
    4   Top = 210
     4  Top = 370
    55  Width = 468
    66  Caption = 'Options'
  • trunk/Forms/UFormOutput.pas

    r38 r67  
    2929
    3030uses
    31   UFormMain, UTargetInterpretter;
     31  UCore, UTargetInterpretter;
    3232
    3333{ TFormOutput }
     
    3535procedure TFormOutput.Reload;
    3636begin
    37   if MainForm.CurrentTarget is TTargetInterpretter then
    38   with TTargetInterpretter(MainForm.CurrentTarget) do
     37  if Core.CurrentTarget is TTargetInterpretter then
     38  with TTargetInterpretter(Core.CurrentTarget) do
    3939    MemoOutput.Lines.Text := Output;
    4040end;
  • trunk/Forms/UFormSourceCode.lfm

    r61 r67  
    2727  end
    2828  object PopupMenuSource: TPopupMenu
    29     Images = MainForm.ImageListMain
     29    Images = FormMain.ImageListMain
    3030    left = 128
    3131    top = 112
    3232    object MenuItem23: TMenuItem
    33       Action = MainForm.ABreakpointToggle
     33      Action = FormMain.ABreakpointToggle
    3434    end
    3535    object MenuItem26: TMenuItem
     
    7676    end
    7777    object MenuItem29: TMenuItem
    78       Action = MainForm.AShowTargetPosition
     78      Action = FormMain.AShowTargetPosition
    7979      Bitmap.Data = {
    8080        36040000424D3604000000000000360000002800000010000000100000000100
     
    281281  end
    282282  object ActionList1: TActionList
    283     Images = MainForm.ImageListMain
     283    Images = FormMain.ImageListMain
    284284    left = 128
    285285    top = 56
  • trunk/Forms/UFormSourceCode.pas

    r61 r67  
    169169begin
    170170  Core.Project.Modified := True;
    171   MainForm.CurrentTarget.Compiled := False;
    172   MainForm.UpdateInterface;
     171  Core.CurrentTarget.Compiled := False;
     172  FormMain.UpdateInterface;
    173173end;
    174174
     
    185185  Shift: TShiftState);
    186186begin
    187   MainForm.UpdateStatusBar;
     187  FormMain.UpdateStatusBar;
    188188end;
    189189
     
    191191  Shift: TShiftState; X, Y: Integer);
    192192begin
    193   MainForm.UpdateStatusBar;
     193  FormMain.UpdateStatusBar;
    194194end;
    195195
  • trunk/Languages/LazFuckIDE.cs.po

    r65 r67  
    106106msgstr "Záznam"
    107107
     108#: tformmain.aabout.caption
     109#, fuzzy
     110msgctxt "tformmain.aabout.caption"
     111msgid "About"
     112msgstr "O programu"
     113
     114#: tformmain.abreakpointtoggle.caption
     115#, fuzzy
     116msgctxt "tformmain.abreakpointtoggle.caption"
     117msgid "Toggle breakpoint"
     118msgstr "Přepnout bod zastavení"
     119
     120#: tformmain.aexit.caption
     121#, fuzzy
     122msgctxt "tformmain.aexit.caption"
     123msgid "Exit"
     124msgstr "Ukončit"
     125
     126#: tformmain.ahelp.caption
     127#, fuzzy
     128msgctxt "tformmain.ahelp.caption"
     129msgid "Help"
     130msgstr "Nápověda"
     131
     132#: tformmain.aoptions.caption
     133#, fuzzy
     134msgctxt "tformmain.aoptions.caption"
     135msgid "Options"
     136msgstr "Volby"
     137
     138#: tformmain.aprogramcompile.caption
     139#, fuzzy
     140msgctxt "tformmain.aprogramcompile.caption"
     141msgid "Compile"
     142msgstr "PřeloÅŸit"
     143
     144#: tformmain.aprogrampause.caption
     145#, fuzzy
     146msgctxt "tformmain.aprogrampause.caption"
     147msgid "Pause"
     148msgstr "Pozastavit"
     149
     150#: tformmain.aprogramrun.caption
     151#, fuzzy
     152msgctxt "tformmain.aprogramrun.caption"
     153msgid "Run"
     154msgstr "Spustit"
     155
     156#: tformmain.aprogramruntocursor.caption
     157#, fuzzy
     158msgctxt "tformmain.aprogramruntocursor.caption"
     159msgid "Run to cursor"
     160msgstr "Spustit po ukazatel"
     161
     162#: tformmain.aprogramshowexecutionpoint.caption
     163#, fuzzy
     164msgctxt "tformmain.aprogramshowexecutionpoint.caption"
     165msgid "Show execution point"
     166msgstr "Ukázat bod vykonání"
     167
     168#: tformmain.aprogramstepinto.caption
     169#, fuzzy
     170msgctxt "tformmain.aprogramstepinto.caption"
     171msgid "Step into"
     172msgstr "Vstoupit do"
     173
     174#: tformmain.aprogramstepout.caption
     175#, fuzzy
     176msgctxt "tformmain.aprogramstepout.caption"
     177msgid "Step out"
     178msgstr "Vystoupit z"
     179
     180#: tformmain.aprogramstepover.caption
     181#, fuzzy
     182msgctxt "tformmain.aprogramstepover.caption"
     183msgid "Step over"
     184msgstr "Přejít přes"
     185
     186#: tformmain.aprogramstop.caption
     187#, fuzzy
     188msgctxt "tformmain.aprogramstop.caption"
     189msgid "Stop"
     190msgstr "Zastavit"
     191
     192#: tformmain.aprojectclose.caption
     193#, fuzzy
     194msgctxt "tformmain.aprojectclose.caption"
     195msgid "Close"
     196msgstr "Zavřít"
     197
     198#: tformmain.aprojectnew.caption
     199#, fuzzy
     200msgctxt "tformmain.aprojectnew.caption"
     201msgid "New"
     202msgstr "NovÃœ"
     203
     204#: tformmain.aprojectopen.caption
     205#, fuzzy
     206msgctxt "tformmain.aprojectopen.caption"
     207msgid "Open"
     208msgstr "Otevřít"
     209
     210#: tformmain.aprojectsave.caption
     211#, fuzzy
     212msgctxt "tformmain.aprojectsave.caption"
     213msgid "Save"
     214msgstr "UloÅŸit"
     215
     216#: tformmain.aprojectsaveas.caption
     217#, fuzzy
     218msgctxt "tformmain.aprojectsaveas.caption"
     219msgid "Save as..."
     220msgstr "UloÅŸit jako..."
     221
     222#: tformmain.ashowsourceposition.caption
     223#, fuzzy
     224msgctxt "tformmain.ashowsourceposition.caption"
     225msgid "Show position in source"
     226msgstr "UkaÅŸ pozici ve zdroji"
     227
     228#: tformmain.ashowtargetposition.caption
     229#, fuzzy
     230msgctxt "tformmain.ashowtargetposition.caption"
     231msgid "Show position in target"
     232msgstr "UkaÅŸ pozici v cíli"
     233
     234#: tformmain.aviewcompilers.caption
     235#, fuzzy
     236msgctxt "tformmain.aviewcompilers.caption"
     237msgid "Compilers"
     238msgstr "Překladače"
     239
     240#: tformmain.aviewlog.caption
     241#, fuzzy
     242msgctxt "tformmain.aviewlog.caption"
     243msgid "Log"
     244msgstr "Záznam"
     245
     246#: tformmain.caption
     247#, fuzzy
     248msgctxt "tformmain.caption"
     249msgid "LazFuck"
     250msgstr "LazFuck"
     251
     252#: tformmain.menuitem1.caption
     253#, fuzzy
     254msgctxt "tformmain.menuitem1.caption"
     255msgid "Project"
     256msgstr "Projekt"
     257
     258#: tformmain.menuitem10.caption
     259#, fuzzy
     260msgctxt "tformmain.menuitem10.caption"
     261msgid "Help"
     262msgstr "Nápověda"
     263
     264#: tformmain.menuitem17.caption
     265#, fuzzy
     266msgctxt "tformmain.menuitem17.caption"
     267msgid "-"
     268msgstr "-"
     269
     270#: tformmain.menuitem18.caption
     271#, fuzzy
     272msgctxt "tformmain.menuitem18.caption"
     273msgid "View"
     274msgstr "Zobrazení"
     275
     276#: tformmain.menuitem24.caption
     277#, fuzzy
     278msgctxt "tformmain.menuitem24.caption"
     279msgid "Tools"
     280msgstr "Nástroje"
     281
     282#: tformmain.menuitem5.caption
     283#, fuzzy
     284msgctxt "tformmain.menuitem5.caption"
     285msgid "-"
     286msgstr "-"
     287
     288#: tformmain.menuitem9.caption
     289#, fuzzy
     290msgctxt "tformmain.menuitem9.caption"
     291msgid "Program"
     292msgstr "Program"
     293
     294#: tformmain.menuitemopenrecent.caption
     295#, fuzzy
     296msgctxt "tformmain.menuitemopenrecent.caption"
     297msgid "Open recent"
     298msgstr "Otevřít nedávnÃœ"
     299
     300#: tformmain.menuitemtarget.caption
     301#, fuzzy
     302msgctxt "tformmain.menuitemtarget.caption"
     303msgid "Target"
     304msgstr "Cíl"
     305
     306#: tformmain.tabsheetdebug.caption
     307#, fuzzy
     308msgctxt "tformmain.tabsheetdebug.caption"
     309msgid "Debug"
     310msgstr "Ladění"
     311
     312#: tformmain.tabsheetmessages.caption
     313#, fuzzy
     314msgctxt "tformmain.tabsheetmessages.caption"
     315msgid "Messages"
     316msgstr "Zprávy"
     317
     318#: tformmain.tabsheetsource.caption
     319#, fuzzy
     320msgctxt "tformmain.tabsheetsource.caption"
     321msgid "Source code"
     322msgstr "ZdrojovÃœ kód"
     323
     324#: tformmain.tabsheettarget.caption
     325#, fuzzy
     326msgctxt "tformmain.tabsheettarget.caption"
     327msgid "Target code"
     328msgstr "CílovÃœ kód"
     329
     330#: tformmain.toolbuttontarget.caption
     331#, fuzzy
     332msgctxt "tformmain.toolbuttontarget.caption"
     333msgid "Target select"
     334msgstr "VÃœběr cíle"
     335
     336#: tformmain.toolbuttontarget.hint
     337#, fuzzy
     338msgctxt "tformmain.toolbuttontarget.hint"
     339msgid "Target select"
     340msgstr "VÃœběr cíle"
     341
    108342#: tformmemory.caption
    109343msgid "Memory"
     
    338572
    339573#: tmainform.aabout.caption
     574msgctxt "tmainform.aabout.caption"
    340575msgid "About"
    341576msgstr "O programu"
    342577
    343578#: tmainform.abreakpointtoggle.caption
     579msgctxt "tmainform.abreakpointtoggle.caption"
    344580msgid "Toggle breakpoint"
    345581msgstr "Přepnout bod zastavení"
    346582
    347583#: tmainform.aexit.caption
     584msgctxt "tmainform.aexit.caption"
    348585msgid "Exit"
    349586msgstr "Ukončit"
     
    365602
    366603#: tmainform.aprogrampause.caption
     604msgctxt "tmainform.aprogrampause.caption"
    367605msgid "Pause"
    368606msgstr "Pozastavit"
    369607
    370608#: tmainform.aprogramrun.caption
     609msgctxt "tmainform.aprogramrun.caption"
    371610msgid "Run"
    372611msgstr "Spustit"
     
    378617
    379618#: tmainform.aprogramshowexecutionpoint.caption
     619msgctxt "tmainform.aprogramshowexecutionpoint.caption"
    380620msgid "Show execution point"
    381621msgstr "Ukázat bod vykonání"
     
    397637
    398638#: tmainform.aprogramstop.caption
     639msgctxt "tmainform.aprogramstop.caption"
    399640msgid "Stop"
    400641msgstr "Zastavit"
    401642
    402643#: tmainform.aprojectclose.caption
     644msgctxt "tmainform.aprojectclose.caption"
    403645msgid "Close"
    404646msgstr "Zavřít"
    405647
    406648#: tmainform.aprojectnew.caption
     649msgctxt "tmainform.aprojectnew.caption"
    407650msgid "New"
    408651msgstr "NovÜ"
    409652
    410653#: tmainform.aprojectopen.caption
     654msgctxt "tmainform.aprojectopen.caption"
    411655msgid "Open"
    412656msgstr "Otevřít"
    413657
    414658#: tmainform.aprojectsave.caption
     659msgctxt "tmainform.aprojectsave.caption"
    415660msgid "Save"
    416661msgstr "UloÅŸit"
    417662
    418663#: tmainform.aprojectsaveas.caption
     664msgctxt "tmainform.aprojectsaveas.caption"
    419665msgid "Save as..."
    420666msgstr "UloÅŸit jako..."
    421667
    422668#: tmainform.ashowsourceposition.caption
     669msgctxt "tmainform.ashowsourceposition.caption"
    423670msgid "Show position in source"
    424671msgstr "UkaÅŸ pozici ve zdroji"
    425672
    426673#: tmainform.ashowtargetposition.caption
     674msgctxt "tmainform.ashowtargetposition.caption"
    427675msgid "Show position in target"
    428676msgstr "Ukaş pozici v cíli"
     
    439687
    440688#: tmainform.caption
     689msgctxt "tmainform.caption"
    441690msgid "LazFuck"
    442691msgstr "LazFuck"
    443692
    444693#: tmainform.menuitem1.caption
     694msgctxt "tmainform.menuitem1.caption"
    445695msgid "Project"
    446696msgstr "Projekt"
     
    457707
    458708#: tmainform.menuitem18.caption
     709msgctxt "tmainform.menuitem18.caption"
    459710msgid "View"
    460711msgstr "Zobrazení"
    461712
    462713#: tmainform.menuitem24.caption
     714msgctxt "tmainform.menuitem24.caption"
    463715msgid "Tools"
    464716msgstr "Nástroje"
     
    470722
    471723#: tmainform.menuitem9.caption
     724msgctxt "tmainform.menuitem9.caption"
    472725msgid "Program"
    473726msgstr "Program"
    474727
    475728#: tmainform.menuitemopenrecent.caption
     729msgctxt "tmainform.menuitemopenrecent.caption"
    476730msgid "Open recent"
    477731msgstr "Otevřít nedávnÃœ"
     
    7631017msgid "Unsupported command"
    7641018msgstr "NepodporovanÃœ příkaz"
     1019
  • trunk/Languages/LazFuckIDE.po

    r65 r67  
    9595msgstr ""
    9696
     97#: tformmain.aabout.caption
     98msgctxt "TFORMMAIN.AABOUT.CAPTION"
     99msgid "About"
     100msgstr ""
     101
     102#: tformmain.abreakpointtoggle.caption
     103msgctxt "TFORMMAIN.ABREAKPOINTTOGGLE.CAPTION"
     104msgid "Toggle breakpoint"
     105msgstr ""
     106
     107#: tformmain.aexit.caption
     108msgctxt "TFORMMAIN.AEXIT.CAPTION"
     109msgid "Exit"
     110msgstr ""
     111
     112#: tformmain.ahelp.caption
     113msgctxt "TFORMMAIN.AHELP.CAPTION"
     114msgid "Help"
     115msgstr ""
     116
     117#: tformmain.aoptions.caption
     118msgctxt "TFORMMAIN.AOPTIONS.CAPTION"
     119msgid "Options"
     120msgstr ""
     121
     122#: tformmain.aprogramcompile.caption
     123msgctxt "TFORMMAIN.APROGRAMCOMPILE.CAPTION"
     124msgid "Compile"
     125msgstr ""
     126
     127#: tformmain.aprogrampause.caption
     128msgctxt "TFORMMAIN.APROGRAMPAUSE.CAPTION"
     129msgid "Pause"
     130msgstr ""
     131
     132#: tformmain.aprogramrun.caption
     133msgctxt "TFORMMAIN.APROGRAMRUN.CAPTION"
     134msgid "Run"
     135msgstr ""
     136
     137#: tformmain.aprogramruntocursor.caption
     138msgctxt "TFORMMAIN.APROGRAMRUNTOCURSOR.CAPTION"
     139msgid "Run to cursor"
     140msgstr ""
     141
     142#: tformmain.aprogramshowexecutionpoint.caption
     143msgctxt "TFORMMAIN.APROGRAMSHOWEXECUTIONPOINT.CAPTION"
     144msgid "Show execution point"
     145msgstr ""
     146
     147#: tformmain.aprogramstepinto.caption
     148msgctxt "TFORMMAIN.APROGRAMSTEPINTO.CAPTION"
     149msgid "Step into"
     150msgstr ""
     151
     152#: tformmain.aprogramstepout.caption
     153msgctxt "TFORMMAIN.APROGRAMSTEPOUT.CAPTION"
     154msgid "Step out"
     155msgstr ""
     156
     157#: tformmain.aprogramstepover.caption
     158msgctxt "TFORMMAIN.APROGRAMSTEPOVER.CAPTION"
     159msgid "Step over"
     160msgstr ""
     161
     162#: tformmain.aprogramstop.caption
     163msgctxt "TFORMMAIN.APROGRAMSTOP.CAPTION"
     164msgid "Stop"
     165msgstr ""
     166
     167#: tformmain.aprojectclose.caption
     168msgctxt "TFORMMAIN.APROJECTCLOSE.CAPTION"
     169msgid "Close"
     170msgstr ""
     171
     172#: tformmain.aprojectnew.caption
     173msgctxt "TFORMMAIN.APROJECTNEW.CAPTION"
     174msgid "New"
     175msgstr ""
     176
     177#: tformmain.aprojectopen.caption
     178msgctxt "TFORMMAIN.APROJECTOPEN.CAPTION"
     179msgid "Open"
     180msgstr ""
     181
     182#: tformmain.aprojectsave.caption
     183msgctxt "TFORMMAIN.APROJECTSAVE.CAPTION"
     184msgid "Save"
     185msgstr ""
     186
     187#: tformmain.aprojectsaveas.caption
     188msgctxt "TFORMMAIN.APROJECTSAVEAS.CAPTION"
     189msgid "Save as..."
     190msgstr ""
     191
     192#: tformmain.ashowsourceposition.caption
     193msgctxt "TFORMMAIN.ASHOWSOURCEPOSITION.CAPTION"
     194msgid "Show position in source"
     195msgstr ""
     196
     197#: tformmain.ashowtargetposition.caption
     198msgctxt "TFORMMAIN.ASHOWTARGETPOSITION.CAPTION"
     199msgid "Show position in target"
     200msgstr ""
     201
     202#: tformmain.aviewcompilers.caption
     203msgctxt "TFORMMAIN.AVIEWCOMPILERS.CAPTION"
     204msgid "Compilers"
     205msgstr ""
     206
     207#: tformmain.aviewlog.caption
     208msgctxt "TFORMMAIN.AVIEWLOG.CAPTION"
     209msgid "Log"
     210msgstr ""
     211
     212#: tformmain.caption
     213msgctxt "TFORMMAIN.CAPTION"
     214msgid "LazFuck"
     215msgstr ""
     216
     217#: tformmain.menuitem1.caption
     218msgctxt "TFORMMAIN.MENUITEM1.CAPTION"
     219msgid "Project"
     220msgstr ""
     221
     222#: tformmain.menuitem10.caption
     223msgctxt "TFORMMAIN.MENUITEM10.CAPTION"
     224msgid "Help"
     225msgstr ""
     226
     227#: tformmain.menuitem17.caption
     228msgctxt "TFORMMAIN.MENUITEM17.CAPTION"
     229msgid "-"
     230msgstr ""
     231
     232#: tformmain.menuitem18.caption
     233msgctxt "TFORMMAIN.MENUITEM18.CAPTION"
     234msgid "View"
     235msgstr ""
     236
     237#: tformmain.menuitem24.caption
     238msgctxt "TFORMMAIN.MENUITEM24.CAPTION"
     239msgid "Tools"
     240msgstr ""
     241
     242#: tformmain.menuitem5.caption
     243msgctxt "TFORMMAIN.MENUITEM5.CAPTION"
     244msgid "-"
     245msgstr ""
     246
     247#: tformmain.menuitem9.caption
     248msgctxt "TFORMMAIN.MENUITEM9.CAPTION"
     249msgid "Program"
     250msgstr ""
     251
     252#: tformmain.menuitemopenrecent.caption
     253msgctxt "TFORMMAIN.MENUITEMOPENRECENT.CAPTION"
     254msgid "Open recent"
     255msgstr ""
     256
     257#: tformmain.menuitemtarget.caption
     258msgctxt "TFORMMAIN.MENUITEMTARGET.CAPTION"
     259msgid "Target"
     260msgstr ""
     261
     262#: tformmain.tabsheetdebug.caption
     263msgctxt "TFORMMAIN.TABSHEETDEBUG.CAPTION"
     264msgid "Debug"
     265msgstr ""
     266
     267#: tformmain.tabsheetmessages.caption
     268msgctxt "TFORMMAIN.TABSHEETMESSAGES.CAPTION"
     269msgid "Messages"
     270msgstr ""
     271
     272#: tformmain.tabsheetsource.caption
     273msgctxt "TFORMMAIN.TABSHEETSOURCE.CAPTION"
     274msgid "Source code"
     275msgstr ""
     276
     277#: tformmain.tabsheettarget.caption
     278msgctxt "TFORMMAIN.TABSHEETTARGET.CAPTION"
     279msgid "Target code"
     280msgstr ""
     281
     282#: tformmain.toolbuttontarget.caption
     283msgctxt "TFORMMAIN.TOOLBUTTONTARGET.CAPTION"
     284msgid "Target select"
     285msgstr ""
     286
     287#: tformmain.toolbuttontarget.hint
     288msgctxt "TFORMMAIN.TOOLBUTTONTARGET.HINT"
     289msgid "Target select"
     290msgstr ""
     291
    97292#: tformmemory.caption
    98293msgid "Memory"
     
    325520
    326521#: tmainform.aabout.caption
     522msgctxt "tmainform.aabout.caption"
    327523msgid "About"
    328524msgstr ""
    329525
    330526#: tmainform.abreakpointtoggle.caption
     527msgctxt "tmainform.abreakpointtoggle.caption"
    331528msgid "Toggle breakpoint"
    332529msgstr ""
    333530
    334531#: tmainform.aexit.caption
     532msgctxt "tmainform.aexit.caption"
    335533msgid "Exit"
    336534msgstr ""
     
    352550
    353551#: tmainform.aprogrampause.caption
     552msgctxt "tmainform.aprogrampause.caption"
    354553msgid "Pause"
    355554msgstr ""
    356555
    357556#: tmainform.aprogramrun.caption
     557msgctxt "tmainform.aprogramrun.caption"
    358558msgid "Run"
    359559msgstr ""
     
    365565
    366566#: tmainform.aprogramshowexecutionpoint.caption
     567msgctxt "tmainform.aprogramshowexecutionpoint.caption"
    367568msgid "Show execution point"
    368569msgstr ""
     
    384585
    385586#: tmainform.aprogramstop.caption
     587msgctxt "tmainform.aprogramstop.caption"
    386588msgid "Stop"
    387589msgstr ""
    388590
    389591#: tmainform.aprojectclose.caption
     592msgctxt "tmainform.aprojectclose.caption"
    390593msgid "Close"
    391594msgstr ""
    392595
    393596#: tmainform.aprojectnew.caption
     597msgctxt "tmainform.aprojectnew.caption"
    394598msgid "New"
    395599msgstr ""
    396600
    397601#: tmainform.aprojectopen.caption
     602msgctxt "tmainform.aprojectopen.caption"
    398603msgid "Open"
    399604msgstr ""
    400605
    401606#: tmainform.aprojectsave.caption
     607msgctxt "tmainform.aprojectsave.caption"
    402608msgid "Save"
    403609msgstr ""
    404610
    405611#: tmainform.aprojectsaveas.caption
     612msgctxt "tmainform.aprojectsaveas.caption"
    406613msgid "Save as..."
    407614msgstr ""
    408615
    409616#: tmainform.ashowsourceposition.caption
     617msgctxt "tmainform.ashowsourceposition.caption"
    410618msgid "Show position in source"
    411619msgstr ""
    412620
    413621#: tmainform.ashowtargetposition.caption
     622msgctxt "tmainform.ashowtargetposition.caption"
    414623msgid "Show position in target"
    415624msgstr ""
     
    426635
    427636#: tmainform.caption
     637msgctxt "tmainform.caption"
    428638msgid "LazFuck"
    429639msgstr ""
    430640
    431641#: tmainform.menuitem1.caption
     642msgctxt "tmainform.menuitem1.caption"
    432643msgid "Project"
    433644msgstr ""
     
    444655
    445656#: tmainform.menuitem18.caption
     657msgctxt "tmainform.menuitem18.caption"
    446658msgid "View"
    447659msgstr ""
    448660
    449661#: tmainform.menuitem24.caption
     662msgctxt "tmainform.menuitem24.caption"
    450663msgid "Tools"
    451664msgstr ""
     
    457670
    458671#: tmainform.menuitem9.caption
     672msgctxt "tmainform.menuitem9.caption"
    459673msgid "Program"
    460674msgstr ""
    461675
    462676#: tmainform.menuitemopenrecent.caption
     677msgctxt "tmainform.menuitemopenrecent.caption"
    463678msgid "Open recent"
    464679msgstr ""
  • trunk/LazFuckIDE.lpi

    r66 r67  
    104104        <Filename Value="Forms\UFormMain.pas"/>
    105105        <IsPartOfProject Value="True"/>
    106         <ComponentName Value="MainForm"/>
     106        <ComponentName Value="FormMain"/>
    107107        <HasResources Value="True"/>
    108108        <ResourceBaseClass Value="Form"/>
  • trunk/LazFuckIDE.lpr

    r66 r67  
    2222  Application.Initialize;
    2323  Application.CreateForm(TCore, Core);
    24   Application.CreateForm(TMainForm, MainForm);
     24  Application.CreateForm(TFormMain, FormMain);
    2525  Application.CreateForm(TFormCPU, FormCPU);
    2626  Application.CreateForm(TOptionsForm, OptionsForm);
  • trunk/UCore.pas

    r64 r67  
    2020    procedure DataModuleDestroy(Sender: TObject);
    2121  private
     22    FCurrentTarget: TTarget;
     23    procedure SetCurrentTarget(AValue: TTarget);
    2224  public
    2325    ScaleDPI: TScaleDPI;
     
    2830    procedure LoadFromRegistry(Root: HKEY; Key: string);
    2931    procedure SaveToRegistry(Root: HKEY; Key: string);
     32    property CurrentTarget: TTarget read FCurrentTarget write SetCurrentTarget;
    3033  end;
    3134
     
    3942
    4043uses
    41   UTargetJava, UTargetDelphi, UTargetPHP, UTargetC, UTargetInterpretter, UTargetFPC;
     44  UFormMain, UTargetJava, UTargetDelphi, UTargetPHP, UTargetC,
     45  UTargetInterpretter, UTargetFPC;
    4246
    4347
     
    110114end;
    111115
     116procedure TCore.SetCurrentTarget(AValue: TTarget);
     117var
     118  I: Integer;
     119begin
     120  if FCurrentTarget = AValue then Exit;
     121  FCurrentTarget := AValue;
     122  for I := 0 to Targets.Count - 1 do
     123    TTarget(Targets[I]).OnChangeState := nil;
     124  if Assigned(FCurrentTarget) then begin
     125    FCurrentTarget.OnChangeState := FormMain.TargetStateChanged;
     126    FCurrentTarget.OnLog := FormMain.TargetLogExecute;
     127    FCurrentTarget.OptimizationLevel := OptimizationLevel;
     128    FCurrentTarget.Messages.OnChange := FormMain.MessagesChanged;
     129  end;
     130  FormMain.UpdateTargetList;
     131  FormMain.UpdateInterface;
     132end;
     133
     134
    112135end.
    113136
Note: See TracChangeset for help on using the changeset viewer.