How to get default Enabled in Trv*Action.OnUpdate?
Posted: Fri May 19, 2006 12:51 pm
I have a few special situations, where I need to disable some of the actions, even though they are enabled by default. For example, I'd like to prevent insertion of a page break in a paragraph with a certain style.
I tried simply writing the OnUpdate handler but then the default handling is completely bypassed, which is not what I want. I'd like to keep the default handling with additional check for my special cases.
Something along these lines:
How do I do the GetDefaultEnabled part?
I tried simply writing the OnUpdate handler but then the default handling is completely bypassed, which is not what I want. I'd like to keep the default handling with additional check for my special cases.
Something along these lines:
Code: Select all
procedure TSourceDocDesigner.rvActionInsertPageBreakUpdate(Sender: TObject);
begin
TAction(Sender).Enabled := GetDefaultEnabled(Sender) and MyCondition;
end;