• Welcome to TodayPlus Boards v2.
 

Button colour switch

Started by Timmy, January 05, 2005, 10:44:26 AM

Previous topic - Next topic

Timmy

@All,

In my latest skin, I've made eightteen new buttons, as you can see here:


I've worked the whole afternoon, but did not succeed in the following: when I click on a button, the clicked button must remain black, untill I click on another button.

Here's a little part (an example) of my skin text:
initvar,var1,0

imagebutton,230,8,Knop_1.png,,-1,0,\Program Files\ImageViewer\1.imv
button,230,8,8,8,-1,6,var1=1
imagebutton,221,8,Knop_2.png,,-1,0,\Program Files\ImageViewer\2.imv
button,221,8,8,8,-1,6,var1=2

if,var,var1,,=,1
image,230,8,knop-zwart.png,
else
if,var,var1,,=,2
image,221,8,knop-zwart.png,
else
endif
endif


What am I doing wrong???????????

Timmy
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

uk_skinner

Timmy:

 This might not be the best way, but here is my first solution.  You got 18 different size of buttons., so you need 18 "if..else..endif" to determine their status.  

if,var,var1,,=,1
  image,230,8,knop-zwart.png,
else
  image,230,8,button-black.png
endif

if,var,var1,,=,2
image,230,8,knop-zwart.png,
else
 image,230,8,button-black.png
endif


Alternatively, you can create 18 different png in which one "activate" 17 "inactivated" one and name the files like knop-zwatr1.png,knop-zwatr2.png...etc .  Then you can just need one code.  

image,230,8,knop-zwart%var1%.png

Timmy

UK_skinner,

With your help I won!  But it costs me bload, sweat and tears to fix it... The main problem was that I had to stop and reload TodayPlus. Then, at once. it worked!

Here's my skin code:
button,230,8,8,8,0,6,var1=1
button,221,8,8,8,0,6,var1=2
button,212,8,8,8,0,6,var1=3
button,203,8,8,8,0,6,var1=4

if,var,var1,,=,1
image,230,8,Zwart0.png
else
image,230,8,knop1.png
endif

if,var,var1,,=,2
image,221,8,Zwart0.png
else
image,221,8,Knop2.png
endif

if,var,var1,,=,3
image,212,8,Zwart0.png
else
image,212,8,Knop3.png
endif

if,var,var1,,=,4
image,203,8,Zwart0.png
else
image,203,8,Knop4.png
endif

button,230,8,8,8,-1,0,\Program Files\ImageViewer\1.imv
button,221,8,8,8,-1,0,\Program Files\ImageViewer\2.imv
button,212,8,8,8,-1,0,\Program Files\ImageViewer\3.imv
button,203,8,8,8,-1,0,\Program Files\ImageViewer\4.imv

  ... and so on for the other 14 buttons.


Thanks again!
Timmy
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

Timmy

And here are the images:




Timmy
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom