PDA

View Full Version : IInfoPanel  getPanelName()



CodeMonkey
2004-08-23, 01:18 PM
For the weather plugin for example, I assume this method should return the string "weather". Is this correct? How can I find this information out? For the Blue skin, main menu skin.xml file, the only 'panel' reference is:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">&#60;SpecialElement name=&#34;Panel&#34; panelName=&#34;comics&#34; visible=&#34;false&#34; loc=&#34;500,100&#34; size=&#34;180,80&#34;/&#62; [/QUOTE]

even though I do have the weather plugin enabled.

Also, is there a reason to make the returned image 180X80 as suggested in the code? I was thinking of putting the current weather icon and current temp in the panel, but 180X80 seems a little small for that. Is there a maximum size it can be?

sub
2004-08-23, 05:38 PM
The panel name is the returned from the plugin&#39;s IInfoPanel.getPanelName() method.

It can be any size you like. I can see a potential problem looming around this though. If everyone returns different size panels it good look a bit ugly. I suppose if at least they use a similar aspect ratio it should be ok. The first person to implement one (you), probably gets to set the standard for size which others should follow.

CodeMonkey
2004-08-23, 06:49 PM
Quote[/b] (sub @ Aug. 23 2004,08:38)]The panel name is the returned from the plugin&#39;s IInfoPanel.getPanelName() method.
What, if any, is the significance of this panel name? I saw that &#39;comics&#39; had a panel name assigned in the skin.xml. Is there any relation between this panel name and what gets returned by IInfoPanel.getPanelName() ?

sub
2004-08-23, 07:03 PM
When it first loads up the plugins, it adds them to a hash table keyed by the value returned by the plugins IInfoPanel.getPanelName() implementation.

When its rendering the main menu, &#39;Panel SpecialElements&#39; listed in the skin.xml. For each panel name in the skin.xml it checks if it has a plugin plan with that name. If does, it will render it.

sub
2004-08-23, 07:04 PM
The name basically connects the plugin with the location it is supposed to be drawn (listed in skin.xml).

CodeMonkey
2004-08-23, 09:11 PM
OK, so then if I add a &quot;weather&quot; panel, I should add a appropriate panel element in skin.xml named &quot;weather&quot; such as<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">&#60;SpecialElement name=&#34;Panel&#34; panelName=&#34;weather&#34; visible=&#34;true&#34; loc=&#34;500,100&#34; size=&#34;180,80&#34;/&#62; [/QUOTE]

where &#39;size&#39; is whatever size I end up with. Wouldn&#39;t &#39;loc&#39;ation be relative based on the dynamic menu? What would I put in the the &#39;loc&#39; field?

sub
2004-08-23, 09:17 PM
loc is used to position the panel image on the main menu. It is a fixed location.

size is how big the panel will be. It doesnt have to be the same size as the image returned from your plugin, but be aware resizing may have undesireable effects.

CodeMonkey
2004-08-24, 01:33 PM
Ohhhhhh. I assumed the panel would be drawn next to the menu item for the plugin. Now I understand. Thanks.