INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Adding windows to plugin  (Read 2280 times)

llafriel

  • World Citizen
  • ***
  • Posts: 230
Adding windows to plugin
« on: October 25, 2009, 12:54:43 pm »

Hi again,

I feel I'm flooding the forum with questions atm..
I want to add a window(form) in my plugin. The problem is how to connect the new window/form to MC. I'm able to add a form and open it. But doing requests to MC's database doesn't work.
Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Adding windows to plugin
« Reply #1 on: October 25, 2009, 01:41:42 pm »

I feel I'm flooding the forum with questions atm..
Good!!  8)

I want to add a window(form) in my plugin. The problem is how to connect the new window/form to MC. I'm able to add a form and open it. But doing requests to MC's database doesn't work.
not sure if i understand the question. ive had a windows form in my plugin showing file info from the file playing now and volume(until the info panel came, still sometimes i think its a pity i took it away because it also worked on fullscreen etc).
how do you open the form? it should not be diferent from how you get data in your plugin. is it not updating, or do you get nothing..

 :)
gab
Logged

llafriel

  • World Citizen
  • ***
  • Posts: 230
Re: Adding windows to plugin
« Reply #2 on: October 25, 2009, 02:10:28 pm »

I'm doing a plugin for discogs, getting tag information, style/genre etc. In the maininterface my plugin I get a list of albums from MC. With these I do a search in discogs and get hits based upon the search. I want so select one hit, click a button and go into a window which retrieves the album info. This part works fine. In the popup window I also want to get the local files from MC to compare with the info from discogs. This doesn't work.  It seems my new window is missing the link to MC?
Logged

ThoBar

  • Citizen of the Universe
  • *****
  • Posts: 992
  • Was confishy
Re: Adding windows to plugin
« Reply #3 on: October 25, 2009, 09:36:47 pm »

I call the new window passing a reference to the MC object to it...

So the calling code is ...
Code: [Select]
Form_RuleSetEdit subForm = new Form_RuleSetEdit(mediaCenterReference, this, RuleSet2Edit);

and the called form looks like ....
Code: [Select]
public Form_RuleSetEdit(MediaCenter.IMJAutomation mediaCenterReference, MainInterface mainInterface, RuleSet RuleSet2Edit)

I dont say it's the right or best way to do it... but it works for me :)
Logged

pbair

  • Recent member
  • *
  • Posts: 33
Re: Adding windows to plugin
« Reply #4 on: October 26, 2009, 02:29:10 am »

What about the following method:

1. Load your popup form so that it isn't visible.
2. From the MainInterface, get the MC album info and assign it to the popup form's controls (textboxes, listboxes, etc).
3. Make your popup form visible.

Logged

Mr ChriZ

  • Citizen of the Universe
  • *****
  • Posts: 4375
  • :-D
Re: Adding windows to plugin
« Reply #5 on: October 26, 2009, 04:52:31 am »

What about the following method:

1. Load your popup form so that it isn't visible.
2. From the MainInterface, get the MC album info and assign it to the popup form's controls (textboxes, listboxes, etc).
3. Make your popup form visible.



That would use up more memory as you'd have objects in memory that aren't being used.
It's fairly simple to create Form at run time, and pass references at Cornfishy recommends.
That's not to say we haven't done something similar ;-)
Pages: [1]   Go Up