mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-28 22:21:33 +01:00
lcl: moved TWinControlActionLink Help attributes to TControlActionLink from Sergei
git-svn-id: trunk@10392 -
This commit is contained in:
parent
eb2bc015d7
commit
312ea10264
@ -2066,7 +2066,6 @@ end;
|
|||||||
Function TSourceEditor.RefreshEditorSettings: Boolean;
|
Function TSourceEditor.RefreshEditorSettings: Boolean;
|
||||||
Begin
|
Begin
|
||||||
Result:=true;
|
Result:=true;
|
||||||
EditorOpts.
|
|
||||||
SetSyntaxHighlighterType(fSyntaxHighlighterType);
|
SetSyntaxHighlighterType(fSyntaxHighlighterType);
|
||||||
EditorOpts.GetSynEditSettings(FEditor);
|
EditorOpts.GetSynEditSettings(FEditor);
|
||||||
SourceNotebook.UpdateActiveEditColors;
|
SourceNotebook.UpdateActiveEditColors;
|
||||||
|
|||||||
@ -1422,13 +1422,10 @@ type
|
|||||||
|
|
||||||
{ TWinControlActionLink }
|
{ TWinControlActionLink }
|
||||||
|
|
||||||
TWinControlActionLink = class(TControlActionLink)
|
// Since HelpContext and HelpKeyword are properties of TControl,
|
||||||
protected
|
// this class is obsolete. In order not to break existing code,
|
||||||
procedure AssignClient(AClient: TObject); override;
|
// its declaration is aliased to TControlActionLink.
|
||||||
function IsHelpContextLinked: Boolean; override;
|
TWinControlActionLink = TControlActionLink;
|
||||||
procedure SetHelpContext(Value: THelpContext); override;
|
|
||||||
end;
|
|
||||||
|
|
||||||
TWinControlActionLinkClass = class of TWinControlActionLink;
|
TWinControlActionLinkClass = class of TWinControlActionLink;
|
||||||
|
|
||||||
|
|
||||||
@ -1518,9 +1515,6 @@ type
|
|||||||
var BoundsModified: Boolean);
|
var BoundsModified: Boolean);
|
||||||
protected
|
protected
|
||||||
FWinControlFlags: TWinControlFlags;
|
FWinControlFlags: TWinControlFlags;
|
||||||
procedure AssignTo(Dest: TPersistent); override;
|
|
||||||
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
|
|
||||||
function GetActionLinkClass: TControlActionLinkClass; override;
|
|
||||||
procedure AdjustClientRect(var ARect: TRect); virtual;
|
procedure AdjustClientRect(var ARect: TRect); virtual;
|
||||||
procedure AlignControls(AControl: TControl;
|
procedure AlignControls(AControl: TControl;
|
||||||
var RemainingClientRect: TRect); virtual;
|
var RemainingClientRect: TRect); virtual;
|
||||||
|
|||||||
@ -591,21 +591,18 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TControl.IsHelpContextStored: boolean;
|
function TControl.IsHelpContextStored: boolean;
|
||||||
begin
|
begin
|
||||||
if ActionLink=nil then
|
Result := (ActionLink = nil) or not ActionLink.IsHelpLinked;
|
||||||
Result := HelpContext<>0
|
|
||||||
else
|
|
||||||
Result := not ActionLink.IsHelpContextLinked;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
function TControl.IsHelpKeyWordStored: boolean;
|
function TControl.IsHelpKeyWordStored: boolean;
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
|
// Using IsHelpContextLinked() for controlling HelpKeyword
|
||||||
|
// is not correct. Therefore, use IsHelpLinked which means that all 3 Help* properties
|
||||||
|
// must be equal. Also, this function becomes exactly the same as one just above.
|
||||||
function TControl.IsHelpKeyWordStored: boolean;
|
function TControl.IsHelpKeyWordStored: boolean;
|
||||||
begin
|
begin
|
||||||
if ActionLink=nil then
|
Result := (ActionLink = nil) or not ActionLink.IsHelpLinked;
|
||||||
Result := HelpKeyword<>''
|
|
||||||
else
|
|
||||||
Result := not ActionLink.IsHelpContextLinked;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TControl.IsOnClickStored: Boolean;
|
function TControl.IsOnClickStored: Boolean;
|
||||||
@ -1358,6 +1355,11 @@ begin
|
|||||||
Visible := NewAction.Visible;
|
Visible := NewAction.Visible;
|
||||||
if not CheckDefaults or not Assigned(OnClick) then
|
if not CheckDefaults or not Assigned(OnClick) then
|
||||||
OnClick := NewAction.OnExecute;
|
OnClick := NewAction.OnExecute;
|
||||||
|
if not CheckDefaults or (Self.HelpContext = 0) then
|
||||||
|
Self.HelpContext := HelpContext;
|
||||||
|
if not CheckDefaults or (Self.HelpKeyword = '') then
|
||||||
|
Self.HelpKeyword := HelpKeyword;
|
||||||
|
// HelpType is set implicitly when assigning HelpContext or HelpKeyword
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2624,6 +2626,9 @@ begin
|
|||||||
Caption := Self.Caption;
|
Caption := Self.Caption;
|
||||||
Visible := Self.Visible;
|
Visible := Self.Visible;
|
||||||
OnExecute := Self.OnClick;
|
OnExecute := Self.OnClick;
|
||||||
|
HelpContext := Self.HelpContext;
|
||||||
|
HelpKeyword := Self.HelpKeyword;
|
||||||
|
HelpType := Self.HelpType;
|
||||||
end
|
end
|
||||||
else inherited AssignTo(Dest);
|
else inherited AssignTo(Dest);
|
||||||
end;
|
end;
|
||||||
@ -2925,6 +2930,8 @@ end;
|
|||||||
procedure TControl.SetHelpContext(const AValue: THelpContext);
|
procedure TControl.SetHelpContext(const AValue: THelpContext);
|
||||||
begin
|
begin
|
||||||
if FHelpContext=AValue then exit;
|
if FHelpContext=AValue then exit;
|
||||||
|
if not (csLoading in ComponentState) then
|
||||||
|
FHelpType := htContext;
|
||||||
FHelpContext:=AValue;
|
FHelpContext:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2934,6 +2941,8 @@ end;
|
|||||||
procedure TControl.SetHelpKeyword(const AValue: String);
|
procedure TControl.SetHelpKeyword(const AValue: String);
|
||||||
begin
|
begin
|
||||||
if FHelpKeyword=AValue then exit;
|
if FHelpKeyword=AValue then exit;
|
||||||
|
if not (csLoading in ComponentState) then
|
||||||
|
FHelpType := htKeyword;
|
||||||
FHelpKeyword:=AValue;
|
FHelpKeyword:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -115,23 +115,4 @@ begin
|
|||||||
if IsHelpLinked then FClient.HelpType := Value;
|
if IsHelpLinked then FClient.HelpType := Value;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TWinControlActionLink }
|
|
||||||
|
|
||||||
procedure TWinControlActionLink.AssignClient(AClient: TObject);
|
|
||||||
begin
|
|
||||||
inherited AssignClient(AClient);
|
|
||||||
FClient := AClient as TWinControl;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TWinControlActionLink.IsHelpContextLinked: Boolean;
|
|
||||||
begin
|
|
||||||
// only for Delphi compatibility
|
|
||||||
Result := IsHelpLinked;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TWinControlActionLink.SetHelpContext(Value: THelpContext);
|
|
||||||
begin
|
|
||||||
inherited SetHelpContext(Value);
|
|
||||||
end;
|
|
||||||
|
|
||||||
// included by controls.pp
|
// included by controls.pp
|
||||||
|
|||||||
@ -3629,27 +3629,6 @@ Begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWinControl.AssignTo(Dest: TPersistent);
|
|
||||||
begin
|
|
||||||
inherited AssignTo(Dest);
|
|
||||||
if Dest is TCustomAction then
|
|
||||||
TCustomAction(Dest).HelpContext:=HelpContext;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TWinControl.ActionChange(Sender: TObject; CheckDefaults: Boolean);
|
|
||||||
begin
|
|
||||||
inherited ActionChange(Sender,CheckDefaults);
|
|
||||||
if Sender is TCustomAction then
|
|
||||||
with TCustomAction(Sender) do
|
|
||||||
if (not CheckDefaults) or (Self.HelpContext = 0) then
|
|
||||||
Self.HelpContext := HelpContext;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TWinControl.GetActionLinkClass: TControlActionLinkClass;
|
|
||||||
begin
|
|
||||||
Result := TWinControlActionLink;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
TWinControl KeyDown
|
TWinControl KeyDown
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user