FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log inLog in 


Accessing a specific URL from within the code

Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog
View previous topic :: View next topic  
Author Message
Frank



USA
Joined: 23 Nov 2014
Posts: 17

PostPosted: 20 Feb 2017 5:30    Post subject: Accessing a specific URL from within the code Reply with quote

Hello,
Environment VP 7.4 Commercial Edition.
I am trying to access an specific URL www.abc.com from within a dialog box when someone clicks on the cancel button. I am using the following code inside the program :

...
predicates
    onCancelClick : button::clickResponder.
clauses
    onCancelClick(_Source ) = button::defaultAction:-
      URL = "www.abc.com",
    cancel_ctl:navigate(URL).
...

When I compile I get an error message: undeclared identifier ' navigate/1'

I would appreciate any feedback.

Thanks,
Frank
Back to top
View user's profile Send private message
Thomas Linder Puls



Copenhagen, Denmark
Joined: 28 Feb 2000
Posts: 3124

PostPosted: 21 Feb 2017 8:49    Post subject: Reply with quote

A button is a user interface element that can basically receive clicks, to "access a URL" you will need something that can do that.

It is however not clear what you mean by "access a URL". Should it open in an external browser or do you which to load it somewhere in your dialog, or what?

_________________
Regards Thomas Linder Puls
Prolog Development Center
Back to top
View user's profile Send private message
Frank



USA
Joined: 23 Nov 2014
Posts: 17

PostPosted: 21 Feb 2017 17:29    Post subject: Accessing a specific URL from within the code Reply with quote

Thanks Thomas.

All I want to open the website in an external browser, once the button is clicked.

Or alternatively if it makes it easier, I would like to put a URL link in my dialog box such that once someone clicks on that to open that website in an external browser.

Best,
Frank
Back to top
View user's profile Send private message
Frank



USA
Joined: 23 Nov 2014
Posts: 17

PostPosted: 24 Feb 2017 18:46    Post subject: Accessing a specific URL from within the code Reply with quote

I was able to find the webBrowser code in the example section that deals with the URLs.
Apparently opening a URL in an external browser is achieved through the webBrowserControl type control( which is not an standard Control) on the Form. But I cannot figure out how to include such a control on a Form.
Back to top
View user's profile Send private message
Thomas Linder Puls



Copenhagen, Denmark
Joined: 28 Feb 2000
Posts: 3124

PostPosted: 26 Feb 2017 13:55    Post subject: Reply with quote

If you want to open an URL in an independent browser, which your program should not otherwise control or interact with, then you should use call shell_api::shellOpen with the URL.

But if you want to open it in a separate browser that your program control, then you should use the internetExplorer class.

And finally if you want to have a web browser embedded directly in your own dialog then you should use the webBrowser control.

_________________
Regards Thomas Linder Puls
Prolog Development Center
Back to top
View user's profile Send private message
Frank



USA
Joined: 23 Nov 2014
Posts: 17

PostPosted: 26 Feb 2017 18:12    Post subject: Accessing a specific URL from within the code Reply with quote

Thank you Thomas.
For now I used webBrowser control and it works fine for what I wanted to do.

Best,
Frank
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum