update bookmark icons

git-svn-id: trunk@14358 -
This commit is contained in:
laurent 2008-03-01 22:21:05 +00:00
parent 3b2ef57a07
commit 1382b29f7a
2 changed files with 17 additions and 8 deletions

View File

@ -34,7 +34,7 @@
{$DEFINE DisableFakeMethods} {$DEFINE DisableFakeMethods}
{$ENDIF} {$ENDIF}
{.$DEFINE EnableDocking} {$DEFINE EnableDocking}
// end. // end.

View File

@ -679,14 +679,23 @@ end;
function TSourceMarks.AddImage(const ResName: string): integer; function TSourceMarks.AddImage(const ResName: string): integer;
var var
APixmap: TPixmap; Bitmap: TBitmap;
Resource: TLResource;
begin begin
APixmap:=TPixMap.Create; Resource:=LazarusResources.Find(ResName);
APixmap.TransparentColor:=clBtnFace; if Resource=nil then
APixmap.LoadFromLazarusResource(ResName); DebugLn('TSourceMarks.AddImage: ',
Result:=ImgList.Count; ' WARNING: icon not found: "',ResName,'"');
ImgList.Add(APixmap,nil); if SysUtils.CompareText(Resource.ValueType,'xpm')=0 then begin
APixmap.Free; Bitmap:=TPixmap.Create;
end else if SysUtils.CompareText(Resource.ValueType,'png')=0 then begin
Bitmap:=TPortableNetworkGraphic.Create;
end else
DebugLn('TSourceMarks.AddImage: ',
' WARNING: wrong icon format: "',ResName,'"="',Resource.ValueType,'"');
Bitmap.LoadFromLazarusResource(ResName);
Result:=ImgList.Add(Bitmap,nil);
Bitmap.Free;
end; end;
function TSourceMarks.GetSourceEditor(AMark: TSourceMark): TObject; function TSourceMarks.GetSourceEditor(AMark: TSourceMark): TObject;