• Welcome to TodayPlus Boards v2.
 

Probably a straightforward one...

Started by arbitrajeu, October 27, 2003, 11:25:30 AM

Previous topic - Next topic

arbitrajeu

I have the following code to toggle the online/offline state, and I also link in the availability of the refresh button with this state, ie if offline, we can't refresh weather/rss data.

region,7,0,-1

imagebutton,132,3,offline.png,t,0,30,,0,7,8,9,10
button,132,3,11,11,7,4,1

endregion,7,0

region,7,1,-1

imagebutton,132,3,online.png,t,0,31,,0,7,8,9,10
button,132,3,11,11,7,4,0
imagebutton,146,3,refresh.png,t,0,7,,-1

endregion,7,1


Initially we are offline, so we only see my offline button and no refresh.  Then, once I have clicked the button we are online and the refresh button is visible.  However, when I click again to say we are now offline, the refresh button image remains, although it is not clickable.  What am I missing?
[size=14]arbitrajeu[/size]
[size=12]todayplus moderator[/size]
[size=10]
iPAQ 3970, Windows Mobile 2003, 256MB SD, AgendaFusion 5[/size]

arbitrajeu

Incidentally, I have now tried this with a full rerender, and it works okay, but would like to find a more efficient way to do it, ie

region,7,0,-1

imagebutton,132,3,offline.png,t,0,30,,0,7,8,9,10
button,132,3,11,11,7,4,1,-1

endregion,7,0
[size=14]arbitrajeu[/size]
[size=12]todayplus moderator[/size]
[size=10]
iPAQ 3970, Windows Mobile 2003, 256MB SD, AgendaFusion 5[/size]

srs

I'm almost positive that region 7 doesn't have the correct dimensions defined in the defregion, which is why when you do a refresh of region 7, the area region 7 occupies doesn't get cleared properly.

arbitrajeu

Quote from: srsI'm almost positive that region 7 doesn't have the correct dimensions defined in the defregion, which is why when you do a refresh of region 7, the area region 7 occupies doesn't get cleared properly.
You're absolutely right.  This was the definition for region 7:

defregion,7,0,0,0,0,2

Of course, I expected your code to magically know that I wanted to refresh just the two buttons in that region.  Sheesh! :wink:
[size=14]arbitrajeu[/size]
[size=12]todayplus moderator[/size]
[size=10]
iPAQ 3970, Windows Mobile 2003, 256MB SD, AgendaFusion 5[/size]

srs

all mind reading and magic will be reserved for version 2 (after all I gotta save something for version 2)  :P

arbitrajeu

I dunno, this whole thing feels a bit like magic right now.  I've not had so much fun since I got my first Pocket PC.  Thanks again.
[size=14]arbitrajeu[/size]
[size=12]todayplus moderator[/size]
[size=10]
iPAQ 3970, Windows Mobile 2003, 256MB SD, AgendaFusion 5[/size]