mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-16 02:00:30 +01:00
ide: load component treeview images from FPC resource
git-svn-id: trunk@42977 -
This commit is contained in:
parent
d0e5148925
commit
6ec1af244d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -5490,6 +5490,7 @@ images/components_images.res -text
|
||||
images/components_images_list.txt svneol=native#text/plain
|
||||
images/componenttreeview.bat svneol=native#text/x-msdos-program
|
||||
images/componenttreeview.lrs svneol=native#text/pascal
|
||||
images/componenttreeview.res -text
|
||||
images/componenttreeview/oi_box.png -text svneol=unset#image/png
|
||||
images/componenttreeview/oi_collection.png -text svneol=unset#image/png
|
||||
images/componenttreeview/oi_comp.png -text svneol=unset#image/png
|
||||
|
||||
@ -25,7 +25,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, TypInfo, LCLProc, AvgLvlTree, Dialogs, Controls, ComCtrls,
|
||||
ExtCtrls, LResources,
|
||||
Graphics, ExtCtrls,
|
||||
ObjInspStrConsts, PropEdits, PropEditUtils;
|
||||
|
||||
type
|
||||
@ -69,6 +69,8 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
{$R ../../images/componenttreeview.res}
|
||||
|
||||
type
|
||||
TCollectionAccess = class(TCollection);
|
||||
|
||||
@ -558,18 +560,31 @@ begin
|
||||
end;
|
||||
|
||||
constructor TComponentTreeView.Create(TheOwner: TComponent);
|
||||
var
|
||||
Bitmap: TPortableNetworkGraphic;
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
DragMode := dmAutomatic;
|
||||
FComponentList:=TBackupComponentList.Create;
|
||||
Options := Options + [tvoAllowMultiselect, tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly];
|
||||
FImageList := TImageList.Create(nil);
|
||||
FImageList.AddLazarusResource('oi_form');
|
||||
FImageList.AddLazarusResource('oi_comp');
|
||||
FImageList.AddLazarusResource('oi_control');
|
||||
FImageList.AddLazarusResource('oi_box');
|
||||
FImageList.AddLazarusResource('oi_collection');
|
||||
FImageList.AddLazarusResource('oi_item');
|
||||
Bitmap := TPortableNetworkGraphic.Create;
|
||||
try
|
||||
Bitmap.LoadFromResourceName(HInstance, 'oi_form');
|
||||
FImageList.Add(Bitmap, nil);
|
||||
Bitmap.LoadFromResourceName(HInstance, 'oi_comp');
|
||||
FImageList.Add(Bitmap, nil);
|
||||
Bitmap.LoadFromResourceName(HInstance, 'oi_control');
|
||||
FImageList.Add(Bitmap, nil);
|
||||
Bitmap.LoadFromResourceName(HInstance, 'oi_box');
|
||||
FImageList.Add(Bitmap, nil);
|
||||
Bitmap.LoadFromResourceName(HInstance, 'oi_collection');
|
||||
FImageList.Add(Bitmap, nil);
|
||||
Bitmap.LoadFromResourceName(HInstance, 'oi_item');
|
||||
FImageList.Add(Bitmap, nil);
|
||||
finally
|
||||
Bitmap.Free;
|
||||
end;
|
||||
Images := FImageList;
|
||||
end;
|
||||
|
||||
@ -750,8 +765,5 @@ begin
|
||||
Result := DefaultName + ':' + Result;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I ../../images/componenttreeview.lrs}
|
||||
|
||||
end.
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
..\tools\lazres componenttreeview.lrs @componenttreeview_list.txt
|
||||
..\tools\lazres componenttreeview.rc @componenttreeview_list.txt
|
||||
|
||||
BIN
images/componenttreeview.res
Normal file
BIN
images/componenttreeview.res
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user