Dialog Confirm Different Button Layouts
#1
I'm currently coding DialogConfirm.xml and am trying to have different button sizes depending on whether it's an OK, Yes/No or Progress dialog. This is my code...

Code:
            
            <!--ok buttons-->
            <control type="group">
                <visible>Window.IsVisible(OKDialog)</visible>
            
                <!--buttons-->
                <control type="grouplist" id="9000">
                    <left>-15</left>
                    <bottom>-15</bottom>
                    <width>1040</width>
                    <height>120</height>
                    <align>left</align>
                    <orientation>horizontal</orientation>
                    <itemgap>-30</itemgap>
                    
                    <!--ok-->
                    <include content="Dialog.Popup.Button">
                        <param name="id" value="11" />
                        <param name="label" value="" />
                        <param name="width" value="1030" />
                    </include>
                    
                </control>
                
            </control>
            
            <!--yes / no buttons-->
            <control type="group">
                <visible>Window.IsVisible(YesNoDialog)</visible>
            
                <!--buttons-->
                <control type="grouplist" id="9000">
                    <left>-15</left>
                    <bottom>-15</bottom>
                    <width>1040</width>
                    <height>120</height>
                    <align>left</align>
                    <orientation>horizontal</orientation>
                    <itemgap>-30</itemgap>
                    
                    <!--yes-->
                    <include content="Dialog.Popup.Button">
                        <param name="id" value="11" />
                        <param name="label" value="" />
                        <param name="width" value="530" />
                    </include>
                    
                    <!--no-->
                    <include content="Dialog.Popup.Button">
                        <param name="id" value="10" />
                        <param name="label" value="" />
                        <param name="width" value="530" />
                    </include>
                    
                </control>
                
            </control>
            
            <!--progress buttons-->
            <control type="group">
                <visible>Window.IsVisible(ProgressDialog)</visible>
            
                <!--buttons-->
                <control type="grouplist" id="9000">
                    <left>-15</left>
                    <bottom>-15</bottom>
                    <width>1040</width>
                    <height>120</height>
                    <align>left</align>
                    <orientation>horizontal</orientation>
                    <itemgap>-30</itemgap>
                    
                    <!--cancel-->
                    <include content="Dialog.Popup.Button">
                        <param name="id" value="10" />
                        <param name="label" value="" />
                        <param name="width" value="1030" />
                    </include>
                    
                </control>
                
            </control>

It works fine for OK and Yes/No. when it's an OK dialog it's one full width button, when it's a Yes/No it's two half width buttons. It isn't working properly for Progress though. The full width button is there but it never has focus. Any ideas why?

Also if someone could shed some light on what I'm meant to do with the id="12" button that would be great, I've taken it out for now but if it's something that's gonna come into prominence in the near future then it would be good to know!

Thanks
 
Reply
#2
I'm not sure, but my first thought is that it's because you have multiple grouplists/buttons with the same id so the invisible one is trying to focus not the visible one. It probably works for yes/no because its the only one with id="11" and that focuses first.

I would suggest putting each grouplist *inside* an include and make that include conditional based upon the window visible.

e.g.
Code:
<include condition="Window.IsVisible(ProgressDialog)">MyDialogProgressInclude</include>
<include condition="Window.IsVisible(YesNoDialog)">MyDialogYesNoInclude</include>
<include condition="Window.IsVisible(OKDialog)">MyDialogOKInclude</include>

That way only the respective include code will load with the corresponding dialog, rather than having multiple controls with the same ids that are not visible.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
Thanks jurialmunkey, that worked perfectly!
 
Reply
#4
(2017-03-17, 19:44)Eddage Wrote: Also if someone could shed some light on what I'm meant to do with the id="12" button that would be great, I've taken it out for now but if it's something that's gonna come into prominence in the near future then it would be good to know!

it was added for future use, but there are currently no plans to actually use it.
i'd say it is pretty safe to omit that button for now.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
Hi, Will someone help me add the confirm action to it
Code:
ActivateWindowAndFocus(PVRSettings, -98,10, -71,10)
takes me where I want but I don't approve
I have to press ok and I'd like to call the yes, no window



edit:

I have already found a solution
Code:
<onclick>Action(Select)</onclick>

thanks...
Reply

Logout Mark Read Team Forum Stats Members Help
Dialog Confirm Different Button Layouts0