ide: load component treeview images from FPC resource

git-svn-id: trunk@42977 -
This commit is contained in:
paul 2013-09-27 08:58:33 +00:00
parent d0e5148925
commit 6ec1af244d
4 changed files with 24 additions and 11 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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.

View File

@ -1 +1 @@
..\tools\lazres componenttreeview.lrs @componenttreeview_list.txt
..\tools\lazres componenttreeview.rc @componenttreeview_list.txt

Binary file not shown.