Kodi Community Forum
Help to add a button - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Help to add a button (/showthread.php?tid=128172)

Pages: 1 2


Help to add a button - gegecom83 - 2012-04-08

Hello,
For several days I try to add buttons in a view
Trailer for the button it works, but for the information movie, I get a blank window.
Thank you for your help

Code:
</control>
<control type="group" description="Options">
  <posy>0</posy>
  <posx>0</posx>
  <control type="grouplist" id="300">
    <posx>0</posx>
    <posy>673</posy>
    <width>1280</width>
    <height>59</height>
    <itemgap>0</itemgap>
    <aligny>bottom</aligny>
    <align>center</align>
    <onup>54</onup>
     <ondown>54</ondown>
    <orientation>horizontal</orientation>
    <control type="button" id="301" description="Trailer">
      <height>50</height>
      <width>180</width>
      <font>XSmall</font>
      <align>center</align>
      <label>Extrait</label>
      <textcolor>White</textcolor>
      <texturefocus>img/HomeBarFO.png</texturefocus>
      <enable>!IsEmpty(ListItem.Trailer)</enable>
     <onclick>PlayMedia(&quot;$INFO[ListItem.Trailer]&quot;)</onclick>
      <pulseonselect>true</pulseonselect>
    </control>
     <control type="button" id="302" description="Info">
      <height>50</height>
      <width>180</width>
      <align>center</align>
      <font>XSmall</font>
      <textcolor>White</textcolor>
      <label>Info</label>
       <onclick>ActivateWindow(2003)</onclick>
       <texturefocus>img/HomeBarFO.png</texturefocus>
      <alttexturefocus>img/HomeBarFO.png</alttexturefocus>
    </control>
  </control>

Image


RE: Help to add a button - Hitcher - 2012-04-08

There's already a Trailer button in the Video Info screen -

http://wiki.xbmc.org/index.php?title=List_of_Built_In_Controls#DialogVideoInfo.xml


RE: Help to add a button - gegecom83 - 2012-04-08

Thank you Hitcher
But when I hit the button "<onclick> ActivateWindow (2003) </ onclick>" in the view from my video library
I get a black screen


RE: Help to add a button - Hitcher - 2012-04-08

You shouldn't need a separate button (which doesn't work because you're no longer focused on a movie) instead press i.


RE: Help to add a button - gegecom83 - 2012-04-08

Thanks Hitcher
Is it possible to simulate to press "i" on the keyboard
with the command "<onclick>"



RE: Help to add a button - Hitcher - 2012-04-08

You'd need a script because as soon as you focus on a button you lose focus on the movie you want to access.


RE: Help to add a button - gegecom83 - 2012-04-08

Hitcher thank you for your help


RE: Help to add a button - butchabay - 2012-04-08

There is a way, i'm not on my pc now, but i can post it later.
I've done something similar for a game info screen in cirrus extended and fusion migmav2.


RE: Help to add a button - Jezz_X - 2012-04-08

Multiple onclick with the first one setting focus to the list then the next one opening the dialog probably


RE: Help to add a button - gegecom83 - 2012-04-08

Thanks Smile


RE: Help to add a button - Hitcher - 2012-04-08

But remember it can't be used for Panel viewtypes. Wink


RE: Help to add a button - Jezz_X - 2012-04-09

(2012-04-08, 22:09)Hitcher Wrote: But remember it can't be used for Panel viewtypes. Wink

Unless you have a touchscreen and can still have the right item in the panel selected before you select the button Tongue


RE: Help to add a button - butchabay - 2012-04-09

Here an example how i've done it:

1. Copy DialogVideoInfo.xml
2. Rename the Copy Custom_DialogVideoInfo.xml for example
3. Open Custom_DialogVideoInfo.xml assign a window ID and place type Dialog

Example:

PHP Code:
<window id="1122" type="dialog"

4. On your Button Control:

Example:

PHP Code:
<onclick>Dialog.Close(your actual dialog)</onclick>
<
onclick>ActivateWindow(1122)</onclick





RE: Help to add a button - gegecom83 - 2012-04-10

Great
it works Big Grin but I have no information for actors.
Thank you butchabay


RE: Help to add a button - butchabay - 2012-04-10

What do you mean Information for actors ? There is no information for actors in video info, else you mean the thumb and name.