Changeset 228
- Timestamp:
- Jun 24, 2023, 12:33:35 PM (18 months ago)
- Location:
- branches/xpascal
- Files:
-
- 10 added
- 9 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xpascal/Forms/FormMain.lfm
r227 r228 1 1 object FormMain: TFormMain 2 Left = 5152 Left = 482 3 3 Height = 993 4 Top = 674 Top = 205 5 5 Width = 1491 6 6 Caption = 'Interpreter' … … 10 10 Menu = MainMenu1 11 11 OnActivate = FormActivate 12 OnClose = FormClose13 12 OnCreate = FormCreate 14 13 OnDestroy = FormDestroy -
branches/xpascal/Forms/FormMain.pas
r227 r228 6 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Menus, 7 7 ActnList, ExtCtrls, SynHighlighterPas, SynEdit, Source, Optimizer, 8 Generator, FormSource, FormMessages, FormOutput ;8 Generator, FormSource, FormMessages, FormOutput, FormEx; 9 9 10 10 type … … 12 12 { TFormMain } 13 13 14 TFormMain = class(TForm )14 TFormMain = class(TFormEx) 15 15 ACompile: TAction; 16 16 ATest: TAction; … … 46 46 procedure AGenerateXmlExecute(Sender: TObject); 47 47 procedure ATestExecute(Sender: TObject); 48 procedure FormCreate(Sender: TObject);49 48 procedure Optimize(Features: TOptimizeFeatures); 50 49 procedure ARunExecute(Sender: TObject); 51 50 procedure FormActivate(Sender: TObject); 52 procedure FormC lose(Sender: TObject; var CloseAction: TCloseAction);51 procedure FormCreate(Sender: TObject); 53 52 procedure FormDestroy(Sender: TObject); 54 53 procedure FormShow(Sender: TObject); … … 75 74 76 75 uses 77 Parser, Executor, GeneratorPascal, GeneratorPhp, FormTests, 76 Parser, Executor, GeneratorPascal, GeneratorPhp, FormTests, Translator, 78 77 GeneratorCSharp, GeneratorXml, ParserPascal; 79 78 … … 89 88 end; 90 89 91 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);92 begin93 end;94 95 90 procedure TFormMain.FormDestroy(Sender: TObject); 96 91 begin 97 92 if Assigned(Prog) then FreeAndNil(Prog); 98 FreeAndNil(FormSource);99 FreeAndNil(FormMessages);100 FreeAndNil(FormOutput);93 if Assigned(FormSource) then FreeAndNil(FormSource); 94 if Assigned(FormMessages) then FreeAndNil(FormMessages); 95 if Assigned(FormOutput) then FreeAndNil(FormOutput); 101 96 end; 102 97 … … 211 206 procedure TFormMain.FormCreate(Sender: TObject); 212 207 begin 208 Translator.POFilesFolder := 'Languages;Packages/Common/Languages'; 209 Translator.Language := Translator.Languages.SearchByCode(''); 213 210 end; 214 211 -
branches/xpascal/Languages/xpascal.cs.po
r227 r228 113 113 msgstr "Zdroj:" 114 114 115 #: tformtest.arun.caption116 msgctxt "tformtest.arun.caption"117 msgid "Run"118 msgstr "Spustit"119 120 #: tformtest.ashow.caption121 msgid "Show"122 msgstr "Ukázat"123 124 #: tformtest.buttonrun.caption125 msgctxt "tformtest.buttonrun.caption"126 msgid "Run"127 msgstr "Spustit"128 129 #: tformtest.caption130 msgctxt "tformtest.caption"131 msgid "Test"132 msgstr "Test"133 134 #: tformtest.labelresult.caption135 msgid " "136 msgstr " "137 138 #: tformtest.listviewtestcases.columns[0].caption139 msgid "Name"140 msgstr "Jméno"141 142 #: tformtest.listviewtestcases.columns[1].caption143 msgid "Result"144 msgstr "VÃœsledek"145 146 #: tformtestcase.caption147 msgid "Test case"148 msgstr "TestovÃœ pÅÃpad" -
branches/xpascal/Languages/xpascal.pot
r227 r228 103 103 msgstr "" 104 104 105 #: tformtest.arun.caption106 msgctxt "tformtest.arun.caption"107 msgid "Run"108 msgstr ""109 110 #: tformtest.ashow.caption111 msgid "Show"112 msgstr ""113 114 #: tformtest.buttonrun.caption115 msgctxt "tformtest.buttonrun.caption"116 msgid "Run"117 msgstr ""118 119 #: tformtest.caption120 msgctxt "tformtest.caption"121 msgid "Test"122 msgstr ""123 124 #: tformtest.labelresult.caption125 msgid " "126 msgstr ""127 128 #: tformtest.listviewtestcases.columns[0].caption129 msgid "Name"130 msgstr ""131 132 #: tformtest.listviewtestcases.columns[1].caption133 msgid "Result"134 msgstr ""135 136 #: tformtestcase.caption137 msgid "Test case"138 msgstr ""139 -
branches/xpascal/Packages/Common/Common.lpk
r227 r228 11 11 <PathDelim Value="\"/> 12 12 <SearchPaths> 13 <OtherUnitFiles Value="Forms"/> 13 14 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 14 15 </SearchPaths> … … 42 43 <License Value="Copy left."/> 43 44 <Version Minor="11"/> 44 <Files Count="3 5">45 <Files Count="37"> 45 46 <Item1> 46 47 <Filename Value="StopWatch.pas"/> … … 159 160 </Item26> 160 161 <Item27> 161 <Filename Value="FormAbout.pas"/> 162 <UnitName Value="FormAbout"/> 162 <Filename Value="AboutDialog.pas"/> 163 <HasRegisterProc Value="True"/> 164 <UnitName Value="AboutDialog"/> 163 165 </Item27> 164 166 <Item28> 165 <Filename Value="AboutDialog.pas"/> 166 <HasRegisterProc Value="True"/> 167 <UnitName Value="AboutDialog"/> 167 <Filename Value="PixelPointer.pas"/> 168 <UnitName Value="PixelPointer"/> 168 169 </Item28> 169 170 <Item29> 170 <Filename Value=" PixelPointer.pas"/>171 <UnitName Value=" PixelPointer"/>171 <Filename Value="DataFile.pas"/> 172 <UnitName Value="DataFile"/> 172 173 </Item29> 173 174 <Item30> 174 <Filename Value=" DataFile.pas"/>175 <UnitName Value=" DataFile"/>175 <Filename Value="TestCase.pas"/> 176 <UnitName Value="TestCase"/> 176 177 </Item30> 177 178 <Item31> 178 <Filename Value=" TestCase.pas"/>179 <UnitName Value=" TestCase"/>179 <Filename Value="Generics.pas"/> 180 <UnitName Value="Generics"/> 180 181 </Item31> 181 182 <Item32> 182 <Filename Value="Generics.pas"/>183 <UnitName Value="Generics"/>184 </Item32>185 <Item33>186 183 <Filename Value="CommonPackage.pas"/> 187 184 <Type Value="Main Unit"/> 188 185 <UnitName Value="CommonPackage"/> 186 </Item32> 187 <Item33> 188 <Filename Value="Table.pas"/> 189 <UnitName Value="Table"/> 189 190 </Item33> 190 191 <Item34> 191 <Filename Value="Table.pas"/> 192 <UnitName Value="Table"/> 192 <Filename Value="FormEx.pas"/> 193 <HasRegisterProc Value="True"/> 194 <UnitName Value="FormEx"/> 193 195 </Item34> 194 196 <Item35> 195 <Filename Value="FormEx.pas"/> 196 <HasRegisterProc Value="True"/> 197 <UnitName Value="FormEx"/> 197 <Filename Value="Forms\FormTests.pas"/> 198 <UnitName Value="FormTests"/> 198 199 </Item35> 200 <Item36> 201 <Filename Value="Forms\FormTest.pas"/> 202 <UnitName Value="FormTest"/> 203 </Item36> 204 <Item37> 205 <Filename Value="Forms\FormAbout.pas"/> 206 <UnitName Value="FormAbout"/> 207 </Item37> 199 208 </Files> 200 209 <CompatibilityMode Value="True"/> -
branches/xpascal/Packages/Common/CommonPackage.pas
r227 r228 13 13 XML, ApplicationInfo, SyncCounter, ListViewSort, PersistentForm, FindFile, 14 14 ScaleDPI, Theme, StringTable, MetaCanvas, Geometric, Translator, Languages, 15 FormAbout, AboutDialog, PixelPointer, DataFile, TestCase, Generics, Table,16 Form Ex, LazarusPackageIntf;15 AboutDialog, PixelPointer, DataFile, TestCase, Generics, Table, FormEx, 16 FormTests, FormTest, FormAbout, LazarusPackageIntf; 17 17 18 18 implementation -
branches/xpascal/Packages/Common/FormEx.pas
r227 r228 11 11 12 12 TFormEx = class(TForm) 13 private 14 FCounter: Integer; static; 15 public 13 16 PersistentForm: TPersistentForm; static; 14 ThemeManager: TThemeManager; 15 Translator: TTranslator; 17 ThemeManager: TThemeManager; static; 18 Translator: TTranslator; static; 16 19 procedure DoShow; override; 17 20 procedure DoCreate; override; … … 27 30 procedure Register; 28 31 begin 29 Register Class(TFormEx);32 RegisterNoIcon([TFormEx]); 30 33 end; 31 34 … … 34 37 procedure TFormEx.DoShow; 35 38 begin 39 inherited; 36 40 PersistentForm.Load(Self); 37 inherited;38 41 end; 39 42 40 43 procedure TFormEx.DoCreate; 41 44 begin 42 inherited;43 45 if not Assigned(PersistentForm) then 44 46 PersistentForm := TPersistentForm.Create(nil); … … 52 54 Translator.TranslateComponentRecursive(Self); 53 55 ThemeManager.UseTheme(Self); 56 Inc(FCounter); 57 inherited; 54 58 end; 55 59 … … 62 66 procedure TFormEx.DoDestroy; 63 67 begin 64 FreeAndNil(PersistentForm); 65 FreeAndNil(ThemeManager); 66 FreeAndNil(Translator); 68 Dec(FCounter); 69 if FCounter <= 0 then begin 70 FreeAndNil(PersistentForm); 71 FreeAndNil(ThemeManager); 72 FreeAndNil(Translator); 73 end; 67 74 inherited; 68 75 end; -
branches/xpascal/Packages/Common/Translator.pas
r227 r228 173 173 begin 174 174 FPoFiles.Clear; 175 if Assigned(FLanguage) then 176 try 175 if Assigned(FLanguage) then begin 177 176 LocaleShort := GetLocaleShort; 178 //ShowMessage(ExtractFileDir(Application.ExeName) +179 // DirectorySeparator + 'Languages' + ' ' + '*.' + LocaleShort + '.po');180 177 SearchMask := '*'; 181 178 if LocaleShort <> '' then SearchMask := SearchMask + '.' + LocaleShort; … … 184 181 for J := 0 to LangDirs.Count - 1 do begin 185 182 FileList := FindAllFiles(LangDirs[J], SearchMask); 186 for I := 0 to FileList.Count - 1 do begin 187 FileName := FileList[I]; 188 //FileName := FindLocaleFileName('.po'); 189 if FileExists(FileName) and ( 190 ((LocaleShort = '') and (Pos('.', FileName) = Pos(PoExt, FileName))) or 191 (LocaleShort <> '')) then FPoFiles.Add(TPOFile.Create(FileName)); 183 try 184 for I := 0 to FileList.Count - 1 do begin 185 FileName := FileList[I]; 186 //FileName := FindLocaleFileName('.po'); 187 if FileExists(FileName) and ( 188 ((LocaleShort = '') and (Pos('.', FileName) = Pos(PoExt, FileName))) or 189 (LocaleShort <> '')) then FPoFiles.Add(TPOFile.Create(FileName)); 190 end; 191 finally 192 FileList.Free; 192 193 end; 193 194 end; 194 195 LangDirs.Free; 195 finally196 FileList.Free;197 196 end; 198 197 end; -
branches/xpascal/xpascal.lpi
r227 r228 61 61 </CompilerOptions> 62 62 </Item2> 63 <SharedMatrixOptions Count="2"> 64 <Item1 ID="376528892696" Targets="Common" Modes="Debug" Value="-g -gl -gh -CirotR -O1"/> 65 <Item2 ID="434607938817" Targets="Common" Modes="Release" Value="-CX -XX -O3"/> 66 </SharedMatrixOptions> 63 67 </BuildModes> 64 68 <PublishOptions> … … 81 85 </Item3> 82 86 </RequiredPackages> 83 <Units Count="1 9">87 <Units Count="17"> 84 88 <Unit0> 85 89 <Filename Value="xpascal.lpr"/> … … 162 166 <IsPartOfProject Value="True"/> 163 167 </Unit16> 164 <Unit17>165 <Filename Value="Forms/FormTests.pas"/>166 <IsPartOfProject Value="True"/>167 <ComponentName Value="FormTests"/>168 <HasResources Value="True"/>169 <ResourceBaseClass Value="Form"/>170 </Unit17>171 <Unit18>172 <Filename Value="Forms/FormTest.pas"/>173 <IsPartOfProject Value="True"/>174 <ComponentName Value="FormTestCase"/>175 <HasResources Value="True"/>176 <ResourceBaseClass Value="Form"/>177 </Unit18>178 168 </Units> 179 169 </ProjectOptions> -
branches/xpascal/xpascal.lpr
r227 r228 10 10 Forms, Parser, Tokenizer, Source, Executor, Interpreter, Generator, 11 11 FormMessages, FormSource, Optimizer, FormOutput, FormMain, 12 FormTests, FormTest,ParserPascal;12 ParserPascal; 13 13 14 14 {$R *.res}
Note:
See TracChangeset
for help on using the changeset viewer.