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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.