Buttons move as the window is created

This forum is for eXpress++ general support.
Post Reply
Message
Author
Jeanne
Posts: 34
Joined: Thu Jan 28, 2010 8:11 am
Location: Oklahoma, USA
Contact:

Buttons move as the window is created

#1 Post by Jeanne »

Another touch screen resize issue.. When the window is being created if I have the mouse over a large group of buttons while they are being drawn and positioned they will sometimes be put in the wrong place. I cannot recreate it every time and I have not figured out exactly what is causing it other than it has something to do with the mouse being on top of them because if it is off to the side of them it never happens.

I have a test that I will attach that will demo this but you have to recreate the window a number of times to see it happen. Make sure the mouse is over where the bottons will be created as they are created.. also if you click it while it is created the button can change a bit too.

Just press the Enter a Number popup or the Enter a String pop up to see this behaviour.

Jeanne
Attachments
BrowseButtons.zip
(837.79 KiB) Downloaded 733 times

Jeanne
Posts: 34
Joined: Thu Jan 28, 2010 8:11 am
Location: Oklahoma, USA
Contact:

Re: Buttons move as the window is created

#2 Post by Jeanne »

Roger fixed it... Wow and it is faster too.. I had a function that maximized the screen and he added a few things to stop the strange button movement.

FUNCTION MaximizeScreen( oDlg, nMaxWidth, nMaxHeight )
LOCAL aWorkArea, nRow, nCol , nWidth, nHeight

oDlg:lockUpdate(.t.) <===== ADDED BY ROGER

nWidth := oDlg:currentSize()[1]
nHeight := oDlg:currentSize()[2]

aWorkArea := DC_GetWorkArea()
nHeight := aWorkArea[4] - aWorkArea[2]
nWidth := aWorkArea[3] - aWorkArea[1]

IF !Empty( nMaxWidth )
nWidth := nMaxWidth
ENDIF

IF !Empty( nMaxHeight )
nHeight := nMaxHeight
ENDIF

nCol := aWorkArea[1]
nRow := oDlg:setParent():currentSize()[2] - aWorkArea[4]
oDlg:setPos({nCol,nRow})
DC_ClearEvents() <===== ADDED BY ROGER
oDlg:setSize({nWidth,nHeight})

DC_CompleteEvents()
oDlg:lockUpdate(.f.) <===== ADDED BY ROGER
oDlg:invalidateRect() <===== ADDED BY ROGER

RETURN nil

He is so good... what every would I do with out Roger? :clap:
Jeanne

Post Reply