Changeset 191 for branches/generator


Ignore:
Timestamp:
May 17, 2019, 12:02:45 AM (6 years ago)
Author:
chronos
Message:
  • Added: Interface language selection in Settings dialog.
Location:
branches/generator
Files:
24 added
10 edited

Legend:

Unmodified
Added
Removed
  • branches/generator/Forms

    • Property svn:ignore
      •  

        old new  
        1 *.lrj
        21*.lrt
  • branches/generator/Forms/UFormMain.lfm

    r190 r191  
    3232      Height = 33
    3333      Top = 5
    34       Width = 239
     34      Width = 237
    3535      Align = alNone
    3636      AutoSize = True
     
    4646      Transparent = True
    4747      object ToolButton2: TToolButton
    48         Left = 169
     48        Left = 167
    4949        Top = 0
    5050        Action = ABuildCompiler
     
    7979      end
    8080      object ToolButton7: TToolButton
    81         Left = 204
     81        Left = 202
    8282        Top = 0
    8383        Action = ALookupTables
     
    184184      end
    185185    end
     186    object MenuItem14: TMenuItem
     187      Caption = 'Tools'
     188      object MenuItem15: TMenuItem
     189        Action = ASettings
     190      end
     191    end
    186192  end
    187193  object ActionList1: TActionList
     
    232238    end
    233239    object AGrammerSettings: TAction
    234       Caption = 'Settings'
     240      Caption = 'Grammer settings'
    235241      ImageIndex = 3
    236242      OnExecute = AGrammerSettingsExecute
     
    250256      ImageIndex = 8
    251257      OnExecute = ALookupTablesExecute
     258    end
     259    object ASettings: TAction
     260      Caption = 'Settings'
     261      OnExecute = ASettingsExecute
    252262    end
    253263  end
  • branches/generator/Forms/UFormMain.lrj

    r190 r191  
    88{"hash":243811202,"name":"tformmain.menuitem8.caption","sourcebytes":[71,114,97,109,109,101,114],"value":"Grammer"},
    99{"hash":380871,"name":"tformmain.menuitem1.caption","sourcebytes":[86,105,101,119],"value":"View"},
     10{"hash":5989939,"name":"tformmain.menuitem14.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"},
    1011{"hash":5882563,"name":"tformmain.arules.caption","sourcebytes":[82,117,108,101,115],"value":"Rules"},
    1112{"hash":5882563,"name":"tformmain.arules.hint","sourcebytes":[82,117,108,101,115],"value":"Rules"},
     
    2021{"hash":21703,"name":"tformmain.aprojectnew.caption","sourcebytes":[78,101,119],"value":"New"},
    2122{"hash":4863637,"name":"tformmain.aprojectclose.caption","sourcebytes":[67,108,111,115,101],"value":"Close"},
    22 {"hash":213582195,"name":"tformmain.agrammersettings.caption","sourcebytes":[83,101,116,116,105,110,103,115],"value":"Settings"},
     23{"hash":142765043,"name":"tformmain.agrammersettings.caption","sourcebytes":[71,114,97,109,109,101,114,32,115,101,116,116,105,110,103,115],"value":"Grammer settings"},
    2324{"hash":172269778,"name":"tformmain.abuildcompiler.caption","sourcebytes":[66,117,105,108,100,32,99,111,109,112,105,108,101,114],"value":"Build compiler"},
    2425{"hash":191244498,"name":"tformmain.atoolbarvisible.caption","sourcebytes":[84,111,111,108,98,97,114],"value":"Toolbar"},
    25 {"hash":79806131,"name":"tformmain.alookuptables.caption","sourcebytes":[76,111,111,107,117,112,32,116,97,98,108,101,115],"value":"Lookup tables"}
     26{"hash":79806131,"name":"tformmain.alookuptables.caption","sourcebytes":[76,111,111,107,117,112,32,116,97,98,108,101,115],"value":"Lookup tables"},
     27{"hash":213582195,"name":"tformmain.asettings.caption","sourcebytes":[83,101,116,116,105,110,103,115],"value":"Settings"}
    2628]}
  • branches/generator/Forms/UFormMain.pas

    r167 r191  
    1616  TFormMain = class(TForm)
    1717    ABuildCompiler: TAction;
     18    ASettings: TAction;
    1819    ALookupTables: TAction;
    1920    AToolbarVisible: TAction;
     
    3839    MenuItem12: TMenuItem;
    3940    MenuItem13: TMenuItem;
     41    MenuItem14: TMenuItem;
     42    MenuItem15: TMenuItem;
    4043    MenuItem2: TMenuItem;
    4144    MenuItem3: TMenuItem;
     
    6568    procedure ABuildCompilerExecute(Sender: TObject);
    6669    procedure ALookupTablesExecute(Sender: TObject);
     70    procedure ASettingsExecute(Sender: TObject);
    6771    procedure AToolbarVisibleExecute(Sender: TObject);
    6872    procedure AExitExecute(Sender: TObject);
     
    100104
    101105uses
    102   UFormRules, UCore, UFormGrammer, UBuilder, UFormLookupTables;
     106  UFormRules, UCore, UFormGrammer, UBuilder, UFormLookupTables, UFormSettings;
    103107
    104108resourcestring
     
    322326end;
    323327
     328procedure TFormMain.ASettingsExecute(Sender: TObject);
     329begin
     330  FormSettings := TFormSettings.Create(nil);
     331  FormSettings.Load;
     332  if FormSettings.ShowModal = mrOk then begin
     333    FormSettings.Save;
     334  end;
     335  FreeAndNil(FormSettings);
     336end;
     337
    324338procedure TFormMain.AToolbarVisibleExecute(Sender: TObject);
    325339begin
  • branches/generator/Languages/generator.cs.po

    r190 r191  
    1818
    1919#: tformgrammer.buttonok.caption
     20msgctxt "tformgrammer.buttonok.caption"
    2021msgid "OK"
    2122msgstr "OK"
    2223
    2324#: tformgrammer.caption
     25msgctxt "tformgrammer.caption"
    2426msgid "Grammer settings"
    2527msgstr "Nastavení gramatiky:"
     
    107109
    108110#: tformmain.agrammersettings.caption
    109 msgid "Settings"
    110 msgstr "Nastavení"
     111msgctxt "tformmain.agrammersettings.caption"
     112msgid "Grammer settings"
     113msgstr "Nastavení gramatiky"
    111114
    112115#: tformmain.alookuptables.caption
     
    162165msgstr "Pravidla"
    163166
     167#: tformmain.asettings.caption
     168msgctxt "tformmain.asettings.caption"
     169msgid "Settings"
     170msgstr "Nastavení"
     171
    164172#: tformmain.atoolbarvisible.caption
    165173msgctxt "tformmain.atoolbarvisible.caption"
     
    175183msgstr "Zobrazení"
    176184
     185#: tformmain.menuitem14.caption
     186msgid "Tools"
     187msgstr "Nástroje"
     188
    177189#: tformmain.menuitem2.caption
    178190msgid "File"
     
    421433msgstr "Úroveň"
    422434
     435#: tformsettings.buttoncancel.caption
     436msgctxt "tformsettings.buttoncancel.caption"
     437msgid "Cancel"
     438msgstr "ZruÅ¡it"
     439
     440#: tformsettings.buttonok.caption
     441msgctxt "tformsettings.buttonok.caption"
     442msgid "OK"
     443msgstr "OK"
     444
     445#: tformsettings.caption
     446msgctxt "tformsettings.caption"
     447msgid "Settings"
     448msgstr "Nastavení"
     449
     450#: tformsettings.label1.caption
     451msgid "Language:"
     452msgstr "Jazyk:"
     453
    423454#: uformmain.sdoyouwanttosaveproject
    424455msgid "There are unsaved changes in project. Do you want to save them?"
  • branches/generator/Languages/generator.po

    r190 r191  
    88
    99#: tformgrammer.buttonok.caption
     10msgctxt "tformgrammer.buttonok.caption"
    1011msgid "OK"
    1112msgstr ""
    1213
    1314#: tformgrammer.caption
     15msgctxt "tformgrammer.caption"
    1416msgid "Grammer settings"
    1517msgstr ""
     
    9799
    98100#: tformmain.agrammersettings.caption
    99 msgid "Settings"
     101msgctxt "tformmain.agrammersettings.caption"
     102msgid "Grammer settings"
    100103msgstr ""
    101104
     
    152155msgstr ""
    153156
     157#: tformmain.asettings.caption
     158msgctxt "tformmain.asettings.caption"
     159msgid "Settings"
     160msgstr ""
     161
    154162#: tformmain.atoolbarvisible.caption
    155163msgctxt "tformmain.atoolbarvisible.caption"
     
    165173msgstr ""
    166174
     175#: tformmain.menuitem14.caption
     176msgid "Tools"
     177msgstr ""
     178
    167179#: tformmain.menuitem2.caption
    168180msgid "File"
     
    411423msgstr ""
    412424
     425#: tformsettings.buttoncancel.caption
     426msgctxt "tformsettings.buttoncancel.caption"
     427msgid "Cancel"
     428msgstr ""
     429
     430#: tformsettings.buttonok.caption
     431msgctxt "tformsettings.buttonok.caption"
     432msgid "OK"
     433msgstr ""
     434
     435#: tformsettings.caption
     436msgctxt "tformsettings.caption"
     437msgid "Settings"
     438msgstr ""
     439
     440#: tformsettings.label1.caption
     441msgid "Language:"
     442msgstr ""
     443
    413444#: uformmain.sdoyouwanttosaveproject
    414445msgid "There are unsaved changes in project. Do you want to save them?"
  • branches/generator/UCore.lfm

    r167 r191  
    33  OnDestroy = DataModuleDestroy
    44  OldCreateOrder = False
    5   Height = 562
    6   HorizontalOffset = 384
    7   VerticalOffset = 276
    8   Width = 865
    9   PPI = 120
     5  Height = 674
     6  HorizontalOffset = 517
     7  VerticalOffset = 441
     8  Width = 1038
     9  PPI = 144
    1010  object ImageList1: TImageList
    11     left = 256
    12     top = 136
     11    left = 307
     12    top = 163
    1313    Bitmap = {
    1414      4C690B0000001000000010000000000000000000000000000000000000000000
     
    370370    MinVisiblePart = 50
    371371    EntireVisible = False
    372     left = 408
    373     top = 144
     372    left = 490
     373    top = 173
    374374  end
    375375  object XMLConfig1: TXMLConfig
     
    377377    RootName = 'CONFIG'
    378378    ReadOnly = False
    379     left = 96
    380     top = 128
     379    left = 115
     380    top = 154
    381381  end
    382382  object ApplicationInfo1: TApplicationInfo
     
    386386    VersionBugFix = 0
    387387    AppName = 'Generator'
    388     ReleaseDate = 0
     388    Description = 'Programming language generator'
     389    ReleaseDate = 43601
    389390    RegistryKey = '\Software\Chronosoft\Generator'
    390391    RegistryRoot = rrKeyCurrentUser
    391     License = 'CC)'
    392     left = 192
    393     top = 259
     392    License = 'CC0'
     393    left = 230
     394    top = 311
     395  end
     396  object CoolTranslator1: TCoolTranslator
     397    POFilesFolder = 'Languages'
     398    left = 422
     399    top = 306
    394400  end
    395401end
  • branches/generator/UCore.pas

    r167 r191  
    77uses
    88  Classes, SysUtils, XMLConf, FileUtil, Controls, ActnList, UGrammer,
    9   UPersistentForm, ULastOpenedList, UApplicationInfo;
     9  UPersistentForm, ULastOpenedList, UApplicationInfo, UCoolTranslator;
    1010
    1111type
     
    1515  TCore = class(TDataModule)
    1616    ApplicationInfo1: TApplicationInfo;
     17    CoolTranslator1: TCoolTranslator;
    1718    ImageList1: TImageList;
    1819    PersistentForm1: TPersistentForm;
     
    5758  with XMLConfig1 do begin
    5859    ReopenLastFile := GetValue('ReopenLastFile', True);
     60    CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(String(GetValue('Language', '')));
    5961  end;
    6062end;
     
    6466  with XMLConfig1 do begin
    6567    SetValue('ReopenLastFile', ReopenLastFile);
     68    SetValue('Language', WideString(CoolTranslator1.Language.Code));
    6669    Flush;
    6770  end;
  • branches/generator/generator.lpi

    r189 r191  
    3030            <IncludeFiles Value="$(ProjOutDir)"/>
    3131            <OtherUnitFiles Value="Forms"/>
    32             <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     32            <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/>
    3333          </SearchPaths>
    3434          <Parsing>
     
    7474      </Modes>
    7575    </RunParams>
    76     <RequiredPackages Count="3">
     76    <RequiredPackages Count="4">
    7777      <Item1>
    78         <PackageName Value="FCL"/>
     78        <PackageName Value="CoolTranslator"/>
     79        <DefaultFilename Value="Packages/CoolTranslator/CoolTranslator.lpk" Prefer="True"/>
    7980      </Item1>
    8081      <Item2>
     82        <PackageName Value="FCL"/>
     83      </Item2>
     84      <Item3>
    8185        <PackageName Value="Common"/>
    8286        <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/>
    83       </Item2>
    84       <Item3>
     87      </Item3>
     88      <Item4>
    8589        <PackageName Value="LCL"/>
    86       </Item3>
     90      </Item4>
    8791    </RequiredPackages>
    88     <Units Count="12">
     92    <Units Count="13">
    8993      <Unit0>
    9094        <Filename Value="generator.lpr"/>
     
    162166        <ResourceBaseClass Value="Form"/>
    163167      </Unit11>
     168      <Unit12>
     169        <Filename Value="Forms/UFormSettings.pas"/>
     170        <IsPartOfProject Value="True"/>
     171        <ComponentName Value="FormSettings"/>
     172        <HasResources Value="True"/>
     173        <ResourceBaseClass Value="Form"/>
     174      </Unit12>
    164175    </Units>
    165176  </ProjectOptions>
     
    172183      <IncludeFiles Value="$(ProjOutDir)"/>
    173184      <OtherUnitFiles Value="Forms"/>
    174       <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     185      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/>
    175186    </SearchPaths>
    176187    <Parsing>
  • branches/generator/generator.lpr

    r189 r191  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UCore, Common, UFormMain, SysUtils, UBuilder,
    11   UFormRules, UFormLookupTables, UFormLookupTable
     10  Forms, UCore, Common, UFormMain, SysUtils, UBuilder, CoolTranslator,
     11  UFormRules, UFormLookupTables, UFormLookupTable, UFormSettings
    1212  { you can add units after this };
    1313
Note: See TracChangeset for help on using the changeset viewer.