• Welcome to TodayPlus Boards v2.
 

Weather left arrow

Started by Blazingwolf, January 11, 2004, 10:17:33 AM

Previous topic - Next topic

Blazingwolf

I have been trying to add in a left arrow to the weather section. I have tried this code:

imagebutton,119,64,left_arrow.png,t,0,13,var0_-1,1

If I understand the skin reference correctly the -1 should subtract 1 from var0. The problem is if I use the button from the starting point it does not go back to the next city. It just blanks out the weather info. Example: I have 3 cities for weather. If I right arrow to the second or third city the left arrow will go back to the next city. If I start from the first city and tap the left arrow the weather is blanked.

Anyone have an idea.

Oh, as a side note I have also tried to add more on to var0 also. Ex:add 3 to var 0 to make it go all the way around. This way it will move back to the first city. but if I hi the left arrow it stays on the same first city.
Toshiba E800 WM2003 SE
Ipaq 3955 WM2003, SD and CF,Pocket Informant
Dell Axim X5 PPC2002 SD and CF (Wife's)

dp1don

BW:

You need to include a routing that tests the value of your weather city variable.

You read in the number of citites in a variable early on:

calcvar,var29,fromconfig,numcities

Then, in your weather sec, you include something that looks like the following:


//create variable controlled by arrow keys

initvar,var0,1

//define buttons and how they affect var0

imagebutton,119,64,left_arrow.png,t,0,13,var0_-1
imagebutton,130,64,right_arrow.png,t,0,13,var0_1

//test var0 for value (can't be > var29 or <1)
if,var,var0,,>,%var29%
storevar,var0=1
else
endif

if,var,var0,,<,1
storevar,var0=%var29%
else
endif


You'll need to modify the x,y values to meet your skin, but this should  do the hi/low test for you.

And I can't claim credit for this myself...this is just a minor mod of the code in the RSS Headline section from Slider - which hasppens to do the test you want it to.

Hope this helps,
DP1Don

joelw135

Tried that changed X & Y, all it did was prevented TodayPlus form loading at all.
Dell Axim X3i, Windows Mobile 2003
512mb Kingston SD card
256mb Lexar SD card
Today Plus
WisBar Advanced
PIEPlus
DotPocket

dp1don

Don't know what you did wrong, Joel...

it works for me.

dp1don

Blazingwolf

dp1don, Thanks for the suggestion. it does work to a certain extent. However, instead of going to the third city when you tap on it half of the region disappears(not the weather region but in region 0 where I have this code(I might need to change something there)). It then goes to the 2nd city with no problems. Which is almost the same with out adding that code. Any more ideas?
Toshiba E800 WM2003 SE
Ipaq 3955 WM2003, SD and CF,Pocket Informant
Dell Axim X5 PPC2002 SD and CF (Wife's)

Scotty

I know this doesn't help Blazingwolf (sorry  :cry: ) - but the code works for me, no problems....

Scotty

Blazingwolf

Quote from: ScottyI know this doesn't help Blazingwolf (sorry  :cry: ) - but the code works for me, no problems....

Scotty

Are you using this in just the regular weater section? I'm wondering if it has to do with the fact I have some of the code in the 0 region.
Toshiba E800 WM2003 SE
Ipaq 3955 WM2003, SD and CF,Pocket Informant
Dell Axim X5 PPC2002 SD and CF (Wife's)

joelw135

More Information!!!

We have the current weather conditions in region 0, and the 5 day forecast in the weather region.

We need a left arrow button to scroll back through the cities. If any one knows how to achieve this pleaser post. Thanks.
Dell Axim X3i, Windows Mobile 2003
512mb Kingston SD card
256mb Lexar SD card
Today Plus
WisBar Advanced
PIEPlus
DotPocket

dp1don

So I know what you are looking for, Joel:

Current Weather for your home city is in region 0, and 5 day forecast is in your standard weather region.

So, when you wish to scroll through cities, which do you wish to change:

1) Both Current weather and 5-day forecast?
2) Current Weather only?
3) 5- day forecast only?

Let me know....I think I might have an answer for you...

joelw135

