I want to show a palette below a webtextfield so I am trying to find out it’s real coordinates on the screen.
My idea was to loop through the parent and get its top and left coordinates using this code
[code]
dim parent as WebView = self.Parent
dim top as integer = self.top
dim left as integer = self.Left
while parent <> NIL
top = top + parent.Top
left = left + parent.Left
parent = parent.parent
wend[/code]
So far this works but the text field is place (inside containers) on a web dialog that is shown modal. The left and top properties of that dialog return 0.
[quote=302685:@Fabian Eschrich]great idea Greg. Thanks a lot. will do it this way.
is there a plan to change / fix this in Xojo or is it the way it is meant to be?[/quote]
The issue is that the “control” includes the dark overlay. It was an original design flaw and fixing the behavior challenging to put it simply.
It does not seem completely impossible to get these values. Since the overlay covers the entire browser window, offsetLeft and offsetTop give the correct left and top. Here in a button placed on the dialog :
[code]Sub Action() Handles Action
dim js as string