Buttons in Lists
#1
Hi,

I'm busy creating a skin optimized for touchscreens. Therefore I would like to add some buttons to lists as a replacement of the context-menu. For example, myMusic lists have to contain 2 extra buttons: Information and Add to Queue).

Adding those buttons is not the problem, but it seems that OnClick event do not trigger. Is there any way of solving this?
Reply
#2
I don't think it's really possible to be honest. If the appropriate listitem is focused, then something that:

1. Sets focus to the appropriate listitem.
2. Executes the appropriate action command (I guess it'd be "Queue" or "Info").

*might* do the trick. You wouldn't get it per listitem though.

I'd see what happens if you just have a button outside the list with <onclick>Info</onclick> set - I think it won't work as it doesn't come from the list. I'm not sure if SendClick() can take in an action param at this point. I suspect not, but that would be the ideal thing to do for a button outside the list. Check Util.cpp in the function ExecuteBuiltIn.

EDIT: Nope, it doesn't. A patch to SendClick() (or Control.Message) that adds this functionality would be most welcome.

Buttons inside the list aren't going to work at all I should think - do they render? What happens if you set an <onclick> to something that should always do something (eg to bring up the shutdown menu)?

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
XBMC.Action(Info) works for plugins adding an item to the context menu
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#4
jmarshall Wrote:Buttons inside the list aren't going to work at all I should think - do they render? What happens if you set an <onclick> to something that should always do something (eg to bring up the shutdown menu)?

The buttons do render, but the onclick does not trigger. I'll have a look at some other possibilities, although I'm still open to suggenstions. Thanks

Selmar
Reply
#5
what about the multiselect control??
Reply
#6
It's fine for static content, but won't work here, as you don't control what the list is filled with or what is done on the click.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
darkrogi Wrote:what about the multiselect control??

Didn't work either, exactly the same effect as buttons. They render fine, but OnClick is not triggered.
Reply
#8
Thank you guys for your help. The last days I've been working on a patch of the code, and now all controls are rendered correctly, and OnClick events are triggered when using the mouse. If anyone is interested, send me a message.

Maybe I'll spend some time on keyboard support too.
Reply
#9
Sounds great Smile

Please post your patch to trac so that we can review it for possible inclusion.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
Patch is submitted
Reply

Logout Mark Read Team Forum Stats Members Help
Buttons in Lists0