RE: How can I make a field ready to receive typing?
- Posted by Elliott Sales de Andrade <quantum_analyst at hotmail.com> Oct 11, 2003
- 392 views
>From: Louis at cwshop.com >Subject: RE: How can I make a field ready to receive typing? > > >This is interesting. >It appears that "setCtlPosition(MainWin, 0,0)" does not do what I first >assumed. This is more clear if the main window opens initially at >200,200,.... When setCtlPosition() executes, the main window is NOT moved. > The top left corner is dragged to the specified coordinates, enlarging >the window. I expect that when the top left corner is dragged down and to >the right beyond the bottom right corner, the window will shrink to the >minimum size. > >To make it MOVE the window, we must use TWO commands instead: >setCtlPosition(MainWin, 200, 200) -- Push the bottom right corner into >place >setCtlPosition(MainWin, 0, 0) -- Stretch the window by the upper >left corner to size > >Is that what setCtlPosition() is supposed to do? No, it is not working right. The problem is that getRect() returns the positions of the top-left and bottom-right corners, and that setRect() sets the top-left corner, and the *height*, and the *width*, not the position of the bottom-right corner. setCtlPosition() does not adjust for this. It should use getCtlSize() instead of getRect(). global procedure setCtlPosition(integer id, object x, object y) sequence lSize lSize = getCtlSize(id) setRect(id, x, y, lSize[1], lSize[2], 1) end procedure > >Louis. >