Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SetDialogFont (background)
#5
Works great! Thanks a lot!
One more question: I was able to change some static text fields text getting info from a file thanks to this thread: Returning values from function to different dialog controls , but I'm having a little problem, that is: I use SetDlgItemText hDlg 6 F"{cs}" (beeing 'cs' the str variable with the value I want to put) but when this variable changes the info is updated on the dialog but it goes over the last value that was there, I mean, I doesn't clear the filed and shows the new value, it writes over it and you can't see anything.
How can I correct this?

This is my function:

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

str cs

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 320 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"
;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
/---Sys do bitmap---
int x(0) y(0) wid(955) hei(550) ;;change this
__MemBmp-- mb

sel message
,case WM_INITDIALOG
/---Timer do semaforo---
,SetTimer hDlg 1 1000 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")
,f2.SetDialogFontColor(hDlg 0x00CC00 "8")
,f3.SetDialogFontColor(hDlg 0xFFFFFF "7 11 12 13 14 15 16")
,f4.SetDialogFontColor(hDlg 0xFFFFFF "6 9")
/---Load Image de fundo---
,_s="S:\***\background.jpg"
,int hb=LoadPictureFile(_s); if(!hb) ret
,hb=CopyImage(hb IMAGE_BITMAP wid hei LR_COPYDELETEORG|LR_COPYRETURNORG)
,mb.Attach(hb)
,RedrawWindow hDlg 0 0 RDW_INVALIDATE

,case WM_TIMER
,str fcs="S:\***\CS.txt"
,sel wParam
,,case 1
,,cs.getfile(fcs)
,,SetDlgItemText hDlg 6 F"{cs}"

,case WM_DESTROY
,case WM_COMMAND goto messages2
/---Bitmaps---
,case WM_PAINT
,PAINTSTRUCT p; int dc=BeginPaint(hDlg &p)
,BitBlt dc x y wid hei mb.dc 0 0 SRCCOPY
,EndPaint hDlg &p

ret

;messages2
sel wParam

,case IDOK
,case IDCANCEL
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)