Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SetDialogFont (background)
#10
I'm having a problem with "sel". I used "sel" to trigger something at a certain point of the day, in this case you can see it's at 2pm. But the thing is, it doesn't trigger it if you don't press any button.
Can this be done and I'm doing it wrong or can't this be done?

Check the "messages2" part:

Function resumo_remote_metade
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str cs s2 s1 _s1

if(!ShowDialog("resumo_remote_metade" &resumo_remote_metade)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 640 325 "RESUMO DA REDE"
;3 Static 0x50000000 0x40000 60 20 140 35 "CS'S"
;4 Static 0x54000000 0x0 255 20 170 35 "ALARMES"
;5 Static 0x54000000 0x0 100 120 150 35 "IDR"
;6 Static 0x54807000 0x0 50 60 80 35 " "
;7 Static 0x54800000 0x0 50 160 180 150 "BELEM[]MACEIÓ[]ANTUNES"
;8 Static 0x54800000 0x0 300 160 180 30 "ACEITE !"
;9 Static 0x54800000 0x0 300 200 120 30 "02:00:00"
;10 Static 0x50000000 0x40000 340 120 140 35 "AUDIT"
;11 Static 0x50000000 0x0 210 50 50 20 "TNO"
;12 Static 0x50000000 0x0 310 50 50 20 "TCO"
;13 Static 0x50000000 0x0 410 50 50 20 "TNE"
;14 Static 0x54800000 0x0 200 80 60 25 "12"
;15 Static 0x54800000 0x0 300 80 60 25 "17"
;16 Static 0x54800000 0x0 400 80 60 25 "21"
;17 Button 0x54032000 0x0 600 150 48 14 "teste"
;1 Button 0x54030001 0x4 315 102 0 0 "OK"
;2 Button 0x54030000 0x4 712 134 0 0 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030408 "" "" "" ""

ret
;messages
/---Variável do timer do audit---
int-- timervar
/---Sys do bitmap---
int x(0) y(0) wid(955) hei(550) ;;change this
int x1(470) y1(400) wid1(120) hei1(150) ;;change this
__MemBmp-- mb
__MemBmp-- mb1 ;;Sinal de perigo

sel message

,case WM_INITDIALOG
/---Timer do semaforo---
,SetTimer hDlg 1 2000 0
,SendMessage hDlg WM_TIMER 1 0
/-----Fonte,tamanho e cor----
,__Font-- f.Create("Calibri" 35 1) f2.Create("Calibri" 35 1) f3.Create("Calibri" 25 1) f4.Create("Calibri" 35 1)
,f.SetDialogFont(hDlg "3 4 5 10")
,f2.SetDialogFont(hDlg "8")
,f3.SetDialogFont(hDlg "7 11 12 13 14 15 16")
,f4.SetDialogFont(hDlg "6 9")
,f.SetDialogFontColor(hDlg 0x999999 "3 4 5 10")
,DT_SetTextColor(hDlg 0x006600 "8")
,f3.SetDialogFontColor(hDlg 0xFFFFFF "11 12 13")
,DT_SetTextColor(hDlg 0xFFFFFF "7 14 15 16")
,DT_SetTextColor(hDlg 0xFFFFFF "6 9")
/---Load Imagem de fundo---
,_s="S:\GS\SN SS GNOC\Projects\TIM\Menu TIM\remote\background.jpg"
,__GdiHandle hb=LoadPictureFile(_s); if(!hb) ret
,hb=CopyImage(hb IMAGE_BITMAP wid hei LR_COPYDELETEORG|LR_COPYRETURNORG)
,SaveBitmap hb _s.from("S:\GS\SN SS GNOC\Projects\TIM\Menu TIM\remote\active_metade.jpg")
,DT_SetBackgroundImage hDlg _s
;

,case WM_TIMER
/---Refresh dos CS's---
,str fcs="S:\GS\SN SS GNOC\Projects\TIM\Menu TIM\remote\CS.txt"
,cs.getfile(fcs)
,SetDlgItemText hDlg 6 F"{cs%%s}"
/---Timer do Audit---
, if timervar<=7199
,, _s1="S:\GS\SN SS GNOC\Projects\TIM\Menu TIM\remote\perigo_metade.jpg"
,, int hb1=LoadPictureFile(_s1); if(!hb1) ret
,, hb1=CopyImage(hb1 IMAGE_BITMAP wid1 hei1 LR_COPYDELETEORG|LR_COPYRETURNORG)
,, mb1.Attach(hb1)
,, RedrawWindow hDlg 0 0 RDW_INVALIDATE
,if timervar<=0
,,KillTimer(hDlg 1)
,_s.format("%02i:%02i:%02i" timervar/3600 timervar/60%60 timervar%60)
,_s.setwintext(id(9 hDlg));err
,timervar-1

,case WM_DESTROY
,KillTimer(hDlg 1)

,case WM_COMMAND goto messages2
;/---Bitmaps---
,case WM_PAINT
,PAINTSTRUCT p; int dc=BeginPaint(hDlg &p)
,BitBlt dc x1 y1 wid1 hei1 mb1.dc 0 0 SRCCOPY
,EndPaint hDlg &p

ret

;messages2
DateTime dt; str xs;
dt.FromComputerTime; xs=dt.ToStrFormat("{HH}")
sel xs
,case "14": s1="IN PROGRESS"
,s1.setwintext(id(8 hDlg)) ; DT_SetTextColor(hDlg 0x33FFFF "8")
,timervar=7200
,SetTimer hDlg 2 1000 0
;
, case IDOK
, case IDCANCEL
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)