When you slide the TTMSFMXSlider button with a mouse drag (down and move) if the MouseUp event happens out of the control bounds the control stays in an unstable state. Also the OnStateChanged event is not fired.
This has beent tested in Windows and iOS environments.
Pieter
(Pieter)
June 18, 2012, 6:54am
2
Hi,
We have been able to reproduce this and the fix will be available in the next release
Regards,
Pieter
I've tested the problem with your latest version and it seems to me thet it is not solved.
To solve the problem I've modified the source code in the FMX_TMSSlider.pas unit as follows:
Added two fields to the private area of the TTMSFMXSlider class:
FLastMouseX: Single; FLastMouseY: Single;
Added to the protected area the following method:
procedure DoMouseLeave; override;
Modified the fowwowing methods implementation:
procedure TTMSFMXSlider.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin inherited; if (Button <> TMouseButton.mbLeft) then Exit;
FMouseDown := True; FMouseDownButton := PointInRect(PointF(X, Y), GetButtonRect); FCx := X; if FMouseDownButton then begin FLastMouseX := X; FLastMouseY := Y; end; end;
procedure TTMSFMXSlider.MouseMove(Shift: TShiftState; X, Y: Single); var bs: Single; begin inherited; if FMouseDown and not FDoAnimation then begin bs := GetButtonSize; case FState of ssOn: FCurrentPos := Min(Max(X - FCx + Width - bs, 0), Width - bs); ssOff: FCurrentPos := Min(Max(X - FCx, 0), Width - bs); end; UpdateSlider; FLastMouseX := X; FLastMouseY := Y; end; end;
Added the following method implementation:
procedure TTMSFMXSlider.DoMouseLeave; begin inherited; MouseUp(TMouseButton.mbLeft, [], FLastMouseX, FLastMouseY); end;
Pieter
(Pieter)
October 3, 2012, 7:40am
4
Looking at your code, it seems that the fix we have implemented is not present
Which version is the TTMSFMXSlider ?
it should be v1.0.5.3
Kind Regards,
Scheldeman Pieter
The version I've downloaded is the 1.0.5.2.
To get this version I went to My Account->My Products->TMS Instrumentation Workshop for FireMonkey and from the Product downloads box I clicked the "Registered version" link.
Where should I go to download the latest version?
Best regards