Changeset 157 for trunk


Ignore:
Timestamp:
Aug 19, 2024, 10:58:23 AM (3 months ago)
Author:
chronos
Message:
  • Added: Allow to hide main toolbar.
  • Fixed: Update cursor position in status bar.
  • Fixed: Memory leak in target code form.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Core.pas

    r156 r157  
    4949    OptionsFormTabIndex: Integer;
    5050    Optimizations: TOptimizations;
     51    ShowToolbar: Boolean;
    5152    procedure Init;
    5253    procedure AddItemToLastOpenedList(FileName: string);
     
    179180      ReadIntegerWithDefault('DPIY', 96));
    180181    ScaleDPI1.AutoDetect := ReadBoolWithDefault('DPIAuto', True);
     182    ShowToolbar := ReadBoolWithDefault('ShowToolbar', True);
    181183    OptimizationLevel := TCompilerOptimization(ReadIntegerWithDefault('OptimizationLevel', Integer(coNormal)));
    182184    MemorySize := ReadIntegerWithDefault('MemorySize', 30000);
     
    212214    WriteBool('OpenProjectOnStart', OpenProjectOnStart);
    213215    WriteBool('DPIAuto', ScaleDPI1.AutoDetect);
     216    WriteBool('ShowToolbar', ShowToolbar);
    214217    WriteInteger('DPIX', ScaleDPI1.DPI.X);
    215218    WriteInteger('DPIY', ScaleDPI1.DPI.Y);
  • trunk/Forms/FormMain.lfm

    r154 r157  
    331331        Action = AFullScreen
    332332      end
     333      object MenuItemViewToolbar: TMenuItem
     334        AutoCheck = True
     335        Caption = 'Toolbar'
     336        OnClick = MenuItemViewToolbarClick
     337      end
    333338    end
    334339    object MenuItem9: TMenuItem
  • trunk/Forms/FormMain.lrj

    r154 r157  
    1111{"hash":310020,"name":"tformmain.menuitem24.caption","sourcebytes":[69,100,105,116],"value":"Edit"},
    1212{"hash":380871,"name":"tformmain.menuitem23.caption","sourcebytes":[86,105,101,119],"value":"View"},
     13{"hash":191244498,"name":"tformmain.menuitemviewtoolbar.caption","sourcebytes":[84,111,111,108,98,97,114],"value":"Toolbar"},
    1314{"hash":22974,"name":"tformmain.menuitem9.caption","sourcebytes":[82,117,110],"value":"Run"},
    1415{"hash":94932420,"name":"tformmain.menuitemtarget.caption","sourcebytes":[84,97,114,103,101,116],"value":"Target"},
  • trunk/Forms/FormMain.pas

    r156 r157  
    7171    MenuItem34: TMenuItem;
    7272    MenuItem35: TMenuItem;
     73    MenuItemViewToolbar: TMenuItem;
    7374    MenuItemOpenRecent: TMenuItem;
    7475    MenuItemTarget: TMenuItem;
     
    153154    procedure FormDestroy(Sender: TObject);
    154155    procedure FormShow(Sender: TObject);
     156    procedure MenuItemViewToolbarClick(Sender: TObject);
    155157    procedure TimerRefreshTimer(Sender: TObject);
    156158  private
     
    172174    procedure LastOpenedListChange(Sender: TObject);
    173175    procedure CurrentTargetChangeExecute(Sender: TObject);
     176    procedure UpdateStatusBarExecute(Sender: TObject);
     177    procedure UpdateInterfaceExecute(Sender: TObject);
    174178  public
    175179    procedure MessagesChanged(Sender: TObject);
     
    213217  try
    214218    if Core.Core.LastOpenedList.Items.Count = 0 then
    215       Core.Core.LastOpenedList.Items.Add(CombinePaths(Core.Core.DataDir, ExamplesDir + DirectorySeparator + 'Sierpinski.b'));
     219      Core.Core.LastOpenedList.Items.Add(CombinePaths(Core.Core.DataDir, ExamplesDir +
     220      DirectorySeparator + 'Sierpinski.b'));
    216221
    217222    if Core.Core.OpenProjectOnStart and (Core.Core.LastOpenedList.Items.Count > 0) and
     
    230235end;
    231236
     237procedure TFormMain.MenuItemViewToolbarClick(Sender: TObject);
     238begin
     239  Core.Core.ShowToolbar := MenuItemViewToolbar.Checked;
     240  UpdateInterface;
     241end;
     242
    232243procedure TFormMain.TimerRefreshTimer(Sender: TObject);
    233244begin
     
    321332begin
    322333  UpdateTargetList;
     334  UpdateInterface;
     335end;
     336
     337procedure TFormMain.UpdateStatusBarExecute(Sender: TObject);
     338begin
     339  UpdateStatusBar;
     340end;
     341
     342procedure TFormMain.UpdateInterfaceExecute(Sender: TObject);
     343begin
    323344  UpdateInterface;
    324345end;
     
    357378    AShowTargetPosition.Enabled := CurrentTarget.Compiled;
    358379    AFullScreen.Checked := FullScreen;
     380    MenuItemViewToolbar.Checked := Core.Core.ShowToolbar;
     381    ToolBarMain.Visible := Core.Core.ShowToolbar;
    359382  end;
    360383  UpdateStatusBar;
     
    387410begin
    388411  FormSourceCode := TFormSourceCode.Create(nil);
     412  FormSourceCode.OnUpdateStatusBar := UpdateStatusBarExecute;
     413  FormSourceCode.OnUpdateInterface := UpdateInterfaceExecute;
    389414  FormCPU := TFormCPU.Create(nil);
    390415  FormInput := TFormInput.Create(nil);
  • trunk/Forms/FormTargetCode.lfm

    r153 r157  
    88  ClientWidth = 734
    99  DesignTimePPI = 144
     10  OnDestroy = FormDestroy
    1011  LCLVersion = '3.4.0.0'
    1112  inline SynEditTarget: TSynEdit
     
    509510  object PopupMenuTarget: TPopupMenu
    510511    Images = Core.ImageListMain
    511     Left = 101
    512     Top = 120
     512    Left = 239
     513    Top = 144
    513514    object MenuItem20: TMenuItem
    514515      Action = AFormatCode
  • trunk/Forms/FormTargetCode.pas

    r149 r157  
    2323    procedure AFormatCodeExecute(Sender: TObject);
    2424    procedure AShrinkCodeExecute(Sender: TObject);
     25    procedure FormDestroy(Sender: TObject);
    2526  public
    2627    procedure SetHighlighter(SourceExt: string);
     
    8081end;
    8182
     83procedure TFormTargetCode.FormDestroy(Sender: TObject);
     84begin
     85  if Assigned(SynEditTarget.Highlighter) then
     86    SynEditTarget.Highlighter.Free;
     87end;
     88
    8289procedure TFormTargetCode.SetHighlighter(SourceExt: string);
    8390begin
  • trunk/Languages/LazFuck.cs.po

    r154 r157  
    496496msgstr "Cíl"
    497497
     498#: tformmain.menuitemviewtoolbar.caption
     499msgid "Toolbar"
     500msgstr "NástrojovÃœ panel"
     501
    498502#: tformmain.tabsheetdebug.caption
    499503msgid "Debug"
  • trunk/Languages/LazFuck.pot

    r154 r157  
    482482msgstr ""
    483483
     484#: tformmain.menuitemviewtoolbar.caption
     485msgid "Toolbar"
     486msgstr ""
     487
    484488#: tformmain.tabsheetdebug.caption
    485489msgid "Debug"
Note: See TracChangeset for help on using the changeset viewer.