General Help regarding HMG, Compilation, Linking, Samples
Moderator: Rathinagiri
serge_girard
Posts: 3165 Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB 2 DBF
Location: Belgium
Contact:
Post
by serge_girard » Mon Dec 30, 2013 2:34 pm
Hello all !
Probably my last question this year....
How can I get the url address in my textbox when I leave a page.
I start (for example) in
http://www.hmgforum.com and then click on 'active posts' it gives something like
http://hmgforum.com/search.php?search_i ... 98e616821. .
How can I retrieve this location in my program?
Thanks to all and a happy newyear !
Serge
Code: Select all
#INCLUDe "hmg.ch"
cAddress := 'http://www.hmgforum.com'
DEFINE WINDOW mainx ;
AT 0,0 ;
WIDTH 1300 ;
HEIGHT 900 ;
TITLE 'TEST ' ;
MAIN
@ 10,10 TEXTBOX T_cAddress ;
WIDTH 400 ;
VALUE cAddress
@ 50,10 ACTIVEX Test ;
WIDTH 1250 ;
HEIGHT 800 ;
PROGID "shell.explorer.2"
END WINDOW
mainx.Test.Object:Navigate(cAddress)
CENTER WINDOW mainx
ACTIVATE WINDOW mainx
RETURN
There's nothing you can do that can't be done...
srvet_claudio
Posts: 2193 Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:
Post
by srvet_claudio » Tue Dec 31, 2013 1:31 am
Hi Serge,
this is a simplification of a program I use to know weather forecasts long term, this helps me make decisions about grazing livestock feed. I hope this demo is useful to you.
Code: Select all
#include "hmg.ch"
FUNCTION Main()
DEFINE WINDOW Win1 ;
AT 0,0 ;
WIDTH 800 ;
HEIGHT 600 ;
TITLE "Weather Forecasts";
MAIN;
ON PAINT ( Win1.Test.Width := Win1.Width - 28,;
Win1.Test.Height := Win1.Height- 95 )
DEFINE MAIN MENU
POPUP "CPTEC"
MENUITEM "Go.." ACTION Win1.Test.Object:Navigate("http://clima1.cptec.inpe.br/gpc/")
END POPUP
POPUP "IRI"
MENUITEM "Go ..." ACTION Win1.Test.Object:Navigate("http://iri.columbia.edu/our-expertise/climate/forecasts/seasonal-climate-forecasts/")
END POPUP
END MENU
DEFINE LABEL LABEL_1
ROW 0
COL 10
WIDTH 80
HEIGHT 24
VALUE "Http:"
END LABEL
DEFINE TEXTBOX TEXT_1
ROW 0
COL 100
WIDTH 500
HEIGHT 24
VALUE ""
END TEXTBOX
DEFINE BUTTON BTN_1
ROW 0
COL 610
WIDTH 24
HEIGHT 24
CAPTION "Go"
ACTION Win1.Test.Object:Navigate( Win1.Text_1.Value )
END BUTTON
DEFINE BUTTON BTN_2
ROW 0
COL 650
WIDTH 60
HEIGHT 24
CAPTION "Get URL"
ACTION Win1.Text_1.Value := Win1.Test.Object:LocationURL()
// Win1.Test.Object:Visible = .T.
// Win1.Test.Object:AddressBar := .T.
// Win1.Test.Object:GoHome ()
// Win1.Test.Object:Busy()
// Win1.Test.Object:GoSearch()
// Win1.Text_1.Value := Win1.Test.Object:LocationURL()
// * Win1.Test.Object:GoBack ()
// * Win1.Test.Object:GoForward ()
END BUTTON
DEFINE ACTIVEX Test
ROW 30
COL 10
WIDTH 100
HEIGHT 100
PROGID "shell.explorer.2"
END ACTIVEX
Win1.Test.Object:Navigate("about:blank")
END WINDOW
Center Window Win1
Activate Window Win1
RETURN NIL
serge_girard
Posts: 3165 Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB 2 DBF
Location: Belgium
Contact:
Post
by serge_girard » Tue Dec 31, 2013 8:29 am
Thanks Pablo & Claudio!
I will take look right away!
Serge
There's nothing you can do that can't be done...
serge_girard
Posts: 3165 Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB 2 DBF
Location: Belgium
Contact:
Post
by serge_girard » Tue Dec 31, 2013 8:49 am
Claudio,
This is working nice ! Pity that ACTIVEX don't accept ON CHANGE..
Thx !
Serge
There's nothing you can do that can't be done...
srvet_claudio
Posts: 2193 Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:
Post
by srvet_claudio » Tue Dec 31, 2013 3:27 pm
serge_girard wrote: Pity that ACTIVEX don't accept ON CHANGE.
Yes is pity.
serge_girard
Posts: 3165 Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB 2 DBF
Location: Belgium
Contact:
Post
by serge_girard » Tue Dec 31, 2013 3:34 pm
One solution is to put a TIMER function but that is .... bad and ugly programming...?
Thx anyway, Claudio !
Serge
There's nothing you can do that can't be done...
Pablo César
Posts: 4059 Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Post
by Pablo César » Fri Feb 24, 2017 12:49 pm
Claudio, thank you to share and almost goes unnoticed your usage of
Object .
srvet_claudio wrote: ↑ Tue Dec 31, 2013 1:31 am
Screen99.png (10.06 KiB) Viewed 3256 times
What it would be: a pre-set object or a variable name of the object type ?
Where this
Object is defined ? How it know it that's a object ?
Very clever indeed !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein