| |||||||
| Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here. |
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Portal Member Join Date: Aug 2006 Location: Southsea, UK
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
| Hello, I am currently developing my first plugin for MP (a PDF ebook reader). I have read the "how to develop your first plugin" but that doesn't seem to help with this. I am trying to add a list control to my GUI which will load all the names of the ebooks into it - a similar layout to the my music plugin. At the moment I am just trying to add an item to the list but it just doesn't show! I'm initialising the list control with the following - Code: [SkinControlAttribute(21)]
protected GUIListControl lstEbooks = null;
Code: lstEbooks.Add(new GUIListItem("A new item!"));
Code: <control> <type>group</type> <description>group element</description> <animation>FlyInFromTop</animation> <posX>120</posX> <posY>97</posY> <width>50</width> <height>60</height> <control> <description>composite control consisting of a list control and a thumbnail panel</description> <type>facadeview</type> <id>20</id> <control> <description>listcontrol</description> <type>listcontrol</type> <id>21</id> <width>50</width> <height>60</height> <onleft>2</onleft> <onright>51</onright> <onup>2</onup> <ondown>2</ondown> <textcolor>FFFFFFFF</textcolor> </control> <control> <description>Thumbnail Panel</description> <type>thumbnailpanel</type> <id>22</id> <onleft>2</onleft> <onright>52</onright> <onup>2</onup> <ondown>2</ondown> </control> </control> Cheers, JestriK
__________________ Epia VIA 10000M :: 1GB RAM :: GeForce Low Profile 6600 :: 1x 300GB HDD :: 1x 250GB HDD :: MS Wireless Mouse and Keyboard :: MCE 2005 Remote |
| | |
| | #2 (permalink) |
| Portal Member Join Date: Aug 2006 Location: Southsea, UK
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
| Just to make it clearer, this is what i can see on my screen - ![]()
__________________ Epia VIA 10000M :: 1GB RAM :: GeForce Low Profile 6600 :: 1x 300GB HDD :: 1x 250GB HDD :: MS Wireless Mouse and Keyboard :: MCE 2005 Remote |
| | |
| | #3 (permalink) |
| Portal Member Join Date: Aug 2006 Location: Southsea, UK
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
| OK, since my last post have figured out what I was doing wrong - I should be using a GUIFacadeControl. Now I've got that sorted that out, I have the code below. Code: private void LoadList(string currentDirectory)
{
ArrayList arry = new ArrayList();
arry.Add(".pdf");
virtualDirectory.SetExtensions(arry);
List<GUIListItem> items = virtualDirectory.GetDirectoryExt(currentDirectory);
facadeView.Clear();
for (int i = 0; items.Count > i; i++)
facadeView.Add(items[0]);
}
Code: OnMessage exception:System.DivideByZeroException: Attempted to divide by zero. at MediaPortal.GUI.Library.GUIListControl.Add(GUIListItem item) at MediaPortal.GUI.Library.GUIFacadeControl.Add(GUIListItem item) at MediaPortal.GUI.Library.GUIFacadeControl.OnMessage(GUIMessage message) at MediaPortal.GUI.Library.GUIWindow.OnMessage(GUIMessage message) Cheers, JestriK
__________________ Epia VIA 10000M :: 1GB RAM :: GeForce Low Profile 6600 :: 1x 300GB HDD :: 1x 250GB HDD :: MS Wireless Mouse and Keyboard :: MCE 2005 Remote |
| | |
| | #4 (permalink) |
| Portal Member Join Date: Aug 2006 Location: Southsea, UK
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
| I have now fixed this too, it seems there was something wrong with my XML file, I rewrote it and it now seems to work Sorry for all the posts! Cheers, Jes_triK
__________________ Epia VIA 10000M :: 1GB RAM :: GeForce Low Profile 6600 :: 1x 300GB HDD :: 1x 250GB HDD :: MS Wireless Mouse and Keyboard :: MCE 2005 Remote |
| | |
| | #5 (permalink) |
| Portal Member Join Date: Apr 2005 Location: Germany Age: 34
Posts: 457
Thanks: 1
Thanked 2 Times in 2 Posts
Country: | Don't say sorry (sorry nobody answered!). It is good to show what pitfalls there are for developing.
__________________ *** Power is nothing without control *** |
| | |
| | #6 (permalink) |
| Portal Developer | Try someting like : Code: private void LoadList(string currentDirectory)
{
ArrayList arry = new ArrayList();
arry.Add(".pdf");
virtualDirectory.SetExtensions(arry);
List<GUIListItem> items = virtualDirectory.GetDirectoryExt(currentDirectory);
facadeView.Clear();
for (int i = 0; items.Count= > i; i++)
facadeView.Add(items[i]);
}
__________________ Hungarian MP forum |
| | |
![]() |
| Bookmarks |
| Tags |
| control, gui, list |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Inifinite Loop in GUI List Control | TesterBoy | 0.2.0.0 Final and SVN Builds | 3 | 2006-09-19 06:36 |
| cant see list control list in my plugin | kenny | Plugins | 1 | 2006-04-04 20:58 |
| Navigation within 'My Video' & 'My Music' | malachy | 0.2.0.0 Release Candidate 1 | 1 | 2005-11-15 21:27 |
| Finally a Fix for MPexTuneCMD with DTV Control. | bitbyte | Tips and Tricks | 1 | 2005-10-16 14:24 |
| Simple examle how to populate list control | CoolHammer | Plugins | 6 | 2004-12-28 14:01 |