Ignore:
Timestamp:
Jun 5, 2023, 6:44:57 PM (11 months ago)
Author:
chronos
Message:
  • Modified: Remove U prefix from unit names.
  • Modified: Updated Common package.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormSourceCode.pas

    r144 r145  
    1 unit UFormSourceCode;
     1unit FormSourceCode;
    22
    33interface
     
    66  Classes, SysUtils, FileUtil, SynEdit, SynHighlighterIni, Forms, Controls,
    77  Graphics, Dialogs, Menus, ActnList,
    8   SynEditHighlighter, SynHighlighterAny, SynHighlighterJava, UBFHighlighter;
     8  SynEditHighlighter, SynHighlighterAny, SynHighlighterJava, BFHighlighter;
    99
    1010type
     
    6060  private
    6161    BFHighlighter: TSynBrainFuckHl;
     62    FOnUpdateInterface: TNotifyEvent;
     63    FOnUpdateStatusBar: TNotifyEvent;
    6264  public
    6365    procedure UpdateInterface;
    6466    procedure UpdateTheme;
     67    property OnUpdateStatusBar: TNotifyEvent read FOnUpdateStatusBar
     68      write FOnUpdateStatusBar;
     69    property OnUpdateInterface: TNotifyEvent read FOnUpdateInterface
     70      write FOnUpdateInterface;
    6571  end;
    6672
    67 var
    68   FormSourceCode: TFormSourceCode;
    69 
    7073
    7174implementation
     
    7477
    7578uses
    76   UCore, UFormMain, UBFCodeTools;
     79  Core, BFCodeTools;
    7780
    7881resourcestring
     
    142145procedure TFormSourceCode.FormCreate(Sender: TObject);
    143146begin
     147  Core.Core.Translator.TranslateComponentRecursive(Self);
     148  Core.Core.ThemeManager.UseTheme(Self);
     149
    144150  BFHighlighter := TSynBrainFuckHl.Create(nil);
    145151  SynEditSource.Highlighter := BFHighlighter;
     
    162168  clLightRed = TColor($8080FF);
    163169begin
    164   if Core.ThemeManager.Theme.Name = 'Dark' then begin
     170  if Core.Core.ThemeManager.Theme.Name = 'Dark' then begin
    165171    BFHighlighter.IoAttri.Foreground := clWhite;
    166172    BFHighlighter.LoopAttri.Foreground := clLightRed;
     
    177183procedure TFormSourceCode.MemoSourceChange(Sender: TObject);
    178184begin
    179   Core.Project.Modified := True;
    180   Core.CurrentTarget.Compiled := False;
    181   FormMain.UpdateInterface;
     185  Core.Core.Project.Modified := True;
     186  Core.Core.CurrentTarget.Compiled := False;
     187  if Assigned(FOnUpdateInterface) then
     188    OnUpdateInterface(Self);
    182189end;
    183190
     
    194201  Shift: TShiftState);
    195202begin
    196   FormMain.UpdateStatusBar;
     203  if Assigned(FOnUpdateStatusBar) then
     204    FOnUpdateStatusBar(Self);
    197205end;
    198206
     
    200208  Shift: TShiftState; X, Y: Integer);
    201209begin
    202   FormMain.UpdateStatusBar;
     210  if Assigned(FOnUpdateStatusBar) then
     211    FOnUpdateStatusBar(Self);
    203212end;
    204213
Note: See TracChangeset for help on using the changeset viewer.