@@ -336,7 +336,7 @@ interface
336
336
{$ifdef DEBUG_VTV}
337
337
VTLogger,
338
338
{$endif}
339
- LCLType, LResources, LMessages, Types,
339
+ LCLType, LMessages, Types,
340
340
SysUtils, Classes, Graphics, Controls, Forms, ImgList, StdCtrls, Menus, Printers,
341
341
SyncObjs, // Thread support
342
342
Clipbrd // Clipboard support
@@ -3878,6 +3878,8 @@ function WrapString(DC: HDC; const S: String; const Bounds: TRect; RTL: Boolean;
3878
3878
3879
3879
implementation
3880
3880
3881
+ {$R VirtualTrees.res}
3882
+
3881
3883
uses
3882
3884
StrUtils, Math,
3883
3885
{$ifdef EnableOLE}
@@ -4986,12 +4988,17 @@ procedure InitializeGlobalStructures;
4986
4988
4987
4989
// initialization of stuff global to the unit
4988
4990
4991
+ var
4992
+ TheInstance: THandle;
4993
+
4989
4994
begin
4990
4995
Initialized := True;
4991
4996
4992
4997
// For the drag image a fast MMX blend routine is used. We have to make sure MMX is available.
4993
4998
MMXAvailable := HasMMX;
4994
4999
5000
+ TheInstance := HINSTANCE;
5001
+
4995
5002
// There is a bug in Win95 and WinME (and potentially in Win98 too) regarding GetDCEx which causes sometimes
4996
5003
// serious trouble within GDI (see method WMNCPaint).
4997
5004
@@ -5008,15 +5015,15 @@ procedure InitializeGlobalStructures;
5008
5015
5009
5016
UtilityImages := TBitmap.Create;
5010
5017
UtilityImages.Transparent := True;
5011
- UtilityImages.LoadFromLazarusResource( 'VT_UTILITIES');
5018
+ UtilityImages.LoadFromResourceName(0, 'VT_UTILITIES');
5012
5019
5013
5020
// Specify an useful timer resolution for timeGetTime.
5014
5021
timeBeginPeriod(MinimumTimerInterval);
5015
5022
5016
5023
// Delphi (at least version 6 and lower) does not provide a standard split cursor.
5017
5024
// Hence we have to load our own.
5018
- Screen.Cursors[crHeaderSplit] := LoadCursorFromLazarusResource( 'VT_HEADERSPLIT');
5019
- Screen.Cursors[crVertSplit] := LoadCursorFromLazarusResource( 'VT_VERTSPLIT');
5025
+ Screen.Cursors[crHeaderSplit] := LoadCursor(TheInstance, 'VT_HEADERSPLIT');
5026
+ Screen.Cursors[crVertSplit] := LoadCursor(TheInstance, 'VT_VERTSPLIT');
5020
5027
// Clipboard format registration.
5021
5028
// Native clipboard format. Needs a new identifier and has an average priority to allow other formats to take over.
5022
5029
// This format is supposed to use the IStream storage format but unfortunately this does not work when
@@ -13120,21 +13127,23 @@ procedure TBaseVirtualTree.LimitPaintingToArea(Canvas: TCanvas; ClipRect: TRect;
13120
13127
//----------------------------------------------------------------------------------------------------------------------
13121
13128
13122
13129
procedure TBaseVirtualTree.LoadPanningCursors;
13123
-
13130
+ var
13131
+ TheInstance: THandle;
13124
13132
begin
13133
+ TheInstance := HINSTANCE;
13125
13134
with Screen do
13126
13135
begin
13127
- Cursors[crVT_MOVEALL]:=LoadCursorFromLazarusResource( 'VT_MOVEALL');
13128
- Cursors[crVT_MOVEEW]:=LoadCursorFromLazarusResource( 'VT_MOVEEW');
13129
- Cursors[crVT_MOVENS]:=LoadCursorFromLazarusResource( 'VT_MOVENS');
13130
- Cursors[crVT_MOVENW]:=LoadCursorFromLazarusResource( 'VT_MOVENW');
13131
- Cursors[crVT_MOVESW]:=LoadCursorFromLazarusResource( 'VT_MOVESW');
13132
- Cursors[crVT_MOVESE]:=LoadCursorFromLazarusResource( 'VT_MOVESE');
13133
- Cursors[crVT_MOVENE]:=LoadCursorFromLazarusResource( 'VT_MOVENE');
13134
- Cursors[crVT_MOVEW]:=LoadCursorFromLazarusResource( 'VT_MOVEW');
13135
- Cursors[crVT_MOVEE]:=LoadCursorFromLazarusResource( 'VT_MOVEE');
13136
- Cursors[crVT_MOVEN]:=LoadCursorFromLazarusResource( 'VT_MOVEN');
13137
- Cursors[crVT_MOVES]:=LoadCursorFromLazarusResource( 'VT_MOVES');
13136
+ Cursors[crVT_MOVEALL]:=LoadCursor(TheInstance, 'VT_MOVEALL');
13137
+ Cursors[crVT_MOVEEW]:=LoadCursor(TheInstance, 'VT_MOVEEW');
13138
+ Cursors[crVT_MOVENS]:=LoadCursor(TheInstance, 'VT_MOVENS');
13139
+ Cursors[crVT_MOVENW]:=LoadCursor(TheInstance, 'VT_MOVENW');
13140
+ Cursors[crVT_MOVESW]:=LoadCursor(TheInstance, 'VT_MOVESW');
13141
+ Cursors[crVT_MOVESE]:=LoadCursor(TheInstance, 'VT_MOVESE');
13142
+ Cursors[crVT_MOVENE]:=LoadCursor(TheInstance, 'VT_MOVENE');
13143
+ Cursors[crVT_MOVEW]:=LoadCursor(TheInstance, 'VT_MOVEW');
13144
+ Cursors[crVT_MOVEE]:=LoadCursor(TheInstance, 'VT_MOVEE');
13145
+ Cursors[crVT_MOVEN]:=LoadCursor(TheInstance, 'VT_MOVEN');
13146
+ Cursors[crVT_MOVES]:=LoadCursor(TheInstance, 'VT_MOVES');
13138
13147
end;
13139
13148
end;
13140
13149
//----------------------------------------------------------------------------------------------------------------------
@@ -13380,7 +13389,7 @@ procedure TBaseVirtualTree.PrepareBitmaps(NeedButtons, NeedLines: Boolean);
13380
13389
LineTo(Width - 2 , Width div 2);
13381
13390
end
13382
13391
else
13383
- FMinusBM.LoadFromLazarusResource( 'VT_XPBUTTONMINUS');
13392
+ FMinusBM.LoadFromResourceName(0, 'VT_XPBUTTONMINUS');
13384
13393
FHotMinusBM.Canvas.Draw(0, 0, FMinusBM);
13385
13394
end;
13386
13395
end;
@@ -13422,7 +13431,7 @@ procedure TBaseVirtualTree.PrepareBitmaps(NeedButtons, NeedLines: Boolean);
13422
13431
LineTo(Width div 2, Width - 2);
13423
13432
end
13424
13433
else
13425
- FPlusBM.LoadFromLazarusResource( 'VT_XPBUTTONPLUS');
13434
+ FPlusBM.LoadFromResourceName(0, 'VT_XPBUTTONPLUS');
13426
13435
FHotPlusBM.Canvas.Draw(0, 0, FPlusBM);
13427
13436
end;
13428
13437
end;
@@ -20294,7 +20303,7 @@ procedure TBaseVirtualTree.CheckImageListNeeded;
20294
20303
begin
20295
20304
FCheckImages := TBitmap.Create;
20296
20305
FCheckImages.Transparent := True;
20297
- FCheckImages.LoadFromLazarusResource( CheckImagesStrings[FCheckImageKind]);
20306
+ FCheckImages.LoadFromResourceName(0, CheckImagesStrings[FCheckImageKind]);
20298
20307
end;
20299
20308
end;
20300
20309
@@ -23328,7 +23337,7 @@ procedure TBaseVirtualTree.StartWheelPanning(const Position: TPoint);
23328
23337
else
23329
23338
ImageName := 'VT_MOVENS_BMP';
23330
23339
23331
- FPanningWindow.Image.LoadFromLazarusResource( ImageName);
23340
+ FPanningWindow.Image.LoadFromResourceName(0, ImageName);
23332
23341
23333
23342
FPanningWindow.Show(CreateClipRegion);
23334
23343
@@ -32933,7 +32942,6 @@ function TVirtualDrawTree.GetOptionsClass: TTreeOptionsClass;
32933
32942
//----------------------------------------------------------------------------------------------------------------------
32934
32943
32935
32944
initialization
32936
- {$I virtualtrees.lrs}
32937
32945
// Necessary for dynamic package loading.
32938
32946
Initialized := False;
32939
32947
NeedToUnitialize := False;
0 commit comments