Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text color control in dialog initiated by a button
#2
This works as I wish. However, I am still wondering whether this is the proper solution :

Function Dialog32_Buttons_Control2
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 195 108 "Dialog"
;3 Button 0x54032000 0x0 19 18 48 14 "Button-3"
;4 Button 0x54032000 0x0 83 18 48 14 "Button-4"
;5 Static 0x54000000 0x0 59 57 48 12 "Text"
;6 Static 0x54000000 0x0 20 2 48 12 "Busy"
;1 Button 0x54030001 0x4 77 90 48 14 "OK"
;2 Button 0x54030000 0x4 135 90 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040308 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam
,
sel message
,case WM_INITDIALOG
,DT_SetTextColor(hDlg 0xFF0000 "6")    

,case WM_DESTROY
,case WM_COMMAND goto messages2

,case WM_TIMER
,sel wParam
,,case 1
,,KillTimer hDlg wParam
,,out "sta"
,,5
,,out "end"
,,_s="Ended"
,,_s.setwintext(id(5 hDlg))
,,DT_SetTextColor(hDlg 0xFF0000 "6")    
,,EnableWindow(id(4, hDlg) 1)

ret



;messages2
;OutWinMsg message wParam lParam

sel wParam
,case 3
,EnableWindow(id(4, hDlg) 0)

,DT_SetTextColor(hDlg 170 "6")    
,_s="Started"
,_s.setwintext(id(5 hDlg))
,SetTimer hDlg 1 1000 0

,
,
,case 4
,_s="Continue"
,_s.setwintext(id(5 hDlg))


,case IDOK
,case IDCANCEL
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)