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

  • Information is data with context. The era of Big Data has begun demonstrating to information security that there is more that can, and must, be done to identify threats, reduce risk, address fraud, and improve compliance monitoring activities by bringing better context to data and thereby creating information for actionable intelligence. This analyst report sets the stage and provides insights into IT and information security practitioners' perceptions of the impediments to, and the solutions necessary for, …

  • On-demand Event Event Date: September 10, 2014 Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds