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

  • 10 Rules that Make or Break Enterprise App Development Projects In today's app-driven world, application development is a top priority. Even so, 68% of enterprise application delivery projects fail. Designing and building applications that pay for themselves and adapt to future needs is incredibly difficult. Executing one successful project is lucky, but making it a repeatable process and strategic advantage? That's where the money is. With help from our most experienced project leads and software engineers, …

  • The first phase of API management was about realizing the business value of APIs. This next wave of API management enables the hyper-connected enterprise to drive and scale their businesses as API models become more complex and sophisticated. Today, real world product launches begin with an API program and strategy in mind. This API-first approach to development will only continue to increase, driven by an increasingly interconnected web of devices, organizations, and people. To support this rapid growth, …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds