Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SetDialogFont (background)
#1
Hello there,

I'm using this function SetDialogFont but I'm having trouble putting a background color.
I have this dialog with a background color and for the text I used a different format with a diferent font, size and color but the problem is that on those fields that I changed the font, the background is not formated to the color I chose. This is what I got:

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





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

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 1280 650 "RESUMO DA REDE"
;3 Static 0x54000000 0x0 50 20 280 70 "CS'S"
;4 Static 0x54000000 0x0 50 120 340 70 "ASSIGNED"
;5 Static 0x54000000 0x0 50 220 520 70 "ÚLTIMO AUDIT"
;6 Static 0x54807000 0x0 800 20 400 70 "3213231"
;7 Static 0x54800000 0x0 800 120 400 70 "5498561"
;8 Static 0x54800000 0x0 800 220 400 70 "ACEITE !"
;10 Static 0x54000000 0x0 160 400 300 200 " ";Verde
;11 Static 0x54000000 0x0 506 400 300 200 " ";Amarelo
;12 Static 0x54000000 0x0 850 400 300 200 " ";Vermelho
;13 Static 0x54000000 0x0 0 0 1282 650 "  "
;1 Button 0x54030001 0x4 702 102 0 0 "OK"
;2 Button 0x54030000 0x4 712 134 0 0 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030408 "" "" "" ""

ret
;messages
__GdiHandle- t_brush
__GdiHandle- t_brush2
__GdiHandle- t_brush3
__GdiHandle- t_brush4
__GdiHandle- t_brush5

sel message
,case WM_INITDIALOG
/-----Fonte e tamanho----
,__Font-- f
,__Font-- f2
,f.Create("Comic sans ms" 70 1)
,f.SetDialogFont(hDlg "3 4 5 6 7 9")
,f.SetDialogFontColor(hDlg 0x000000 "3 4 5 6 7 9")
,f2.Create("Comic sans ms" 70 1)
,f2.SetDialogFont(hDlg "8")
,f2.SetDialogFontColor(hDlg 0x009900 "8")

/---Sys da pintura de background---
,t_brush=CreateSolidBrush(0x00CCFF) ;;create brush of random color
,InvalidateRect id(13 hDlg) 0 1 ;;redraw; then it sends WM_CTLCOLORSTATIC
,t_brush2=CreateSolidBrush(0x009900) ;;create brush of random color
,InvalidateRect id(10 hDlg) 0 1 ;;redraw; then it sends WM_CTLCOLORSTATIC
,t_brush3=CreateSolidBrush(0x00FFFF) ;;create brush of random color
,InvalidateRect id(11 hDlg) 0 1 ;;redraw; then it sends WM_CTLCOLORSTATIC
,t_brush4=CreateSolidBrush(0x000099) ;;create brush of random color
,InvalidateRect id(12 hDlg) 0 1 ;;redraw; then it sends WM_CTLCOLORSTATIC

,case WM_DESTROY
,case WM_COMMAND goto messages2

/---Pintura dos fields---
,case WM_CTLCOLORSTATIC
,sel GetDlgCtrlID(lParam)
,,case 13
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush
,sel GetDlgCtrlID(lParam)
,,case 10
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush2
,sel GetDlgCtrlID(lParam)
,,case 11
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush3
,sel GetDlgCtrlID(lParam)
,,case 12
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush4

ret

;messages2
sel wParam


,case IDOK
,case IDCANCEL
ret 1

How can I edit the text field background?

Thank you very much!
#2
Replace
f.SetDialogFontColor
to
DT_SetTextColor

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