Both the current weather and the five day.
Dell Axim X3i, Windows Mobile 2003
512mb Kingston SD card
256mb Lexar SD card
Today Plus
WisBar Advanced
PIEPlus
DotPocket

dp1don

As far as I have found (with testing and the limited documentation online)...it can't be done.

The reason is that it seems that each region updates independently... so while we can use the load command to tie the ciity value to a variable, and use the arrows in one section to modify that variable, and thus change the display in that section...I don't believe the changes cross over globally...

In other words, the refresh only occurs in the active section, not in all sections...

I'm going to experiment with this over the next couple of days and see if there is a way around it...

SRS, Eitel...anytime you want to chime in and say I'm wrong, please do so!

dp1don

Scotty

Hi Blazingwolf:

Yes, it's in the weather section. I don't really want weather info in region 0. Just a matter of individual preference. I have, though, been playing around with the weather section, and have it set so that the home city automatically shows a 5 day forecast, with no "current conditions" information (I reckon I can look out of the window for that, and it's more accurate  :wink: ), but when I scroll to any "non-home" city, the display changes automatically to show current conditions (and update time), followed by a 4-day forecast. I attach a couple of jpgs.

All the best....................Scotty

Scotty

Blazingwolf

dp1don,

I see what you are saying but it makes no sense that we can arrow through with the right arrow and not the left. If you look at the skin on this page you will notice that the right arrow works both regions. The left arrow works to a certain extent, at least until I try to go from city 1 to city 3( not in the skin). As far as active sections, both sections are active(or even if region 0 only was active) so I am not sure why this wouldn't work.

I have also tried to make the weather section in region 0 it's own region but that is not working either. :(

Perhaps it is impossible but this program does so much why not that.

Scotty, Thank you for letting me know.
Toshiba E800 WM2003 SE
Ipaq 3955 WM2003, SD and CF,Pocket Informant
Dell Axim X5 PPC2002 SD and CF (Wife's)

MadTxn

Quote from: dp1donBW:

You need to include a routing that tests the value of your weather city variable.

You read in the number of citites in a variable early on:

calcvar,var29,fromconfig,numcities

Then, in your weather sec, you include something that looks like the following:


//create variable controlled by arrow keys

initvar,var0,1

//define buttons and how they affect var0

imagebutton,119,64,left_arrow.png,t,0,13,var0_-1
imagebutton,130,64,right_arrow.png,t,0,13,var0_1

//test var0 for value (can't be > var29 or <1)
if,var,var0,,>,%var29%
storevar,var0=1
else
endif

if,var,var0,,<,1
storevar,var0=%var29%
else
endif


You'll need to modify the x,y values to meet your skin, but this should  do the hi/low test for you.

And I can't claim credit for this myself...this is just a minor mod of the code in the RSS Headline section from Slider - which hasppens to do the test you want it to.

Hope this helps,
DP1Don

I've somehow been missing this thread... Anyway, here's what you do...

You need an if statement that redraws your image button...
[pseudocode]
if city=1
 imagebutton that makes var0 = 3, and refreshes both sections
else
 imagebutton var0_=1
endif
[/pseudocode]

That should work.  You may need to add a button to refresh the section or something.  I'm not sure.

jhollin1138

I haven't tried to make a "left arrow" for the weather region, but I have been able to make one for both my Launcher and Clock regions.  See this post.  Maybe the code for my Launcher region might be helpfully.
region,16,0,-1
updateregions,18
initvar,var16,1

region,18,0,-1

imagebutton,3,3,left_arrow.png,t,16,13,var16_-1

if,var,var16,,>,%var18%
storevar,var16=1
else
endif

if,var,var16,,<,1
storevar,var16=%var18%
else
endif

<Insert Region Code Here>

imagebutton,226,2,right_arrow.png,t,16,13,var16_1

endregion,18,0

endregion,16,0


Note: I only kept the code that is required to actually control the "left arrow" and "right arrow." The variable "var18" is for the maximum number of items defined.

I'll see what I can do about making adding a "left arrow" to my weather region after lunch.

Edit: While I was at lunch, I had a thought of allowing the user to scroll thru different forecast days for a city.  The code (I won't post it) for my clock region can be modified to do this.
Jim H