<property name="ActionRight:...2 actions
#1
Hi, I have a static list populated by a range of <content><item> elements with different conditional visibilities to make up a list where you can scroll vertical and then horizontal on each item (Thanks to Hitcher for coming up with the original code).

What I would like to do is toggle one SkinSetting off and another on with a single right press, like this:

                    <property name="ActionRight">Skin.ToggleSetting(Setting1)</property>
                    <property name="ActionRight">Skin.ToggleSetting(Setting2)</property>

But from what I can tell, you can't have two elements listed like this, it only carries out the first.

I can do this with two <onclick> elements like so:

                    <onclick>Skin.ToggleSetting(Setting1)</onclick>
                    <onclick>Skin.ToggleSetting(Setting2)</onclick>

That works fine, but I would prefer to be able to do this with a right press instead if possible, I'm just not sure if there is a particular syntax I need to follow or a way of calling something other than a built-in action on a button press to let me fulfil this objective using a different method?

Alternatively is there a better way to switch between the following four scenarios than by relying on toggling different Skin.HasSettings elements? A + B Enabled, A Enabled + B Disabled, A Disabled + B Enabled, A + B Disabled.

Currently I'm doing it using three Skin.HasSettings that I'm trying to toggle between (A + B Enabled, A Enabled, B Enabled), which is why I need two toggles to move between them (switch the current enabled setting off AND switch the next desired setting on).


Thanks in advance for any help
Reply
#2
I found a better way to do this using Skin.Strings instead of Skin.HasSettings, and then just having a default value for the string enabled in Startup.xml
Reply
#3
Are you looking for
Code:
<onright>Skin.ToggleSetting(foobar)</onright>
Huh
Reply
#4
(2019-09-11, 08:33)jurialmunkey Wrote: Are you looking for
Code:
<onright>Skin.ToggleSetting(foobar)</onright>
Huh

That didn't work for some reason when I tried which I guess is why Hitcher used the propertyname syntax in this context to begin with (I'm trying to modify his base code). Perhaps a <content> item can't work with onright because it doesn't have physical attributes? Thanks for the reply though.

Ended up using a skin string instead of a toggle and then I only needed one action on each button press instead of two.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
<property name="ActionRight:...2 actions00