mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-25 23:39:03 +02:00
* Fixed some valis resourcetypes
git-svn-id: trunk@13771 -
This commit is contained in:
parent
d49945c877
commit
56d9683e1a
lcl
@ -1314,6 +1314,7 @@ type
|
||||
procedure InitFPImageReader(IntfImg: TLazIntfImage; ImgReader: TFPCustomImageReader); override;
|
||||
public
|
||||
class function GetFileExtensions: string; override;
|
||||
function LazarusResourceTypeValid(const ResourceType: string): boolean; override;
|
||||
property Bitmaps: TObjectList read FBitmaps;
|
||||
destructor Destroy; override;
|
||||
procedure AddBitmap(Bitmap: TBitmap); { Note that Ownership passes to TIcon }
|
||||
@ -2049,6 +2050,22 @@ begin
|
||||
TLazReaderIcon(ImgReader).Icon := self;
|
||||
end;
|
||||
|
||||
function TIcon.LazarusResourceTypeValid(const ResourceType: string): boolean;
|
||||
var
|
||||
ResType: String;
|
||||
begin
|
||||
if Length(ResourceType) < 3 then Exit(False);
|
||||
|
||||
ResType := UpperCase(ResourceType);
|
||||
case ResType[1] of
|
||||
'I': begin
|
||||
Result := (ResType = 'ICO') or (ResType = 'ICON');
|
||||
end;
|
||||
else
|
||||
Result := inherited LazarusResourceTypeValid(ResType);
|
||||
end;
|
||||
end;
|
||||
|
||||
class function TIcon.GetFileExtensions: string;
|
||||
begin
|
||||
Result:='ico';
|
||||
@ -2082,9 +2099,19 @@ begin
|
||||
end;
|
||||
|
||||
function TCursorImage.LazarusResourceTypeValid(const ResourceType: string): boolean;
|
||||
var
|
||||
ResType: String;
|
||||
begin
|
||||
Result := inherited LazarusResourceTypeValid(ResourceType) or
|
||||
(AnsiCompareText(ResourceType,'CUR')=0);
|
||||
if Length(ResourceType) < 3 then Exit(False);
|
||||
|
||||
ResType := UpperCase(ResourceType);
|
||||
case ResType[1] of
|
||||
'C': begin
|
||||
Result := (ResType = 'CUR') or (ResType = 'CURSOR');
|
||||
end;
|
||||
else
|
||||
Result := inherited LazarusResourceTypeValid(ResType);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCursorImage.ReleaseCursorHandle: HCURSOR;
|
||||
|
@ -269,9 +269,22 @@ begin
|
||||
end;
|
||||
|
||||
function TBitmap.LazarusResourceTypeValid(const ResourceType: string): boolean;
|
||||
var
|
||||
ResType: String;
|
||||
begin
|
||||
Result := AnsiSameText(ResourceType,'XPM')
|
||||
or AnsiSameText(ResourceType,'BMP');
|
||||
if Length(ResourceType) < 3 then Exit(False);
|
||||
|
||||
ResType := UpperCase(ResourceType);
|
||||
case ResType[1] of
|
||||
'B': begin
|
||||
Result := (ResType = 'BMP') or (ResType = 'BITMAP');
|
||||
end;
|
||||
'X': begin
|
||||
Result := Restype = 'XPM';
|
||||
end;
|
||||
else
|
||||
Result := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBitMap.Mask(ATransparentColor: TColor);
|
||||
|
Loading…
Reference in New Issue
Block a user