CStatic as digital clock

Download project files.

Class CXJWDigitClock is a static control derived from CStatic. It displays as a digital clock,as shown below:

digitclock_sample.jpg (26130 bytes)

There are three properties in CXJWDigitClock

face color <-----> SetColor();
second style <-----> SetStyle();
alarm mode <----> SetAlarm();

Usage: Check the sample project for the detail.

Note: You should insert all 12 bitmaps in your project, and take care the value and order of bitmap's ID. In my sample project, I used IDB_BITMAP1 to IDB_BITMAP12 side by side. See following:

Digit ID VALUE
0 IDB_BITMAP1 100
1 IDB_BITMAP2 101
2 IDB_BITMAP3 102
3 IDB_BITMAP4 103
4 IDB_BITMAP5 104
5 IDB_BITMAP6 105
6 IDB_BITMAP7 106
7 IDB_BITMAP8 107
8 IDB_BITMAP9 108
9 IDB_BITMAP10 109
10 IDB_BITMAP11 110
11 IDB_BITMAP12 111



Comments

  • TOOLTIPS Z ORDER

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

    Originally posted by: cHRIS jONES

    I am having problems with my tooltips.	I have a dialog box app with lots of buttons and tooltips for these
    buttons.  At start up i create a dialog box that is loacted a the bottpm of the app.  When I hover over a
    button on the bottom of the app the tooltips are obscured by the new dialog.  I thought I had solved this
    long ago with the upgrade to IE5 but I guess there was more to it.  My basic question is At start up I want a
    dialog app to be at top sub-dialog boxes that I create at run-time to be below the top (in the z-order) and
    the tooltips to be the top most.  Below are pieces of my code that come from lots of examples I have received
    here at codeguru any help with z-order and tooltips would be appreciated
    
    

    CCSUHelp m_Descriptions; //my sub-dialog class a dialog box with an edit box that i write text to

    OnInitDialog()
    {
    .
    . //set main dialog box
    SetWindowPos(&wndTopMost, xPos, 30, 0, 0, SWP_NOSIZE);
    .
    .
    .
    m_Descriptions.Create(IDD_DESCRIPTIONS,0);
    m_Descriptions.SetText(pztext);
    .
    m_tooltip.Create(this);
    m_tooltip.Activate(tooltips);
    m_tooltip.SendMessage(TTM_SETMAXTIPWIDTH, 0, 300);
    m_tooltip.SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, 10000);


    // TODO: Use one of the following forms to add controls:
    // m_tooltip.AddTool(GetDlgItem(IDC_<name>), <string-table-id>);
    // m_tooltip.AddTool(GetDlgItem(IDC_<name>), "<text>");
    // m_tooltip.UpdateTipText("update works",GetDlgItem(IDC_BUTTON1) );

    m_tooltip.AddTool(GetDlgItem(IDC_BUTTON1),pzbutton1[0]);
    .
    .
    .
    PostMessage(WM_AFTERINIT);
    }

    LRESULT CCSUDlg::OnAfterInit(WPARAM wParam, LPARAM lParam)
    {

    CRect rect;
    GetWindowRect(&rect);
    //SetWindowPos(&wndTopMost,rect.left,rect.top,0,0,SWP_NOSIZE | SWP_SHOWWINDOW);

    m_Descriptions.SetWindowPos(&wndBottom ,rect.left,rect.bottom,0,0,SWP_NOSIZE | SWP_NOACTIVATE );
    m_Descriptions.ShowWindow(SW_SHOWNA);

    return 0;
    }

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

Top White Papers and Webcasts

  • Live Event Date: September 16, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you starting an on-premise-to-cloud data migration project? Have you thought about how much space you might need for your online platform or how to handle data that might be related to users who no longer exist? If these questions or any other concerns have been plaguing you about your migration project, check out this eSeminar. Join our speakers Betsy Bilhorn, VP, Product Management at Scribe, Mike Virnig, PowerSucess Manager and Michele …

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds