Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TO_Enable enable dialog button
#1
Hi !

In a dialog, i would like to "make clickable" a button if a condition is fulfilled

The problem is that i only found how to enable the button from a checkbox.

Long story short, i would like to make the button "Repair" clickable after button "Calculate" has been pressed.

How can i do that ? thanks in advance Smile

Macro Macro3
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x5C032000 0x0 120 44 48 14 "Repair"
;4 Button 0x54032000 0x0 56 44 48 21 "Calculate"
;5 Button 0x54012003 0x0 56 92 48 22 "Calculate"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "5"
str c5Cal
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,int a
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret


;messages2
sel wParam
,case 4
,,a=1
,,if a=1
,,,TO_Enable hDlg "3" but(lParam)
,case 5
,,a=1
,,if a=1
,,,TO_Enable hDlg "3" but(lParam)
ret 1
#2
this will work for ya

Macro Macro3
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x5C032000 0x0 120 44 48 14 "Repair"
;4 Button 0x54032000 0x0 56 44 48 21 "Calculate"
;5 Button 0x54012003 0x0 56 92 48 22 "Calculate"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "5"
str c5Cal
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,int a
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret


;messages2
sel wParam
,case 4
,,a=1
,,if a=1
,,,EnableWindow id(3 hDlg) 1 ;; flag 1 for enable 0 for disable
,,,;or
,,,;TO_Enable hDlg "3" 1
,case 5
//        a=1
//        if a=1
//            TO_Enable hDlg "3" but(lParam)
ret 1
#3
It works, thanks a lot Smile


Forum Jump:


Users browsing this thread: 1 Guest(s)