Hide or disable HoverButtons

Hello,

I am using HoverButtons in TAdvStringGrid - I have 4 buttons (read,write,erase,run)
When I click on one button an event occurred and corresponding function was executed.

But One function take quite long time to finish, and I would like to hide or disable HoveButtons to prevent run another task.

So I would like ask if there is some way to do it ?

Thanks in advance.

Radim

There was not yet a built-in method for this.
We have added grid.HideHoverButtons and this new method will be available in the next release

Dear Bruno,

thanks for quick answer.
Regards
Radim

Dear Bruno,


I found one workaround. In OnHoverButtonsShow event I don't use Allow variable to show/hide all buttons. But I am able do disable functionality of partial buttons using

if ( Button0Enabled ) then
begin
   AdvStringGrid.HoverButtons.Buttons[0].Enabled := false; // disable button
   AdvStringGrid.HoverButtons.Buttons[0].ImageIndex := 5; // set imageindex to another 
end
else
begin
   AdvStringGrid.HoverButtons.Buttons[0].Enabled := true; // enable button
   AdvStringGrid.HoverButtons.Buttons[0].ImageIndex := 0; // set imageindex to correct value
end;

And it is working... but sometimes It will be nice to have options to hide disabled button or show Disabled image instead of original.

Regards
Radim

Instead of a property to hide specific buttons, it would be much better to provide an OnShowHoverButton event, with parameters the button number and the row and column, and a var parameter I could set to true or false.  Then I could hide specific buttons on specific rows.


This would save me having to make a change to the source on every upgrade of the component!  Please consider this change to replace the less flexible one you propose.