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: July 30, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT You may already know about some of the benefits of Bluemix, IBM's open platform for developing and deploying mobile and web applications. Check out this upcoming eSeminar that focuses on building an Android application using the MobileData service, with a walk-through of the real process and workflow used to build and link the MobileData service within your application. Join IBM's subject matter experts as they show you the way to build a base …

  • Mobile is introducing sweeping changes throughout your workplace. As a senior stakeholder driving mobile initiatives in your organization, you may be lost in a sea of technologies and claims from vendors promising rapid delivery of applications to your employees, customers, and partners. To help explain some of the topics you will need to be aware of, and to separate the must-haves from the nice-to-haves, this reference guide can help you with applying a mobile strategy in the context of application …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds