mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 16:56:01 +02:00
LCL: improvements for TArrow. Publish Color, call Invalidate when setting properties.
git-svn-id: trunk@40975 -
This commit is contained in:
parent
9255f8d208
commit
4f2fb8c377
39
lcl/arrow.pp
39
lcl/arrow.pp
@ -44,11 +44,9 @@ type
|
||||
|
||||
TArrow = class(TCustomControl)
|
||||
private
|
||||
FArrowType : TArrowType;
|
||||
FShadowType : TShadowType;
|
||||
function GetShadowType: TShadowType;
|
||||
fArrowType : TArrowType;
|
||||
fShadowType : TShadowType;
|
||||
procedure SetShadowType(const AValue: TShadowType);
|
||||
function GetArrowType: TArrowType;
|
||||
procedure SetArrowType(const AValue: TArrowType);
|
||||
procedure SetProps;
|
||||
protected
|
||||
@ -60,21 +58,22 @@ type
|
||||
procedure Loaded; override;
|
||||
procedure InitializeWnd; override;
|
||||
published
|
||||
property ArrowType: TArrowType read fArrowType write SetArrowType default atLeft;
|
||||
property ShadowType: TShadowType read fShadowType write SetShadowType default stEtchedIn;
|
||||
property Align;
|
||||
property Anchors;
|
||||
property ArrowType: TArrowType read GetArrowType write SetArrowType default atLeft;
|
||||
property BorderSpacing;
|
||||
property ShadowType: TShadowType read fShadowType write SetShadowType default stEtchedIn;
|
||||
property Color;
|
||||
property OnChangeBounds;
|
||||
property PopupMenu;
|
||||
property Visible;
|
||||
property OnClick;
|
||||
property OnContextPopup;
|
||||
property OnDblClick;
|
||||
property OnMouseMove;
|
||||
property OnMouseDown;
|
||||
property OnMouseUp;
|
||||
property OnChangeBounds;
|
||||
property OnResize;
|
||||
property OnContextPopup;
|
||||
property PopupMenu;
|
||||
end;
|
||||
|
||||
procedure Register;
|
||||
@ -127,26 +126,26 @@ begin
|
||||
SetProps;
|
||||
end;
|
||||
|
||||
function TArrow.GetArrowType: TArrowType;
|
||||
begin
|
||||
Result := FArrowType;
|
||||
end;
|
||||
|
||||
procedure TArrow.SetArrowType(const AValue: TArrowType);
|
||||
begin
|
||||
if fArrowType = aValue then Exit;
|
||||
fArrowType := AValue;
|
||||
SetProps;
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
function TArrow.GetShadowType: TShadowType;
|
||||
procedure TArrow.SetShadowType(const AValue: TShadowType);
|
||||
begin
|
||||
Result := FShadowType;
|
||||
if fShadowType = aValue then Exit;
|
||||
fShadowType := aValue;
|
||||
SetProps;
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
procedure TArrow.SetProps;
|
||||
begin
|
||||
if HandleAllocated and (not (csLoading in ComponentState)) then
|
||||
TWSArrowClass(WidgetSetClass).SetType(Self, FArrowType, FShadowType);
|
||||
TWSArrowClass(WidgetSetClass).SetType(Self, fArrowType, fShadowType);
|
||||
end;
|
||||
|
||||
class procedure TArrow.WSRegisterClass;
|
||||
@ -155,10 +154,4 @@ begin
|
||||
RegisterArrow;
|
||||
end;
|
||||
|
||||
procedure TArrow.SetShadowType(const AValue: TShadowType);
|
||||
begin
|
||||
FShadowType := aValue;
|
||||
SetProps;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user