09-25-2008, 06:56 AM
Function Move_ok_botton
nice tight and neat...(so you can run this as a separate function if you wish...well without the case WM_SIZE. I usually try to run different function just to make life simple in the main dialog.)
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("Move_ok_botton" &Move_ok_botton)) ret
;BEGIN DIALOG
;0 "" 0x90CF0A44 0x100 0 0 222 134 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_SIZE
,
,;;GetWinXY(hwnd [&x] [&y] [&width] [&height] [hwndparent])
,
,;;GetWinXY gets coordinates of main window
,int x y cx cy
,GetWinXY(win("Dialog" "#32770") x y cx cy)
,
,;;MoveWindow hWnd x y nWidth nHeight bRepaint
,;;MoveWindow not only moves the control, but also resizes
,;;nWidth=72 and nHeight=23 are size of the button
,;;cx and cy the size of the main window...those are the coordinates of the bottom right corner
,;;therfore x=cx-160 and y=cy-63 (subtracting values pads the distance from bottom corner)
,MoveWindow id(1 win("Dialog" "#32770")) cx-160 cy-63 72 23 1
,
,;;moves the Cancel Button per same as OK button
,MoveWindow id(2 win("Dialog" "#32770")) cx-85 cy-63 72 23 1
,
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
nice tight and neat...(so you can run this as a separate function if you wish...well without the case WM_SIZE. I usually try to run different function just to make life simple in the main dialog.)