|
I wrote the clock control because people kept asking "What time is it over there?". It's even more complicated because it changes. During the winter (over here) it's one hour difference from EST and during the summer it's three hours difference (because of Daylight Savings Time in both countries). The clock cycles through four displays: 1) current time in Brazil, 2) time that Scott has lived in Brazil , 3) time until my furniture arrives, 4) the estimate of the population in Brazil. The clock control was written in C++ with the ATL library. The tricky parts were to not use MFC or the standard library in order to keep the size down. Also, getting the clock to update was more difficult than I anticipated. In fact the clock uses a global variable which means if you embed the control twice, only the last one gets updated! (blech!). Here's the source code.
I got a report from a friend that the time was wrong (like 48100:107:9964 PM). I've updated the code, but if you see something like this, send me some e-mail. 1998-09-27 Update Updated the code to support transition effects. Split the code up to have a separate MyTime class, and MyTimeZone. Numeric formatting added so that the population has commas in it. Random number generator code, so that I wouldn't have to include the standard C library which bloats the size.
|