ok, the actual bar is pretty much finished - just got to get the mouse operation working a bit nicer, and then work on what the user should be able to easily do.
the xml file looks something like this (i'll edit this a little later to make sure it's perfect)
Quote:<control>
<description>button scroller</description>
<id>300</id>
<type>buttonscroller</type>
<posx>200</posx>
<posy>150</posy>
<width>185</width>
<height>30</height>
<buttongap>5</buttongap>
<orientation>vertical</orientation>
<numbuttons>5</numbuttons>
<defaultbutton>3</defaultbutton>
<movement>1</movement>
<smoothscrolling>yes</smoothscrolling>
<wraparound>yes</wraparound>
<alpha>80</alpha>
<texturefocus>button-focus.png</texturefocus>
<texturenofocus>button-nofocus.jpg</texturenofocus>
<font>font16</font>
<align>center</align>
<aligny>center</aligny>
<textoffsetx>0</textoffsetx>
<textoffsety>0</textoffsety>
<control>
most of them are self-explainatory. the scroller will be made of <numbuttons> buttons each having the specified <width> and <height>, seperated by a distance <buttongap>. it will be positioned at <posx>,<posy> and will be orientated according to <orientation> (either vertically or horizontally). buttons will use the <texturenofocus> texture, and the <font>, <textoffset*> and <align*> denote how the labels will be drawn.
the cursor (which uses the <texturefocus> texture) will initially be placed in position <defaultbutton>, and will be able to move a distance <movement> in either direction. if you try and move more (assuming that there is sufficient buttons) then the buttons will scroll through 1 position. they will wrap around if <wraparound> is set to yes or true. the scrolling will be smooth if <smoothscrolling> is enabled, else the buttons will jump from position to position as needed (same for the cursor).
lastly, if the skinner wants, the buttons on either end of the button scroller will be faded out from the movement range to the specified <alpha> transparency. <alpha>100</alpha> is fully transparent on the edge. all buttons within the <movement> range will not be touched by the transparency code. obviously, you are welcome to include transparency in the textures as well.
each button can have a number of images associated with it - up to 3 depending on what options you use. each button has an <icon> tag with it denoting the id of the background image that should be displayed when that button is selected. (eg icon value of 103 is my music iirc). these icon values are bounded between 101 and 120. currently only 102-109 are used, excluding 108.
additionally, the skinner is free to define a set of images to use in place of the standard button textures defined in <texturefocus> and <texturenofocus>. the no focus textures should be given ids in the range 121-140. each corresponds to the background image id plus 20. (eg 123 would be the id of the music texture).
if the skinner wishes to have separate focus textures as well (which you will want, unless your <texturefocus> bar is a color/alpha combo that just changes the tint on your button) then they take ids 141-160, with each corresponding to the <icon> settings plus 40. (eg 143 would be the id of the music focused texture). this will only work if <smoothscrolling> is turned off. you can't have both, as under smooth scrolling, the buttons scroll, but the cursor does not. note that all the location settings (posx, posy, width, height) of the images you define for these purposes are overridden by the settings in the buttonscroller.
you must always keep in mind that the user has full control over the buttons that they want displayed, and the order in which they appear. while this does give a restriction, imo it's not a major one. the users buttons are defined in xboxmediacenter.xml, and they have the possibility to change them from within the gui. they can alter the default button, reorder the buttons, and delete buttons they no longer want. they can only add buttons from the .xml file at present (like shares, it's not a simple process to develop a gui for.)
the layout is pretty simple:
Quote:<buttonscroller>
<button>
<label>my music</label>
<execute>xbmc.activatewindow(501)</execute>
<icon>103</icon>
</button>
....
</buttonscroller>
the window id (501) may be replaced with a text label over time, or i might leave it as numbers (as defined in the skin).
your comments are most welcome.
cheers,
jonathan