Search code examples
delphidelphi-2010jvcl

Is there a way to stop a TJvDocServerForm from hiding when its unpinned?


So my problem is that I have a TJvDocServerForm with an image inside, now all functionality works when its pinned, however when its unpinned and I try to use the mousewheel to zoom, the form hides straight after the zoom operation.

  • The zoom works through a scrollboxmousewheel event that triggers a timer.
  • The timer then redraws the larger/smaller image through my own
    image class when movement on the mousewheel has stopped.
  • Through break points it appears the draw is causing the form to hide.

I believe this has got something to do with the focus being lost, however resetting the focus back to he form directly after the draw does not stop the hide as it has already been told to hide.

Is there a way to somehow lock the form from hiding until after the image has been redrawn?


Solution

  • This functionality (the unpinning thing) is rarely used. This code is extremely complex, and changing it is not recommended unless you like causing regressions. How common is the combination of mouse wheel + unpinning? So rare, I'd let it go, if I were you. If you can live without the unpin feature at all, just change dock styles. Personally I hate the unpinned state and I use a dock style that doesn't even support it. The unpinned "zoom away" animation may be directly linked to the focus-loss. You could store that state, wait until the next time through the message loop and then trigger the animation, if you wanted to, but even I, who have done lots of work in JvDocking source code, would be hesitant to try it.