Digital Clock Class

Sample Image

The CGCClock class allows the developer to quickly place a clock in a user interface. It is publicly derived from the CGCColorStatic class to provide the ability to control the background and text colors, the font utilized, the border style and more.

The CGCClock class provides the capability to select between 12 hour format or 24 hour (sometimes referred to as "military time") format.

HOW TO USE CGECClock

  • 1. Add the CGCClock class to your project.
  • 2. Add the CGCColorStatic class to your project.
  • 3. Place a static text control using the Resource Editor.
  • 4. For best results, set the "Align Text" style to "Center" and check the "Center vertically" style.
  • 5. Use ClassWizard to create a member variable for the control of type CGECClock.
  • 6. Call the Start() method to start the clock running.
  • Downloads

    Download demo application - 101 Kb
    Download demo source - 36 Kb


    Comments

    • A one another good bug

      Posted by g_arora on 11/06/2005 07:09am

      Its good but wants more labour to modify. Ayway, well try t plot a good bug

      Reply
    • Thanks Steve! Darn cut-n-paste errors!

      Posted by Legacy on 04/26/2000 12:00am

      Originally posted by: George Chastain

      They get me once-in-a-while. Thanks!

      Reply
    • Very nice easy to use - One small bug....

      Posted by Legacy on 04/26/2000 12:00am

      Originally posted by: Steve McCray

      On line #86:
      
      

      m_FormattedTime.Format("%d:%02d:%02d p.m.", m_CurrentDateTime.wHour, m_CurrentDateTime.wMinute, m_CurrentDateTime.wSecond);

      Should be changed to:

      m_FormattedTime.Format("%d:%02d:%02d a.m.", m_CurrentDateTime.wHour, m_CurrentDateTime.wMinute, m_CurrentDateTime.wSecond);

      Reply
    • Set the styles in the code...

      Posted by Legacy on 01/10/2000 12:00am

      Originally posted by: Markus

      Instead of setting the styles in the resource editor you can override the PreSubclassWindow to set the nessisary styles

      /Markus


      void CGCClock::PreSubclassWindow()
      {
      ModifyStyle(0,SS_CENTER|SS_CENTERIMAGE);

      CGCColorStatic::PreSubclassWindow();
      }

      Reply
    • Very nice digital clock and easy to use

      Posted by Legacy on 01/05/2000 12:00am

      Originally posted by: Eder Arroyo

      Anyway do you know where can i get the same but for an analogic clock?

      Reply
    Leave a Comment
    • Your email address will not be published. All fields are required.

    Top White Papers and Webcasts

    • With 81% of employees using their phones at work, companies have stopped asking: "Is corporate data leaking from personal devices?" and started asking: "How do we effectively prevent corporate data from leaking from personal devices?" The answer has not been simple. ZixOne raises the bar on BYOD security by not allowing email data to reside on the device. In addition, Zix allows employees to maintain complete control of their personal device, therefore satisfying privacy demands of valued employees and the …

    • Live Event Date: August 20, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT When you look at natural user interfaces as a developer, it isn't just fun and games. There are some very serious, real-world usage models of how things can help make the world a better place – things like Intel® RealSense™ technology. Check out this upcoming eSeminar and join the panel of experts, both from inside and outside of Intel, as they discuss how natural user interfaces will likely be getting adopted in a wide variety …

    Most Popular Programming Stories

    More for Developers

    Latest Developer Headlines

    RSS Feeds