Kodi Community Forum

Full Version: Setting with multiple radiobuttons in a windows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I have some radiobuttons and I want to put them in one setting in a window, so when I click on the setting, a window opens with all the radiobuttons. Do you know how to do that please ?

Thanks
So, I did that but it didn't work :

In the SkinSettings.xml file :

xml:
<control type="button" id="919">
                    <label>$LOCALIZE[40369]</label>
                    <include>DefaultSettingButton</include>
                    <onclick>ActivateWindow(1163)</onclick>
                    <label2>$VAR[ThumbnailsSeasonsSettingLabel2Var]</label2>
</control>

And I created a new xml file, for a window :

xml:
<?xml version="1.0" encoding="UTF-8"?>
<window id="1163" type="dialog">
<defaultcontrol>2</defaultcontrol>
  <coordinates>
    <left>500</left>
    <top>100</top>
  </coordinates>
  <controls>
  <include condition="[Skin.HasSetting(BarH)]">BarHaut</include>
                <control type="radiobutton" id="711">
                    <label>$LOCALIZE[40342]</label>
                    <include>DefaultSettingButton</include>
                    <selected>!Skin.HasSetting(BarH)</selected>
                    <onclick>Skin.ToggleSetting(BarH)</onclick>
                </control>
                <include condition="[Skin.HasSetting(BarB)]">BarBas</include>
                <control type="radiobutton" id="710">
                    <label>$LOCALIZE[40341]</label>
                    <include>DefaultSettingButton</include>
                    <selected>!Skin.HasSetting(BarB)</selected>
                    <onclick>Skin.ToggleSetting(BarB)</onclick>
                </control>
  </controls>
</window>
what the filename of the xml file? it needs to start with custom.
so something like customsettings.xml should work.

if all else fails, enable debug logging and check your logfile for issues.
Yes, I named the file custom_....xml
Nothing happens when I click on the button. There is only the sentence for the action of the radiobutton that is displayed at the coordinates I specified in the windows xml file as you can see in the screenshot :Image
I don't think there is an issue, I think I forgot some lines in the window xml file. Because the name of the first radiobutton displays when I click on the button so the window is displayed...

EDIT: If I add a width and a height for both of the radiobutton they appear but I don't think it is the right method... And I can't click on these buttons...Image
I still don't understand why the window is invisible...
Can someone help me ?
You haven't added any background textures to the window that's why it's 'invisible'.
Thanks for your answer, can you give me an example with everything I should add in my window xml file so the window works well ? I don't know how to do that... How can I get a window like this one :Image
That's the DialogSelect.xml so copy the layout/controls found in it to your custom window to replicate it.

Note: they can be found in Includes_DialogSelect.xml in the <include name="DefaultDialogSelectLayout"> control.
Thanks, so I added <include>DefaultDialogSelectLayout</include> and now I have this :Image
But the radiobuttons are displayed above the window as you can see... And I can't toggle the button.
Now you'll have to start customising it by removing the lists and adding your radio buttons in their place, and making the default control the first button, etc.
Thanks, so I deleted the two control list and replaced them with my radiobuttons, now I have this :
Image
But I can't use the radiobuttons... They are not highlighted in blue when selected.



This is the xml file of my custom window :

xml:
<?xml version="1.0" encoding="UTF-8"?>
<window id="1163" type="dialog">
  <defaultcontrol>2</defaultcontrol>
  <coordinates>
    <left>0</left>
    <top>0</top>
  </coordinates>
  <controls>
    <control type="group">
            <centertop>50%</centertop>
            <centerleft>50%</centerleft>
            <height>750</height>
            <width>1220</width>
            <include content="DialogBackgroundCommons">
                <param name="width" value="1220" />
                <param name="height" value="750" />
                <param name="header_label" value="" />
                <param name="header_id" value="1" />
            </include>
            <control type="image">
                <left>0</left>
                <top>80</top>
                <width>920</width>
                <bottom>2</bottom>
                <texture border="40">buttons/dialogbutton-nofo.png</texture>
            </control>
            <control type="grouplist" id="110">
                <top>100</top>
                <left>5</left>
                <width>900</width>
                <control type="radiobutton" id="710">
                    <label>$LOCALIZE[40342]</label>
                    <include>DefaultSettingButton</include>
                    <selected>!Skin.HasSetting(BarH)</selected>
                    <onclick>Skin.ToggleSetting(BarH)</onclick>
              </control>
                <control type="radiobutton" id="711">
                    <label>$LOCALIZE[40341]</label>
                    <include>DefaultSettingButton</include>
                    <selected>!Skin.HasSetting(BarB)</selected>
                    <onclick>Skin.ToggleSetting(BarB)</onclick>
                </control>
                     </control>
            <control type="scrollbar" id="61">
                <left>910</left>
                <top>100</top>
                <width>12</width>
                <bottom>20</bottom>
                <onleft condition="Control.IsVisible(3)">3</onleft>
                <onleft condition="Control.IsVisible(6)">6</onleft>
                <onright>9001</onright>
                <orientation>vertical</orientation>
            </control>
            <control type="label">
                <left>925</left>
                <bottom>10</bottom>
                <width>275</width>
                <height>35</height>
                <font>font12</font>
                <align>right</align>
                <textcolor>grey</textcolor>
                <label>$VAR[SelectLabel]</label>
            </control>
            <control type="grouplist" id="9001">
                <left>920</left>
                <top>80</top>
                <onleft>61</onleft>
                <itemgap>dialogbuttons_itemgap</itemgap>
                <onright>3</onright>
                <include content="DefaultDialogButton">
                    <param name="id" value="5" />
                    <param name="label" value="" />
                </include>
                <include content="DefaultDialogButton">
                    <param name="id" value="8" />
                    <param name="label" value="" />
                </include>
                <include content="DefaultDialogButton">
                    <param name="id" value="7" />
                    <param name="label" value="$LOCALIZE[222]" />
                </include>
            </control>
    </control>
                      
  </controls>
</window>
Change <defaultcontrol>2</defaultcontrol> to 110 or 710.
(2021-06-15, 18:57)Hitcher Wrote: [ -> ]Change <defaultcontrol>2</defaultcontrol> to 110 or 710.

Thanks a lot for your help, now it works !
But there is another problem : I can't use the scroll bar and the cancel button (in the screnshots, it is "Annuler" in french)
Do you know how to fix that ?