08-04-2010 02:33 AM
I just wanna to know that how can i get a field's position in a manager(Vertical or Flow)?
If i get the x,y position, than i can make a popup screen depends on this position....
Can anyone help me to solve this?
Solved! Go to Solution.
08-04-2010 03:18 AM
may be u can try this:
int index = getFieldWithFocusIndex(); Field f = getField(index); Manager m = (Manager)f; //above 3 steps are done if multiple managers(containing fields) are added to screen and u want to get index of manager int index1 = m.getFieldWithFocusIndex()(); //above line is written to get index of focused field inside that manager Field f1 = m.getField(index1); //above line is written to get field on which current focus exists //below mentioned are 4 methods that u can use to calculate your values f1.getLeft(); f1.getTop(); f1.getHeight(); f1.getWidth();
08-04-2010 03:34 AM
welcome to the forums.
I use getFocusRect to retrieve the XYRect of the focused field. you can get the coordinates from there.
06-05-2012 08:42 AM - edited 06-05-2012 08:46 AM
please help me on this issue.
But when i use this it will hides my field. here in getFocusRext am passing my fields Extent values. but i get the x and y positions but i the field was not drawing. can u please help me on this issue.
in my code i am using this
is this correct to set the Focus Rect. a give me a sample to get this.
06-05-2012 08:49 AM
06-05-2012 08:56 AM
Thanks for the replay.
i tried getScreen().getFocusRect(new XYRect());
and then how can i get the x and y positions
can i use this.getExtent().x and this.getExtent().y to get the x and y corditions is it right.
Where can i set this object at the time of initicalization. right now i am initializing this at the time of onFocus(). it won't return any values can u please help me.
06-05-2012 09:16 AM