• Welcome to TodayPlus Boards v2.
 

Incrementing Variables in Functions

Started by IanT, November 12, 2003, 04:43:50 PM

Previous topic - Next topic

IanT

Hi

This program is exactly what I have been looking for and I have rather ambituously started my own skin.  It is a simple skin, just text based no graphics.  I have created a world clock how I want it next a calendar where I have been partially successful.  I have managed to put two simple calenders on the today screen and two arrows.  My question is this - I would like to use these arrows to move forward/backward month by month and have the calendar change accordingly.  I have two problems with this:-

How do I use the arrows to update a variable?  I have tried

'imagebutton,226,50,right_arrow.png,t,11,6,%var19%=%var19%+1,11'

I am then trying to use this variable as follows:-

'calendar,0,%var19%,3,11,14,8,l'

Second problem, possibly linked to the fact that my only programming experience is in ancient basic and some database work.  How do I loop to go back to the beginning as if to constantly monitor for arrow depressions?  

Should I use paging for the second or is paging the answer for it all - restricting myself to two months ahead, two behind.

Any help would be appreciated.  Apologies for the long question.

Ian T

srs

the way to move to different months in the calendar is to use this (image) button command with action 8 (to advance forward one month), and 9 (to move back one month).

so for example if you have a calendar defined as such

calendar,0,0,0,24,14,13,box.png,t

the first two numbers (0,0) are the calendar id and initial offset.  In this case the calendar id is 0, and the initial offset is 0 (so the calendar will initially show the current month).

to advance the calendar do this

button,<x>,<y>,<width>,<height>,<target region>,8,0

the 8 is the action and specifies that the month should be advanced one month, and the 0 specifies which calendar to advance (calendar id 0 in this case).

for the <target region> enter in the region the calendar is in, so that the region will be redrawn (and will show the updated calendar).

----------------------------------------------------------

as for adding values to variables, there is button action 13, and the addvar command, but for what you are trying to accomplish these are not needed.

fishboy

To add value to a variable with imagebutton, use action 13.  So to add 1 to variable var19 you would use.

imagebutton,226,50,right_arrow.png,t,11,13,var19_1,11'


No need to perform any looping.  Once and area is defined with the imagebutton, or button command, TodayPlus automatically monitors these areas for click events.

EDIT: I knew there was probably a better way to do this (but didnt know this since I was posting at the same time as srs).
Axim X5 Advanced, Windows Mobile 2003

IanT

Thanks for the quick response.  As I looking to have two calendars on the same section updated by the same button I am currently attempting to implement the second which appears to allow this unless I can have two button commands refer to the same graphic?

Option 13 doesn't appear in my user guide, do I take it this is a recent option?

Many thanks for the help, I'm sure I'll get there.

Ian T

PS.  Next project currency rates on the today screen using RSS - is this possible or already done?  Used journal bar but doesn't do £/Euro due to its feeds being US based.

arbitrajeu

Quote from: IanTThanks for the quick response.  As I looking to have two calendars on the same section updated by the same button I am currently attempting to implement the second which appears to allow this unless I can have two button commands refer to the same graphic?
To do this, you can use an image button and a button referring to the same coordinates.  For example:

imagebutton,226,50,right_arrow.png,t,<region>,8,0
button,226,50,12,12,<region>,8,1

To advance both calendars with the same button.
[size=14]arbitrajeu[/size]
[size=12]todayplus moderator[/size]
[size=10]
iPAQ 3970, Windows Mobile 2003, 256MB SD, AgendaFusion 5[/size]

IanT

That worked, thanks a lot, appreciate it.

Ian T