if(!ShowDialog("Dialog124" &Dialog124 0)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;3 Static 0x54000000 0x0 10 14 80 38 "Text"
;4 Static 0x54000000 0x0 110 46 48 12 "Text"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030503 "*" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,__Font-- f.Create("Comic sans ms" 30 1) f2.Create("Arial" 9 2)
,f.SetDialogFont(hDlg "3")
,f2.SetDialogFont(hDlg "4")
,
,DT_SetTextColor hDlg 0xFF0000 "3"
,DT_SetTextColor hDlg 0xC0 "4"
,
,__GdiHandle- t_brush=CreateSolidBrush(0x00CCFF) ;;create brush of random color
,__GdiHandle- t_brush2=CreateSolidBrush(0x009900) ;;create brush of random color
,
,DT_SetBackgroundColor hDlg 2 0xff8080 0xf0f0f0
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
,
,case WM_CTLCOLORSTATIC
,;out GetDlgCtrlID(lParam)
,sel GetDlgCtrlID(lParam)
,,case 3
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush
,,case 4
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#3
Great! Now let's say that I want to apply different brushes every second - Exemple:

I have a static box with red brush. Next second is green, next second is red again, and so on...
I can't get it to work =\
I tried on WM_CTLCOLORSTATIC to use "sel" with the seconds of the clock but can't make it work!

Can you help?

I still a lot of questions about dialogs so I'm going to ask on this topic but feel free to answer whenever you want.

Thanks again!

Edit: - Actually I saw examples in the forum of how can you change colors of some static elements but the problem is it's always triggered by a button, I would like to do it triggered by a timer.
#4
Function Dialog124
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("Dialog124" &Dialog124 0)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;3 Static 0x54000000 0x0 8 14 58 22 "Text"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030503 "*" "" "" ""

ret
;messages
__GdiHandle- t_brush
sel message
,case WM_INITDIALOG
,SetTimer hDlg 1 1000 0
,SendMessage hDlg WM_TIMER 1 0
,
,case WM_TIMER
,sel wParam
,,case 1
,,t_brush.Delete; t_brush=CreateSolidBrush(RandomInt(0 0xffffff))
,,InvalidateRect id(3 hDlg) 0 1 ;;redraw; then it sends WM_CTLCOLORSTATIC
,,
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CTLCOLORSTATIC
,sel GetDlgCtrlID(lParam)
,,case 3
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#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
#6
I did not test, but maybe replacing x.SetDialogFontColor to DT_SetTextColor will fix it.
SetDialogFontColor is obsolete, it has some problems.
#7
Problem solved but other problem emerged.
I guess this is a known problem because you said here DT_SetTextColor problem that DT_SetTextColor can't be used with a bitmap background.

Is this true? Or is there a way to do it?
#8
Use DT_SetBackgroundImage instead of WM_PAINT.
If need to resize, SaveBitmap the resized bitmap to a temporary file and load it.

Function resumo_remote_metade
Code:
Copy      Help
/---Load Image de fundo---
,_s="Q:\test\app_55.png"
,__GdiHandle hb=LoadPictureFile(_s); if(!hb) ret
,hb=CopyImage(hb IMAGE_BITMAP wid hei LR_COPYDELETEORG|LR_COPYRETURNORG)
,SaveBitmap hb _s.from("$temp$\b.bmp")
,DT_SetBackgroundImage hDlg _s

and remove the WM_PAINT code.

In current version DT_SetTextColor does not steal WM_CTLCOLORSTATIC. Forgot to remove the statement from DT_SetTextColor help.
#9
Gintaras Sir, you rock Big Grin
#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
#11
Function Dialog124
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

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

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030503 "" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,SetTimer hDlg 1 2000 0 ;;timer 1
,SetTimer hDlg 2 1000 0 ;;timer 2
,
,case WM_TIMER
,sel wParam
,,case 1
,,;timer 1 code
,,;...
,,
,,case 2
,,;timer 2 code
,,DateTime dt; int hour
,,dt.FromComputerTime; dt.GetParts(0 0 0 hour)
,,sel hour
,,,case 14: out "IN PROGRESS"
,,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#12
Thanks one more time!
#13
Hey there, so I have another question which may be a simple one:

I have two Dialogs, and I want that by using an action on one of the dialogs I could change something in the second.
For example:
On the first Dialog I have one button and by pressing that button, the color on a static text field on the second Dialog would change (DT_SetTextColor(hDlg 0x33FFFF "8"))

Can that be done?

Thanks one more time
#14
Let dialog1 send a message to dialog2, and dialog2 change colors etc when it receives the message. Use messages WM_APP+0, +1, +2 etc.

Dialog1:
sel wParam
,...
,case 3 ;;button 3 pressed
,SendMessage win("Dialog2") WM_APP+5 0 0 ;;notify Dialog2 to do something

Dialog2:
sel message
,...
,case WM_APP+5
,;do something
#15
Got it!

Thank you very much one more time!
#16
But now, what if the Dialog is in a Network computer? Do I need to use "Net" function?

Thanks again
#17
Yes, then can use net (if receiver is not exe) or TcpSocket class.
TCP/IP server and client
#18
ačiū !
#19
I'm trying to make this work using TcpSocket but there is on problem:
TcpSocket.Send is always expecting a string, how can I send a "SendMessage" ?

Thanks!

Edit: wait wait wait... I'll try something on the server side
Edit 2: Managed! Big Grin
#20
Hey Gintaras, quick question.
This is my dialog:

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

str s1 s2 s3 s4 ss ss1
int i

str controls = "3"
str ax3SHD

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 640 325 "RESUMO DA REDE"
;4 Static 0x54000000 0x0 40 10 120 35 "HORAS"
;11 Static 0x50000000 0x0 91 50 160 20 "TCO - BRASÍLIA"
;12 Static 0x50000000 0x0 90 110 150 20 "TCO - MANAUS"
;17 Static 0x50000000 0x0 101 170 150 20 "TNE - RECIFE"
;13 Static 0x50000000 0x0 100 230 150 20 "TNO - BELÉM"
;14 Static 0x54800000 0x0 22 75 120 30 "HORAS BRASILIA"
;15 Static 0x54800000 0x0 22 135 120 30 "HORAS MANAUS"
;16 Static 0x54800000 0x0 22 195 120 30 "HORAS RECIFE"
;18 Static 0x54800000 0x0 22 255 120 30 "HORAS BELEM"
;19 Static 0x54000000 0x0 185 10 120 35 "TEMP"
;20 Static 0x54000000 0x0 350 10 220 35 "METEREOLOGIA"
;22 Static 0x54800000 0x0 185 75 70 30 "TEMP BRASILIA"
;23 Static 0x54800000 0x0 185 135 70 30 "TEMP MANAUS"
;24 Static 0x54800000 0x0 185 195 70 30 "TEMP RECIFE"
;25 Static 0x54800000 0x0 185 255 70 30 "TEMP BELEM"
;3 ActiveX 0x54030000 0x0 300 60 323 226 "SHDocVw.WebBrowser"
;1 Button 0x54030001 0x4 315 102 0 0 "OK"
;2 Button 0x54030000 0x4 712 134 0 0 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030408 "" "" "" ""


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

ret
;messages
/---Variável do timer do audit---
int-- timervar
/---Sys do bitmap---
int x(0) y(0) wid(1300) hei(800) ;;change this
__MemBmp-- mb


sel message

,case WM_INITDIALOG
,SHDocVw.WebBrowser b
/---Timer---
,SetTimer hDlg 1 1000 0 ;;timer de um segundo
,SetTimer hDlg 2 10000 0 ;;timer de uma hora
,SendMessage hDlg WM_TIMER 1 0
/-----Fonte,tamanho e cor----
,__Font-- f.Create("Calibri" 15 1) f2.Create("Calibri" 25 1)  f3.Create("Calibri" 35 1) f4.Create("Calibri" 35 1)
,f.SetDialogFont(hDlg "3 5 6")
,f2.SetDialogFont(hDlg "11 12 13 17")
,f3.SetDialogFont(hDlg "4 19 20")
,f4.SetDialogFont(hDlg "14 15 16 18")
,f.SetDialogFontColor(hDlg 0x999999 "4 19 20")
,DT_SetTextColor(hDlg 0xFF9900 "11 12 13 17")
,DT_SetTextColor(hDlg 0xFFFFFF "14 15 16 18")

/---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
,sel wParam
,,case 1
/---Horas---
,,DateTime dth dtm dts; int hour hourb hourb1 minute second
,,dth.FromComputerTime; dth.GetParts(0 0 0 hour)
,,dtm.FromComputerTime; dtm.GetParts(0 0 0 0 minute)
,,dts.FromComputerTime; dts.GetParts(0 0 0 0 0 second)
,,hourb=hour-4
,,hourb1=hour-5
,,ss.format("%02i:%02i:%02i" hourb minute second)
,,ss.setwintext(id(14 hDlg)) ss.setwintext(id(16 hDlg)) ss.setwintext(id(18 hDlg))
,,ss1.format("%02i:%02i:%02i" hourb1 minute second)
,,ss1.setwintext(id(15 hDlg))
,,case 2
/---Refresh do mapa de metereologia---
,,b._getcontrol(id(3 hDlg))
,,b.Navigate("http://imagens.climatempo.com.br/mapas/brasil_prev1_menor.gif")



,case WM_DESTROY
,KillTimer(hDlg 1)

,case WM_COMMAND goto messages2

ret

;messages2

sel wParam
,case IDOK
,case IDCANCEL
ret 1

What I want to do is to stretch the webbrowser and the image alltogether because if I stretch the webbrowser the image stay the same size.
Thank you very much!
#21
Function resumo_remote_2_metade
Code:
Copy      Help
str controls = "3"
str ax3SHD
ax3SHD=
;<html><head>
;<style>
;body { margin: 0 0 0 0; overflow: auto; }
;img.bg { top: 0; left: 0; width: 100%; height: auto; position: fixed; }
;</style>
;</head>
;<body>
;<img class="bg" src="http://imagens.climatempo.com.br/mapas/brasil_prev1_menor.gif">
;</body></html>

if(!ShowDialog("resumo_remote_2_metade" &resumo_remote_2_metade &controls)) ret
Function resumo_remote_2_metade
Code:
Copy      Help
/---Refresh do mapa de metereologia---
,,b._getcontrol(id(3 hDlg))
,,b.Refresh

http://css-tricks.com/perfect-full-page ... und-image/
#22
As always gintaras, you rock!

Thanks one more time!!!


Forum Jump:


Users browsing this thread: 2 Guest(s)