Widget to display web page

Hi,

I am a developer and have just started looking into DesktopX, and compared with many other solutions out there I have to say that I like it quite a lot. OK, to get to the point:

I need to create a widget that will display any page (configurable) in a widget. At this point I am hardcoding the web address into the script, I'm pretty sure that I can figure out how to the customization allowing the web site to be set by the user.

I have been able to accomplish this to some degree by creating an object with the following code:

Sub Object_OnScriptEnter
Control.Navigate2 "http://www.somesite.com"
End Sub

But I am having the following problems with this method:

1. One is unable to do anything with the widget, and it can only by moved with a right-click. Is that normal?
2. I would like to display some sort of frame around it. I tried to set the option looking at the picture frame widget (which seems to do that in the States->Appearance tab), but this tab is not available in my object.

The frame is really the most crucial thing for me I believe at this point, so any help with this would be appreciated.


Thanks!
9,633 views 28 replies
Reply #1 Top
Have you looked at (downloaded, imported into builder) some of the existing Browser widgets in the libraries? There are a number of different implementations of browsers.

Posted via WinCustomize Browser/Stardock Central
Reply #2 Top
Ahem - no! I will search through the widget gallery right now - I assume that's what you mean - right?

Thanks!
Reply #3 Top
I made a really bad browser called Browser central. However, it appears to be corrupted.

I cross posted it to my blog here: http://www.klenkefamily.net/blog/archive/2005_03_13_archive.htm

It was an interesting test for me, I used the TabletPC to create a font based on my handwriting and embedded it in the widget.

The version I built for work had a nice splash screen that minimized tothe systray after 3 seconds. Nice.



Posted via WinCustomize Browser/Stardock Central
Reply #4 Top
thanks for the info - I actually found a browser template that made me realize a basic concept that I had been missing so far - that I can group objects!!!

I have a frame now that seems to work well, and now the only thing I need to figure out is how I can set properties for this thing that will determine the URL where the browser goes ...


Thanks again
Reply #5 Top
Have you read the Developer's Guide here: https://www.stardock.com/products/desktopx/documentation/index.html

It's probably Stardock's best effort at documenting and it's awesome.


Posted via WinCustomize Browser/Stardock Central
Reply #6 Top
Awesome? I don't know, I find the entire DesktopX experience to be utterly confusing, and I have no idea how to get the preferences up.

So far, when you right-click, all you see is "Remove". I added that funny code to show the preferences, but nothing happens - I'm probably missing something basic.

Plus, the little "browser" I built only loads on the computer where I built it - and not on another one for whatever reason. So close, yet so far.
Reply #7 Top
OK, I didn't show up on the other computer because I had the coordinates off the screen (the screen I'm on is a 23" and the other one a laptop)

Still leaves me with the quest to display the preferences ...

Reply #8 Top
Take a look at Brad's post for instructions on adding content to the preference tab: https://www.joeuser.com/index.asp?AID=67611

I'd get rid of that 23" monitor. It's throwing off you groove.

I however, have no groove AND a 15" monitor. Sounds like a good trade!


Posted via WinCustomize Browser/Stardock Central
Reply #9 Top
Zubaz has no groove



Reply #10 Top
But it could be worse . . I could be a troll.

Posted via WinCustomize Browser/Stardock Central
Reply #11 Top
Reply #12 Top
Well, I don't have any groove creating widgets either apparently ..

Thanks - I had actually already looked at that article where you sent me the link, but it's not working - at least not for me.

I added some code to the startup part but I can't access any properties. Whenever I right-click that widget (the frame that is), all I see is "Remove". Other widgets have "About", "Properties" etc.

The thing that I don't understand about preferences and scripts is where to add them to. Right now, I have two objects: One is the Microsoft Web Browser that I use to display the web page, the other one is the frame that's around it.

I can associate a script with both of them, but to which one do I add the preference thing? I figured it would be the frame, since I can right-click the frame. If I right-click the web browser, I get the Internet Explorer context menu.

In either case, I don't see the (in my opinion lame) documentation mentioning that? I added the following code:

