Mouse scroll in the python plugin

Discussion about user contributed plugins

Moderator: Moderator

Fredde
veteran
Posts: 288
Joined: Tue Dec 06, 2005 7:18 am
Location: Sweden

Mouse scroll in the python plugin

Postby Fredde » Sat Jan 24, 2009 10:37 am

I added a way to achive mouse scroll in the python plugin (rev 2065)

This should work automatically in the script laucher window, but only in the standard theme (rev 2065), because I had to change the scriptwindow-*.xml that contain the gui-layout of that window.

I didn't add mouse scroll the appletrailer or youtube pyglets, because then you need the latest rev. But if you upgrade it's easy to add mouse scroll:

Appletrailers:
Open appletrailers-0.3.6/gui/window.xml and add the last line in the code below:

Code: Select all

<window>
   <id>1001</id>
   <defaultcontrol>30</defaultcontrol>
   <width>800</width>
   <height>600</height>
   <controls>
      <control>
         <description>Image Control</description>
         <type>image</type>
         <id>1</id>
         <posx>0</posx>
         <posy>0</posy>
         <width>800</width>
         <height>600</height>
         <layer>0</layer>
         <texture>general/bg.png</texture>
         <routecontrol>12</routecontrol>            <-- Add this line


Youtube:
Open youtube-0.2.2/gui/mainwindow.xml and add the last line in the code below:

Code: Select all

<window>
   <id>1001</id>
   <defaultcontrol>22</defaultcontrol>
   <width>800</width>
   <height>600</height>
   <controls>
      <control>
         <description>Image Control</description>
         <type>image</type>
         <id>1</id>
         <posx>0</posx>
         <posy>0</posy>
         <width>800</width>
         <height>600</height>
         <layer>0</layer>
         <texture>general/bg.png</texture>
         <routecontrol>13</routecontrol>          <-- Add this line


It's really quite simple. It route the actions sent to one control to an other. In the code above actions sent to the background image control is routed to the control with id 12 (appletrailers), 13 (youtube), which is the list control. So when you hold down the left mouse button and move the mouse over the background image, pg_up and pg_down is routed to the list, simple and effective :)

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Re: Mouse scroll in the python plugin

Postby arj » Tue Jan 27, 2009 12:52 am

Nice. I think maybe we should add this in before we do 1.1.0 final. Please remind me when I do a last call for changes :D

Fredde
veteran
Posts: 288
Joined: Tue Dec 06, 2005 7:18 am
Location: Sweden

Re: Mouse scroll in the python plugin

Postby Fredde » Tue Jan 27, 2009 5:50 am

Will do :D


Return to “user plugins”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest