Changeset 228 for branches/xpascal/Packages
- Timestamp:
- Jun 24, 2023, 12:33:35 PM (17 months ago)
- Location:
- branches/xpascal/Packages/Common
- Files:
-
- 10 added
- 3 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.