Why is FMX TScrollBar OnMouseUp not working?

  

I have a ScrollBar with mouse events assigned to onChange, onMouseWheel and onMouseUp. The onChange and wheel events work fine, but the onMouseUp event does not fire. Drilling down to the TControl method on debug, I noticed that the event variable (FOnMouseUp) is nill. The event is assigned in the IDE and I put it in the onCreate event of the form, plus I tried assigning it in various other places after the form is created, but to no avail. What gives?

Here is a simple reproducible example, in which all three scroll bar mouse events do not fire:
`TForm4 = class(TForm)
ScrollBar1: TScrollBar;
Label1: TLabel;
procedure ScrollBar1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Single);
procedure ScrollBar1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
procedure ScrollBar1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
procedure ScrollBar1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form4: TForm4;

implementation

{$R *.fmx}

procedure TForm4.ScrollBar1Change(Sender: TObject);
begin
Label1.Text := ‘onChange: ‘ + Screen.MousePos.Y.ToString;
end;

procedure TForm4.ScrollBar1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
Label1.Text := ‘mousedown: ‘ + Y.ToString;
end;

procedure TForm4.ScrollBar1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Single);
begin
Label1.Text := ‘mousemove: ‘ + Y.ToString;
end;

procedure TForm4.ScrollBar1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
Label1.Text := ‘mouseUP: ‘ + Y.ToString;
end;

end.`

And the .FMX:
`object Form4: TForm4
Left = 0
Top = 0
Caption = ‘Form4’
ClientHeight = 480
ClientWidth = 640
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
DesignerMasterStyle = 0
object ScrollBar1: TScrollBar
SmallChange = 0.000000000000000000
Orientation = Vertical
Position.X = 616.000000000000000000
Position.Y = 8.000000000000000000
Size.Width = 18.000000000000000000
Size.Height = 449.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
OnChange = ScrollBar1Change
OnMouseDown = ScrollBar1MouseDown
OnMouseMove = ScrollBar1MouseMove
OnMouseUp = ScrollBar1MouseUp
end
object Label1: TLabel
Position.X = 568.000000000000000000
Position.Y = 152.000000000000000000
Text = ‘Label1’
TabOrder = 1
end
end`

Comments are closed.