mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-20 07:01:53 +02: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;
|
||||
Begin
|
||||
Result:=true;
|
||||
EditorOpts.
|
||||
SetSyntaxHighlighterType(fSyntaxHighlighterType);
|
||||
EditorOpts.GetSynEditSettings(FEditor);
|
||||
SourceNotebook.UpdateActiveEditColors;
|
||||
|
@ -1422,13 +1422,10 @@ type
|
||||
|
||||
{ TWinControlActionLink }
|
||||
|
||||
TWinControlActionLink = class(TControlActionLink)
|
||||
protected
|
||||
procedure AssignClient(AClient: TObject); override;
|
||||
function IsHelpContextLinked: Boolean; override;
|
||||
procedure SetHelpContext(Value: THelpContext); override;
|
||||
end;
|
||||
|
||||
// Since HelpContext and HelpKeyword are properties of TControl,
|
||||
// this class is obsolete. In order not to break existing code,
|
||||
// its declaration is aliased to TControlActionLink.
|
||||
TWinControlActionLink = TControlActionLink;
|
||||
TWinControlActionLinkClass = class of TWinControlActionLink;
|
||||
|
||||
|
||||
@ -1518,9 +1515,6 @@ type
|
||||
var BoundsModified: Boolean);
|
||||
protected
|
||||
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 AlignControls(AControl: TControl;
|
||||
var RemainingClientRect: TRect); virtual;
|
||||
|
@ -591,21 +591,18 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TControl.IsHelpContextStored: boolean;
|
||||
begin
|
||||
if ActionLink=nil then
|
||||
Result := HelpContext<>0
|
||||
else
|
||||
Result := not ActionLink.IsHelpContextLinked;
|
||||
Result := (ActionLink = nil) or not ActionLink.IsHelpLinked;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
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;
|
||||
begin
|
||||
if ActionLink=nil then
|
||||
Result := HelpKeyword<>''
|
||||
else
|
||||
Result := not ActionLink.IsHelpContextLinked;
|
||||
Result := (ActionLink = nil) or not ActionLink.IsHelpLinked;
|
||||
end;
|
||||
|
||||
function TControl.IsOnClickStored: Boolean;
|
||||
@ -1358,6 +1355,11 @@ begin
|
||||
Visible := NewAction.Visible;
|
||||
if not CheckDefaults or not Assigned(OnClick) then
|
||||
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;
|
||||
|
||||
@ -2624,6 +2626,9 @@ begin
|
||||
Caption := Self.Caption;
|
||||
Visible := Self.Visible;
|
||||
OnExecute := Self.OnClick;
|
||||
HelpContext := Self.HelpContext;
|
||||
HelpKeyword := Self.HelpKeyword;
|
||||
HelpType := Self.HelpType;
|
||||
end
|
||||
else inherited AssignTo(Dest);
|
||||
end;
|
||||
@ -2925,6 +2930,8 @@ end;
|
||||
procedure TControl.SetHelpContext(const AValue: THelpContext);
|
||||
begin
|
||||
if FHelpContext=AValue then exit;
|
||||
if not (csLoading in ComponentState) then
|
||||
FHelpType := htContext;
|
||||
FHelpContext:=AValue;
|
||||
end;
|
||||
|
||||
@ -2934,6 +2941,8 @@ end;
|
||||
procedure TControl.SetHelpKeyword(const AValue: String);
|
||||
begin
|
||||
if FHelpKeyword=AValue then exit;
|
||||
if not (csLoading in ComponentState) then
|
||||
FHelpType := htKeyword;
|
||||
FHelpKeyword:=AValue;
|
||||
end;
|
||||
|
||||
|
@ -115,23 +115,4 @@ begin
|
||||
if IsHelpLinked then FClient.HelpType := Value;
|
||||
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
|
||||
|
@ -3629,27 +3629,6 @@ Begin
|
||||
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
|
||||
------------------------------------------------------------------------------}
|
||||
|
Loading…
Reference in New Issue
Block a user