Changeset 153


Ignore:
Timestamp:
Aug 14, 2024, 1:05:13 PM (3 months ago)
Author:
chronos
Message:
  • Added: Full screen switching support.
  • Added: Help form.
  • Modified: Updated Common package.
  • Fixed: Execution of compiled Java and C# programs.
  • Fixed: Removed interlanced empty lines in Console form on Unix.
Location:
trunk
Files:
6 added
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Core.lfm

    r150 r153  
    769769  end
    770770  object ThemeManager: TThemeManager
    771     Left = 362
     771    Left = 369
    772772    Top = 209
    773773  end
  • trunk/Core.pas

    r152 r153  
    121121  TFormEx.PersistentForm := PersistentForm1;
    122122
    123   FormMain := TFormMain.Create(nil);
     123  Application.CreateForm(TFormMain, FormMain);
    124124  FormMain.Show;
    125125end;
     
    132132  FreeAndNil(Project);
    133133  FreeAndNil(StoredDimension);
    134   FreeAndNil(FormMain);
    135134end;
    136135
     
    258257procedure TCore.TargetLogExecute(Lines: TStrings);
    259258begin
    260 
    261259end;
    262260
     
    269267    if (DesignDPI.X <> DPI.X) or (DesignDPI.Y <> DPI.Y) then begin
    270268      //ApplyToAll(DesignDPI);
    271       for I := 0 to Screen.FormCount - 1 do
     269{      for I := 0 to Screen.FormCount - 1 do
    272270      if (Screen.Forms[I].WindowState = wsNormal) or
    273271        (Screen.Forms[I].WindowState = wsMinimized) then begin
     
    275273        ScaleDimensions(Screen.Forms[I], StoredDimension);
    276274      end;
    277       ScaleImageList(ImageListMain, DesignDPI);
     275 }     ScaleImageList(ImageListMain, DesignDPI);
    278276    end;
    279277  end;
  • trunk/Forms/FormConsole.lfm

    r151 r153  
    11object FormConsole: TFormConsole
    2   Left = 449
    3   Height = 727
    4   Top = 261
    5   Width = 975
     2  Left = 779
     3  Height = 689
     4  Top = 375
     5  Width = 1002
    66  Caption = 'Console'
    7   ClientHeight = 727
    8   ClientWidth = 975
     7  ClientHeight = 689
     8  ClientWidth = 1002
     9  DesignTimePPI = 144
    910  OnClose = FormClose
    1011  OnCreate = FormCreate
     
    1213  OnShow = FormShow
    1314  Position = poMainFormCenter
    14   LCLVersion = '1.5'
     15  LCLVersion = '3.4.0.0'
    1516  object Memo1: TMemo
    1617    Left = 4
    17     Height = 674
    18     Top = 48
    19     Width = 966
     18    Height = 628
     19    Top = 56
     20    Width = 993
    2021    Align = alCustom
    2122    Anchors = [akTop, akLeft, akRight, akBottom]
    22     BorderSpacing.Around = 2
    23     Font.Name = 'DejaVu Sans Mono'
     23    BorderSpacing.Around = 3
     24    Font.Name = 'Courier New'
    2425    ParentFont = False
    2526    ReadOnly = True
     
    2829  end
    2930  object ButtonAbort: TButton
    30     Left = 895
    31     Height = 25
    32     Top = 8
    33     Width = 75
     31    Left = 883
     32    Height = 38
     33    Top = 10
     34    Width = 112
    3435    Anchors = [akTop, akRight]
    3536    Caption = 'Abort'
     37    TabOrder = 1
    3638    OnClick = ButtonAbortClick
    37     TabOrder = 1
    3839  end
    3940  object EditCommand: TEdit
    4041    Left = 4
    41     Height = 35
    42     Top = 7
    43     Width = 884
     42    Height = 43
     43    Top = 10
     44    Width = 868
    4445    Anchors = [akTop, akLeft, akRight]
    4546    ReadOnly = True
     
    5051    Interval = 1
    5152    OnTimer = Timer1Timer
    52     left = 72
    53     top = 112
     53    Left = 108
     54    Top = 168
    5455  end
    5556end
  • trunk/Forms/FormConsole.pas

    r151 r153  
    102102    Process.Parameters.Assign(Parameters);
    103103    Process.Executable := Executable;
    104     CommandLine := Executable + ' ' + StringReplace(Parameters.Text, LineEnding, ' ', [rfReplaceAll]);
     104    CommandLine := Executable + ' ' + StringReplace(Parameters.Text, LineEnding,
     105      ' ', [rfReplaceAll]);
    105106    if CommandLine[Length(CommandLine)] = LineEnding then
    106107      SetLength(CommandLine, Length(CommandLine) - 1);
     
    117118        SetLength(Buffer, Count);
    118119        Text := Text + Buffer;
     120        {$IFDEF UNIX}
     121        Text := StringReplace(Text, #10#13, LineEnding, [rfReplaceAll]);
     122        {$ENDIF}
    119123        while Pos(LineEnding, Text) > 0 do begin
    120124          Line := Copy(Text, 1, Pos(LineEnding, Text) - 1);
     
    130134        SetLength(Buffer, Count);
    131135        Text := Text + Buffer;
     136        {$IFDEF UNIX}
     137        Text := StringReplace(Text, #10#13, LineEnding, [rfReplaceAll]);
     138        {$ENDIF}
    132139        while Pos(LineEnding, Text) > 0 do begin
    133140          Line := Copy(Text, 1, Pos(LineEnding, Text) - 1);
  • trunk/Forms/FormInput.lfm

    r149 r153  
    11object FormInput: TFormInput
    2   Left = 256
     2  Left = 1040
    33  Height = 360
    4   Top = 32
     4  Top = 540
    55  Width = 480
    66  Caption = 'Input'
     
    1616    Align = alClient
    1717    BorderSpacing.Around = 6
    18     Font.Height = -18
    1918    Font.Name = 'Courier New'
    2019    ParentFont = False
  • trunk/Forms/FormMain.lfm

    r150 r153  
    99  DesignTimePPI = 144
    1010  Menu = MainMenu1
     11  OnActivate = FormActivate
    1112  OnClose = FormClose
    1213  OnCloseQuery = FormCloseQuery
     
    325326      end
    326327    end
     328    object MenuItem23: TMenuItem
     329      Caption = 'View'
     330      object MenuItem26: TMenuItem
     331        Action = AFullScreen
     332      end
     333    end
    327334    object MenuItem9: TMenuItem
    328335      Caption = 'Run'
     
    388395  object ActionList1: TActionList
    389396    Images = Core.ImageListMain
    390     Left = 261
     397    Left = 264
    391398    Top = 230
    392399    object AProjectOpen: TAction
     
    452459      Caption = 'Help'
    453460      ImageIndex = 6
     461      OnExecute = AHelpExecute
    454462    end
    455463    object AProgramPause: TAction
     
    500508    end
    501509    object AOptions: TAction
    502       Category = 'View'
     510      Category = 'Tools'
    503511      Caption = 'Options'
    504512      ImageIndex = 2
     
    534542      Caption = 'Compile multiple...'
    535543      OnExecute = AProgramCompileMultipleExecute
     544    end
     545    object AFullScreen: TAction
     546      Category = 'View'
     547      Caption = 'Full screen'
     548      OnExecute = AFullScreenExecute
     549      ShortCut = 122
    536550    end
    537551  end
  • trunk/Forms/FormMain.lrj

    r145 r153  
    1010{"hash":131987540,"name":"tformmain.menuitemopenrecent.caption","sourcebytes":[79,112,101,110,32,114,101,99,101,110,116],"value":"Open recent"},
    1111{"hash":310020,"name":"tformmain.menuitem24.caption","sourcebytes":[69,100,105,116],"value":"Edit"},
     12{"hash":380871,"name":"tformmain.menuitem23.caption","sourcebytes":[86,105,101,119],"value":"View"},
    1213{"hash":22974,"name":"tformmain.menuitem9.caption","sourcebytes":[82,117,110],"value":"Run"},
    1314{"hash":94932420,"name":"tformmain.menuitemtarget.caption","sourcebytes":[84,97,114,103,101,116],"value":"Target"},
     
    3738{"hash":78944612,"name":"tformmain.aprogramshowexecutionpoint.caption","sourcebytes":[83,104,111,119,32,101,120,101,99,117,116,105,111,110,32,112,111,105,110,116],"value":"Show execution point"},
    3839{"hash":21335,"name":"tformmain.aviewlog.caption","sourcebytes":[76,111,103],"value":"Log"},
    39 {"hash":226669790,"name":"tformmain.aprogramcompilemultiple.caption","sourcebytes":[67,111,109,112,105,108,101,32,109,117,108,116,105,112,108,101,46,46,46],"value":"Compile multiple..."}
     40{"hash":226669790,"name":"tformmain.aprogramcompilemultiple.caption","sourcebytes":[67,111,109,112,105,108,101,32,109,117,108,116,105,112,108,101,46,46,46],"value":"Compile multiple..."},
     41{"hash":131549534,"name":"tformmain.afullscreen.caption","sourcebytes":[70,117,108,108,32,115,99,114,101,101,110],"value":"Full screen"}
    4042]}
  • trunk/Forms/FormMain.pas

    r152 r153  
    1414
    1515  TFormMain = class(TFormEx)
     16    AFullScreen: TAction;
    1617    AProgramCompileMultiple: TAction;
    1718    AViewLog: TAction;
     
    5556    MenuItem21: TMenuItem;
    5657    MenuItem22: TMenuItem;
     58    MenuItem23: TMenuItem;
    5759    MenuItem24: TMenuItem;
    5860    MenuItem25: TMenuItem;
     61    MenuItem26: TMenuItem;
    5962    MenuItem27: TMenuItem;
    6063    MenuItem28: TMenuItem;
     
    117120    procedure ABreakpointToggleExecute(Sender: TObject);
    118121    procedure AExitExecute(Sender: TObject);
     122    procedure AFullScreenExecute(Sender: TObject);
     123    procedure AHelpExecute(Sender: TObject);
    119124    procedure AOptionsExecute(Sender: TObject);
    120125    procedure AProgramCompileExecute(Sender: TObject);
     
    138143    procedure AViewInterpreterExecute(Sender: TObject);
    139144    procedure AViewLogExecute(Sender: TObject);
     145    procedure FormActivate(Sender: TObject);
    140146    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    141147    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
     
    176182
    177183uses
    178   Core, TargetInterpreter, BFTarget, Common, FormAbout;
     184  Core, TargetInterpreter, BFTarget, Common, FormAbout, FormHelp;
    179185
    180186resourcestring
     
    342348    AShowSourcePosition.Enabled := CurrentTarget.Compiled;
    343349    AShowTargetPosition.Enabled := CurrentTarget.Compiled;
     350    AFullScreen.Checked := FullScreen;
    344351  end;
    345352  UpdateStatusBar;
     
    453460end;
    454461
     462procedure TFormMain.FormActivate(Sender: TObject);
     463begin
     464  AFullScreen.Checked := FullScreen;
     465end;
     466
    455467procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    456468begin
     
    469481begin
    470482  Close;
     483end;
     484
     485procedure TFormMain.AFullScreenExecute(Sender: TObject);
     486begin
     487  FullScreen := not FullScreen;
     488  AFullScreen.Checked := FullScreen;
     489  TFormEx.PersistentForm.Save(Self);
     490  TFormEx.PersistentForm.SetFullScreen(FullScreen);
     491  UpdateInterface;
     492end;
     493
     494procedure TFormMain.AHelpExecute(Sender: TObject);
     495var
     496  FormHelp: TFormHelp;
     497begin
     498  FormHelp := TFormHelp.Create(nil);
     499  FormHelp.ShowModal;
     500  FormHelp.Free;
    471501end;
    472502
  • trunk/Forms/FormMemory.lfm

    r149 r153  
    11object FormMemory: TFormMemory
    2   Left = 565
    3   Height = 401
    4   Top = 168
    5   Width = 1039
     2  Left = 705
     3  Height = 866
     4  Top = 287
     5  Width = 1150
    66  Caption = 'Memory'
    7   ClientHeight = 401
    8   ClientWidth = 1039
     7  ClientHeight = 866
     8  ClientWidth = 1150
    99  DesignTimePPI = 144
    1010  LCLVersion = '3.4.0.0'
     
    1313    Height = 26
    1414    Top = 6
    15     Width = 1027
     15    Width = 1138
    1616    Align = alTop
    1717    BorderSpacing.Around = 6
     
    2222  object ListViewMemory: TListView
    2323    Left = 6
    24     Height = 357
     24    Height = 822
    2525    Top = 38
    26     Width = 1027
     26    Width = 1138
    2727    Align = alClient
    2828    BorderSpacing.Around = 6
     
    3838      item
    3939        Caption = 'Text'
    40         Width = 397
     40        Width = 508
    4141      end>
    42     Font.Height = -18
    4342    Font.Name = 'Courier New'
    4443    OwnerData = True
  • trunk/Forms/FormOptions.lfm

    r149 r153  
    11object FormOptions: TFormOptions
    2   Left = 401
     2  Left = 916
    33  Height = 427
    4   Top = 236
     4  Top = 506
    55  Width = 728
    66  Caption = 'Options'
     
    99  DesignTimePPI = 144
    1010  OnCreate = FormCreate
    11   LCLVersion = '2.2.6.0'
     11  LCLVersion = '3.4.0.0'
    1212  object ButtonOk: TButton
    1313    Left = 631
     
    9696          AutoSize = False
    9797          Caption = 'Automatic DPI'
     98          ParentFont = False
     99          TabOrder = 2
    98100          OnChange = CheckBoxDPIAutoChange
    99           ParentFont = False
    100           TabOrder = 2
    101101        end
    102102        object LabelDPI: TLabel
     
    196196            'Normal'
    197197          )
    198           OnSelect = CheckBoxDPIAutoChange
    199198          ParentFont = False
    200199          Style = csDropDownList
    201200          TabOrder = 0
     201          OnSelect = CheckBoxDPIAutoChange
    202202        end
    203203        object CheckBoxOptimizeAddSub: TCheckBox
     
    225225          Width = 142
    226226          Caption = 'Copy multiply'
     227          ParentFont = False
     228          TabOrder = 3
    227229          OnChange = CheckBoxOptimizeCopyMultiplyChange
    228           ParentFont = False
    229           TabOrder = 3
    230230        end
    231231        object CheckBoxOptimizeRelativeIndexes: TCheckBox
     
    235235          Width = 162
    236236          Caption = 'Relative indexes'
     237          ParentFont = False
     238          TabOrder = 4
    237239          OnChange = CheckBoxOptimizeRelativeIndexesChange
    238           ParentFont = False
    239           TabOrder = 4
    240240        end
    241241        object Label2: TLabel
  • trunk/Forms/FormOutput.lfm

    r149 r153  
    11object FormOutput: TFormOutput
    2   Left = 736
    3   Height = 343
    4   Top = 502
    5   Width = 640
     2  Left = 814
     3  Height = 544
     4  Top = 448
     5  Width = 932
    66  Caption = 'Output'
    7   ClientHeight = 343
    8   ClientWidth = 640
     7  ClientHeight = 544
     8  ClientWidth = 932
    99  DesignTimePPI = 144
    1010  LCLVersion = '3.4.0.0'
     
    1313    Height = 26
    1414    Top = 4
    15     Width = 632
     15    Width = 924
    1616    Align = alTop
    1717    BorderSpacing.Around = 4
     
    2121  object MemoOutput: TMemo
    2222    Left = 4
    23     Height = 305
     23    Height = 506
    2424    Top = 34
    25     Width = 632
     25    Width = 924
    2626    Align = alClient
    2727    BorderSpacing.Around = 4
    28     Font.Height = -12
    2928    Font.Name = 'Courier New'
    3029    ParentFont = False
  • trunk/Forms/FormSourceCode.lfm

    r150 r153  
    1717    Width = 672
    1818    Align = alClient
    19     Font.Height = -16
    2019    Font.Name = 'Courier New'
    2120    Font.Pitch = fpFixed
     
    2726    OnKeyUp = MemoSourceKeyUp
    2827    OnMouseDown = MemoSourceMouseDown
    29     Gutter.Width = 80
     28    Gutter.Width = 84
    3029    Gutter.MouseActions = <>
    3130    RightGutter.Width = 0
     
    481480      end
    482481      object SynGutterLineNumber1: TSynGutterLineNumber
    483         Width = 21
     482        Width = 25
    484483        MouseActions = <>
    485484        MarkupInfo.Background = clBtnFace
  • trunk/Forms/FormTargetCode.lfm

    r149 r153  
    11object FormTargetCode: TFormTargetCode
    2   Left = 555
     2  Left = 913
    33  Height = 522
    4   Top = 379
     4  Top = 459
    55  Width = 734
    66  Caption = 'Target code'
     
    1515    Width = 734
    1616    Align = alClient
    17     Font.Height = -16
     17    Font.Height = 13
    1818    Font.Name = 'Courier New'
    1919    Font.Pitch = fpFixed
     
    2323    PopupMenu = PopupMenuTarget
    2424    TabOrder = 0
    25     Gutter.Width = 81
     25    Gutter.Width = 77
    2626    Gutter.MouseActions = <>
    2727    RightGutter.Width = 0
     
    476476      end
    477477      object SynGutterLineNumber1: TSynGutterLineNumber
    478         Width = 21
     478        Width = 17
    479479        MouseActions = <>
    480480        MarkupInfo.Background = clBtnFace
  • trunk/Forms/FormTargetOptions.lfm

    r149 r153  
    11object FormTargetOptions: TFormTargetOptions
    2   Left = 667
    3   Height = 242
    4   Top = 613
    5   Width = 586
     2  Left = 987
     3  Height = 216
     4  Top = 599
     5  Width = 609
    66  Caption = 'Target options'
    7   ClientHeight = 242
    8   ClientWidth = 586
     7  ClientHeight = 216
     8  ClientWidth = 609
    99  DesignTimePPI = 144
    10   LCLVersion = '2.0.10.0'
     10  LCLVersion = '3.4.0.0'
    1111  object Edit1: TEdit
    1212    Left = 10
    13     Height = 42
     13    Height = 43
    1414    Top = 38
    15     Width = 469
     15    Width = 492
    1616    Anchors = [akTop, akLeft, akRight]
    1717    ParentFont = False
     
    2020  object Label1: TLabel
    2121    Left = 10
    22     Height = 24
     22    Height = 26
    2323    Top = 8
    2424    Width = 155
     
    2828  end
    2929  object ButtonCompiler: TButton
    30     Left = 489
     30    Left = 512
    3131    Height = 37
    3232    Top = 42
     
    3434    Anchors = [akTop, akRight]
    3535    Caption = 'Select...'
    36     OnClick = ButtonCompilerClick
    3736    ParentFont = False
    3837    TabOrder = 1
     38    OnClick = ButtonCompilerClick
    3939  end
    4040  object ButtonExecute: TButton
    41     Left = 489
     41    Left = 512
    4242    Height = 37
    4343    Top = 115
     
    4545    Anchors = [akTop, akRight]
    4646    Caption = 'Select...'
    47     OnClick = ButtonExecuteClick
    4847    ParentFont = False
    4948    TabOrder = 2
     49    OnClick = ButtonExecuteClick
    5050  end
    5151  object Edit2: TEdit
    5252    Left = 10
    53     Height = 42
     53    Height = 43
    5454    Top = 115
    55     Width = 469
     55    Width = 492
    5656    Anchors = [akTop, akLeft, akRight]
    5757    ParentFont = False
     
    6060  object Label2: TLabel
    6161    Left = 10
    62     Height = 24
     62    Height = 26
    6363    Top = 86
    6464    Width = 151
     
    6868  end
    6969  object ButtonOk: TButton
    70     Left = 463
     70    Left = 486
    7171    Height = 37
    72     Top = 191
     72    Top = 165
    7373    Width = 109
    7474    Anchors = [akRight, akBottom]
     
    7979  end
    8080  object ButtonCancel: TButton
    81     Left = 328
     81    Left = 351
    8282    Height = 37
    83     Top = 191
     83    Top = 165
    8484    Width = 109
    8585    Anchors = [akRight, akBottom]
     
    8989    TabOrder = 5
    9090  end
    91   object OpenDialog1: TOpenDialog
    92     DefaultExt = '.exe'
    93     Filter = 'Program (*.exe)|*.exe|JakÃœkoliv soubor (*.*)|*.*'
    94     Left = 118
    95     Top = 145
    96   end
    9791end
  • trunk/Languages/LazFuck.cs.po

    r152 r153  
    2323msgstr " kroků/s"
    2424
     25#: formhelp.shelpfeatures
     26msgid ""
     27"Features:\n"
     28"* Graphical code editor with color syntax highlighting\n"
     29"* Cross-compilation to Delphi, Free Pascal, Python, Java, C, C#, PHP, Rust and Javascript\n"
     30"* Interpreter with debugger"
     31msgstr ""
     32"Vlastnosti:\n"
     33"* GrafickÃœ editor kódu s barevnÃœm zvÃœrazněním\n"
     34"* KříşovÃœ překladač do jazyků Delphi, Free Pascal, Python, Java, C, C#, PHP, Rust a Javascript\n"
     35"* Interpretr s ladičem"
     36
     37#: formhelp.shelpsummary
     38msgid "LazFuck is a GUI application for writing, executing, compiling and debugging programs written in famous BrainFuck esoteric programming language."
     39msgstr "LazFuck je GUI aplikace pro psaní, spouÅ¡tění, překládání a ladění programů napsanÃœch ve slavném esoterickém programovacím jazyku BrainFuck."
     40
    2541#: formmain.schanged
    2642msgctxt "formmain.schanged"
     
    231247msgstr "VÃœsledek"
    232248
     249#: tformconsole.buttonabort.caption
     250msgid "Abort"
     251msgstr "PřeruÅ¡it"
     252
     253#: tformconsole.caption
     254msgid "Console"
     255msgstr "Konzola"
     256
    233257#: tformcpu.caption
    234258msgid "CPU"
     
    271295msgstr "   "
    272296
     297#: tformhelp.caption
     298msgctxt "tformhelp.caption"
     299msgid "Help"
     300msgstr "Nápověda"
     301
    273302#: tforminput.caption
    274303msgid "Input"
     
    297326msgstr "Ukončit"
    298327
     328#: tformmain.afullscreen.caption
     329msgid "Full screen"
     330msgstr "Celá obrazovka"
     331
    299332#: tformmain.ahelp.caption
    300333msgctxt "tformmain.ahelp.caption"
     
    407440msgstr "Nástroje"
    408441
     442#: tformmain.menuitem23.caption
     443msgid "View"
     444msgstr "Zobrazení"
     445
    409446#: tformmain.menuitem24.caption
    410447msgctxt "tformmain.menuitem24.caption"
  • trunk/Languages/LazFuck.pot

    r152 r153  
    1313msgstr ""
    1414
     15#: formhelp.shelpfeatures
     16msgid ""
     17"Features:\n"
     18"* Graphical code editor with color syntax highlighting\n"
     19"* Cross-compilation to Delphi, Free Pascal, Python, Java, C, C#, PHP, Rust and Javascript\n"
     20"* Interpreter with debugger"
     21msgstr ""
     22
     23#: formhelp.shelpsummary
     24msgid "LazFuck is a GUI application for writing, executing, compiling and debugging programs written in famous BrainFuck esoteric programming language."
     25msgstr ""
     26
    1527#: formmain.schanged
    1628msgctxt "formmain.schanged"
     
    221233msgstr ""
    222234
     235#: tformconsole.buttonabort.caption
     236msgid "Abort"
     237msgstr ""
     238
     239#: tformconsole.caption
     240msgid "Console"
     241msgstr ""
     242
    223243#: tformcpu.caption
    224244msgid "CPU"
     
    261281msgstr ""
    262282
     283#: tformhelp.caption
     284msgctxt "tformhelp.caption"
     285msgid "Help"
     286msgstr ""
     287
    263288#: tforminput.caption
    264289msgid "Input"
     
    287312msgstr ""
    288313
     314#: tformmain.afullscreen.caption
     315msgid "Full screen"
     316msgstr ""
     317
    289318#: tformmain.ahelp.caption
    290319msgctxt "tformmain.ahelp.caption"
     
    397426msgstr ""
    398427
     428#: tformmain.menuitem23.caption
     429msgid "View"
     430msgstr ""
     431
    399432#: tformmain.menuitem24.caption
    400433msgctxt "tformmain.menuitem24.caption"
  • trunk/LazFuck.lpi

    r152 r153  
    9797      </Item4>
    9898    </RequiredPackages>
    99     <Units Count="31">
     99    <Units Count="32">
    100100      <Unit0>
    101101        <Filename Value="LazFuck.lpr"/>
     
    264264        <IsPartOfProject Value="True"/>
    265265        <ComponentName Value="FormConsole"/>
     266        <HasResources Value="True"/>
    266267        <ResourceBaseClass Value="Form"/>
    267268      </Unit30>
     269      <Unit31>
     270        <Filename Value="Forms\FormHelp.pas"/>
     271        <IsPartOfProject Value="True"/>
     272        <ComponentName Value="FormHelp"/>
     273        <ResourceBaseClass Value="Form"/>
     274      </Unit31>
    268275    </Units>
    269276  </ProjectOptions>
  • trunk/LazFuck.lpr

    r151 r153  
    11program LazFuck;
    2 
    3 {$mode objfpc}{$H+}
    42
    53uses
     
    119  Forms, Target, FormCPU, FormMain, FormOutput, FormInput, FormMemory,
    1210  FormMessages, FormSourceCode, FormTargetCode, FormConsole, Core, Common,
    13   SysUtils, BFCodeTools, TargetRust;
     11  SysUtils, BFCodeTools, TargetRust, FormHelp;
    1412
    1513{$R *.res}
  • trunk/Packages/Common/Common.pas

    r148 r153  
    5353function ComputerName: string;
    5454procedure DeleteFiles(APath, AFileSpec: string);
     55function EndsWith(Text, What: string): Boolean;
    5556function Explode(Separator: Char; Data: string): TStringArray;
    5657procedure ExecuteProgram(Executable: string; Parameters: array of string);
     
    8788procedure SearchFiles(AList: TStrings; Dir: string;
    8889  FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil);
     90procedure SortStrings(Strings: TStrings);
    8991function SplitString(var Text: string; Count: Word): string;
    9092function StripTags(const S: string): string;
     93function StartsWith(Text, What: string): Boolean;
    9194function TryHexToInt(Data: string; out Value: Integer): Boolean;
    9295function TryBinToInt(Data: string; out Value: Integer): Boolean;
    93 procedure SortStrings(Strings: TStrings);
    9496
    9597
    9698implementation
     99
     100function StartsWith(Text, What: string): Boolean;
     101begin
     102  Result := Copy(Text, 1, Length(Text)) = What;
     103end;
     104
     105function EndsWith(Text, What: string): Boolean;
     106begin
     107  Result := Copy(Text, Length(Text) - Length(What) + 1, MaxInt) = What;
     108end;
    97109
    98110function BinToInt(BinStr : string) : Int64;
  • trunk/Packages/Common/FindFile.pas

    r145 r153  
    7575constructor TFindFile.Create(AOwner: TComponent);
    7676begin
    77   inherited Create(AOwner);
     77  inherited;
    7878  Path := IncludeTrailingBackslash(UTF8Encode(GetCurrentDir));
    7979  FileMask := FilterAll;
  • trunk/Packages/Common/FormEx.pas

    r148 r153  
    1313  private
    1414    FCounter: Integer; static;
     15    FFirstShow: Boolean;
    1516  protected
    1617    procedure DoShow; override;
     
    1920    procedure DoDestroy; override;
    2021  public
     22    FullScreen: Boolean;
    2123    PersistentForm: TPersistentForm; static;
    2224    ThemeManager: TThemeManager; static;
     
    4446begin
    4547  inherited;
    46   PersistentForm.Load(Self);
     48  if not FFirstShow and (not (csDesigning in ComponentState)) then begin
     49    FFirstShow := True;
     50    PersistentForm.Load(Self);
     51    FullScreen := PersistentForm.FormFullScreen;
     52  end;
    4753end;
    4854
     
    6874  end;
    6975
    70   PersistentForm.Load(Self);
    7176  Translator.TranslateComponentRecursive(Self);
    7277  ThemeManager.UseTheme(Self);
     
    7782procedure TFormEx.DoClose(var CloseAction: TCloseAction);
    7883begin
    79   PersistentForm.Save(Self);
     84  if (not (csDesigning in ComponentState)) then begin
     85    PersistentForm.FormFullScreen := FullScreen;
     86    PersistentForm.Save(Self);
     87  end;
    8088  inherited;
    8189end;
  • trunk/Packages/Common/ListViewSort.pas

    r145 r153  
    136136constructor TListViewEx.Create(TheOwner: TComponent);
    137137begin
    138   inherited Create(TheOwner);
     138  inherited;
    139139  Filter := TListViewFilter.Create(Self);
    140140  Filter.Parent := Self;
     
    172172constructor TListViewFilter.Create(AOwner: TComponent);
    173173begin
    174   inherited Create(AOwner);
     174  inherited;
    175175  FStringGrid1 := TStringGrid.Create(Self);
    176176  FStringGrid1.Align := alClient;
  • trunk/Packages/Common/PersistentForm.pas

    r145 r153  
    1616    FMinVisiblePart: Integer;
    1717    FRegistryContext: TRegistryContext;
     18    FResizeEventOccured: Boolean;
    1819    procedure LoadControl(Control: TControl);
    1920    procedure SaveControl(Control: TControl);
     21    procedure WindowStateChange(Sender: TObject);
    2022  public
    2123    FormRestoredSize: TRect;
     
    301303
    302304procedure TPersistentForm.SetFullScreen(State: Boolean);
     305{$IFDEF UNIX}
     306var
     307  OldHandler: TNotifyEvent;
     308var
     309  I: Integer;
     310{$ENDIF}
    303311begin
    304312  if State then begin
     
    312320    end;
    313321    FormWindowState := Form.WindowState;
    314     Form.WindowState := wsMaximized;
    315     Form.WindowState := wsNormal;
    316     ShowWindow(Form.Handle, SW_SHOWFULLSCREEN);
    317322    {$IFDEF WINDOWS}
    318323    Form.BorderStyle := bsNone;
    319324    {$ENDIF}
     325    Form.WindowState := wsFullscreen;
     326    {$IFDEF UNIX}
     327    // Workaround on Linux, WindowState is rewriten by WMSize event to wsNormal.
     328    // We need for that even to occure
     329    OldHandler := Form.OnWindowStateChange;
     330    Form.OnWindowStateChange := WindowStateChange;
     331    FResizeEventOccured := False;
     332    for I := 0 to 10 do begin
     333      if FResizeEventOccured then Break;
     334      Application.ProcessMessages;
     335      Sleep(1);
     336    end;
     337    Form.OnWindowStateChange := OldHandler;
     338    FormFullScreen := True;
     339    {$ENDIF}
    320340  end else begin
    321341    FormFullScreen := False;
     342    Form.WindowState := wsNormal;
    322343    {$IFDEF WINDOWS}
    323344    Form.BorderStyle := bsSizeable;
    324345    {$ENDIF}
    325     ShowWindow(Form.Handle, SW_SHOWNORMAL);
    326346    if FormWindowState = wsNormal then begin
    327347      Form.WindowState := wsNormal;
     
    335355end;
    336356
     357procedure TPersistentForm.WindowStateChange(Sender: TObject);
     358begin
     359  Form.WindowState := wsFullscreen;
     360  FResizeEventOccured := True;
     361end;
     362
    337363end.
  • trunk/Packages/Common/PixelPointer.pas

    r148 r153  
    1818    function GetRGB: Cardinal; inline;
    1919  public
     20    class function CreateRGB(R, G, B: Byte): TPixel32; static;
     21    class function CreateRGBA(R, G, B, A: Byte): TPixel32; static;
    2022    property RGB: Cardinal read GetRGB write SetRGB;
    2123    case Integer of
     
    104106end;
    105107
     108class function TPixel32.CreateRGB(R, G, B: Byte): TPixel32;
     109begin
     110  Result.R := R;
     111  Result.G := G;
     112  Result.B := B;
     113  Result.A := 0;
     114end;
     115
     116class function TPixel32.CreateRGBA(R, G, B, A: Byte): TPixel32;
     117begin
     118  Result.R := R;
     119  Result.G := G;
     120  Result.B := B;
     121  Result.A := A;
     122end;
     123
    106124procedure TPixel32.SetRGB(AValue: Cardinal);
    107125begin
  • trunk/Packages/Common/Pool.pas

    r145 r153  
    5757  try
    5858    Lock.Acquire;
    59     inherited SetTotalCount(AValue);
     59    inherited;
    6060  finally
    6161    Lock.Release;
     
    6767  try
    6868    Lock.Acquire;
    69     Result := inherited GetUsedCount;
     69    Result := inherited;
    7070  finally
    7171    Lock.Release;
     
    8888      end;
    8989    end;
    90     Result := inherited Acquire;
     90    Result := inherited;
    9191  finally
    9292    Lock.Release;
     
    9898  try
    9999    Lock.Acquire;
    100     inherited Release(Item);
     100    inherited;
    101101  finally
    102102    Lock.Release;
     
    113113begin
    114114  TotalCount := 0;
    115   Lock.Free;
     115  FreeAndNil(Lock);
    116116  inherited;
    117117end;
  • trunk/Packages/Common/RegistryEx.pas

    r145 r153  
    133133  //CloseKey;
    134134  {$ENDIF}
    135   Result := inherited OpenKey(Key, CanCreate);
     135  Result := inherited;
    136136end;
    137137
  • trunk/Packages/Common/StopWatch.pas

    r145 r153  
    1313  TStopWatch = class
    1414  private
    15     fFrequency : TLargeInteger;
    16     fIsRunning: Boolean;
    17     fIsHighResolution: Boolean;
    18     fStartCount, fStopCount : TLargeInteger;
    19     procedure SetTickStamp(var lInt : TLargeInteger) ;
     15    FFrequency: TLargeInteger;
     16    FIsRunning: Boolean;
     17    FIsHighResolution: Boolean;
     18    FStartCount, fStopCount: TLargeInteger;
     19    procedure SetTickStamp(var Value: TLargeInteger);
    2020    function GetElapsedTicks: TLargeInteger;
    2121    function GetElapsedMiliseconds: TLargeInteger;
    2222    function GetElapsed: string;
    2323  public
    24     constructor Create(const startOnCreate : Boolean = False) ;
     24    constructor Create(const StartOnCreate: Boolean = False) ;
    2525    procedure Start;
    2626    procedure Stop;
    27     property IsHighResolution : Boolean read fIsHighResolution;
    28     property ElapsedTicks : TLargeInteger read GetElapsedTicks;
    29     property ElapsedMiliseconds : TLargeInteger read GetElapsedMiliseconds;
    30     property Elapsed : string read GetElapsed;
    31     property IsRunning : Boolean read fIsRunning;
     27    property IsHighResolution: Boolean read FIsHighResolution;
     28    property ElapsedTicks: TLargeInteger read GetElapsedTicks;
     29    property ElapsedMiliseconds: TLargeInteger read GetElapsedMiliseconds;
     30    property Elapsed: string read GetElapsed;
     31    property IsRunning: Boolean read FIsRunning;
    3232  end;
    3333
     
    3535implementation
    3636
    37 constructor TStopWatch.Create(const startOnCreate : boolean = false) ;
     37constructor TStopWatch.Create(const StartOnCreate: Boolean = False);
    3838begin
    39   inherited Create;
    40 
    41   fIsRunning := False;
     39  FIsRunning := False;
    4240
    4341  {$IFDEF WINDOWS}
    4442  fIsHighResolution := QueryPerformanceFrequency(fFrequency) ;
    4543  {$ELSE}
    46   fIsHighResolution := False;
     44  FIsHighResolution := False;
    4745  {$ENDIF}
    48   if NOT fIsHighResolution then fFrequency := MSecsPerSec;
     46  if NOT FIsHighResolution then FFrequency := MSecsPerSec;
    4947
    5048  if StartOnCreate then Start;
     
    5351function TStopWatch.GetElapsedTicks: TLargeInteger;
    5452begin
    55   Result := fStopCount - fStartCount;
     53  Result := FStopCount - FStartCount;
    5654end;
    5755
    58 procedure TStopWatch.SetTickStamp(var lInt : TLargeInteger) ;
     56procedure TStopWatch.SetTickStamp(var Value: TLargeInteger);
    5957begin
    60   if fIsHighResolution then
     58  if FIsHighResolution then
    6159    {$IFDEF Windows}
    62     QueryPerformanceCounter(lInt)
     60    QueryPerformanceCounter(Value)
    6361    {$ELSE}
    6462    {$ENDIF}
    6563  else
    66     lInt := MilliSecondOf(Now) ;
     64    Value := MilliSecondOf(Now);
    6765end;
    6866
    6967function TStopWatch.GetElapsed: string;
    7068var
    71   dt: TDateTime;
     69  Elapsed: TDateTime;
    7270begin
    73   dt := ElapsedMiliseconds / MSecsPerSec / SecsPerDay;
    74   result := Format('%d days, %s', [Trunc(dt), FormatDateTime('hh:nn:ss.z', Frac(dt))]) ;
     71  Elapsed := ElapsedMiliseconds / MSecsPerSec / SecsPerDay;
     72  Result := Format('%d days, %s', [Trunc(Elapsed), FormatDateTime('hh:nn:ss.z', Frac(Elapsed))]) ;
    7573end;
    7674
    7775function TStopWatch.GetElapsedMiliseconds: TLargeInteger;
    7876begin
    79   Result := (MSecsPerSec * (fStopCount - fStartCount)) div fFrequency;
     77  Result := (MSecsPerSec * (fStopCount - FStartCount)) div FFrequency;
    8078end;
    8179
    8280procedure TStopWatch.Start;
    8381begin
    84   SetTickStamp(fStartCount);
    85   fIsRunning := True;
     82  SetTickStamp(FStartCount);
     83  FIsRunning := True;
    8684end;
    8785
    8886procedure TStopWatch.Stop;
    8987begin
    90   SetTickStamp(fStopCount);
    91   fIsRunning := False;
     88  SetTickStamp(FStopCount);
     89  FIsRunning := False;
    9290end;
    9391
  • trunk/Packages/Common/Threading.pas

    r145 r153  
    188188constructor TThreadList.Create;
    189189begin
    190   inherited Create;
     190  inherited;
    191191end;
    192192
  • trunk/Target/TargetCSharp.pas

    r145 r153  
    3030  FSourceExtension := '.cs';
    3131  FCompiledExtension := '.exe';
    32   FRunExtension := '';
     32  FRunExtension := '.exe';
    3333  FImageIndex := 27;
    3434  FCapabilities := [tcCompile, tcRun];
  • trunk/Target/TargetJava.pas

    r145 r153  
    3030  FSourceExtension := '.java';
    3131  FCompiledExtension := '.class';
    32   FRunExtension := '';
     32  FRunExtension := '.class';
    3333  FImageIndex := 24;
    3434  FCapabilities := [tcCompile, tcRun];
Note: See TracChangeset for help on using the changeset viewer.