Para Rafael Clemente e Biel, Maps Google!

Para Rafael Clemente e Biel, Maps Google!

Postby FWHISHOW » Wed Dec 19, 2007 10:14 am

Utilizo tambem este código para presentar una página .html en una ventana FWH (gracias, José Luis Capel!):

Code:
DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"
oActiveX = TActiveX():New( oWnd, "Shell.Explorer.2" )
oWnd:oClient = oActiveX // To fill the entire window surface
oActiveX:Do("Navigate2",(CurDrive() + ":\"+CurDir()+"\MiHtml.htm"))
ACTIVATE WINDOW oWnd


Acontece que não obtive sucesso em ver o mapa, executando diretamente a pagina html percebi que o Internet explorer me apresenta uma tarja amarela dizendo:

Para protejer sua segurança, o internet exeplorer impediu este site de exibir conteudo ativo que possa acessar seu computador.


Image


Gratos
FWHISHOW
 
Posts: 80
Joined: Thu Nov 29, 2007 2:01 pm

Postby Biel EA6DD » Wed Dec 19, 2007 12:19 pm

Es un mensaje de seguridad de windows, pulsa sobre la linea amarilla, y autoriza la ejecucion de la pagina.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
User avatar
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca

Postby Rafael Clemente » Wed Dec 19, 2007 12:22 pm

Biel tiene razón: Simplemente autoriza la presentación de la página. Cuando se ve desde programa, ese mensaje no debería aparecer.
Rafael
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Postby FWHISHOW » Wed Dec 19, 2007 12:36 pm

Amigos Rafael Clemente e Biel, autorizando mesmo assim não me mostra veja:

Image

Image


porém se executar diretamente a pagina HTML utilizando o firefox ai funciona normalmente:

Image


PRG:

#INCLUDE "FIVEWIN.CH"

FUNCTION MAIN()

LOCAL oDlg, oRadio1, oGet1, obtn
LOCAL cCurrency := "USD "
LOCAL nOption := 1

DEFINE DIALOG oDlg ;
FROM 1, 1 TO 10, 30

@ 1, 1 RADIO oRadio1 VAR nOption OF oDlg UPDATE ;
PROMPT "Estatua Libertad ", "Fortaleny - Valencia - Espa?a", "Torre Eiffel - Par?s "

@ 3, 1 BUTTON oBtn PROMPT "Ver el Mapa" ACTION VerMapa (oDlg, nOption)

ACTIVATE DIALOG oDlg CENTERED

RETURN NIL

Function VerMapa( oDlgp, nMapa )
local ownd, oactivex



LOCAL cHtml
LOCAL nLat, nLon, nZoom

DO CASE
CASE nMapa == 1
nLat := 48.858333
nLon := 2.295000
nZoom := 20
CASE nMapa == 2
nLat := 39.183994491715936
nLon := -0.31486988067626952
nZoom := 18
CASE nMapa == 3
nLat := 40.689360
nLon := -74.044400
nZoom := 20
ENDCASE

cHtml := [ <html> <head> ]+CRLF
cHtml += [ <meta http-equiv="content-type" content="text/html; charset=utf-8"/> ]+CRLF
cHtml += [ <title>Google Maps</title> ]+CRLF
cHtml += [ <script src="http://maps.google.com/maps?file=api&v=2&key=1223" type="text/javascript"></script> ]+CRLF
cHtml += [ <script type="text/javascript"> ]+CRLF
cHtml += " //<![CDATA[ " +CRLF
cHtml += " function load() "+CRLF
cHtml += " { if (GBrowserIsCompatible()) "+CRLF
cHtml += [ { var map = new GMap2(document.getElementById("map"),G_SATELLITE_TYPE); ] + CRLF
cHtml += " map.addControl(new GLargeMapControl()); "+CRLF
cHTML += " map.addControl(new GMapTypeControl()); "+CRLF
cHTML += " map.addControl(new GOverviewMapControl()); "+CRLF
cHTML += " map.setCenter(new GLatLng(<<<LAT>>>, "+CRLF
CHTML += " <<<LONG>>>),<<<ZOOM>>>); "+CRLF
CHTML += " map.setMapType(G_HYBRID_TYPE); "+CRLF
CHTML += " } } "+CRLF
CHTML += " //]]> </script> </head> "+CRLF
CHTML += [ <body scroll="no" bgcolor="#CCCCCC" topmargin="0" leftmargin="0" ] +CRLF
CHTML += [ onload="load()" onunload="GUnload()"> ] + CRLF
chtml += [ <div id="map" style="width:450px;height:300px"></div> ] + CRLF
chtml += [ </body> </html> ]

cHtml := STRTRAN(cHtml, "<<<LONG>>>",STR(nLon) )
cHtml := STRTRAN(cHtml, "<<<LAT>>>",STR(nLat) )
cHtml := STRTRAN(cHtml, "<<<ZOOM>>>",STR(nZoom) )

MemoWrit("mihtml.htm",chtml)

DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"

oActiveX = TActiveX():New( oWnd, "Shell.Explorer.2" )

oWnd:oClient = oActiveX // To fill the entire window surface

oActiveX:Do("Navigate2",(CurDrive() + ":\"+CurDir()+"\MiHtml.htm"))

ACTIVATE WINDOW oWnd
RETUR NIL




Amigos eu utilizo FWH7.1 e xHarbour 99.71 e percebi que só esta acontecendo isso porque tento abrir uma pagina na minha maquina se estiver hospedada na rede (NET) funciona muito bem.

Grato
FWHISHOW
 
Posts: 80
Joined: Thu Nov 29, 2007 2:01 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 46 guests