From 93c931063d7dcdd1840900f1171d9e97c285751c Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 30 Jun 2008 02:14:12 +0000 Subject: [PATCH] lcl: - register more picture extensions (.cur, .icns) - add simple implementation to TCustomIcon.UpdateCurrentView git-svn-id: trunk@15613 - --- lcl/include/icon.inc | 2 ++ lcl/include/picture.inc | 11 +++++++---- lcl/lclstrconsts.pas | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lcl/include/icon.inc b/lcl/include/icon.inc index d9567ff773..e4d0206130 100644 --- a/lcl/include/icon.inc +++ b/lcl/include/icon.inc @@ -712,6 +712,8 @@ end; procedure TCustomIcon.UpdateCurrentView; begin {$IFDEF VerboseLCLTodos}{$note implement me}{$ENDIF} + FreeCanvasContext; + Changed(Self); end; function TCustomIcon.UpdateHandles(ABitmap, AMask: HBITMAP): Boolean; diff --git a/lcl/include/picture.inc b/lcl/include/picture.inc index 9f1d70351e..5496dbf51a 100644 --- a/lcl/include/picture.inc +++ b/lcl/include/picture.inc @@ -51,7 +51,9 @@ begin Add('pbm', rsPortableBitmap, TPortableAnyMapGraphic); Add('pgm', rsPortableGrayMap, TPortableAnyMapGraphic); Add('ppm', rsPortablePixmap, TPortableAnyMapGraphic); - Add('ico', rsIcon, TCustomIcon); + Add('ico', rsIcon, TIcon); + Add('icns', rsIcns, TIcnsIcon); + Add('cur', rsCursor, TCursorImage); Add('jpg', rsJpeg, TJpegImage); end; @@ -432,9 +434,10 @@ var begin if (Value=FGraphic) then exit; NewGraphic := nil; - ok:=false; + ok := False; try - if Value <> nil then begin + if Value <> nil then + begin NewGraphic := TGraphicClass(Value.ClassType).Create; NewGraphic.Assign(Value); NewGraphic.OnChange := @Changed; @@ -443,7 +446,7 @@ begin FGraphic.Free; FGraphic := NewGraphic; Changed(Self); - ok:=true; + ok := True; finally // this try..finally construction will in case of an exception // not alter the error backtrace output diff --git a/lcl/lclstrconsts.pas b/lcl/lclstrconsts.pas index be64b77899..b753621ddb 100644 --- a/lcl/lclstrconsts.pas +++ b/lcl/lclstrconsts.pas @@ -185,6 +185,8 @@ ResourceString rsPortableGrayMap = 'Portable GrayMap'; rsPortablePixmap = 'Portable PixMap'; rsIcon = 'Icon'; + rsIcns = 'OSX Icon Resource'; + rsCursor = 'Cursor'; rsJpeg = 'Joint Picture Expert Group'; rsUnsupportedClipboardFormat = 'Unsupported clipboard format: %s'; rsGroupIndexCannotBeLessThanPrevious = 'GroupIndex cannot be less than a '