mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-10 04:17:11 +01:00
ide: start to use component images as FPC resources with ability to load them from Lazarus resource too
git-svn-id: trunk@42973 -
This commit is contained in:
parent
102a858398
commit
347238c5e8
@ -127,7 +127,10 @@ function CompareControlsWithTag(Control1, Control2: Pointer): integer;
|
||||
|
||||
implementation
|
||||
|
||||
uses MainBase;
|
||||
{$R ../images/components_images.res}
|
||||
|
||||
uses
|
||||
MainBase;
|
||||
|
||||
const
|
||||
OVERVIEW_PANEL_WIDTH = 20;
|
||||
@ -494,9 +497,9 @@ function TComponentPalette.GetUnregisteredIcon: TCustomBitMap;
|
||||
begin
|
||||
if fUnregisteredIcon = nil then
|
||||
begin
|
||||
fUnregisteredIcon := CreateBitmapFromLazarusResource('unregisteredcomponent');
|
||||
fUnregisteredIcon := CreateBitmapFromResourceName(hInstance, 'unregisteredcomponent');
|
||||
if fUnregisteredIcon = nil then
|
||||
fUnregisteredIcon := CreateBitmapFromLazarusResource('default');
|
||||
fUnregisteredIcon := CreateBitmapFromResourceName(hInstance, 'default');
|
||||
end;
|
||||
Result := fUnregisteredIcon;
|
||||
end;
|
||||
@ -504,7 +507,7 @@ end;
|
||||
function TComponentPalette.GetSelectButtonIcon: TCustomBitmap;
|
||||
begin
|
||||
if fSelectButtonIcon=nil then
|
||||
fSelectButtonIcon := CreateBitmapFromLazarusResource('tmouse');
|
||||
fSelectButtonIcon := CreateBitmapFromResourceName(hInstance, 'tmouse');
|
||||
Result:=fSelectButtonIcon;
|
||||
end;
|
||||
|
||||
@ -733,7 +736,7 @@ var
|
||||
with CurBtn do begin
|
||||
Name := 'PaletteSelectBtn' + aButtonUniqueName;
|
||||
OnClick := @SelectionToolClick;
|
||||
LoadGlyphFromLazarusResource('tmouse');
|
||||
LoadGlyphFromResourceName(hInstance, 'tmouse');
|
||||
Flat := True;
|
||||
GroupIndex:= 1;
|
||||
Down := True;
|
||||
@ -904,8 +907,5 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I ../images/components_images.lrs}
|
||||
|
||||
end.
|
||||
|
||||
|
||||
@ -3895,10 +3895,16 @@ begin
|
||||
Result := TBitmap.Create;
|
||||
Result.LoadFromResourceName(HInstance, ResName);
|
||||
Result.Transparent := True;
|
||||
end
|
||||
else
|
||||
if FindResource(HInstance, PChar(ResName), PChar(RT_RCDATA)) <> 0 then
|
||||
begin
|
||||
Result := TPortableNetworkGraphic.Create;
|
||||
Result.LoadFromResourceName(HInstance, ResName);
|
||||
end;
|
||||
|
||||
if Result = nil then
|
||||
Result := CreateBitmapFromLazarusResource('default');
|
||||
Result := CreateBitmapFromResourceName(HInstance, 'default');
|
||||
end;
|
||||
|
||||
function TPkgComponent.HasIcon: boolean;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user