Page 1 of 1

How I can set more than 1 webgadget inside a window??

Posted: Wed Feb 08, 2017 6:11 pm
by Fasasoftware
Hi , i trying to working with this software, but it don't works. i need to put more than 2 webgadget.in a window..i think to put 8 webgadget...can somebody help me please??
Thanks a lot, Lestroso :oops:

Code: Select all

#myWindow = 0
#myWebGadget = 0
#myWebGadget2 = 0
#myTimer = 0

Global URL.s = "http://freeserv.dukascopy.com/ChartServer/chart?stock_id=1020&width=325&height=275&interval=60"
Global URL2.s = "http://freeserv.dukascopy.com/ChartServer/chart?stock_id=1022&width=325&height=275&interval=60"


Procedure Reload()
  ;Debug "Reload..."
  SetGadgetText(#myWebGadget, URL)
  SetGadgetText(#myWebGadget2, URL2)
EndProcedure

OpenWindow(#myWindow, 0, 0, 1000, 500, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
WebGadget(#myWebGadget, 10, 10, 900, 480, URL)
WebGadget(#myWebGadget2, 100, 100, 900, 480, URL2)
AddWindowTimer(#myWindow, #myTimer, 1000) ; 1 seconds...
BindEvent(#PB_Event_Timer, @Reload(), #myWindow, #myWebGadget)


Re: How I can set more than 1 webgadget inside a window??

Posted: Wed Feb 08, 2017 7:13 pm
by Peter
1.: #myWebGadget and #myWebGadget2 have the same value (0). myWebGadget2 overwrites myWebGadget.

2.: the width for #myWebGadget and #myWebGadget2 is to high (900px). They overlap each other.

3.: BindEvent() needs no 4th parameter (#myWebGadget).

Code: Select all

EnableExplicit

Enumeration ; Windows
	#myWindow
EndEnumeration

Enumeration ; Gadgets	
	#myWebGadget
	#myWebGadget2
EndEnumeration

Enumeration ; Timer
	#myTimer
EndEnumeration

Global URL.s = "http://freeserv.dukascopy.com/ChartServer/chart?stock_id=1020&width=325&height=275&interval=60"
Global URL2.s = "http://freeserv.dukascopy.com/ChartServer/chart?stock_id=1022&width=325&height=275&interval=60"

Procedure Reload()
	;Debug "Reload..."
	SetGadgetText(#myWebGadget, URL)
	SetGadgetText(#myWebGadget2, URL2)
EndProcedure

OpenWindow(#myWindow, 0, 0, 1000, 500, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
WebGadget(#myWebGadget,   10,  10, 350, 350, URL)
WebGadget(#myWebGadget2, 370,  10, 350, 350, URL2)
AddWindowTimer(#myWindow, #myTimer, 1000) ; 1 seconds...
BindEvent(#PB_Event_Timer, @Reload(), #myWindow)
Greetings ... Peter

Re: How I can set more than 1 webgadget inside a window??

Posted: Wed Feb 08, 2017 10:52 pm
by Fasasoftware
THanks a lot Peter!!! YoU helped thery much!!! And also Clear explanation of the problems!!!
Best regards,
Lestroso :D