Changeset 162 for trunk/Packages/Common
- Timestamp:
- Jun 30, 2023, 10:01:24 PM (17 months ago)
- Location:
- trunk/Packages/Common
- Files:
-
- 12 added
- 1 deleted
- 4 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Common.lpk
r158 r162 11 11 <PathDelim Value="\"/> 12 12 <SearchPaths> 13 <OtherUnitFiles Value="Forms"/> 13 14 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 14 15 </SearchPaths> … … 41 42 Source: https://svn.zdechov.net/PascalClassLibrary/Common/"/> 42 43 <License Value="Copy left."/> 43 <Version Minor="1 1"/>44 <Files Count="3 4">44 <Version Minor="12"/> 45 <Files Count="36"> 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="PixelPointer.pas"/> 163 <UnitName Value="PixelPointer"/> 163 164 </Item27> 164 165 <Item28> 165 <Filename Value="AboutDialog.pas"/> 166 <HasRegisterProc Value="True"/> 167 <UnitName Value="AboutDialog"/> 166 <Filename Value="DataFile.pas"/> 167 <UnitName Value="DataFile"/> 168 168 </Item28> 169 169 <Item29> 170 <Filename Value=" PixelPointer.pas"/>171 <UnitName Value=" PixelPointer"/>170 <Filename Value="TestCase.pas"/> 171 <UnitName Value="TestCase"/> 172 172 </Item29> 173 173 <Item30> 174 <Filename Value=" DataFile.pas"/>175 <UnitName Value=" DataFile"/>174 <Filename Value="Generics.pas"/> 175 <UnitName Value="Generics"/> 176 176 </Item30> 177 177 <Item31> 178 <Filename Value="TestCase.pas"/>179 <UnitName Value="TestCase"/>180 </Item31>181 <Item32>182 <Filename Value="Generics.pas"/>183 <UnitName Value="Generics"/>184 </Item32>185 <Item33>186 178 <Filename Value="CommonPackage.pas"/> 187 179 <Type Value="Main Unit"/> 188 180 <UnitName Value="CommonPackage"/> 181 </Item31> 182 <Item32> 183 <Filename Value="Table.pas"/> 184 <UnitName Value="Table"/> 185 </Item32> 186 <Item33> 187 <Filename Value="FormEx.pas"/> 188 <HasRegisterProc Value="True"/> 189 <UnitName Value="FormEx"/> 189 190 </Item33> 190 191 <Item34> 191 <Filename Value=" Table.pas"/>192 <UnitName Value=" Table"/>192 <Filename Value="Forms\FormTests.pas"/> 193 <UnitName Value="FormTests"/> 193 194 </Item34> 195 <Item35> 196 <Filename Value="Forms\FormTest.pas"/> 197 <UnitName Value="FormTest"/> 198 </Item35> 199 <Item36> 200 <Filename Value="Forms\FormAbout.pas"/> 201 <UnitName Value="FormAbout"/> 202 </Item36> 194 203 </Files> 195 204 <CompatibilityMode Value="True"/> -
trunk/Packages/Common/CommonPackage.pas
r158 r162 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 LazarusPackageIntf;15 PixelPointer, DataFile, TestCase, Generics, Table, FormEx, FormTests, 16 FormTest, FormAbout, LazarusPackageIntf; 17 17 18 18 implementation … … 31 31 RegisterUnit('Theme', @Theme.Register); 32 32 RegisterUnit('Translator', @Translator.Register); 33 RegisterUnit(' AboutDialog', @AboutDialog.Register);33 RegisterUnit('FormEx', @FormEx.Register); 34 34 end; 35 35 -
trunk/Packages/Common/Forms/FormAbout.lfm
r161 r162 1 1 object FormAbout: TFormAbout 2 Left = 10143 Height = 3494 Top = 5775 Width = 6092 Left = 624 3 Height = 402 4 Top = 622 5 Width = 702 6 6 Caption = 'About' 7 ClientHeight = 3498 ClientWidth = 6099 DesignTimePPI = 1 257 ClientHeight = 402 8 ClientWidth = 702 9 DesignTimePPI = 144 10 10 OnShow = FormShow 11 11 Position = poScreenCenter 12 LCLVersion = '2.2. 4.0'12 LCLVersion = '2.2.6.0' 13 13 object LabelDescription: TLabel 14 Left = 2615 Height = 2 216 Top = 1 1717 Width = 55714 Left = 30 15 Height = 26 16 Top = 135 17 Width = 642 18 18 Align = alTop 19 BorderSpacing.Left = 2620 BorderSpacing.Right = 2621 BorderSpacing.Bottom = 2619 BorderSpacing.Left = 30 20 BorderSpacing.Right = 30 21 BorderSpacing.Bottom = 30 22 22 Caption = 'Description' 23 23 ParentColor = False … … 26 26 end 27 27 object LabelContent: TLabel 28 Left = 2629 Height = 2 230 Top = 1 6531 Width = 55728 Left = 30 29 Height = 26 30 Top = 191 31 Width = 642 32 32 Align = alTop 33 BorderSpacing.Around = 2633 BorderSpacing.Around = 30 34 34 Caption = ' ' 35 35 ParentColor = False … … 38 38 object PanelTop: TPanel 39 39 Left = 0 40 Height = 1 1740 Height = 135 41 41 Top = 0 42 Width = 60942 Width = 702 43 43 Align = alTop 44 44 BevelOuter = bvNone 45 ClientHeight = 1 1746 ClientWidth = 60945 ClientHeight = 135 46 ClientWidth = 702 47 47 FullRepaint = False 48 48 ParentFont = False 49 49 TabOrder = 0 50 50 object LabelAppName: TLabel 51 Left = 9452 Height = 7353 Top = 1754 Width = 48951 Left = 108 52 Height = 84 53 Top = 20 54 Width = 564 55 55 Anchors = [akTop, akLeft, akRight] 56 56 AutoSize = False 57 BorderSpacing.Around = 2657 BorderSpacing.Around = 30 58 58 Caption = 'Title' 59 Font.Height = - 5259 Font.Height = -60 60 60 ParentColor = False 61 61 ParentFont = False … … 63 63 end 64 64 object ImageLogo: TImage 65 Left = 2 166 Height = 6467 Top = 2668 Width = 6265 Left = 24 66 Height = 74 67 Top = 30 68 Width = 71 69 69 Proportional = True 70 70 Stretch = True … … 73 73 object PanelButtons: TPanel 74 74 Left = 0 75 Height = 6576 Top = 28477 Width = 60975 Height = 75 76 Top = 327 77 Width = 702 78 78 Align = alBottom 79 79 BevelOuter = bvNone 80 ClientHeight = 6581 ClientWidth = 60980 ClientHeight = 75 81 ClientWidth = 702 82 82 TabOrder = 1 83 83 object ButtonHomePage: TButton 84 Left = 2 185 Height = 3 386 Top = 2 187 Width = 2 2984 Left = 24 85 Height = 38 86 Top = 24 87 Width = 264 88 88 Anchors = [akLeft, akBottom] 89 89 Caption = 'Home page' … … 93 93 end 94 94 object ButtonClose: TButton 95 Left = 46196 Height = 3 397 Top = 2 198 Width = 1 2295 Left = 531 96 Height = 38 97 Top = 24 98 Width = 141 99 99 Anchors = [akRight, akBottom] 100 100 Caption = 'Close' -
trunk/Packages/Common/Forms/FormAbout.pas
r161 r162 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 7 StdCtrls, ExtCtrls, ApplicationInfo, Common, Translator, Theme;7 StdCtrls, ExtCtrls, ApplicationInfo, Common, FormEx; 8 8 9 9 type 10 10 { TFormAbout } 11 11 12 TFormAbout = class(TForm )12 TFormAbout = class(TFormEx) 13 13 ButtonClose: TButton; 14 14 ButtonHomePage: TButton; … … 21 21 procedure ButtonHomePageClick(Sender: TObject); 22 22 procedure FormShow(Sender: TObject); 23 private 24 FApplicationInfo: TApplicationInfo; 23 25 public 24 AboutDialog: TObject; //TAboutDialog25 26 procedure UpdateInterface; 27 property ApplicationInfo: TApplicationInfo read FApplicationInfo write 28 FApplicationInfo; 26 29 end; 27 30 … … 30 33 31 34 {$R *.lfm} 32 33 uses34 AboutDialog;35 35 36 36 resourcestring … … 43 43 procedure TFormAbout.FormShow(Sender: TObject); 44 44 begin 45 if Assigned(AboutDialog) then 46 with TAboutDialog(AboutDialog) do begin 47 if Assigned(Translator) then 48 Translator.TranslateComponentRecursive(Self); 49 if Assigned(ThemeManager) then 50 ThemeManager.UseTheme(Self); 51 52 if Assigned(ApplicationInfo) then 53 with ApplicationInfo do begin 54 LabelAppName.Caption := AppName; 55 LabelContent.Caption := SVersion + ': ' + Version + LineEnding + 56 SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding + 57 SLicense + ': ' + License; 58 LabelDescription.Caption := Description; 59 ImageLogo.Picture.Bitmap.Assign(Icon); 60 end; 45 if Assigned(ApplicationInfo) then 46 with ApplicationInfo do begin 47 LabelAppName.Caption := AppName; 48 LabelContent.Caption := SVersion + ': ' + Version + LineEnding + 49 SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding + 50 SLicense + ': ' + License; 51 LabelDescription.Caption := Description; 52 ImageLogo.Picture.Bitmap.Assign(Icon); 61 53 end; 62 54 UpdateInterface; … … 65 57 procedure TFormAbout.UpdateInterface; 66 58 begin 67 ButtonHomePage.Enabled := Assigned(AboutDialog) and 68 Assigned(TAboutDialog(AboutDialog).ApplicationInfo); 59 ButtonHomePage.Enabled := Assigned(ApplicationInfo); 69 60 end; 70 61 71 62 procedure TFormAbout.ButtonHomePageClick(Sender: TObject); 72 63 begin 73 OpenWebPage( TAboutDialog(AboutDialog).ApplicationInfo.HomePage);64 OpenWebPage(ApplicationInfo.HomePage); 74 65 end; 75 66 -
trunk/Packages/Common/Languages
-
Property svn:ignore
set to
*.mo
-
Property svn:ignore
set to
-
trunk/Packages/Common/Translator.pas
r159 r162 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.