Event Countdown Timer

Discussion in 'Share Your Creations' started by dlfallen, Jun 8, 2007.

  1. dlfallen

    dlfallen Active Member Licensed 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.
     

    Attached Files:

    Last edited: Jan 30, 2010
  2. taximania

    taximania Well-Known Member Licensed 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: Jun 8, 2009
  3. dlfallen

    dlfallen Active Member Licensed 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
     
  4. taximania

    taximania Well-Known Member Licensed 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.
     

    Attached Files:

  5. dlfallen

    dlfallen Active Member Licensed 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!
     
  6. klaus

    klaus Expert Licensed 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:
    Code:
    [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.
     
  7. taximania

    taximania Well-Known Member Licensed User

    I too noticed that Klaus, but wasn't sure how to correct it :)
     
  8. dlfallen

    dlfallen Active Member Licensed 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
     
  9. dlfallen

    dlfallen Active Member Licensed 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.
     
Loading...