Posts: 10
Joined: Jun 2009
Reputation:
0
Selmar
Junior Member
Posts: 10
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?
Posts: 26,215
Joined: Oct 2003
Reputation:
187
2009-07-18, 02:54
(This post was last modified: 2009-07-18, 02:59 by jmarshall.)
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
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
XBMC.Action(Info) works for plugins adding an item to the context menu
Posts: 32
Joined: Dec 2008
Reputation:
0
what about the multiselect control??
Posts: 26,215
Joined: Oct 2003
Reputation:
187
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.
Posts: 10
Joined: Jun 2009
Reputation:
0
Selmar
Junior Member
Posts: 10
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.