fix TRxHistoryNavigator with empty Back or Forward buttons

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2273 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2012-01-29 17:50:00 +00:00
parent 644473ec2d
commit 1ce3d33d83

View File

@ -190,8 +190,14 @@ end;
procedure TRxHistoryNavigator.EnableAction(ActName: byte; Enable: boolean); procedure TRxHistoryNavigator.EnableAction(ActName: byte; Enable: boolean);
begin begin
if First=nil then Enable:=false; if First=nil then Enable:=false;
if ActName = 0 then (FBackBtnItem.Action as TAction).Enabled:=Enable if ActName = 0 then
else (FForwardBtnItem.Action as TAction).Enabled:=Enable begin
if Assigned(FBackBtnItem) then
(FBackBtnItem.Action as TAction).Enabled:=Enable
end
else
if Assigned(FForwardBtnItem) then
(FForwardBtnItem.Action as TAction).Enabled:=Enable
end; end;
procedure TRxHistoryNavigator.BackProc(Sender: TObject); procedure TRxHistoryNavigator.BackProc(Sender: TObject);