hello girls and boys,
RAD 11.2 Alexandria
FMX project / 32bits
Button1 is on Form1 (directly);
Button1.HitTest = false;
I'm having a little problem with something that would, shall we say, not be a problem...
I need to get control over the mouse cursor to perform some extra tasks. However, I'm not understanding why the result is always "nil" for the "ObjectAtPoint" function.
According to the code below, I believe that it should have the intended return, that is, the control "Button1" (IControl representing it)... however, the function is returning "nil"... and, how can be seen on the printscreen, everything goes well until the line number "101",
after it, the "result" is again used to check if "ITSELF" has an "object (children... but does not )" in the given coordinates... this part seems strange to me, however, the code is from Embarcadero... so there was even more doubt!
So, if anyone can say something that helps me, I thank you in advance.
here my code for tests...
type
TForm1 = class(TForm)
Button1: TButton; // <---- my control into form, "Button1.HitTest := false"
...
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: single);
var
LPointF: TPointF;
LIControl: IControl;
begin
LPointF := TPointF.Create(X, Y);
//
LIControl := ObjectAtPoint(LPointF); = it's nil
// or
LIControl := ObjectAtPoint(ClientToScreen(LPointF)); = it's nil
...
end;
NOTE: on screenshot is "TEDIT" but in fact is "TButton"... ok == I pasted old printscreen ! SORRY!