radiobutton selected condition

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Kr0nZ Offline
Member
Posts: 57
Joined: Apr 2011
Reputation: 2
Post: #1
Is it possible to get the selected state of a radiobutton button within the skin xml?
I want to set the visibility of a control depending whether or not the radiobutton is pressed.

I tired Control.IsSelected(id) which would work in python, but no luck in the skin xml.
find quote
Hitcher Offline
Team-Kodi Member
Posts: 13,429
Joined: Aug 2007
Reputation: 210
Location: Eastleigh, UK
Post: #2
Do you mean if it's On or Off?

Code:
SubString(Control.GetLabel(ID),*)

Or just focused?

Code:
Control.HasFocus(ID)</visible>
(This post was last modified: 2013-01-26 22:11 by Hitcher.)
find quote
Kr0nZ Offline
Member
Posts: 57
Joined: Apr 2011
Reputation: 2
Post: #3
Yep, I meant when its on or off

Code:
SubString(Control.GetLabel(ID),*)
works perfectly thanks
find quote
phil65 Offline
Team-Kodi Developer
Posts: 6,687
Joined: Mar 2009
Reputation: 147
Location: Cologne, Germany
Post: #4
why not just using the same condition like in your radiobutton <selected> tag?

Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
find quote
Kib Offline
Team Kodi 🐤 Member
Posts: 5,011
Joined: Jan 2010
Reputation: 87
Location: The Hague
Post: #5
(2013-01-27 00:11)phil65 Wrote:  why not just using the same condition like in your radiobutton <selected> tag?
Nod
find quote
Kr0nZ Offline
Member
Posts: 57
Joined: Apr 2011
Reputation: 2
Post: #6
determining if the radio button is selected is done in python, windowxml class, not the skin,
so I don't have a condition in the selected tag
find quote
Kib Offline
Team Kodi 🐤 Member
Posts: 5,011
Joined: Jan 2010
Reputation: 87
Location: The Hague
Post: #7
I don't get it, you ask how to determine from the skin when a radiobutton is selected, to enable the visibility of a control in the skin.
What does this have to do with python?

If the radiobutton sets a condition <a> when the user selects it, just have your control check for condition <a>.
find quote
`Black Offline
Team-Kodi Member
Posts: 2,443
Joined: Apr 2009
Reputation: 74
Location: Germany
Post: #8
If you're using a python script, there isn't necessarily a condition which you can check in the skin.

[Image: xp1080-21.png]
find quote
Kib Offline
Team Kodi 🐤 Member
Posts: 5,011
Joined: Jan 2010
Reputation: 87
Location: The Hague
Post: #9
I get that, it is just that the OP never mentioned a python script in his question.
find quote
braz Offline
Skilled Skinner
Posts: 3,253
Joined: Aug 2012
Reputation: 100
Post: #10
Apologies for bringing up an old thread, this was the only discussion I could find on determining the state of a radiobutton.

I'm redesigning the addon info dialog and need to determine the state of the auto-updates radiobutton (id #13) for my new buttons. I tried Hitcher's suggestion above, String.Contains(Control.GetLabel(13),*), but it always returns true.

Upon further investigation, it appears that control 13's label is always "Auto update (*)" regardless of whether it is on or off. Is there a reliable way to determine the state of this radiobutton?

Thanks for any suggestions!
find quote
ronie Offline
Team-Kodi Member
Posts: 13,165
Joined: Jan 2009
Reputation: 391
Post: #11
must be you ;-)

[Image: hMAykgw.jpg]

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
braz Offline
Skilled Skinner
Posts: 3,253
Joined: Aug 2012
Reputation: 100
Post: #12
(2017-01-19 04:48)ronie Wrote:  must be you ;-)
You got me. Smile

After doing more research, it looks like the issue is that SendClick doesn't work with radiobuttons. Any other way to send a click to a radiobutton?

http://forum.kodi.tv/showthread.php?tid=157005
find quote
ronie Offline
Team-Kodi Member
Posts: 13,165
Joined: Jan 2009
Reputation: 391
Post: #13
Code:
Control.Message(13,click)

though i doubt the results will be any different if you use that action.

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
braz Offline
Skilled Skinner
Posts: 3,253
Joined: Aug 2012
Reputation: 100
Post: #14
Thanks for the suggestion Ronie, you're right though, that doesn't change the state of the radiobutton either. Will have to figure out where to stick control #13 since it looks like it's not going to work in my custom menu.
find quote
jurialmunkey Offline
Skilled Skinner
Posts: 2,308
Joined: Feb 2013
Reputation: 214
Post: #15
Doing a thread necromancy here as I was looking for a solution to this myself and figured something out just now

Make radiobutton id=13 a hidden button e.g.
Code:
<visible allowhiddenfocus="true">false</visible>

Then use another button to set it like so:
Code:
<control type="button" id="9013">
    <label>Auto-Update</label>
    <onclick>SetFocus(13)</onclick>
    <onclick>Action(Select)</onclick>
    <onclick>SetFocus(9013)</onclick>
    <visible>Control.IsEnabled(13)</visible>
</control>
find quote
Post Reply