SDB.WebControl

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Mike H
Posts: 39
Joined: Mon Mar 06, 2006 7:51 pm
Location: York, UK

SDB.WebControl

Post by Mike H » Sun Mar 12, 2006 10:01 am

I notice from exploring the MediaMonkey type library that there is a ISDBApplication.WebControl property in RC3, which returns an instance of WebBrowser.

How do you get the browser to display?

Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium
Contact:

Post by Steegy » Sun Mar 12, 2006 11:40 am

I have a little trick for you:

Code: Select all

Set WB = SDB.WebControl
WB.Navigate "http://www.steegy.be"
:lol: :lol:

(The browser window already has to be visible)

Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).

Mike H
Posts: 39
Joined: Mon Mar 06, 2006 7:51 pm
Location: York, UK

Post by Mike H » Sun Mar 12, 2006 12:12 pm

Is it possible to make it visible on arbitrary nodes?

Admittedly I was only mucking around inside an ActiveX control explorer, but I couldn't see any way to make it visible.

I was wondering if I could make the podcast node from my plugin display a webpage (podcast directory of some kind).

Using the integrated web browser has been mentioned a few times, but I can't find out how you could make it display.

Thanks, Mike.

jiri
Posts: 5395
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri » Sun Mar 12, 2006 4:01 pm

I thought I have already posted it somewhere, but anyway here is a short example how to do it:

Code: Select all

Sub OnStartup
  Set Tree = SDB.MainTree

  Set Node = Tree.CreateNode
  Node.Caption = "Test Web"
  Node.IconIndex = 0
  Script.RegisterEvent Node, "OnNodeFocused", "NodeFocus"
  Script.RegisterEvent Tree.Node_Artist, "OnNodeFocused", "NodeFocus"

  Tree.AddNode Tree.Node_Artist, Node, 1     ' Insert after the node
  Node.HasChildren = True
End Sub

Function NodeFocus( Node)
  NodeFocus = 2
  SDB.WebControl.Navigate "http://www.mediamonkey.com"
End Function

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto » Tue Mar 21, 2006 6:42 am

I'm trying to get a script to use the WebControl and I can get the page to display if there is already a webnode displayed, but I can't get the webcontrol to focus otherwise. How do you do this (not from a node)?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.

jiri
Posts: 5395
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri » Tue Mar 21, 2006 6:48 am

I think that it isn't possible, actually it wouldn't be too logical in my opinion too have web browser visible for a node where otherwise track list is shown. You can either:

- Select (using script commands) your node and thus show web browser.
- Or show web browser separately, e.g. on a dockable panel.

Jiri

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto » Tue Mar 21, 2006 7:01 am

Good point! Ok, I'm sorted now - cheers :)

Unrelated question - is there any way to know (from code) what background image or colours the user has currently?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.

jiri
Posts: 5395
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri » Tue Mar 21, 2006 7:27 am

No, it isn't possible yet. I think it would make sense to add some support for skin/images support in MM.

Jiri

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto » Tue Mar 21, 2006 7:28 am

Yes, with dockable panels now available, being able to colour them to match the users skin would be very useful. Cheers! :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.

winnie666

Post by winnie666 » Wed May 17, 2006 2:18 pm

Jiri could you give a long example of how to add a node under the web node? :)

DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo » Thu May 18, 2006 3:54 am

@winnie666
I just tried it here

You just copy the code, and save it to a .vbs file in the MediaMonkey\Scripts\Auto folder

Start up MediaMonkey, and you'll have a web node under /Library/Test Web
Image

winnie666

Post by winnie666 » Thu May 18, 2006 7:00 am

aah! you are a good man! i am a total lamer and i was just coping code at random in the Scripts/Scripts.ini file and then creating a .vbs file into the folder since all the inbuilt scripts are there. :) i was just fooling around actually since i have to idea how to script, but thnx a lot! that fixed it!

DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo » Thu May 18, 2006 7:10 am

I think if you see

Code: Select all

Sub OnStartup
In the top of any script, you can assume it's one that just drops into the \Auto folder. Makes it easy to try out and easy to take out.
Image

winnie666

Post by winnie666 » Thu May 18, 2006 7:11 am

uups, now the website shows up even when i click on the artis node! i just changed the name it shows and the link!

winnie666

Post by winnie666 » Thu May 18, 2006 7:12 am

Well yeah, but you can also asume from the scripts.ini file that while all the other scripts dont run on startup this one does :) Damn it i will become a member...

Post Reply