2011-08-04, 02:15 AM
Apparently the skin I posted yesterday had a 'PopupButtons' element defined, which wasnt used, and only serves to help confusing developers. I've attached another version which removes it. I cant really remember why it was there originally, but it's no longer used. It was probably just some hang over from the early days of NextPVR last year.
This SomePopup initialises a button list using the "PopupLeftButtonNormal"/"PopupLeftButtonSelected" element names.
It'll first look in the popup.xml for the definition of "PopupLeftButtonNormal"/"PopupLeftButtonSelected". Since they're not defined there, it'll fall back to looking for them in global.xml - which is used to define common stuff, giving a consistent look and feel for colors/fonts/positioning of elements.
So... if you wanted your popup to have a button list, with buttons to be placed in a different location to other popups, then you could define overridden definitions in the popup.xml (stopping it from using the common definition in global.xml), or give them a different name and define them in popup.xml.
Regarding the placement - the UiButtonList controls use the location from the 'PopupLeftButtonNormal' definition, then add the vertical button size and spacing make a vertical list of buttons. The spacing can be tweaked in the skin files.
Hopefully that helps. Ask for more details if you need them though.
This SomePopup initialises a button list using the "PopupLeftButtonNormal"/"PopupLeftButtonSelected" element names.
Code:
// setup some fake buttons
List<string> buttonNames = new List<string>();
buttonNames.Add("Test 1");
...
buttonNames.Add("Close");
// construct button list
buttonList = new UiButtonList("PopupLeftButtonNormal", "PopupLeftButtonSelected", buttonNames, skinHelper, this);
It'll first look in the popup.xml for the definition of "PopupLeftButtonNormal"/"PopupLeftButtonSelected". Since they're not defined there, it'll fall back to looking for them in global.xml - which is used to define common stuff, giving a consistent look and feel for colors/fonts/positioning of elements.
So... if you wanted your popup to have a button list, with buttons to be placed in a different location to other popups, then you could define overridden definitions in the popup.xml (stopping it from using the common definition in global.xml), or give them a different name and define them in popup.xml.
Regarding the placement - the UiButtonList controls use the location from the 'PopupLeftButtonNormal' definition, then add the vertical button size and spacing make a vertical list of buttons. The spacing can be tweaked in the skin files.
Hopefully that helps. Ask for more details if you need them though.