On Jul 28, 2009, at 10:16 PM, Greg O'Lone wrote:
I'm attempting to create an autocomplete menu for an editfield
(2009r2.1) that appears at the text insertion point and having a
problem with the placement of the menu. It seems that when I call
TrueWindow.Left and TrueWindow.Top from a subclass of an editfield,
I am not getting the coordinates of the window, but the window
behind it.
True Window is the wrong approach because it won't work for nested
container controls... Put this in a module to calulate ScreenPosition
of any RectControl:
Sub ScreenPosition(Extends RectCtrl as RectControl, ByRef ScreenTop
as integer, ByRef ScreenLeft as Integer)
Dim Container as Window
ScreenTop = RectCtrl.Top
ScreenLeft = RectCtrl.Left
Container = RectCtrl.Window
While Container IsA ContainerControl
ScreenTop = ScreenTop + Container.Top
ScreenLeft = ScreenLeft + Container.Left
Container = ContainerControl(Container).Window
Wend
ScreenTop = ScreenTop + Container.Top
ScreenLeft = ScreenLeft + Container.Left
End Sub
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|