Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hid when all switches are true or false
#1
If the checkbox is 1 and the "hid (hDlg)" command will work when F2, F3 and F4 are all on.
If any of F2 or F3 and F4 is "on", "dialog" is not "unhide".
I want to "unhide" the dialog box when all values are "off".

What is the simplest way to do this?

Function TEST1
Code:
Copy      Help
\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 146 102 "Dialog"
;3 Button 0x54031003 0x0 13 17 48 14 "F2"
;4 Button 0x54031003 0x0 13 41 48 14 "F3"
;5 Button 0x54031003 0x0 13 63 48 15 "F4"
;6 Button 0x54012003 0x0 75 18 48 10 "Hide"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""

str controls = "6"
str c6Hid
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

__RegisterHotKey- t_hk1 t_hk2 t_hk3

int DialogHide = hid(hDlg)
sel message
,case WM_INITDIALOG
,t_hk1.Register(hDlg 1 0 VK_F2)
,t_hk2.Register(hDlg 2 0 VK_F3)
,t_hk3.Register(hDlg 3 0 VK_F4)


,case WM_HOTKEY
,sel wParam
,,case 1 out "F2"
,,SendClickMessage(0 0 id(3 hDlg) 1 1)

,,case 2 out "F3"
,,SendClickMessage(0 0 id(4 hDlg) 1 1)

,,case 3 out "F4"
,,int-- on=0;on+1
,,if(on=1)
,,,_s="F4 OFF"
,,,_s.setwintext(id(5 hDlg))
,,else
,,,_s="F4 ON"
,,,_s.setwintext(id(5 hDlg))
,,,on=0

,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2

sel wParam
,case 3
,if(but(lParam))
,,_s="F2 OFF"
,else
,,_s="F2 ON"
,_s.setwintext(lParam)


,case 4
,if(but(lParam))
,,_s="F3 OFF"
,else
,,_s="F3 ON"
,_s.setwintext(lParam)


,case IDOK
,case IDCANCEL
ret 1


Forum Jump:


Users browsing this thread: 1 Guest(s)