lcl: call HandleNeeded before checking of maskhandle when adding bitmap to the imagelist (fixes #0011692)

git-svn-id: trunk@16011 -
This commit is contained in:
paul 2008-08-09 16:40:07 +00:00
parent 5994265add
commit c157756168
4 changed files with 9 additions and 6 deletions

View File

@ -161,7 +161,7 @@ type
class function GetControlClassDefaultSize: TPoint; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; Override;
destructor Destroy; override;
procedure Click; override;
public
property Glyph: TBitmap read GetGlyph write SetGlyph stored IsGlyphStored;

View File

@ -26,7 +26,7 @@ type
procedure SetTransparent(AValue: Boolean); override;
public
procedure Assign(ASource: TPersistent); override;
constructor Create(AOwner: TButtonGlyph);
constructor Create(AOwner: TButtonGlyph); reintroduce;
end;
procedure TGlyphBitmap.Assign(ASource: TPersistent);

View File

@ -635,10 +635,12 @@ end;
------------------------------------------------------------------------------}
procedure TCustomImageList.Insert(AIndex: Integer; AImage, AMask: TCustomBitmap);
var
msk: THandle;
img, msk: THandle;
begin
if AImage = nil then Exit;
// Paul: dont optimize. We need to call HandleNeeded before checking of maskhandle
img := AImage.Handle;
if AMask = nil
then begin
if AImage.MaskHandleAllocated
@ -647,7 +649,7 @@ begin
end
else msk := AMask.Handle;
InternalInsert(AIndex, AImage.Handle, msk, AImage.Width, AImage.Height);
InternalInsert(AIndex, img, msk, AImage.Width, AImage.Height);
end;
{------------------------------------------------------------------------------

View File

@ -811,7 +811,7 @@ end;
Returns: nothing
------------------------------------------------------------------------------}
procedure TCustomSpeedButton.SetTransparent(const AValue : boolean);
procedure TCustomSpeedButton.SetTransparent(const AValue: boolean);
const
MODE: array[Boolean] of TGlyphTransparencyMode = (gtmOpaque, gtmTransparent);
begin
@ -857,7 +857,8 @@ procedure TCustomSpeedButton.Loaded;
begin
inherited Loaded;
UpdateExclusive;
if FDownLoaded then SetDown(FDownLoaded);
if FDownLoaded then
SetDown(FDownLoaded);
end;
procedure TCustomSpeedButton.LoadGlyphFromLazarusResource(const AName: String);