Old 17th August 2004, 16:13   #1
DigiMike
Member
 
Join Date: Aug 2004
Posts: 57
Send a message via ICQ to DigiMike Send a message via AIM to DigiMike
Right Click

I'm porting one of my skins and i'm trying to mimic a sonique style of navigation (right click animated menus) but for some reason i'm unable to get a right click over a region to activate. The standard right click menu for winamp keeps showing and well...the right click part just doesn't work.

I tried defining my glass layer as a button since layer doesn't seem to have a rightClick script in the std.mi file.

here's how the layer is defined in my groups.xml file

<button
id="Glass"
image="wasabi.layoutitems.glass"
x="0" y="0"
ghost="1"
/>



and here's my maki code...

#include "std.mi"

Global Group centre;
Global Layer viss,useless,id3;
Global Button menu, glass;

global int vstartx, vstarty, vendx, vendy, istartx, iendx;
global int state, alpha;




System.onScriptLoaded() {
centre=getScriptGroup();
viss=centre.findObject("vis");
menu=centre.findObject("Menu");
useless=centre.findObject("Useless");
id3=centre.findObject("Id3");
glass=centre.findObject("Glass");

vstartx=StringToInteger(viss.getXMLparam("x"));
vstarty=StringToInteger(viss.getXMLparam("y"));
vendx=-110;
istartx=StringToInteger(id3.getXMLparam("x"));
iendx=244;
vendy=15;

state=0;
}

glass.onRightClick(){
menu.onLeftclick();
}


menu.onLeftclick(){
if (state==0){
viss.setTargetX(vendx);
viss.setTargety(vendy);
viss.setTargetSpeed(1);
viss.gotoTarget();
id3.setTargetX(iendx);
id3.setTargety(vendy);
id3.setTargetSpeed(1);
id3.gotoTarget();

useless.hide();
state=1;
}else{

viss.setTargetX(vstartx);
viss.setTargety(vstarty);
viss.setTargetSpeed(1);
viss.gotoTarget();
id3.setTargetX(istartx);
id3.setTargety(vstarty);
id3.setTargetSpeed(1);
id3.gotoTarget();

useless.show();
state=0;
}
}

if one of you could give me any hits or solutions it would be much appreciated.
DigiMike is offline   Reply With Quote
Old 17th August 2004, 16:15   #2
DigiMike
Member
 
Join Date: Aug 2004
Posts: 57
Send a message via ICQ to DigiMike Send a message via AIM to DigiMike
oh if you'd like to see how i'm attempting to get this skin to be able to behave and have sonique 2 installed you can try out the other version here...

http://www.deviantart.com/deviation/9793087/
DigiMike is offline   Reply With Quote
Old 17th August 2004, 16:16   #3
carlosp
Major Dude
 
carlosp's Avatar
 
Join Date: Nov 2002
Location: Hamburg, Germany
Posts: 1,312
glass.onRightClick(){
menu.Leftclick();
}
carlosp is offline   Reply With Quote
Old 17th August 2004, 16:18   #4
rpeterclark
Major Dude
(Reviewer)
 
rpeterclark's Avatar
 
Join Date: Aug 2002
Location: South Florida
Posts: 1,388
Only button objects support the .onRightClick event. The GUIObject (which the layer inherits from) has these though:

.onRightButtonUp(int x, int y)
.onRightButtonDown(int x, int y)

This way you can avoid the buttons altogether. If it still seems to be a problem, check your XML and make sure you don't have any non ghost="1" elements over where you are trying to put this menu.
rpeterclark is offline   Reply With Quote
Old 17th August 2004, 16:18   #5
DigiMike
Member
 
Join Date: Aug 2004
Posts: 57
Send a message via ICQ to DigiMike Send a message via AIM to DigiMike
that's just it...i have the glass layer defined as a button...

i'll just keep playing with it though...thanks.
DigiMike is offline   Reply With Quote
Old 17th August 2004, 16:36   #6
rpeterclark
Major Dude
(Reviewer)
 
rpeterclark's Avatar
 
Join Date: Aug 2002
Location: South Florida
Posts: 1,388
I'm just saying ou don't need it as a button a show a menu, that's just an extra hoop to jump through, but I guess it doesn't hurt. Take the ghost="1" off of your glass element if you want it to be able to respond to mouse clicks.
rpeterclark is offline   Reply With Quote
Old 17th August 2004, 16:58   #7
DigiMike
Member
 
Join Date: Aug 2004
Posts: 57
Send a message via ICQ to DigiMike Send a message via AIM to DigiMike
yeah i found that the ghost setting was the culprit but now half the skin is unusable and the right click menu still shows. Maybe i'll just have to leave this a completely button driven skin. Thanks for the help though.
DigiMike is offline   Reply With Quote
Old 17th August 2004, 17:03   #8
rpeterclark
Major Dude
(Reviewer)
 
rpeterclark's Avatar
 
Join Date: Aug 2002
Location: South Florida
Posts: 1,388
To stop the default right-click menu from showing you would do something like this based on your above code:

glass.onRightClick(){
menu.Leftclick();
complete;
}

To prevent the glass layer from getting clicks outside of the area you want, you can place it in it's own group with a background "mask", add drawbackground="0" to that group. Something like his:

PHP Code:
<groupdef id="player.glass" background="player.glass.mask" drawbackground="0">
    <
button id="Glass" image="wasabi.layoutitems.glass"x="0" y="0" ghost="1"/>
</
groupdef
I think that's right, I can't recall if you need to mess with the sysregion attribute in this case...
rpeterclark is offline   Reply With Quote
Old 17th August 2004, 17:10   #9
DigiMike
Member
 
Join Date: Aug 2004
Posts: 57
Send a message via ICQ to DigiMike Send a message via AIM to DigiMike
well what i was aiming for was a mostly transparent glass layer on top of a bunch of active objects (sliders, buttons, vis, etc)

I want the buttons to accept incomming clicks, the glass that is on top to accept right click, and the right click menu to not appear when the glass area over the buttons is clicked but still show over the outer frame.
DigiMike is offline   Reply With Quote
Old 17th August 2004, 17:13   #10
rpeterclark
Major Dude
(Reviewer)
 
rpeterclark's Avatar
 
Join Date: Aug 2002
Location: South Florida
Posts: 1,388
Ah, then yeah, there's not really a reasonable solution that would let the glass layer function like that.
rpeterclark is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump