Event Countdown Timer

dlfallen

Active Member
Licensed User
Longtime User
Here is a little app that counts down the time to an event. Not exactly a mission critical application, but it can be fun.

FEATURES:
You can change the text strings and target time.

Multiple events and target times can be stored in an event db (e.g., New Years, Christmas, Halloween, Birthdays, Retirement date, etc.).

User can set one of the events as the default event to use on startup.

If no event db is present on startup, a default db is created with the event of the next New Year's Day.

ENJOY!

27 January 2010 - V1.1 Fixed bug causing crash.
28 January 2010 - V1.2 Fixed bugs identified by Taximania
29 January 2010 - V1.3 Added fix by Klaus to Calendar/timer, changed behavior after passing event time.
 

Attachments

  • Countdown13.zip
    274.5 KB · Views: 497
  • Display1.jpg
    Display1.jpg
    18.8 KB · Views: 422
  • Display2.jpg
    Display2.jpg
    18.7 KB · Views: 355
  • NewEvent.jpg
    NewEvent.jpg
    17.9 KB · Views: 370
  • EventDb.jpg
    EventDb.jpg
    12.2 KB · Views: 365
Last edited:

taximania

Well-Known Member
Licensed User
Longtime User
:sign0060:

This is what I've just spent a few hours of my life trying to produce.

Point being:

Use the search facility on the forum, it might save you hours of head scratching :)

EDIT: All my regular taxi customers keep saying, not long till the wedding now is it.
It's 23th Aug 2009, if I'd not already mentioned it. Think I have.
At least I can tell them exactly, just for the grin.
 
Last edited:

dlfallen

Active Member
Licensed User
Longtime User
Maybe Taximania is the only one to have used this program, but thought I would post a bug fix anyway - just in case.

The original post now as V1.1 attached which fixed a bug causing a crash if all Event Database items were deleted. I also added screenshots for the curious.

-Dave Fallen
 

taximania

Well-Known Member
Licensed User
Longtime User
Just a couple of bugs.

Because you check for TextBoxHr_keypress(key) etc
once you enter a number in the textbox, you can't edit it
because left right and backspace are ignored.
Also the old values aren't cleared if you set another event.

The SIP hides the Hr Min Secs Textbox's

I've attached my modified version of the original program to this post.
for you to consider. It still has the DB probs though.
 

Attachments

  • CountDownOrigMod.sbp
    8.5 KB · Views: 379

dlfallen

Active Member
Licensed User
Longtime User
Thanks for the feedback! I have fixed the problems you identified.

You actually could edit the entries in the previous version by highlighting the number with your stylus. Then, any new number would replace the original. I followed your suggestion to a better solution: Now the backspace key is recognized to make editing a little easier. It still filters for numbers like the previous version.

Old values are cleared when adding a new event.

I also rearrainged Form2 so the textboxes are not hidden by the SIP. I hadn't noticed this before because my devixe is a WQVGA so the SIP doesn't hide anything. Since writing this program I have installed an emulator so I currently test programs on a variety of platforms before I release them.

Thanks again, Taximania, for your input!
 

klaus

Expert
Licensed User
Longtime User
Hi Dave,

I had also a look at your program, and tried short countdowns of a few tenths of seconds and the program showed much more time.
I found a 'strange' behaviour of the Calendar control.
The Calendar.Value is by default initialized to Now and not to the todays date value. When you open the Calendar and click onto the totay's date then the Calendar.Value is OK.

To avoid this you should add in the AppStart rotine following line:
B4X:
[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Calendar1.Value=[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]DateParse[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Now[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]))[/SIZE][/FONT][/SIZE][/FONT]

Best regards.
 

dlfallen

Active Member
Licensed User
Longtime User
Thanks, Klaus - I have added that line to my program.

I won't post an update to my program until I finish a couple of more changes. I am adding a Years textbox so one can set events more than one year into the future. Also, once an event time has passed, the program displays negative and positive numbers, not too useful! I am going to change that behavior so the program will display the amount of time subsequent to the event having occurred.

-Dave
 

dlfallen

Active Member
Licensed User
Longtime User
OK, I hope this is a wrap.

I added the fix suggested by Klaus for the Calendar control.

I fixed the behavior of the program to display the time SINCE an event, once the event time is passed (see screenshot in first post).

Got rid of some ugly colors.

I did abandon the idea of adding Years and/or Months to the countdown. Weeks, days, hours, and minutes are all simple multiples of seconds. Months and years are not. It could be handled, but just didn't seem worth the effort.
 
Top