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

  • The explosion in mobile devices and applications has generated a great deal of interest in APIs. Today's businesses are under increased pressure to make it easy to build apps, supply tools to help developers work more quickly, and deploy operational analytics so they can track users, developers, application performance, and more. Apigee Edge provides comprehensive API delivery tools and both operational and business-level analytics in an integrated platform. It is available as on-premise software or through …

  • Best-in-Class organizations execute on a strategy that supports the multi-channel nature of customer requests. These leading organizations do not just open up their service infrastructures to accommodate new channels, but also empower their teams to deliver an effective and consistent experience regardless of the channel selected by the customer. This document will highlight the key business capabilities that support a Best-in-Class customer engagement strategy.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds