TVrTrackBar toMouseClip Option Issue

I use the TVrTrackBar and found that if the Enabled property is set to false while the mouse id down (moving the slider) the toMouseClip option causes an issue. It’s checked in OnMouseDown and sets FClipOn if true (and calls ClipCursor). Normally the FClipOn flag is checked in OnMouseUp (to call ClipCursor again), but I suspect that this never happens if the control is no longer enabled. The result is that the mouse gets trapped in the client rectangle.

As a workaround I can set the toMouseClip option to false which avoids this, but I don’t know if this will adversely affect the user’s experience with the mouse. I did get some odd results with adjacent TVrTrackBar controls moving when the mouse moved outside the original control, but not always.

The real solution would be to clear FClipOn (and call ClipCursor) if it is on when the control moves to the disabled state, but I’d rather not hack the source.

I try to understand what exactly you are doing.
Do I understand correct you do something like:

procedure TForm1.VrTrackBar1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
vrtrackbar1.Enabled := false;
end;

?

If that is the case, we applied an improvement for this unexpected handling so the mouse will no longer be clipped if this happens.
If your situation is different, please provide sufficient detailed information.

The TVrTrackBar is for a volume control where the user may be adjusting it when another event fires (end of playback) that disables the control. The same issue affects TVrSlider I believe.

We applied a change that should address this. The change will be in the next release.

1 Like