Changeset 135 for trunk


Ignore:
Timestamp:
Mar 5, 2022, 9:44:18 AM (2 years ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
  • Modified: More translated strings.
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormOptions.lfm

    r128 r135  
    11object FormOptions: TFormOptions
    22  Left = 401
    3   Height = 427
     3  Height = 445
    44  Top = 236
    5   Width = 728
     5  Width = 758
    66  Caption = 'Options'
    7   ClientHeight = 427
    8   ClientWidth = 728
    9   DesignTimePPI = 144
     7  ClientHeight = 445
     8  ClientWidth = 758
     9  DesignTimePPI = 150
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     
    1313  LCLVersion = '2.2.0.4'
    1414  object ButtonOk: TButton
    15     Left = 631
    16     Height = 30
    17     Top = 389
    18     Width = 90
     15    Left = 657
     16    Height = 31
     17    Top = 406
     18    Width = 94
    1919    Anchors = [akRight, akBottom]
    2020    Caption = 'Ok'
     
    2424  end
    2525  object ButtonCancel: TButton
    26     Left = 516
    27     Height = 30
    28     Top = 389
    29     Width = 90
     26    Left = 537
     27    Height = 31
     28    Top = 406
     29    Width = 94
    3030    Anchors = [akRight, akBottom]
    3131    Caption = 'Cancel'
     
    3636  object PageControl1: TPageControl
    3737    Left = 10
    38     Height = 371
     38    Height = 387
    3939    Top = 10
    40     Width = 711
    41     ActivePage = TabSheetGeneral
     40    Width = 741
     41    ActivePage = TabSheetBuild
    4242    Anchors = [akTop, akLeft, akRight, akBottom]
    4343    ParentFont = False
    44     TabIndex = 0
     44    TabIndex = 1
    4545    TabOrder = 2
    4646    object TabSheetGeneral: TTabSheet
    4747      Caption = 'General'
    48       ClientHeight = 331
    49       ClientWidth = 701
     48      ClientHeight = 346
     49      ClientWidth = 731
    5050      ParentFont = False
    5151      object Panel1: TPanel
    5252        Left = 0
    53         Height = 331
     53        Height = 346
    5454        Top = 0
    55         Width = 701
     55        Width = 731
    5656        Align = alClient
    5757        BevelOuter = bvNone
    58         ClientHeight = 331
    59         ClientWidth = 701
     58        ClientHeight = 346
     59        ClientWidth = 731
    6060        ParentFont = False
    6161        TabOrder = 0
    6262        object Label3: TLabel
    6363          Left = 10
    64           Height = 26
    65           Top = 58
    66           Width = 164
     64          Height = 27
     65          Top = 60
     66          Width = 177
    6767          Caption = 'Interface language:'
    6868          ParentFont = False
    6969        end
    7070        object ComboBoxLanguage: TComboBox
    71           Left = 307
    72           Height = 41
    73           Top = 58
    74           Width = 226
     71          Left = 320
     72          Height = 42
     73          Top = 60
     74          Width = 235
    7575          ItemHeight = 0
    7676          ParentFont = False
     
    8080        object CheckBoxReopenLastFile: TCheckBox
    8181          Left = 10
    82           Height = 32
    83           Top = 102
    84           Width = 1260
     82          Height = 33
     83          Top = 106
     84          Width = 1314
    8585          Anchors = [akTop, akLeft, akRight]
    8686          AutoSize = False
     
    9191        object CheckBoxDPIAuto: TCheckBox
    9292          Left = 10
    93           Height = 32
    94           Top = 150
    95           Width = 1250
     93          Height = 33
     94          Top = 156
     95          Width = 1303
    9696          Anchors = [akTop, akLeft, akRight]
    9797          AutoSize = False
     
    102102        end
    103103        object LabelDPI: TLabel
    104           Left = 36
    105           Height = 26
    106           Top = 192
    107           Width = 35
     104          Left = 38
     105          Height = 27
     106          Top = 200
     107          Width = 36
    108108          Caption = 'DPI:'
    109109          ParentFont = False
    110110        end
    111111        object SpinEditDPIX: TSpinEdit
    112           Left = 134
    113           Height = 42
    114           Top = 190
    115           Width = 96
     112          Left = 140
     113          Height = 43
     114          Top = 198
     115          Width = 100
    116116          MaxValue = 1000
    117117          MinValue = 1
     
    121121        end
    122122        object SpinEditDPIY: TSpinEdit
    123           Left = 259
    124           Height = 42
    125           Top = 192
    126           Width = 96
     123          Left = 270
     124          Height = 43
     125          Top = 200
     126          Width = 100
    127127          MaxValue = 1000
    128128          MinValue = 1
     
    132132        end
    133133        object LabelX: TLabel
    134           Left = 240
    135           Height = 26
    136           Top = 192
     134          Left = 250
     135          Height = 27
     136          Top = 200
    137137          Width = 10
    138138          Caption = 'x'
     
    141141        object LabelTheme: TLabel
    142142          Left = 10
    143           Height = 26
    144           Top = 19
    145           Width = 63
     143          Height = 27
     144          Top = 20
     145          Width = 67
    146146          Caption = 'Theme:'
    147147          ParentFont = False
    148148        end
    149149        object ComboBoxTheme: TComboBox
    150           Left = 307
    151           Height = 41
     150          Left = 320
     151          Height = 42
    152152          Top = 10
    153           Width = 226
     153          Width = 235
    154154          ItemHeight = 0
    155155          ParentFont = False
     
    161161    object TabSheetBuild: TTabSheet
    162162      Caption = 'Build'
    163       ClientHeight = 331
    164       ClientWidth = 701
     163      ClientHeight = 346
     164      ClientWidth = 731
    165165      ParentFont = False
    166166      object Panel2: TPanel
    167167        Left = 0
    168         Height = 331
     168        Height = 346
    169169        Top = 0
    170         Width = 701
     170        Width = 731
    171171        Align = alClient
    172172        BevelOuter = bvNone
    173         ClientHeight = 331
    174         ClientWidth = 701
     173        ClientHeight = 346
     174        ClientWidth = 731
    175175        ParentFont = False
    176176        TabOrder = 0
    177177        object Label4: TLabel
    178178          Left = 10
    179           Height = 26
     179          Height = 27
     180          Top = 130
     181          Width = 214
     182          Caption = 'Compiler optimizations:'
     183          ParentFont = False
     184        end
     185        object ComboBoxOptimization: TComboBox
     186          Left = 310
     187          Height = 39
    180188          Top = 125
    181           Width = 202
    182           Caption = 'Compiler optimizations:'
    183           ParentFont = False
    184         end
    185         object ComboBoxOptimization: TComboBox
    186           Left = 298
    187           Height = 38
    188           Top = 120
    189           Width = 226
     189          Width = 235
    190190          ItemHeight = 0
    191191          Items.Strings = (
     
    199199        end
    200200        object CheckBoxOptimizeAddSub: TCheckBox
    201           Left = 37
    202           Height = 30
    203           Top = 163
    204           Width = 236
     201          Left = 39
     202          Height = 31
     203          Top = 170
     204          Width = 249
    205205          Caption = 'Addition and subtraction'
    206206          ParentFont = False
     
    208208        end
    209209        object CheckBoxOptimizeMerge: TCheckBox
    210           Left = 37
    211           Height = 30
    212           Top = 224
    213           Width = 227
     210          Left = 39
     211          Height = 31
     212          Top = 233
     213          Width = 240
    214214          Caption = 'Merge same operations'
    215215          ParentFont = False
     
    217217        end
    218218        object CheckBoxOptimizeCopyMultiply: TCheckBox
    219           Left = 37
    220           Height = 30
    221           Top = 282
    222           Width = 142
     219          Left = 39
     220          Height = 31
     221          Top = 294
     222          Width = 149
    223223          Caption = 'Copy multiply'
    224224          OnChange = CheckBoxOptimizeCopyMultiplyChange
     
    227227        end
    228228        object CheckBoxOptimizeRelativeIndexes: TCheckBox
    229           Left = 37
    230           Height = 30
    231           Top = 253
    232           Width = 162
     229          Left = 39
     230          Height = 31
     231          Top = 264
     232          Width = 172
    233233          Caption = 'Relative indexes'
    234234          OnChange = CheckBoxOptimizeRelativeIndexesChange
     
    238238        object Label2: TLabel
    239239          Left = 10
    240           Height = 26
    241           Top = 64
    242           Width = 73
     240          Height = 27
     241          Top = 67
     242          Width = 77
    243243          Caption = 'Cell size:'
    244244          ParentFont = False
     
    246246        object Label1: TLabel
    247247          Left = 10
    248           Height = 26
    249           Top = 16
    250           Width = 112
     248          Height = 27
     249          Top = 17
     250          Width = 119
    251251          Caption = 'Memory size:'
    252252          ParentFont = False
    253253        end
    254254        object SpinEditMemorySize: TSpinEdit
    255           Left = 198
    256           Height = 42
     255          Left = 206
     256          Height = 43
    257257          Top = 7
    258           Width = 156
     258          Width = 162
    259259          MaxValue = 2000000000
    260260          ParentFont = False
     
    262262        end
    263263        object SpinEditCellSize: TSpinEdit
    264           Left = 198
    265           Height = 42
    266           Top = 56
    267           Width = 156
     264          Left = 206
     265          Height = 43
     266          Top = 58
     267          Width = 162
    268268          MaxValue = 2000000000
    269269          ParentFont = False
     
    271271        end
    272272        object CheckBoxOptimizeSetZero: TCheckBox
    273           Left = 37
    274           Height = 30
    275           Top = 192
    276           Width = 93
     273          Left = 39
     274          Height = 31
     275          Top = 200
     276          Width = 97
    277277          Caption = 'Set zero'
    278278          ParentFont = False
     
    280280        end
    281281        object CheckBoxDebugEnabled: TCheckBox
    282           Left = 392
    283           Height = 30
     282          Left = 408
     283          Height = 31
    284284          Top = 12
    285           Width = 120
     285          Width = 128
    286286          Caption = 'Debugging'
    287287          ParentFont = False
  • trunk/Forms/UFormOptions.pas

    r128 r135  
    168168  Core.ThemeManager.Themes.LoadToStrings(ComboBoxTheme.Items);
    169169  Core.Translator.LanguageListToStrings(ComboBoxLanguage.Items);
     170  ComboBoxOptimization.Items.Clear;
     171  ComboBoxOptimization.Items.Add(CompilerOptimizationText[coNone]);
     172  ComboBoxOptimization.Items.Add(CompilerOptimizationText[coNormal]);
    170173end;
    171174
  • trunk/Languages/LazFuck.cs.po

    r134 r135  
    590590msgstr "Nenalezen překladač \"%s\""
    591591
     592#: utarget.scompiling
     593msgid "Compiling"
     594msgstr "Překládání"
     595
    592596#: utarget.sexecutornotfound
    593597#, object-pascal-format
     
    595599msgstr "Spouštěč \"%s\" nenalezen"
    596600
     601#: utarget.snone
     602msgid "None"
     603msgstr "Ŝádné"
     604
     605#: utarget.snormal
     606msgid "Normal"
     607msgstr "Obyčejné"
     608
     609#: utarget.spaused
     610msgid "Paused"
     611msgstr "Zastaveno"
     612
     613#: utarget.srunning
     614msgid "Running"
     615msgstr "Běşící"
     616
     617#: utarget.sstopped
     618msgid "Stopped"
     619msgstr "Zastaveno"
     620
    597621#: utargetinterpretter.sjumptablecollision
    598622msgid "Jump table collision"
  • trunk/Languages/LazFuck.pot

    r134 r135  
    580580msgstr ""
    581581
     582#: utarget.scompiling
     583msgid "Compiling"
     584msgstr ""
     585
    582586#: utarget.sexecutornotfound
    583587#, object-pascal-format
     
    585589msgstr ""
    586590
     591#: utarget.snone
     592msgid "None"
     593msgstr ""
     594
     595#: utarget.snormal
     596msgid "Normal"
     597msgstr ""
     598
     599#: utarget.spaused
     600msgid "Paused"
     601msgstr ""
     602
     603#: utarget.srunning
     604msgid "Running"
     605msgstr ""
     606
     607#: utarget.sstopped
     608msgid "Stopped"
     609msgstr ""
     610
    587611#: utargetinterpretter.sjumptablecollision
    588612msgid "Jump table collision"
  • trunk/Target/UTargetC.pas

    r133 r135  
    109109begin
    110110  CompiledFile := ExtractFilePath(ProjectFileName) +
    111     'compiled' + DirectorySeparator + Name + DirectorySeparator +
     111    CompiledDir + DirectorySeparator + Name + DirectorySeparator +
    112112    ExtractFileNameOnly(ProjectFileName) + SourceExtension;
    113113  ForceDirectoriesUTF8(ExtractFilePath(CompiledFile));
  • trunk/Target/UTargetJavascript.pas

    r133 r135  
    101101      '</html>';
    102102    HtmlFile := ExtractFilePath(ProjectFileName) +
    103       'compiled' + DirectorySeparator + Name + DirectorySeparator +
     103      CompiledDir + DirectorySeparator + Name + DirectorySeparator +
    104104      ExtractFileNameOnly(ProjectFileName) + '.html';
    105105    ForceDirectories(ExtractFilePath(HtmlFile));
     
    116116  inherited;
    117117  HtmlFile := ExtractFilePath(ProjectFileName) +
    118     'compiled' + DirectorySeparator + Name + DirectorySeparator +
     118    CompiledDir + DirectorySeparator + Name + DirectorySeparator +
    119119    ExtractFileNameOnly(ProjectFileName) + '.html';
    120120
  • trunk/UCore.lfm

    r133 r135  
    546546  object Translator: TTranslator
    547547    POFilesFolder = 'Languages'
     548    OnTranslate = TranslatorTranslate
    548549    Left = 113
    549550    Top = 113
  • trunk/UCore.pas

    r133 r135  
    2525    procedure DataModuleCreate(Sender: TObject);
    2626    procedure DataModuleDestroy(Sender: TObject);
     27    procedure TranslatorTranslate(Sender: TObject);
    2728  private
    2829    FCurrentTarget: TTarget;
     
    102103end;
    103104
     105procedure TCore.TranslatorTranslate(Sender: TObject);
     106begin
     107  UTarget.UpdateTranslation;
     108end;
     109
    104110procedure TCore.InitTargets;
    105111var
  • trunk/UProject.pas

    r68 r135  
    66
    77uses
    8   Classes, SysUtils;
     8  Classes, SysUtils, fgl;
    99
    1010type
     11  TProjectItem = class
     12    Name: string;
     13  end;
     14
     15  TProjectItems = class(TFPGObjectList<TProjectItem>)
     16  end;
     17
     18  TProjectFile = class(TProjectItem)
     19  end;
     20
     21  TProjectDirectory = class(TProjectItem)
     22  end;
    1123
    1224  { TProject }
     
    1729    procedure SetOpenned(AValue: Boolean);
    1830  public
     31    Items: TProjectItems;
    1932    Modified: Boolean;
    2033    FileName: string;
     34    constructor Create;
     35    destructor Destroy; override;
    2136    property Openned: Boolean read FOpenned write SetOpenned;
    2237  end;
     38
     39const
     40  LazFuckProjectExt = '.lfp';
     41
    2342
    2443implementation
     
    3756end;
    3857
     58constructor TProject.Create;
     59begin
     60  Items := TProjectItems.Create;
     61end;
     62
     63destructor TProject.Destroy;
     64begin
     65  FreeAndNil(Items);
     66  inherited;
     67end;
     68
    3969end.
    4070
  • trunk/UTarget.pas

    r133 r135  
    155155  end;
    156156
    157 const
    158   RunStateText: array[TRunState] of string = ('Stopped', 'Paused', 'Running',
    159     'Compiling');
    160 
    161157
    162158resourcestring
     
    164160  SExecutorNotFound = 'Executor "%s" not found';
    165161  SCompiledFileNotFound = 'Program compiled file "%s" not found';
     162  SStopped = 'Stopped';
     163  SPaused = 'Paused';
     164  SRunning = 'Running';
     165  SCompiling = 'Compiling';
     166  SNone = 'None';
     167  SNormal = 'Normal';
     168
     169const
     170  CompiledDir = 'compiled';
     171
     172var
     173  RunStateText: array[TRunState] of string = (SStopped, SPaused, SRunning,
     174    SCompiling);
     175  CompilerOptimizationText: array[TCompilerOptimization] of string = (SNone, SNormal);
     176
     177procedure UpdateTranslation;
    166178
    167179
    168180implementation
     181
     182procedure UpdateTranslation;
     183begin
     184  RunStateText[rsStopped] := SStopped;
     185  RunStateText[rsPaused] := SPaused;
     186  RunStateText[rsRunning] := SRunning;
     187  RunStateText[rsCompiling] := SCompiling;
     188  CompilerOptimizationText[coNone] := SNone;
     189  CompilerOptimizationText[coNormal] := SNormal;
     190end;
    169191
    170192{ TMessages }
     
    464486begin
    465487  CompiledFile := ExtractFilePath(ProjectFileName) +
    466     'compiled' + DirectorySeparator + Name + DirectorySeparator +
     488    CompiledDir + DirectorySeparator + Name + DirectorySeparator +
    467489    ExtractFileNameOnly(ProjectFileName) + SourceExtension;
    468490  ForceDirectories(ExtractFilePath(CompiledFile));
     
    507529
    508530  CompiledFile := ExtractFilePath(ProjectFileName) +
    509     'compiled' + DirectorySeparator + Name + DirectorySeparator +
     531    CompiledDir + DirectorySeparator + Name + DirectorySeparator +
    510532    ExtractFileNameOnly(ProjectFileName) + CompiledExtension;
    511533  RunFile := ExtractFilePath(ProjectFileName) +
    512     'compiled' + DirectorySeparator + Name + DirectorySeparator +
     534    CompiledDir + DirectorySeparator + Name + DirectorySeparator +
    513535    ExtractFileNameOnly(ProjectFileName) + RunExtension;
    514536  if not FileExists(ExecutorPath) then
Note: See TracChangeset for help on using the changeset viewer.