TodayPlus Boards v2

TodayPlus for the Pocket PC Forums => Help and Support => Topic started by: arbitrajeu on October 27, 2003, 11:25:30 AM

Title: Probably a straightforward one...
Post by: arbitrajeu on October 27, 2003, 11:25:30 AM
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?
Title: Probably a straightforward one...
Post by: arbitrajeu on October 27, 2003, 12:26:19 PM
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
Title: Probably a straightforward one...
Post by: srs on October 27, 2003, 12:38:47 PM
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.
Title: Probably a straightforward one...
Post by: arbitrajeu on October 27, 2003, 12:40:45 PM
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:
Title: Probably a straightforward one...
Post by: srs on October 27, 2003, 01:30:50 PM
all mind reading and magic will be reserved for version 2 (after all I gotta save something for version 2)  :P
Title: Probably a straightforward one...
Post by: arbitrajeu on October 27, 2003, 02:07:18 PM
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.