Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Resize Event Callback Timing Complete Rounding Size
The issue is in the math. Say I want to resize by 50 units. It only lets me get 2-4 units before the event triggers. Dividing that out by screen resolution might result in a difference of 2.4 so everything resizes based on 2 and drops the .4. Since this is going to happen, say, 25 times I am going to lose 10 points of resizing in this operation.
I assume my options are to keep my old method and only use the Resize to determine if it was resized (seems like a waste since you've provided this new functionality) or gather up all the fractions and add them at the end (but then the issue arises as to when the "end" occurs).
Maybe I'm missing something obvious???
; (Contant definitons not shown) #DefineSubRoutine MyDialogCallbackProc(MyDialog_Handle,MyDialog_Message,MyDialog_Name,MyDialog_EventInfo,MyDialog_ChangeInfo) ON_EQUAL = @TRUE ; Initialize variable ON_EQUAL Switch MyDialog_Message ; Switch based on Dialog Message type Case MSG_INIT ; Standard Initialization message ; Save values for use when calculating button positions. nDlgWidth = MyDialogWidth strRect = DialogControlGet(MyDialog_Handle, "PushButton_OK", 17 ) nOkMidOff = ItemExtract(1, strRect, " ") - (nDlgWidth/2) strRect = DialogControlGet(MyDialog_Handle, "PushButton_Cancel", 17 ) nCanMidOff = ItemExtract(1, strRect, " ") - (nDlgWidth/2) DialogProcOptions(MyDialog_Handle,MSG_RESIZE,1) DialogProcOptions(MyDialog_Handle,MSG_BUTTONPUSHED,@TRUE) Return(RET_DO_DEFAULT) Case MSG_BUTTONPUSHED If MyDialog_Name == "PushButton_OK" ; OK Return(RET_DO_DEFAULT) ElseIf MyDialog_Name == "PushButton_Cancel" ; Cancel Return(RET_DO_DEFAULT) EndIf ; MyDialog_Name Return(RET_DO_DEFAULT) Case MSG_RESIZE ; Dialog Resize ; Get the dialog's size deltas. nDeltaX = ItemExtract(1,MyDialog_ChangeInfo, " ") nDeltaY = ItemExtract(2,MyDialog_ChangeInfo, " ") nDlgWidth = nDlgWidth + nDeltaX ; The edit just changes size with the dialog. strRect = DialogControlGet(MyDialog_Handle, "MultiLineBox_1", 17 ) nWidth = ItemExtract(3, strRect, " ") nHeight = ItemExtract(4, strRect, " ") strRect = ItemReplace(nWidth+nDeltaX, 3, strRect, " ") strRect = ItemReplace(nHeight+nDeltaY, 4, strRect, " ") DialogControlSet(MyDialog_Handle, "MultiLineBox_1", 17, strRect ) ; Buttons stay more or less centered at the bottom of the dialog. strRect = DialogControlGet(MyDialog_Handle, "PushButton_OK", 17 ) nY = ItemExtract(2, strRect, " ") strRect = ItemReplace(nDlgWidth/2+nOkMidOff , 1, strRect, " ") strRect = ItemReplace(nY+nDeltaY, 2, strRect, " ") DialogControlSet(MyDialog_Handle, "PushButton_OK", 17, strRect ) strRect = DialogControlGet(MyDialog_Handle, "PushButton_Cancel", 17 ) nY = ItemExtract(2, strRect, " ") strRect = ItemReplace(nDlgWidth/2+nCanMidOff, 1, strRect, " ") strRect = ItemReplace(nY+nDeltaY, 2, strRect, " ") DialogControlSet(MyDialog_Handle, "PushButton_Cancel", 17, strRect ) Return(RET_DO_DEFAULT) EndSwitch ; MyDialog_Message Return(RET_DO_DEFAULT) #EndSubRoutine ; End of Dialog Callback MyDialogCallbackProc MyDialogFormat=`WWWDLGED,6.2` MyDialogCaption=`WIL Dialog 1` MyDialogX=082 MyDialogY=051 MyDialogWidth=281 MyDialogHeight=184 MyDialogMinWidth=170 MyDialogMinHeight=060 MyDialogNumControls=003 MyDialogProcedure=`MyDialogCallbackProc` MyDialogFont=`DEFAULT` MyDialogTextColor=`DEFAULT` MyDialogBackground=`DEFAULT,DEFAULT` MyDialogConfig=0 MyDialog001=`098,162,032,011,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,10,32,DEFAULT,DEFAULT,DEFAULT` MyDialog002=`145,162,030,011,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog003=`001,002,275,154,MULTILINEBOX,"MultiLineBox_1",mlVariable1,"Multiline edit 1",DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT` ButtonPushed=Dialog("MyDialog")
Article ID: W17734
Filename: Resize Event.txt
File Created: 2010:07:20:11:06:46
Last Updated: 2010:07:20:11:06:46