On Jul 28, 2009, at 11:32 pm, Michael Diehr wrote:
On Jul 28, 2009, at 7: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.
Mac OSX 10.5.7 -> Windows Vista SP1 (also a problem on XP)
AutocompleteField (Subclass of Editfield)
on a TabPanel
on a Document Window
in front of another document window
inside an MDI window
So what I'm attempting to do is to position another window with a
listbox on it at the cursor position within the AutocompleteField.
Problem is that TrueWindow.left and TrueWindow.Top are returning
the top-left corner of the window BEHIND the top window.
Anyone seen something like this before?
A guess -- perhaps in a MDI app, trueWindow returns the MDI window?
Any reason you can't just do this:
triggerAutoComplete
dim x,y as integer
x = me.left
y = me.top
// figure out global coordinates
x = x + self.left
y = y + self.top
Problem is that because this is a subclass of an editfield self.left
and self.top are returning the top/left corner of the control... not
the window.
I DID find out that this does not occur if the window is by itself on
the MDI window... that is, only if another window appears behind it.
Just tried hiding/minimizing all of the windows, but they apparently
keep/return their top/left coordinates anyway.
One of the iterations I worked on last night I created a routine that
looks like this:
----------------------------
Private Sub GetLocation(byref x as integer, byref y as Integer)
dim v as Variant
x = TrueWindow.Left
y = TrueWindow.Top
v = Self
while v<>nil
select case v
case isa RectControl
x = x + RectControl(v).Left
y = y + RectControl(v).Top
v = RectControl(v).parent
case isa Window
//This section never gets called for some reason
x = x + window(v).Left
y = y + window(v).top
v = nil
end select
wend
End Sub
----------------------------
and it works amazingly well for controls nested within other controls,
except for the fact that the original coordinates are incorrect
because of this bug I'm fighting.
Greg
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|