'Called when the script is executed
Sub Object_OnScriptEnter
Widget.AddPreference "URL"
Widget.Preference("URL").Value = "http://mywebserver/dashboard_widget.asp?PROFILE=Default&COMPUTER=KANGAROO"
End Sub

'Called when the script is terminated
Sub Object_OnScriptExit

End Sub

Sub Widget_OnPreferencesChange
Object_OnTimer123
End Sub

But I can't get a context menu to appear. What am I missing here?


thanks!
Reply #13 Top
The code I used to add a preference to the properties is:
Widget.AddPreference "URL"
Widget.Preference("URL").Type = "Text"
Widget.Preference("URL").Value = "http: //www.klenkefamily. net"

That code should be added to the frame, not the browser object. I'd add some text explaining what it's for.

The browser object should have a sub that looks for
Sub Widget_OnPreferencesChange()
and calls
Widget.Preference("URL").Value

As has been confirned though, I have no DX groove and trial and error is your (my) best bet until someone smarter comes along.

{And how hard nac that be? }


Posted via WinCustomize Browser/Stardock Central
Reply #14 Top
OK, I did just that. But how do I access the preferences?? I right-click the frame and all I see is "Remove" ...

Reply #15 Top
Did you export as a widget? Exporting as an object won't give you the preference options.

Posted via WinCustomize Browser/Stardock Central
Reply #16 Top
Hahaha! Did I mention that I was working with the free version

Well, yes, I exported is an object and that's why I never saw anything. Just bought the Pro edition and now I actually have the PROPERTIES option and can see my thing there.

Hurray!!!

Now I just have to make it work and I'll be very happy!

I'll post follow-ups here if I run into any other problems ...


Thanks!
Reply #17 Top
Did I mention that I was working with the free version


GAH!!!!!!

Glad you figured that part out.

I guess I should have asked version information earlier. -=sigh=-

For all you kids out there; objects do not equal widgets or gadgets.


Posted via WinCustomize Browser/Stardock Central
Reply #18 Top
Yeah, that was silly on my part. Sorry.

Now I'm running into something else - obviously. Though I'm pretty close. The preferences work now and are nice.

However, as you know I have one object for the web browser, and the other one for the frame. The preferences are defined in the frame, as is a global variable.

However, how can I control the web browser from the frame? I looked at the object namespaces and the desktopx namespaces, but I don't get it. I know the name of my frame object, but not the name of the web browser ...

Basically, once the preferences are changed I want to load a different page in the browser object ...
Reply #19 Top
I might be missing something else here - but how can I SEARCH the forums??
Reply #20 Top
Take a look at the basic browser here (by Martin): https://www.wincustomize.com/ViewSkin.aspx?SID=1&SkinID=79&LibID=34

I think that you can use the preferences like he used the URL field.


Posted via WinCustomize Browser/Stardock Central
Reply #21 Top
I might be missing something else here - but how can I SEARCH the forums??


In the lower left hand of wincustomize.com there is a small text field and a combobox. There you go.

While we are on the subject of search, the Wincustomize browser rocks for finding skins/objects/etc. It's worth the subscription price just for that.


Posted via WinCustomize Browser/Stardock Central
Reply #22 Top
Hmm, he just referred to it as "browser" ... I suppose I will just try that.
Reply #23 Top
OK, I will search there.

Is Widget_OnPreferencesChange really called after I click the "OK" button on the preferences?

I put a MsgBox statement in there but it's not doing anything ...
Reply #24 Top
Oh, and the search feature - sorry - sucks because it doesn't work. Search for

Widget_OnPreferencesChange

in there and you won't get one result - even though I just posted something myself?

Also, why don't they add this to the forums page itself? All these web pages seems pretty patched together if you ask me ...
Reply #25 Top
You've only been a member for a day . . . there is a one week probation befoer you can start complaining about the search!

Next week is search complaints. The following week is how some app doesn't work for you and you want a refund. The third week you must post four questions already answered in the top fie results.

At that point you may have uploaded something and you get to start the "Ratings are unfair" series.

Welcome to the community!


Posted via WinCustomize Browser/Stardock Central