Re: Dialog wanders when shown repeatedly
- Posted by CChris <christian.cuvier at ag?icultu?e.gouv.fr> Jan 21, 2008
- 601 views
Tony Bohm wrote: > > Thank you! > > The dialog now moves straight down in increments of 29 pixels XD It stays in > place with setClientRect remarked, so that is doing something unexpected. > > I've got the result I was seeking using setRect, though ;D > > I notice that the create() documentation states that the x,y coordinates > specified > in the create() parameters are in relation to the parent window client area, > but MsgWin appears relative to the top-left of the screen even with MainWin > specified as its parent, if I remark the setClientRect and do not use setRect. > Is this expected, or is there a problem/misunderstanding in my use of > create()? > As I mentioned earlier, the problm is with setCtlSize(), which setClientRect() calls. The former routineperforms one client area correction too many, resulting in the problem you report. In setCtlSize(), locate the line hat says
posn = getPosition( id )
(close to line 19063) and replace it like this
oldBmp=w32acquire_mem(0,16) if not w32Func(xGetWindowRect,{getHandle(id),oldBmp}) then ? warnErr(Err_GRGETWINDRECT) end if posn=peek4u({oldBmp,4}) w32release_mem(oldBmp)
This way, the dialog opens at the same place it was closed. Anyway, you didn't need the calls to setClientRect(), since the "child" window doesn't change size. CChris > Thanks for the help and for all the work on the library; I probably wouldn't > have touched programming again without it!