09-25-2008, 12:49 AM
Is there a way to change the size and shape of the OK button based on if the dialog is maximized or not?
Example:
If Dialog is maximized the OK button will look and be in its normal position in a normal dialog. If Dialog is not maximized then the OK button will start at left of bottom of the dialog and continua to the right bottom of the dialog.
Function Move_ok_botton
It is that left bottom and right bottom part that I am having problems with. How do you find the left and right part of the dialog then change the size of the ok button based on it?
Example:
If Dialog is maximized the OK button will look and be in its normal position in a normal dialog. If Dialog is not maximized then the OK button will start at left of bottom of the dialog and continua to the right bottom of the dialog.
Function Move_ok_botton
\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
,if(IsZoomed(win("Dialog" "#32770")))
,,MoveWindow id(1 win("Dialog" "#32770")) 182 189 70 24 1
,if(!IsZoomed(win("Dialog" "#32770")))
,,;Get window size and adjust edit box to match //
,,int x y width height
,,GetWinXY(hDlg &x &y &width &height)
,,siz width-9 height-65 id(1 hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
It is that left bottom and right bottom part that I am having problems with. How do you find the left and right part of the dialog then change the size of the ok button based on it?