mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 05:19:31 +02:00
lcl: TButtonGlyph
- show always in design time and don't react on ShowMode change - show always for TSpeedButton git-svn-id: trunk@19947 -
This commit is contained in:
parent
ac4b855749
commit
695d17aeb1
@ -88,6 +88,7 @@ type
|
||||
|
||||
TButtonGlyph = class(TObject, IUnknown, IImageCacheListener)
|
||||
private
|
||||
FIsDesigning: Boolean;
|
||||
FShowMode: TGlyphShowMode;
|
||||
FImageIndexes: array[TButtonState] of Integer;
|
||||
FImages: TCustomImageList;
|
||||
@ -125,6 +126,7 @@ type
|
||||
BiDiFlags: Longint): TRect;
|
||||
procedure Refresh;
|
||||
property Glyph: TBitmap read FOriginal write SetGlyph;
|
||||
property IsDesigning: Boolean read FIsDesigning write FIsDesigning;
|
||||
property NumGlyphs: TNumGlyphs read FNumGlyphs write SetNumGlyphs;
|
||||
property Images: TCustomImageList read FImages;
|
||||
property Width: Integer read GetWidth;
|
||||
|
@ -29,6 +29,7 @@ begin
|
||||
FButtonGlyph := TButtonGlyph.Create;
|
||||
FButtonGlyph.NumGlyphs := 1;
|
||||
FButtonGlyph.OnChange := @GlyphChanged;
|
||||
FButtonGlyph.IsDesigning := csDesigning in ComponentState;
|
||||
Align := alNone;
|
||||
RealizeKind;
|
||||
end;
|
||||
|
@ -68,6 +68,7 @@ end;
|
||||
constructor TButtonGlyph.Create;
|
||||
begin
|
||||
FImagesCache := nil;
|
||||
FIsDesigning := False;
|
||||
FShowMode:= gsmApplication;
|
||||
FOriginal := TGlyphBitmap.Create(Self);
|
||||
FOriginal.OnChange := @GlyphChanged;
|
||||
@ -156,7 +157,8 @@ procedure TButtonGlyph.SetShowMode(const AValue: TGlyphShowMode);
|
||||
begin
|
||||
if FShowMode = AValue then Exit;
|
||||
FShowMode := AValue;
|
||||
Refresh;
|
||||
if not IsDesigning then
|
||||
Refresh;
|
||||
end;
|
||||
|
||||
function TButtonGlyph.GetHeight: Integer;
|
||||
@ -189,6 +191,8 @@ procedure TButtonGlyph.GlyphChanged(Sender: TObject);
|
||||
end;
|
||||
|
||||
begin
|
||||
if IsDesigning then
|
||||
Exit(True);
|
||||
case ShowMode of
|
||||
gsmAlways:
|
||||
Result := True;
|
||||
|
@ -42,6 +42,8 @@ constructor TCustomSpeedButton.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FGlyph := TButtonGlyph.Create;
|
||||
FGlyph.IsDesigning := csDesigning in ComponentState;
|
||||
FGlyph.ShowMode := gsmAlways;
|
||||
FGlyph.SetTransparentMode(gtmTransparent);
|
||||
FGlyph.OnChange := @GlyphChanged;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user