Changeset 128 for trunk/Forms


Ignore:
Timestamp:
Jan 17, 2022, 4:53:31 PM (2 years ago)
Author:
chronos
Message:
  • Added: Two more code examples.
  • Added: Allow to disable debugging support.
  • Added: Remember last opened tab in options form.
Location:
trunk/Forms
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r126 r128  
    334334var
    335335  Title: string;
     336  CanDebug: Boolean;
    336337begin
    337338  Title := '';
     
    352353  AProgramCompile.Enabled := (tcCompile in Core.CurrentTarget.Capabilities) and
    353354    Core.Project.Openned;
    354   AProgramStepInto.Enabled := (tcStepInto in Core.CurrentTarget.Capabilities) and
    355     Core.Project.Openned and ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
    356   AProgramStepOut.Enabled := (tcStepOut in Core.CurrentTarget.Capabilities) and
    357     Core.Project.Openned and (Core.CurrentTarget.State = rsPaused);
    358   AProgramRunToCursor.Enabled := (tcRunToCursor in Core.CurrentTarget.Capabilities) and
    359     Core.Project.Openned and ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
    360   AProgramStepOver.Enabled := (tcStepOver in Core.CurrentTarget.Capabilities) and
    361     Core.Project.Openned and ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
    362   AProgramShowExecutionPoint.Enabled := (tcPause in Core.CurrentTarget.Capabilities) and
    363     Core.Project.Openned and (Core.CurrentTarget.State = rsPaused);
     355  CanDebug := Core.DebugEnabled and Core.Project.Openned and
     356    ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
     357  AProgramStepInto.Enabled := CanDebug and (tcStepInto in Core.CurrentTarget.Capabilities);
     358  AProgramStepOut.Enabled := CanDebug and (tcStepOut in Core.CurrentTarget.Capabilities);
     359  AProgramRunToCursor.Enabled := CanDebug and (tcRunToCursor in Core.CurrentTarget.Capabilities);
     360  AProgramStepOver.Enabled := CanDebug and (tcStepOver in Core.CurrentTarget.Capabilities);
     361  AProgramShowExecutionPoint.Enabled := CanDebug and (tcPause in Core.CurrentTarget.Capabilities);
    364362  AShowSourcePosition.Enabled := Core.CurrentTarget.Compiled;
    365363  AShowTargetPosition.Enabled := Core.CurrentTarget.Compiled;
     
    568566  if Core.CurrentTarget.State = rsStopped then begin
    569567    if not Core.CurrentTarget.Compiled then AProgramCompile.Execute;
    570     Core.CurrentTarget.BreakPoints.SetSystem(TDebugStep(Core.CurrentTarget.DebugSteps.First).ProgramPosition);
     568    Core.CurrentTarget.BreakPoints.SetSystem(Core.CurrentTarget.DebugSteps.First.ProgramPosition);
    571569    AProgramRun.Execute;
    572570  end else Core.CurrentTarget.StepInto;
  • trunk/Forms/UFormOptions.lfm

    r126 r128  
    3939    Top = 10
    4040    Width = 711
    41     ActivePage = TabSheetBuild
     41    ActivePage = TabSheetGeneral
    4242    Anchors = [akTop, akLeft, akRight, akBottom]
    4343    ParentFont = False
    44     TabIndex = 1
     44    TabIndex = 0
    4545    TabOrder = 2
    4646    object TabSheetGeneral: TTabSheet
     
    7878          TabOrder = 0
    7979        end
    80         object CheckBox1: TCheckBox
     80        object CheckBoxReopenLastFile: TCheckBox
    8181          Left = 10
    8282          Height = 32
     
    279279          TabOrder = 7
    280280        end
     281        object CheckBoxDebugEnabled: TCheckBox
     282          Left = 392
     283          Height = 30
     284          Top = 12
     285          Width = 120
     286          Caption = 'Debugging'
     287          ParentFont = False
     288          TabOrder = 8
     289        end
    281290      end
    282291    end
  • trunk/Forms/UFormOptions.lrj

    r126 r128  
    55{"hash":231000124,"name":"tformoptions.tabsheetgeneral.caption","sourcebytes":[71,101,110,101,114,97,108],"value":"General"},
    66{"hash":52873082,"name":"tformoptions.label3.caption","sourcebytes":[73,110,116,101,114,102,97,99,101,32,108,97,110,103,117,97,103,101,58],"value":"Interface language:"},
    7 {"hash":100189188,"name":"tformoptions.checkbox1.caption","sourcebytes":[82,101,111,112,101,110,100,32,108,97,115,116,32,111,112,101,110,101,100,32,112,114,111,106,101,99,116],"value":"Reopend last opened project"},
     7{"hash":100189188,"name":"tformoptions.checkboxreopenlastfile.caption","sourcebytes":[82,101,111,112,101,110,100,32,108,97,115,116,32,111,112,101,110,101,100,32,112,114,111,106,101,99,116],"value":"Reopend last opened project"},
    88{"hash":37628553,"name":"tformoptions.checkboxdpiauto.caption","sourcebytes":[65,117,116,111,109,97,116,105,99,32,68,80,73],"value":"Automatic DPI"},
    99{"hash":300234,"name":"tformoptions.labeldpi.caption","sourcebytes":[68,80,73,58],"value":"DPI:"},
     
    1818{"hash":243182762,"name":"tformoptions.label2.caption","sourcebytes":[67,101,108,108,32,115,105,122,101,58],"value":"Cell size:"},
    1919{"hash":239490586,"name":"tformoptions.label1.caption","sourcebytes":[77,101,109,111,114,121,32,115,105,122,101,58],"value":"Memory size:"},
    20 {"hash":208144671,"name":"tformoptions.checkboxoptimizesetzero.caption","sourcebytes":[83,101,116,32,122,101,114,111],"value":"Set zero"}
     20{"hash":208144671,"name":"tformoptions.checkboxoptimizesetzero.caption","sourcebytes":[83,101,116,32,122,101,114,111],"value":"Set zero"},
     21{"hash":163419895,"name":"tformoptions.checkboxdebugenabled.caption","sourcebytes":[68,101,98,117,103,103,105,110,103],"value":"Debugging"}
    2122]}
  • trunk/Forms/UFormOptions.pas

    r126 r128  
    1616    ButtonOk: TButton;
    1717    ButtonCancel: TButton;
    18     CheckBox1: TCheckBox;
     18    CheckBoxReopenLastFile: TCheckBox;
    1919    CheckBoxDPIAuto: TCheckBox;
    2020    CheckBoxOptimizeAddSub: TCheckBox;
     21    CheckBoxDebugEnabled: TCheckBox;
    2122    CheckBoxOptimizeCopyMultiply: TCheckBox;
    2223    CheckBoxOptimizeSetZero: TCheckBox;
     
    9697  ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.ThemeManager.Theme);
    9798  if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0;
    98   CheckBox1.Checked := Core.OpenProjectOnStart;
     99  CheckBoxReopenLastFile.Checked := Core.OpenProjectOnStart;
    99100  CheckBoxOptimizeAddSub.Checked := Core.Optimizations.AddSub;
    100101  CheckBoxOptimizeSetZero.Checked := Core.Optimizations.SetZero;
     
    108109  SpinEditCellSize.Value := Core.CellSize;
    109110  SpinEditMemorySize.Value := Core.MemorySize;
     111  CheckBoxDebugEnabled.Checked := Core.DebugEnabled;
     112  if Core.OptionsFormTabIndex < PageControl1.PageCount then
     113    PageControl1.TabIndex := Core.OptionsFormTabIndex
     114    else PageControl1.TabIndex := 0;
    110115  UpdateInterface;
    111116end;
     
    117122  if ComboBoxTheme.ItemIndex <> -1 then
    118123    Core.ThemeManager.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);
    119   Core.OpenProjectOnStart := CheckBox1.Checked;
     124  Core.OpenProjectOnStart := CheckBoxReopenLastFile.Checked;
    120125  Core.ScaleDPI1.DPI := Point(SpinEditDPIX.Value, SpinEditDPIY.Value);
    121126  Core.ScaleDPI1.AutoDetect := CheckBoxDPIAuto.Checked;
     
    128133  Core.Optimizations.RelativeIndexes := CheckBoxOptimizeRelativeIndexes.Checked;
    129134  Core.Optimizations.CopyMultiply := CheckBoxOptimizeCopyMultiply.Checked;
     135  Core.DebugEnabled := CheckBoxDebugEnabled.Checked;
     136  Core.OptionsFormTabIndex := PageControl1.TabIndex;
    130137end;
    131138
  • trunk/Forms/UFormSourceCode.lfm

    r115 r128  
    1010  OnCreate = FormCreate
    1111  OnDestroy = FormDestroy
    12   LCLVersion = '2.0.2.0'
     12  LCLVersion = '2.2.0.4'
    1313  inline SynEditSource: TSynEdit
    1414    Left = 0
    15     Height = 491
     15    Height = 589
    1616    Top = 0
    17     Width = 560
     17    Width = 672
    1818    Align = alClient
    1919    Font.Height = -16
     
    517517  object PopupMenuSource: TPopupMenu
    518518    Images = Core.ImageListMain
    519     left = 154
    520     top = 154
     519    Left = 154
     520    Top = 154
    521521    object MenuItem23: TMenuItem
    522522      Action = FormMain.ABreakpointToggle
     
    591591  object ActionList1: TActionList
    592592    Images = Core.ImageListMain
    593     left = 154
    594     top = 67
     593    Left = 154
     594    Top = 67
    595595    object AGenerateNumber: TAction
    596596      Caption = 'Generate number'
     
    645645    DefaultFilter = 'Soubory Java (*.java)|*.java'
    646646    Enabled = False
    647     left = 486
    648     top = 316
     647    Left = 486
     648    Top = 316
    649649  end
    650650end
  • trunk/Forms/UFormSourceCode.pas

    r109 r128  
    77uses
    88  Classes, SysUtils, FileUtil, SynEdit, SynHighlighterIni, Forms, Controls,
    9   Graphics, Dialogs, StdCtrls, Menus, ActnList, strutils,
     9  Graphics, Dialogs, Menus, ActnList, strutils,
    1010  SynEditHighlighter, SynHighlighterAny, SynHighlighterJava, UBFHighlighter;
    1111
     
    132132  end;
    133133  SynEditSource.Text := NewSource;
     134  MemoSourceChange(nil);
    134135end;
    135136
     
    165166  SetLength(Source, Pos - 1);
    166167  SynEditSource.Text := Source;
     168  MemoSourceChange(nil);
    167169end;
    168170
  • trunk/Forms/UFormTargetCode.pas

    r107 r128  
    99  SynHighlighterCpp, SynHighlighterPHP, SynHighlighterJava,
    1010  SynHighlighterPython, SynHighlighterJScript, Forms, Controls, Graphics,
    11   Dialogs, StdCtrls, Menus, ActnList, strutils;
     11  Dialogs, Menus, ActnList, strutils;
    1212
    1313type
Note: See TracChangeset for help on using the changeset viewer.