view at position?

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,

In Windows there is a handy little function called something like "child at position". Give it the X Y coordinates and it will tell you if the window has a child whose visible area includes those coordinates.

Is there an analogous function in B4A? It would probably be called "view at position". For example, given the X Y coordinates within a panel, it would tell you if there is some child view, like a button, whose visible area includes those coordinates.

Thanks,
Barry.
 

canalrun

Well-Known Member
Licensed User
Longtime User
Thanks.

Yes, I wrote a little subroutine that does that. I was wondering if there was a built-in function.

A question which arose when writing the subroutine: suppose a panel has 5 buttons and 5 labels. You would like to find all the buttons and ignore all the labels. As you are iterating over the list of panel views, is it possible to determine what kind of view you are seeing? Something like the fakeo code below.

for i=0 to p. NumberOfViews-1
v = p.GetView(i)
if (v.IsButton = True) ' this line is the question
WhoopieDoo = True
end if
Next

Thanks,
Barry.
 
Upvote 0
Top