Position (x,y) variables Thread last updated on 2006-12-12 17:06:33

Posted by member 348804 on 2006-12-12 14:49:04

in xTaskbar.rc...why wont this work?

xTaskbarx 50
IF volume
xTaskbarx $xTaskbarx+40$
ELSE
xTaskbarx $xTaskbarx+100$
ENDIF

if I set xTaskbarx to 400 it works fine, but the variable addition doesn't.

Peter

Posted by member 1949 on 2006-12-12 16:04:12 link

Did you define volume in a var.rc file and include it in the theme.rc?

Posted by member 1 on 2006-12-12 16:05:31 link

How are you checking the variable addition? Are you using !Alert $xtaskbarx$ to see if it changes when you show the volume bar or something? If so...you won't see the change because eVars are only set on startup or recycle. To do it dynamically you need a scripting module.

Posted by member 348804 on 2006-12-12 16:31:57 link

I am extending another theme, so I am not entirely sure what is defined where. However if I !alert $volume$ I get a messagebox with true as the value. Hence I must assume it is defined.

I am not doing it dynamically, but rather a !recycle and then watching to see if the task bar moves, it does not.

Interestingly if I do this:
xTaskbarx 300
IF volume
xTaskbarx 100
ELSE
xTaskbarx 200
ENDIF

!recycle and then !alert $xTaskbarx$, I get 300...so it seems the whole IF block is failing, however the original IF block from the theme shown below (without ; of course) works fine for dynamic positioning of the taskbar. I am trying to add a new element, and simplify the IF logic.

Peter

;IF playerman AND NOT playerlaunched AND volume AND vwm
;xTaskbarx 212
;ELSEIF NOT playerman AND NOT playerlaunched AND volume AND vwm
;xTaskbarx 212
;ELSEIF playerman AND playerlaunched AND volume AND vwm
;xTaskbarx 382

;ELSEIF playerman AND NOT playerlaunched AND NOT volume AND vwm
;xTaskbarx 163
;ELSEIF NOT playerman AND NOT playerlaunched AND NOT volume AND vwm
;xTaskbarx 163
;ELSEIF playerman AND playerlaunched AND NOT volume AND vwm
;xTaskbarx 333

;ELSEIF playerman AND NOT playerlaunched AND volume AND NOT vwm
;xTaskbarx 100
;ELSEIF NOT playerman AND NOT playerlaunched AND volume AND NOT vwm
;xTaskbarx 100
;ELSEIF playerman AND playerlaunched AND volume AND NOT vwm
;xTaskbarx 270

;ELSEIF playerman AND NOT playerlaunched AND NOT volume AND NOT vwm
;xTaskbarx 50
;ELSEIF NOT playerman AND NOT playerlaunched AND NOT volume AND NOT vwm
;xTaskbarx 50
;ELSEIF playerman AND playerlaunched AND NOT volume AND NOT vwm
;xTaskbarx 220
;ENDIF
;xTaskbarx 163
;ELSE
;xTaskbarx 50
;ENDIF

Posted by member 212670 on 2006-12-12 16:35:37 link

The IF/ENDIF block isn't failing. xTaskbarX is already defined, so it's discarding the next one found. If for some reason you want to use a variable in the xTaskbarX definition, then use a different name.

SomeOtherName 100
IF volume
xTaskbarx $100+SomeOtherName$
ELSE
xTaskbarx $200+SomeOtherName$
ENDIF

But, if SomeOtherName is going to be static, I don't see the point in it in the first place.

Posted by member 348804 on 2006-12-12 16:41:55 link

excellent that worked...the SomeOtherName is a minimum x position, then I add on to that for each possible widget that is enabled

thx
Peter

Posted by member 348804 on 2006-12-12 16:45:19 link

well that worked and that didn't work :(
How would one go about writing the following C code without horrendous IF statements:

xOffset = 50
if (volume) xOffset += 40
if (vwm) xOffset += 100
if (player) xOffset += 200

This way we simply move the offset for each object loaded
Peter

Posted by member 212670 on 2006-12-12 16:54:36 link

xOffset 50
IF volume
xTaskbarX $xOffset+40$
ELSEIF vwm
xTaskbarX $xOffset+100$
ELSEIF player
xTaskbarX $xOffset+200$
ENDIF

That's not so bad?

Posted by member 1 on 2006-12-12 16:56:03 link

Value=50
If Volume
VolumePosition = 40
Else
VolumePosition = 0
EndIf
xTaskbarX $Value + VolumePosition$

Posted by member 348804 on 2006-12-12 17:06:33 link

xcal:
if volume AND vwm case is not handled, so that wont work. What I ended up doing was:

xTaskbarOffset 60
IF playerman
xtb1 160
ELSE
xtb1 0
ENDIF

IF volume
xtb2 50
ELSE
xtb2 0
ENDIF

if vwm
xtb3 113
ELSE
xtb3 0
ENDIF

xTaskbarx $xTaskbarOffset+xtb1+xtb2+xtb3$