- Timestamp:
- Jan 18, 2022, 12:14:46 PM (3 years ago)
- Location:
- Common
- Files:
-
- 11 added
- 9 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/Common.lpk
r554 r555 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <CONFIG> 3 <Package Version=" 4">3 <Package Version="5"> 4 4 <PathDelim Value="\"/> 5 5 <Name Value="Common"/> … … 33 33 <Other> 34 34 <CompilerMessages> 35 <IgnoredMessages idx 5024="True"/>35 <IgnoredMessages idx6058="True" idx5024="True" idx3124="True" idx3123="True"/> 36 36 </CompilerMessages> 37 37 </Other> … … 172 172 </Item29> 173 173 </Files> 174 <CompatibilityMode Value="True"/> 174 175 <i18n> 175 176 <EnableI18N Value="True"/> -
Common/Languages/UFormAbout.cs.po
r548 r555 24 24 msgstr "Verze" 25 25 26 #: tformabout.buttonhomepage.caption27 msgid "Home page"28 msgstr "Domovská stránka"29 30 #: tformabout.buttonclose.caption31 msgid "Close"32 msgstr "Zavřít" -
Common/Languages/UJobProgressView.cs.po
r530 r555 13 13 14 14 #: ujobprogressview.sestimatedtime 15 #, object-pascal-format 15 16 msgid "Estimated time: %s" 16 17 msgstr "Odhadovaný čas: %s" … … 33 34 34 35 #: ujobprogressview.stotalestimatedtime 36 #, object-pascal-format 35 37 msgid "Total estimated time: %s" 36 38 msgstr "Celkový odhadovaný čas: %s" -
Common/Languages/UScaleDPI.cs.po
r510 r555 13 13 14 14 #: uscaledpi.swrongdpi 15 #, object-pascal-format 15 16 msgid "Wrong DPI [%d,%d]" 16 17 msgstr "Chybné DPI [%d,%d]" -
Common/Languages/UThreading.cs.po
r328 r555 11 11 12 12 #: uthreading.scurrentthreadnotfound 13 #, object-pascal-format 13 14 msgid "Current thread ID %d not found in virtual thread list." 14 15 msgstr "Aktuální vlákno ID %d nenalezeno v seznamu virtuálních vláken." -
Common/UAboutDialog.pas
r553 r555 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 StdCtrls,ExtCtrls, UApplicationInfo, UCommon, UTranslator, UTheme, UFormAbout;9 ExtCtrls, UApplicationInfo, UCommon, UTranslator, UTheme, UFormAbout; 10 10 11 11 type -
Common/UCommon.pas
r552 r555 6 6 7 7 uses 8 {$ ifdef Windows}Windows,{$endif}9 {$ ifdef Linux}baseunix,{$endif}8 {$IFDEF WINDOWS}Windows,{$ENDIF} 9 {$IFDEF UNIX}baseunix,{$ENDIF} 10 10 Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, 11 11 FileUtil; //, ShFolder, ShellAPI; … … 35 35 DLLHandle1: HModule; 36 36 37 {$IFDEF W indows}37 {$IFDEF WINDOWS} 38 38 GetUserNameEx: procedure (NameFormat: DWORD; 39 39 lpNameBuffer: LPSTR; nSize: PULONG); stdcall; … … 292 292 function Explode(Separator: char; Data: string): TArrayOfString; 293 293 begin 294 Result := nil; 294 295 SetLength(Result, 0); 295 296 while Pos(Separator, Data) > 0 do begin … … 346 347 Name: UtsName; 347 348 begin 349 Name := Default(UtsName); 348 350 fpuname(Name); 349 351 Result := Name.Nodename; … … 505 507 I: Integer; 506 508 begin 509 Result := Default(TArrayOfString); 507 510 SetLength(Result, Length(A) + Length(B)); 508 511 for I := 0 to Length(A) - 1 do -
Common/UFindFile.pas
r510 r555 59 59 FilterAll = '*.*'; 60 60 {$ENDIF} 61 {$IFDEF LINUX}61 {$IFDEF UNIX} 62 62 FilterAll = '*'; 63 63 {$ENDIF} -
Common/UGeometric.pas
r540 r555 96 96 I: Integer; 97 97 begin 98 Result := Default(TPointArray); 98 99 SetLength(Result, Length(P)); 99 100 for I := 0 to High(P) do -
Common/UJobProgressView.lfm
r530 r555 1 1 object FormJobProgressView: TFormJobProgressView 2 2 Left = 467 3 Height = 3453 Height = 414 4 4 Top = 252 5 Width = 5395 Width = 647 6 6 BorderIcons = [biSystemMenu] 7 ClientHeight = 3458 ClientWidth = 5399 DesignTimePPI = 1 207 ClientHeight = 414 8 ClientWidth = 647 9 DesignTimePPI = 144 10 10 OnClose = FormClose 11 11 OnCloseQuery = FormCloseQuery 12 12 OnCreate = FormCreate 13 OnDestroy = FormDestroy14 13 OnHide = FormHide 15 14 OnShow = FormShow 16 15 Position = poScreenCenter 17 LCLVersion = '2. 0.2.0'16 LCLVersion = '2.2.0.4' 18 17 object PanelOperationsTitle: TPanel 19 18 Left = 0 20 Height = 3 219 Height = 38 21 20 Top = 0 22 Width = 53921 Width = 647 23 22 Align = alTop 24 23 BevelOuter = bvNone 25 ClientHeight = 3 226 ClientWidth = 53924 ClientHeight = 38 25 ClientWidth = 647 27 26 FullRepaint = False 28 27 TabOrder = 0 29 28 object LabelOperation: TLabel 30 Left = 831 Height = 2 032 Top = 833 Width = 7629 Left = 10 30 Height = 26 31 Top = 10 32 Width = 99 34 33 Caption = 'Operations:' 35 ParentColor = False36 34 ParentFont = False 37 35 end … … 39 37 object PanelLog: TPanel 40 38 Left = 0 41 Height = 1 3342 Top = 2 1243 Width = 53939 Height = 161 40 Top = 253 41 Width = 647 44 42 Align = alClient 45 43 BevelOuter = bvSpace 46 ClientHeight = 1 3347 ClientWidth = 53944 ClientHeight = 161 45 ClientWidth = 647 48 46 TabOrder = 1 49 47 object MemoLog: TMemo 50 Left = 851 Height = 1 1752 Top = 853 Width = 52348 Left = 10 49 Height = 141 50 Top = 10 51 Width = 627 54 52 Anchors = [akTop, akLeft, akRight, akBottom] 55 53 ReadOnly = True … … 60 58 object PanelProgress: TPanel 61 59 Left = 0 62 Height = 5463 Top = 1 0664 Width = 53960 Height = 65 61 Top = 126 62 Width = 647 65 63 Align = alTop 66 64 BevelOuter = bvNone 67 ClientHeight = 5468 ClientWidth = 53965 ClientHeight = 65 66 ClientWidth = 647 69 67 TabOrder = 2 70 68 object ProgressBarPart: TProgressBar 71 Left = 1 072 Height = 2 473 Top = 2 474 Width = 52369 Left = 12 70 Height = 29 71 Top = 29 72 Width = 628 75 73 Anchors = [akTop, akLeft, akRight] 76 74 TabOrder = 0 77 75 end 78 76 object LabelEstimatedTimePart: TLabel 79 Left = 880 Height = 2 077 Left = 10 78 Height = 26 81 79 Top = -2 82 Width = 1 0380 Width = 132 83 81 Caption = 'Estimated time:' 84 ParentColor = False85 82 end 86 83 end 87 84 object PanelOperations: TPanel 88 85 Left = 0 89 Height = 4290 Top = 6491 Width = 53986 Height = 50 87 Top = 76 88 Width = 647 92 89 Align = alTop 93 90 BevelOuter = bvNone 94 ClientHeight = 4295 ClientWidth = 53991 ClientHeight = 50 92 ClientWidth = 647 96 93 FullRepaint = False 97 94 TabOrder = 3 98 95 object ListViewJobs: TListView 99 Left = 8100 Height = 3 2101 Top = 5102 Width = 52396 Left = 10 97 Height = 38 98 Top = 6 99 Width = 627 103 100 Anchors = [akTop, akLeft, akRight, akBottom] 104 101 AutoWidthLastColumn = True … … 107 104 Columns = < 108 105 item 109 Width = 523106 Width = 614 110 107 end> 111 108 OwnerData = True … … 120 117 object PanelProgressTotal: TPanel 121 118 Left = 0 122 Height = 52123 Top = 1 60124 Width = 539119 Height = 62 120 Top = 191 121 Width = 647 125 122 Align = alTop 126 123 BevelOuter = bvNone 127 ClientHeight = 52128 ClientWidth = 539124 ClientHeight = 62 125 ClientWidth = 647 129 126 TabOrder = 4 130 127 object LabelEstimatedTimeTotal: TLabel 131 Left = 8132 Height = 2 0128 Left = 10 129 Height = 26 133 130 Top = 0 134 Width = 1 41131 Width = 178 135 132 Caption = 'Total estimated time:' 136 ParentColor = False137 133 end 138 134 object ProgressBarTotal: TProgressBar 139 Left = 8140 Height = 2 4141 Top = 2 4142 Width = 523135 Left = 10 136 Height = 29 137 Top = 29 138 Width = 627 143 139 Anchors = [akTop, akLeft, akRight] 144 140 TabOrder = 0 … … 147 143 object PanelText: TPanel 148 144 Left = 0 149 Height = 3 2150 Top = 3 2151 Width = 539145 Height = 38 146 Top = 38 147 Width = 647 152 148 Align = alTop 153 149 BevelOuter = bvNone 154 ClientHeight = 3 2155 ClientWidth = 539150 ClientHeight = 38 151 ClientWidth = 647 156 152 TabOrder = 5 157 153 object LabelText: TLabel 158 Left = 8159 Height = 2 4160 Top = 8161 Width = 525154 Left = 10 155 Height = 29 156 Top = 10 157 Width = 630 162 158 Anchors = [akTop, akLeft, akRight] 163 159 AutoSize = False 164 ParentColor = False165 160 end 166 161 end 167 162 object ImageList1: TImageList 168 BkColor = clForeground 169 left = 200 170 top = 8 163 Left = 240 164 Top = 10 171 165 Bitmap = { 172 4C69020000001000000010000000FF00FF00FF00FF00FF00FF00FF00FF00FF00 173 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 174 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 175 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 176 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 177 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 178 FF00000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 179 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000000 180 00FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 181 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF0000 182 00FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 183 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF0000 184 00FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 185 FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000 186 00FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FFFF00FF00FF00 187 FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF000000FFFF00 188 FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FFFF00 189 FF00FF00FF00FF00FF00000000FF000000FF000000FF000000FFFF00FF00FF00 190 FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000 191 00FFFF00FF00000000FF000000FF000000FF000000FFFF00FF00FF00FF00FF00 192 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF0000 193 00FF000000FF000000FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00 194 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF0000 195 00FF000000FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00 196 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000000 197 00FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 198 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 199 FF00000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 200 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 201 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 202 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 203 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 204 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 205 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 206 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 207 FF00FF00FF00FF00FF00FF00FF00000000FFFF00FF00FF00FF00FF00FF00FF00 208 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 209 FF00FF00FF00FF00FF00FF00FF00000000FF000000FFFF00FF00FF00FF00FF00 210 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 211 FF00FF00FF00FF00FF00FF00FF00000000FF000084FF000000FFFF00FF00FF00 212 FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000 213 00FF000000FF000000FF000000FF000000FF0000FFFF000084FF000000FFFF00 214 FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000 215 FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000084FF0000 216 00FFFF00FF00FF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000 217 FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000 218 84FF000000FFFF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000 219 FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000 220 FFFF000084FF000000FFFF00FF00FF00FF00000000FF0000FFFF0000FFFF0000 221 FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000 222 84FF000000FFFF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000 223 FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000084FF0000 224 00FFFF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000 225 00FF000000FF000000FF000000FF000000FF0000FFFF000084FF000000FFFF00 226 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 227 FF00FF00FF00FF00FF00FF00FF00000000FF000084FF000000FFFF00FF00FF00 228 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 229 FF00FF00FF00FF00FF00FF00FF00000000FF000000FFFF00FF00FF00FF00FF00 230 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 231 FF00FF00FF00FF00FF00FF00FF00000000FFFF00FF00FF00FF00FF00FF00FF00 232 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 233 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 234 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 235 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 236 FF00FF00FF00FF00FF00FF00FF00 166 4C7A0200000010000000100000006A0000000000000078DAE593490E00100C45 167 7B78F72E5684A63A1142C382BE4F0708F89C955117F4B016BE67B5FC6E96DB97 168 B0D4B9F4CD949F36DED1DF922B0F1BD11FAB5AFC68DE5C44D40220A9FA779EC8 169 6A349FD5A435E43CADA1E3678D73F773F1DBF3EFADFFEEFEBBF97F6696BE9D36 237 170 } 238 171 end … … 241 174 Interval = 100 242 175 OnTimer = TimerUpdateTimer 243 left = 320244 top = 8176 Left = 384 177 Top = 10 245 178 end 246 179 end -
Common/UJobProgressView.pas
r530 r555 7 7 uses 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, Syncobjs, 9 Dialogs, ComCtrls, StdCtrls, ExtCtrls, Contnrs, UThreading, Math,9 Dialogs, ComCtrls, StdCtrls, ExtCtrls, fgl, UThreading, Math, 10 10 DateUtils; 11 11 … … 71 71 end; 72 72 73 TJobs = class(T ObjectList)73 TJobs = class(TFPGObjectList<TJob>) 74 74 end; 75 75 … … 105 105 procedure ReloadJobList; 106 106 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 107 procedure FormDestroy(Sender: TObject);108 107 procedure ListViewJobsData(Sender: TObject; Item: TListItem); 109 108 procedure TimerUpdateTimer(Sender: TObject); … … 286 285 end; 287 286 288 procedure TFormJobProgressView.FormDestroy(Sender:TObject);289 begin290 end;291 292 287 procedure TFormJobProgressView.ListViewJobsData(Sender: TObject; Item: TListItem); 293 288 begin 294 289 if (Item.Index >= 0) and (Item.Index < JobProgressView.Jobs.Count) then 295 with TJob(JobProgressView.Jobs[Item.Index])do begin290 with JobProgressView.Jobs[Item.Index] do begin 296 291 Item.Caption := Title; 297 292 if Item.Index = JobProgressView.CurrentJobIndex then Item.ImageIndex := 1 … … 405 400 I := 0; 406 401 while I < Jobs.Count do 407 with TJob(Jobs[I])do begin402 with Jobs[I] do begin 408 403 CurrentJobIndex := I; 409 CurrentJob := TJob(Jobs[I]);404 CurrentJob := Jobs[I]; 410 405 JobProgressChange(Self); 411 406 StartTime := Now; … … 420 415 Method(CurrentJob); 421 416 end else begin 417 Thread := TJobThread.Create(True); 422 418 try 423 Thread := TJobThread.Create(True);424 419 with Thread do begin 425 420 FreeOnTerminate := False; … … 494 489 if AValue = FTerminate then Exit; 495 490 for I := 0 to Jobs.Count - 1 do 496 TJob(Jobs[I]).Terminate := AValue;491 Jobs[I].Terminate := AValue; 497 492 FTerminate := AValue; 498 493 end; … … 620 615 procedure TProgress.Increment; 621 616 begin 622 try623 FLock.Acquire;617 FLock.Acquire; 618 try 624 619 Value := Value + 1; 625 620 finally … … 630 625 procedure TProgress.Reset; 631 626 begin 632 try633 FLock.Acquire;627 FLock.Acquire; 628 try 634 629 FValue := 0; 635 630 finally … … 678 673 destructor TJob.Destroy; 679 674 begin 680 Progress.Free;675 FreeAndNil(Progress); 681 676 inherited; 682 677 end; -
Common/UMetaCanvas.pas
r551 r555 142 142 procedure RoundRect(const Rect: TRect; RX,RY: Integer); overload; 143 143 procedure TextOut(X,Y: Integer; const Text: String); override; 144 procedure Polygon(Points: PPoint; NumPts: Integer; Winding: boolean = False); override;144 procedure Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean = False); override; 145 145 procedure Ellipse(x1, y1, x2, y2: Integer); override; 146 146 procedure StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic); override; … … 502 502 end; 503 503 504 procedure TMetaCanvas.Polygon(Points: PPoint; NumPts: Integer; Winding: boolean504 procedure TMetaCanvas.Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean 505 505 ); 506 506 var … … 508 508 I: Integer; 509 509 begin 510 APoints := nil; 510 511 SetLength(APoints, NumPts); 511 512 for I := 0 to High(APoints) do -
Common/URegistry.pas
r544 r555 132 132 function TRegistryEx.OpenKey(const Key: string; CanCreate: Boolean): Boolean; 133 133 begin 134 {$IFDEF Linux}134 {$IFDEF UNIX} 135 135 //CloseKey; 136 136 {$ENDIF} … … 140 140 function TRegistryEx.GetCurrentContext: TRegistryContext; 141 141 begin 142 Result.Key := CurrentPath;142 Result.Key := String(CurrentPath); 143 143 Result.RootKey := RootKey; 144 144 end; -
Common/UScaleDPI.pas
r551 r555 8 8 9 9 uses 10 Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils, StdCtrls, 11 Contnrs; 10 Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils, fgl; 12 11 13 12 type 13 TControlDimensions = class; 14 14 15 15 { TControlDimension } … … 18 18 BoundsRect: TRect; 19 19 FontHeight: Integer; 20 Controls: T ObjectList; // TList<TControlDimension>20 Controls: TControlDimensions; 21 21 // Class specifics 22 22 ButtonSize: TPoint; // TToolBar … … 26 26 constructor Create; 27 27 destructor Destroy; override; 28 end; 29 30 TControlDimensions = class(TFPGObjectList<TControlDimension>) 28 31 end; 29 32 … … 73 76 constructor TControlDimension.Create; 74 77 begin 75 Controls := T ObjectList.Create;78 Controls := TControlDimensions.Create; 76 79 end; 77 80 … … 79 82 begin 80 83 FreeAndNil(Controls); 81 inherited Destroy;84 inherited; 82 85 end; 83 86 … … 212 215 TempBmp: TBitmap; 213 216 Temp: array of TBitmap; 214 NewWidth, NewHeight: integer; 217 NewWidth: Integer; 218 NewHeight: Integer; 215 219 I: Integer; 216 220 begin 217 221 ImgList.BeginUpdate; 218 NewWidth := ScaleX(ImgList.Width, FromDPI.X); 219 NewHeight := ScaleY(ImgList.Height, FromDPI.Y); 220 221 SetLength(Temp, ImgList.Count); 222 for I := 0 to ImgList.Count - 1 do 223 begin 224 TempBmp := TBitmap.Create; 225 TempBmp.PixelFormat := pf32bit; 226 ImgList.GetBitmap(I, TempBmp); 227 Temp[I] := TBitmap.Create; 228 Temp[I].SetSize(NewWidth, NewHeight); 229 {$IFDEF Linux} 230 Temp[I].PixelFormat := pf24bit; 231 {$ELSE} 232 Temp[I].PixelFormat := pf32bit; 233 {$ENDIF} 234 Temp[I].TransparentColor := TempBmp.TransparentColor; 235 //Temp[I].TransparentMode := TempBmp.TransparentMode; 236 Temp[I].Transparent := True; 237 Temp[I].Canvas.Brush.Style := bsSolid; 238 Temp[I].Canvas.Brush.Color := Temp[I].TransparentColor; 239 Temp[I].Canvas.FillRect(0, 0, Temp[I].Width, Temp[I].Height); 240 241 if (Temp[I].Width = 0) or (Temp[I].Height = 0) then Continue; 242 Temp[I].Canvas.StretchDraw(Rect(0, 0, Temp[I].Width, Temp[I].Height), TempBmp); 243 TempBmp.Free; 244 end; 245 246 ImgList.Clear; 247 ImgList.Width := NewWidth; 248 ImgList.Height := NewHeight; 249 250 for I := 0 to High(Temp) do 251 begin 252 ImgList.Add(Temp[I], nil); 253 Temp[i].Free; 254 end; 255 ImgList.EndUpdate; 222 try 223 NewWidth := ScaleX(ImgList.Width, FromDPI.X); 224 NewHeight := ScaleY(ImgList.Height, FromDPI.Y); 225 226 Temp := nil; 227 SetLength(Temp, ImgList.Count); 228 for I := 0 to ImgList.Count - 1 do 229 begin 230 TempBmp := TBitmap.Create; 231 try 232 TempBmp.PixelFormat := pf32bit; 233 ImgList.GetBitmap(I, TempBmp); 234 Temp[I] := TBitmap.Create; 235 Temp[I].SetSize(NewWidth, NewHeight); 236 {$IFDEF UNIX} 237 Temp[I].PixelFormat := pf24bit; 238 {$ELSE} 239 Temp[I].PixelFormat := pf32bit; 240 {$ENDIF} 241 Temp[I].TransparentColor := TempBmp.TransparentColor; 242 //Temp[I].TransparentMode := TempBmp.TransparentMode; 243 Temp[I].Transparent := True; 244 Temp[I].Canvas.Brush.Style := bsSolid; 245 Temp[I].Canvas.Brush.Color := Temp[I].TransparentColor; 246 Temp[I].Canvas.FillRect(0, 0, Temp[I].Width, Temp[I].Height); 247 248 if (Temp[I].Width = 0) or (Temp[I].Height = 0) then Continue; 249 Temp[I].Canvas.StretchDraw(Rect(0, 0, Temp[I].Width, Temp[I].Height), TempBmp); 250 finally 251 TempBmp.Free; 252 end; 253 end; 254 255 ImgList.Clear; 256 ImgList.Width := NewWidth; 257 ImgList.Height := NewHeight; 258 259 for I := 0 to High(Temp) do 260 begin 261 ImgList.Add(Temp[I], nil); 262 Temp[i].Free; 263 end; 264 finally 265 ImgList.EndUpdate; 266 end; 256 267 end; 257 268 … … 331 342 with TCoolBar(Control) do begin 332 343 BeginUpdate; 333 for I := 0 to Bands.Count - 1 do 334 with Bands[I] do begin 335 MinWidth := ScaleX(MinWidth, FromDPI.X); 336 MinHeight := ScaleY(MinHeight, FromDPI.Y); 337 // Workaround to bad band width auto sizing 338 //Width := ScaleX(Width, FromDPI.X); 339 Width := ScaleX(Control.Width + 28, FromDPI.X); 340 //Control.Invalidate; 344 try 345 for I := 0 to Bands.Count - 1 do 346 with Bands[I] do begin 347 MinWidth := ScaleX(MinWidth, FromDPI.X); 348 MinHeight := ScaleY(MinHeight, FromDPI.Y); 349 // Workaround to bad band width auto sizing 350 //Width := ScaleX(Width, FromDPI.X); 351 Width := ScaleX(Control.Width + 28, FromDPI.X); 352 //Control.Invalidate; 353 end; 354 // Workaround for bad autosizing of coolbar 355 if AutoSize then begin 356 AutoSize := False; 357 Height := ScaleY(Height, FromDPI.Y); 358 AutoSize := True; 341 359 end; 342 // Workaround for bad autosizing of coolbar 343 if AutoSize then begin 344 AutoSize := False; 345 Height := ScaleY(Height, FromDPI.Y); 346 AutoSize := True; 347 end; 348 EndUpdate; 360 finally 361 EndUpdate; 362 end; 349 363 end; 350 364
Note:
See TracChangeset
for help on using the changeset viewer.