mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-27 18:13:55 +02:00
improved menuitems, speedbuttons and imagelist from Colin
git-svn-id: trunk@8071 -
This commit is contained in:
parent
0936587d9f
commit
ae7c181070
@ -637,6 +637,7 @@ begin
|
||||
FVisible:=true;
|
||||
FMenuItemClass:=TMenuItem;
|
||||
FSectionIndex:=-1;
|
||||
FImageIndex:=-1;
|
||||
{$IFDEF VerboseMenuIntf}
|
||||
//debugln('TIDEMenuItem.Create ',dbgsName(Self),' Name="',Name,'"');
|
||||
{$ENDIF}
|
||||
|
@ -355,6 +355,8 @@ function TMenuItem.GetBitmap: TBitmap;
|
||||
begin
|
||||
if FBitmap=nil then
|
||||
FBitmap:=TBitmap.Create;
|
||||
if (ImageIndex >= 0) and Assigned(GetImageList) then
|
||||
GetImageList.GetBitmap(ImageIndex, FBitmap);
|
||||
FBitmap.Transparent:=True;
|
||||
Result:=FBitmap;
|
||||
end;
|
||||
@ -1079,6 +1081,8 @@ begin
|
||||
if FImageIndex = Value then exit;
|
||||
//debugln('TMenuItem.SetImageIndex A ',Name,' Old=',FImageIndex,' New=',Value);
|
||||
FImageIndex := Value;
|
||||
if HandleAllocated then RecreateHandle;
|
||||
MenuChanged(False);
|
||||
//TODO: TMenuItem.SetImageIndex
|
||||
end;
|
||||
|
||||
|
@ -284,14 +284,7 @@ procedure TCustomSpeedButton.ActionChange(Sender: TObject; CheckDefaults: Boolea
|
||||
|
||||
procedure CopyImage(ImageList: TCustomImageList; Index: Integer);
|
||||
begin
|
||||
with Glyph do
|
||||
begin
|
||||
Width := ImageList.Width;
|
||||
Height := ImageList.Height;
|
||||
Canvas.Brush.Color := clMaroon; // whatever
|
||||
Canvas.FillRect(Rect(0,0,Width,Height));
|
||||
ImageList.Draw(Canvas,0,0,Index,true);
|
||||
end;
|
||||
ImageList.GetBitmap(Index, Glyph);
|
||||
end;
|
||||
|
||||
begin
|
||||
|
@ -2366,9 +2366,10 @@ begin
|
||||
{$ENDIF}
|
||||
if not GetWindowRawImageDescription(GdkWindow,@NewRawImage.Description) then
|
||||
begin
|
||||
DebugLn('WARNING: TGtkWidgetSet.GetRawImageFromGdkWindow GetWindowRawImageDescription failed');
|
||||
DebugLn('WARNING: TGtkWidgetSet.GetRawImageFromGdkWindow GetWindowRawImageDescription failed ');
|
||||
exit;
|
||||
end;
|
||||
//DebugLn('TGtkWidgetSet.GetRawImageFromGdkWindow GdkWindow is ... ',RawImageDescriptionAsString(@NewRawImage.Description));
|
||||
|
||||
// get intersection
|
||||
ARect:=SrcRect;
|
||||
|
@ -3389,12 +3389,16 @@ end;
|
||||
|
||||
procedure TLazIntfImageMask.SetInternalPixel(x, y: integer; Value: integer);
|
||||
begin
|
||||
|
||||
if UsePalette then
|
||||
SetInternalColor(x,y,Palette.Color[Value])
|
||||
end;
|
||||
|
||||
function TLazIntfImageMask.GetInternalPixel(x, y: integer): integer;
|
||||
begin
|
||||
Result:=0;
|
||||
if UsePalette then
|
||||
Result := Palette.IndexOf(GetInternalColor(x,y))
|
||||
else
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
constructor TLazIntfImageMask.CreateWithImage(TheImage: TLazIntfImage);
|
||||
|
Loading…
Reference in New Issue
Block a user