View Full Version : ThrottleLauncher Widgets (Sample: S2P Widget)
APBilbo
1st October 2008, 03:40 PM
Hi!!
I've released a prebeta of 0.9.4 version (http://www.throttlelauncher.com) to public. This version has the posibility to include moveable widgets. I post this thread to show an example on how to build simple but powerfull widgets.
For example I've done in about 20 minutes this S2P widget:
http://forum.xda-developers.com/attachment.php?attachmentid=117796&stc=1&d=1222868198
The code is this one:
<?xml version="1.0" encoding="utf-8"?>
<panel name="S2PWidget" width="116" height="106">
<icon X="0" Y="0" path="widgets\S2PWidget\back.png"/>
<panel name="Cover" X="3" Y="3" width="70" height="70">
<icon path="widgets\S2PWidget\album.png" exec="#@S2PPath#" height="70" width="70">
<event type="MouseDown"><action execute=":Script" parameters="S2PWidget:Set(MoveLock,true)"/></event>
</icon>
<icon path="#$Registry,HKEY_CURRENT_USER\Software\A_C\S2P\Curr entAlbum#" exec="#@S2PPath#" height="70" width="70">
<event type="MouseDown"><action execute=":Script" parameters="S2PWidget:Set(MoveLock,true)"/></event>
</icon>
</panel>
<icon X="83" Y="5" name="Prev" exec="#$THROTTLE#\Util\S2PControl.exe" params="Previous" path="widgets\S2PWidget\previous.png"/>
<icon X="78" Y="35" name="Play" exec="#$THROTTLE#\Util\S2PControl.exe" params="PlayPause" path="widgets\S2PWidget\#$Registry,HKEY_CURRENT_USER\Sof tware\A_C\S2P\Status,map,[0-pause|default-play]#.png"/>
<icon X="83" Y="75" name="Next" exec="#$THROTTLE#\Util\S2PControl.exe" params="Next" path="widgets\S2PWidget\next.png" />
<text name="Artist" X="3" Y="70" width="70" height="30" alignment="Near" fontcolor="255,255,255" fonttype="7,true" text="#$Registry,HKEY_CURRENT_USER\Software\A_C\S2P\Curr entTitle#" leftmargin="0" textheight="30" textwidth="70" topmargin="2" spacing="0" />
</panel>
As you see it's 16 lines of code for a realtively complex widget that controls S2P :).
To install the widget just un compress the zip file to \Program Files\ThrottleLauncher\Widgets and it should now appear when you click the plus button of the widgets page.
If you include Mortscripts in the ecuation.... you can have almost anything done!! :).
Hope you'll find this interesting and contribute if you develop cool widgets :).
edit: I forgot. You can also include any widget in any page you want by adding <widget name="NAME"/> where name is the folder of the widget. This way you can design module based themes and you can reuse components from one theme to another!
Thanks!!
nir36
1st October 2008, 03:54 PM
i'm gonna hardreset and start exploring your new beta.. try to write something of my own as well..
thanks man.
-Arturo-
1st October 2008, 05:03 PM
Thanks! I think I'm going to ditch M2D for this:)
APBilbo
1st October 2008, 05:40 PM
Thanks! I think I'm going to ditch M2D for this:)
i'm gonna hardreset and start exploring your new beta.. try to write something of my own as well..
thanks man.
Thanks to both... :). I know it's bad that I'm the one telling it.... but I really thing this is worth a try.
frenchglen
1st October 2008, 07:33 PM
Nice work, keep it up!
LeAdReW
1st October 2008, 09:34 PM
made it little bigger and placed buttons under album image and placed on home tab?looks great?tnx
APBilbo
1st October 2008, 11:32 PM
made it little bigger and placed buttons under album image and placed on home tab?looks great?tnx
You mean that you've done that?... or is it a request? It's really eassy to do it :), hope you've managed to do it...
pgiuoco
1st October 2008, 11:47 PM
I just installed the release and I can't find how to get the widgets, sry about the noob question
APBilbo
1st October 2008, 11:51 PM
I just installed the release and I can't find how to get the widgets, sry about the noob question
Widgets are in the last tab of the footer. You should see a page with a [+] icon on it... click on the [+] and a dialog must show with the available widgets. Select wichever you want and hit ok, they should appear after a little delay....
Techie87
1st October 2008, 11:57 PM
nice work mate, keep it up :)
pgiuoco
1st October 2008, 11:57 PM
lol i accidentally installed the old verson off my sdcard, thx again for for your help
APBilbo
2nd October 2008, 12:10 AM
nice work mate, keep it up :)
Thanks!! :)
APBilbo
2nd October 2008, 12:10 AM
lol i accidentally installed the old verson off my sdcard, thx again for for your help
Hehehe, you have scared me for a moment :P. Glad it was such a simple thing ;).
aeratos
2nd October 2008, 01:03 AM
Posted More Plz Thx And New Ideas
malrok37
2nd October 2008, 01:31 AM
Gosh :eek:
Will you ever stop improving your software ?
Amazing job, this app just gets better with every release ;)
I will try some tweaks myself asap
Thx for your job !
LeAdReW
2nd October 2008, 08:19 AM
i have done it,its really easy to customize,tnx,now i delete album art to make it less in height,only track info and buttons
jdiperla
2nd October 2008, 02:22 PM
AP, can you describe some more Event types? I cant seem to find the documentation on that. Also can you describe the scripts as well that are mentioned in this line of code:
execute=":Script" parameters="S2PWidget:Set(MoveLock,true)
APBilbo
2nd October 2008, 03:18 PM
AP, can you describe some more Event types? I cant seem to find the documentation on that. Also can you describe the scripts as well that are mentioned in this line of code:
execute=":Script" parameters="S2PWidget:Set(MoveLock,true)
Sorry... I know this is not documented still... that's what the wiki on my web is for ;).
This is what I can give you right now....
You can specify event's inside Elements and inside pages. Inside each event you can specify as much actions as you want. Here you have an example you can place inside a Page to make it lauch an app:
<event type="PageShow">
<action execute="#$THROTTLE#\Util\PruebaMAPI\Message2Reg.e xe" parameters="#@SMSAccount# Refresh"/>
</event>
Possible events are:
- For pages: PageLoad,PageUnload,PageShow,PageHide,UpDownGestur e,DownUpGesture,LeftRightGesture,RightLeftGesture, ChangeToLandscape,ChangeToPortraitvalid for pages.
- For elements: Click,ElementUpdate
- For elements inside rows with advancedevents="true" (like the widgets page): MouseDown,MouseOver,MouseUp.
Possible actions are (the same that for icons and texts)
- Any executable file with params
- :Page (parameter is the page name to load)
- :Exit
- :Apps2Cat (parameter is the category to assign)
- :Reload
- :OthersPage (parameter is the page number)
- :Minimize
- :Config
- :ConfigSetup
- :Script: this is the most complicated. execute=":Script" and the param must match this pattern XXXXXX:YYYY(args). for example: <action execute=":Script" parameters="Battery:Refresh()"/>
XXXXXX is the name of the element to change
YYYY is the method to call. Methods supported are:
o Set: Set(Property,value) will set the property to the target value. Valid properties are Name,X,Y,Width,Height,Visible. LocketState is also valid, if set to true the element will follow the finger arround the screen and inside it's containing row until it's released.
o Refresh: supports:
+ (). Will update the whole XXXXXX element
+ (num) will update the XXXXX and the num pixels arround it.
+ (numX,numY) numX means margin in X and numY means margin Y.
+ (x,Y,Width,Height) all the numbers represent margin. To update an especific area watch the next command.
o RefreshRectangle: suports (X,Y,Width,Height)
o Add. Supports (Property,number) will set the property to the property value plus number. Only valid for numeric properties.
o Complement. Supports (property). Only valid for boolean properties (Visible). Will complement it.
jdiperla
2nd October 2008, 04:12 PM
WOW!
This totally makes ThrottleLauncher very customizable, especially with MortScript!
Thanks for the help.
APBilbo
2nd October 2008, 04:14 PM
WOW!
This totally makes ThrottleLauncher very customizable, especially with MortScript!
Thanks for the help.
That's the target ;).
Thank you for your interest!
fards
2nd October 2008, 08:41 PM
Pretty neat.
I've reworked the s2p widget and made it bigger.
Then changed it to run off mortplayer with track artist and album, and used it on the Music tab, no album art but all the details work, which is better than the standard music tab.
yrsmart
2nd October 2008, 08:47 PM
Widgets are in the last tab of the footer. You should see a page with a [+] icon on it... click on the [+] and a dialog must show with the available widgets. Select wichever you want and hit ok, they should appear after a little delay....
Everytime i try to click the plus button it does nothing.
APBilbo
2nd October 2008, 11:50 PM
Pretty neat.
I've reworked the s2p widget and made it bigger.
Then changed it to run off mortplayer with track artist and album, and used it on the Music tab, no album art but all the details work, which is better than the standard music tab.
Great!! :). Chan you share the code please? It could be usefull.... BTW I've already solved the album art issue for next version. It's a core bug...
Thanks!!
APBilbo
2nd October 2008, 11:51 PM
Everytime i try to click the plus button it does nothing.
Check if your widgets folder exist... Also have you tweaked any widget or added any new folder to the widget page?
fards
3rd October 2008, 12:25 AM
Great!! :). Chan you share the code please? It could be usefull.... BTW I've already solved the album art issue for next version. It's a core bug...
Thanks!!
No problem here's the widget xml, nothing special but tweaked yours to work with MP as I can't get S2P working in 96dpi, it paints it off the screen for some reason and locks the device..
<?xml version="1.0" encoding="utf-8"?>
<panel name="S2PWidget" width="182" height="182">
<panel name="Cover" X="3" Y="3" width="182" height="140">
<icon path="widgets\S2PWidget\album.png" exec="#@S2PPath#" height="140" width="140">
<event type="MouseDown"><action execute=":Script" parameters="S2PWidget:Set(MoveLock,true)"/></event>
</icon>
<icon name="Cover" path="#@WMPCoverPath#\#$Registry,HKEY_CURRENT_USER\Softw are\A_C\S2P\CurrentAlbum#" exec="#@S2PPath#" height="140" width="140">
<event type="MouseDown"><action execute=":Script" parameters="S2PWidget:Set(MoveLock,true)"/></event>
</icon>
</panel>
<icon X="141" Y="30" name="Prev" exec="#$THROTTLE#\Util\MortPControl.exe" params="Previous" path="widgets\S2PWidget\previous.png"/>
<icon X="136" Y="70" name="Play" exec="#$THROTTLE#\Util\MortPControl.exe" params="PlayPause" path="widgets\S2PWidget\#$Registry,HKEY_CURRENT_USER\Sof tware\Mort\MortPlayer\Remote\StatePaused,map,[0-pause|default-play]#.png"/>
<icon X="141" Y="120" name="Next" exec="#$THROTTLE#\Util\S2PControl.exe" params="Next" path="widgets\S2PWidget\next.png" />
<text name="Artist" X="23" Y="140" width="140" height="60" alignment="Near" fontcolor="255,255,255" fonttype="14,true" text="#$Registry,HKEY_CURRENT_USER\Software\Mort\MortPla yer\Remote\TrackArtist#" leftmargin="0" textheight="60" textwidth="140" topmargin="4" spacing="0" />
<text name="Title" X="23" Y="160" width="140" height="60" alignment="Near" fontcolor="255,255,255" fonttype="14,true" text="#$Registry,HKEY_CURRENT_USER\Software\Mort\MortPla yer\Remote\TrackTitle#" leftmargin="0" textheight="60" textwidth="140" topmargin="4" spacing="0" />
</panel>
and this is what TL looks like at 96dpi 640x480 realvga on my advantage btw..
need to change the font colours around the clock and maybe move it down a touch.
Still looks pretty sharp even using the vga upscaling..
I've changed the home in landscape so it just has the clock.
Background found in the Diamond forum...
request from me now, any way of making the footer vertical so it can go down the right hand side in landscape?
yrsmart
3rd October 2008, 06:35 AM
Check if your widgets folder exist... Also have you tweaked any widget or added any new folder to the widget page?
Yes it is there, but i did not add new folders.
PzykoSkillz
17th April 2009, 06:28 AM
I've got TL 1.0 and on the Android theme, I can't move my widgets around, they're all stuck in the middle on top of one another....
malrok37
17th April 2009, 11:20 AM
I've got TL 1.0 and on the Android theme, I can't move my widgets around, they're all stuck in the middle on top of one another....
Hi
In fact you have to "unlock" them.
To do that you have to push the tab on top of the screen and slide to the lock sign without releasing your finger.
You should then be able to move your widgets...
PzykoSkillz
17th April 2009, 11:09 PM
Hi
In fact you have to "unlock" them.
To do that you have to push the tab on top of the screen and slide to the lock sign without releasing your finger.
You should then be able to move your widgets...
Thanks, man. I figured that out not long after I posted this, lol...
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.