Join Our 3 MILLION+ Members Today! Register Here | Login
Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > Theme Developers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
    Thread Author   #1  
Old 07-03-2011, 07:09 PM
CrackBerry User
 
Join Date: Sep 2010
Posts: 15
Likes Received: 0
Thanked 0 Times in 0 Posts
Default Button event

Does anyone know how to successfully create a button event(focus, click) for a touch screen theme(torch\storm). Manually editing the svg file may be the only way to go. Please assist. Thank you.
Reply With Quote Tip this Post
  #2  
Old 07-04-2011, 12:11 AM
CrackBerry Abuser
Device(s): 9700 (Bold)
Carrier: Rogers
Pin: PM ME
 
Location: Victoria
Join Date: Jun 2008
Posts: 239
Likes Received: 17
Thanked 28 Times in 19 Posts
Default

Check out matt ginsbergs website. He has a tutorial on how to create buttons for storm. What are you looking to do?

Posted from my CrackBerry at wapforums.crackberry.com
Reply With Quote Tip this Post
  #3  
Old 07-04-2011, 03:55 AM
CrackBerry Master
Device(s): 9850 7.1.0.402 + PlayBook 16Gb
Carrier: Verizon
Pin: PM me for it!
 
Location: Eastern Shore of MD
Join Date: Sep 2008
Posts: 1,090
Likes Received: 119
Thanked 217 Times in 126 Posts
Default

For a touch button:

<rect id="button" x="100" y="100" width="50" height="50" fill="black"/>
<loadScene xlink:href="x-object:/slot0" begin="button.focusin"/>

For a click button you would just change "button.focusin" to "button.activate".

Your actual button can be pretty much anything, for example an image:

<image id="another_button" x="50" y="50" width="30" height="30" xlink:href="button.png"/>

Hope this helps!

Russ.

Posted from my CrackBerry at wapforums.crackberry.com
Reply With Quote Tip this Post
  #4  
Old 07-04-2011, 12:37 PM
CrackBerry Master
Device(s): 9850 7.1.0.402 + PlayBook 16Gb
Carrier: Verizon
Pin: PM me for it!
 
Location: Eastern Shore of MD
Join Date: Sep 2008
Posts: 1,090
Likes Received: 119
Thanked 217 Times in 126 Posts
Default

Quote:
Thanks Ross. My question was not clear enough however. I really want to trigger an event (eg. show a different wallpaper) after the screen is touched. Would the loadscene tag accomplish this? Thanks again.
Chris
Chris,

You won't be able to directly change the wallpaper, but you could simply add your own images for the background wallpapers and just switch them as the user clicks buttons:

Code:
<image id="wall1" x="0" y="0" width="360" height="480" xlink:href="wall1.png" display="inline"/>

<image id="wall2" x="0" y="0" width="360" height="480" xlink:href="wall2.png" display="none"/>

<image id="wall3" x="0" y="0" width="360" height="480" xlink:href="wall3.png" display="none"/>

<rect id="wall1hs" x="10" y="10" width="30" height="30" fill="blue"/>
    <set xlink:href="#wall1" attributeName="display" to="inline" begin="wall1hs.activate"/>
    <set xlink:href="#wall2" attributeName="display" to="none" begin="wall1hs.activate"/>
    <set xlink:href="#wall3" attributeName="display" to="none" begin="wall1hs.activate"/>

<rect id="wall2hs" x="50" y="10" width="30" height="30" fill="blue"/>
    <set xlink:href="#wall1" attributeName="display" to="none" begin="wall1hs.activate"/>
    <set xlink:href="#wall2" attributeName="display" to="inline" begin="wall1hs.activate"/>
    <set xlink:href="#wall3" attributeName="display" to="none" begin="wall1hs.activate"/>

<rect id="wal3hs" x="90" y="10" width="30" height="30" fill="blue"/>
    <set xlink:href="#wall1" attributeName="display" to="none" begin="wall1hs.activate"/>
    <set xlink:href="#wall2" attributeName="display" to="none" begin="wall1hs.activate"/>
    <set xlink:href="#wall3" attributeName="display" to="inline" begin="wall1hs.activate"/>

<rect id="walluserhs" x="130" y="10" width="30" height="30" fill="blue"/>
    <set xlink:href="#wall1" attributeName="display" to="none" begin="walluserhs.activate"/>
    <set xlink:href="#wall2" attributeName="display" to="none" begin="walluserhs.activate"/>
    <set xlink:href="#wall3" attributeName="display" to="none" begin="walluserhs.activate"/>
So, basically, for wall1 through 3 you simply are displaying the relevant image and hiding the others. When the user selects the walluserhs you are hiding all three images and allowing the standard wallpaper to show.

Russ.
__________________
"If anyone would come after me, let him deny himself and take up his cross and follow me" - Matthew 16:24

Follow me on twitter: graymatteron
Reply With Quote Tip this Post
    Thread Author   #5  
Old 07-20-2011, 06:08 PM
CrackBerry User
 
Join Date: Sep 2010
Posts: 15
Likes Received: 0
Thanked 0 Times in 0 Posts
Default Errors

Thanks Ross,

But I keep getting the errors below:

SVG failed to import correctly.
Certain portions of the SVG may not be rendered correctly.
The SVG file: C:\Documents and Settings\... may not be rendered correctly for the following reasons:


Duration is not defined
Duration is not defined
Duration is not defined
Duration is not defined
Duration is not defined
Duration is not defined
Duration is not defined
Duration is not defined
Duration is not defined
Reply With Quote Tip this Post
  #6  
Old 07-20-2011, 08:43 PM
CrackBerry Master
Device(s): 9850 7.1.0.402 + PlayBook 16Gb
Carrier: Verizon
Pin: PM me for it!
 
Location: Eastern Shore of MD
Join Date: Sep 2008
Posts: 1,090
Likes Received: 119
Thanked 217 Times in 126 Posts
Default

Please post your svg file Chris.
__________________
"If anyone would come after me, let him deny himself and take up his cross and follow me" - Matthew 16:24

Follow me on twitter: graymatteron
Reply With Quote Tip this Post
  #7  
Old 07-20-2011, 10:33 PM
CrackBerry Abuser
Device(s): 9700 (Bold)
Carrier: Telkomsel
 
Location: Indonesia
Join Date: Aug 2010
Posts: 136
Likes Received: 1
Thanked 0 Times in 0 Posts
Default

Duration is not defined error is usually fine to ignore. My themes have had at least 64 duration not defined errors and they work just fine, except maybe there will be uncaught exception error at startup

Posted from my CrackBerry at wapforums.crackberry.com
Reply With Quote Tip this Post
    Thread Author   #8  
Old 07-21-2011, 11:47 AM
CrackBerry User
 
Join Date: Sep 2010
Posts: 15
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the responses. Ross I dont have the file with me now but I used the same example you provided changing only the href image path and filename(image\myimage.png) to a valid one and "wall1hs" to the respective "wall2hs" and "wall3hs". Nothing happens when I click the blue rectangles in the 9800 simulator. Please help.
Reply With Quote Tip this Post
Reply
BlackBerry Forums at CrackBerry.com > > BlackBerry Professionals > Theme Developers   Button event

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes