Prevent end user from deleting a component
Can you add a property to the TTppComponent that would prevent an end
user from deleting that component at run time? The work around using
OnSelectionChanged would prevent the end user from editing other
properties of the component and that fix is worse than the problem.
We have reports that use the OnCalc event to set the value some
tppVariable components based on some other components. If the end
user deletes the wrong component, the OnCalc event throws an AV
because the source component was deleted. Our work around is to the
user to right-click on the component and set visible to false. That
wouldn't work if the user couldn't select the component.
The desired behaviour would be to be able to set a property at design
time that would protect the user from deleting the component. At
runtime, a message dialog would be displayed saying that the component
was protected from deletion. It would be really nice if the
programmer could set the message text at runtime.
thanks,
Chris Miller
VersaTrans Solutions Inc
user from deleting that component at run time? The work around using
OnSelectionChanged would prevent the end user from editing other
properties of the component and that fix is worse than the problem.
We have reports that use the OnCalc event to set the value some
tppVariable components based on some other components. If the end
user deletes the wrong component, the OnCalc event throws an AV
because the source component was deleted. Our work around is to the
user to right-click on the component and set visible to false. That
wouldn't work if the user couldn't select the component.
The desired behaviour would be to be able to set a property at design
time that would protect the user from deleting the component. At
runtime, a message dialog would be displayed saying that the component
was protected from deletion. It would be really nice if the
programmer could set the message text at runtime.
thanks,
Chris Miller
VersaTrans Solutions Inc
This discussion has been closed.
Comments
move it or delete it.
TppLabel.Locks := [lkMovable, lkDeletable];
Then you could override the OnDeleteAttemptMsgCreate event of the
component...
Something like this is on the ToDo list. Thanks for the suggestion.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
report and recreates components that should always be present. Run this
whenever the designer has been in use.