Skip to content

Commit 073c18f

Browse files
author
joachim.marder
committed
TUICommandActionLink.Update() now checks if an action is assigned before calling inherited in order to prevent AVs.
1 parent 93460c4 commit 073c18f

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Doc/Readme.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ Please see http://www.bilsen.com/windowsribbon for detailed information
22
about this library.
33

44
Version history:
5-
5/27/2011: Version 1.0: Initial release by Erik van Bilsen.
5+
XX/07/2105: TUIRibbon is now a control that can be placed on a VCL form.
6+
TUIRibbonForm is deprecated and no longer needed.
7+
01/14/2015: The project was adopted by JAM Software which continues maintaining
8+
this project. A V2.0 is expected in summer 2015.
9+
12/17/2012: Version 1.2: Added Delphi XE3 compatibility (thanks to Cherryl
10+
Martin for pointing this out).
611
7/30/2011: Version 1.1: Added support for linking UI Commands to Delphi
712
actions. See the "Text Pad with Action List" sample application
813
and the web site for information on how to do this.
@@ -13,7 +18,5 @@ Version history:
1318
enable a more traditional user interface.
1419
These changes were inspired by contributions from
1520
Patrick Kolla-ten Venne. Many thanks for this!
16-
12/17/2012: Version 1.2: Added Delphi XE3 compatibility (thanks to Cherryl
17-
Martin for pointing this out).
18-
01/14/2015: The project was adopted by JAM Software which continues maintaining
19-
this project. A V2.0 is expected in summer 2015.
21+
5/27/2011: Version 1.0: Initial release by Erik van Bilsen.
22+

Lib/UIRibbonActions.pas

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ TUICommandActionLink = class abstract (TActionLink)
2626
property Client: TUICommand read FClient;
2727
public
2828
constructor Create(const AClient: TUICommand); reintroduce;
29+
function Update: Boolean; override;
2930
end;
3031

3132
TUICommandEmptyActionLink = class(TUICommandActionLink)
@@ -157,6 +158,14 @@ procedure TUICommandActionLink.SetVisible(Value: Boolean);
157158
FClient.Enabled := False;
158159
end;
159160

161+
function TUICommandActionLink.Update: Boolean;
162+
begin
163+
if Assigned(Self.Action) then
164+
Result := inherited Update()
165+
else
166+
Result := False;
167+
end;
168+
160169
procedure TUICommandActionLink.SetHint(const Value: String);
161170
var
162171
I: Integer;

0 commit comments

Comments
 (0)