CTC++ Coverage Report - Execution Profile   #7/7

Directory Summary | Files Summary | Functions Summary | Untested Code | Execution Profile
To files: First | Previous | Next | Last | Index | No Index


File: F:\ctcwork\demos\cube\mainfrm.cpp
Instrumentation mode: multicondition
TER: 60 % (25/42), 56 % (22/39) statement

Hits/True False -Line Source

 // mainfrm.cpp : implementation of the CMainFrame class
 //
 // This is a part of the Microsoft Foundation Classes C++ library.
 // Copyright (c) Microsoft Corporation.  All rights reserved.
 //
 // This source code is only intended as a supplement to the
 // Microsoft Foundation Classes Reference and related
 // electronic documentation provided with the library.
 // See these sources for detailed information regarding the
 10 // Microsoft Foundation Classes product.
 11 
 12 #include "stdafx.h"
 13 #include "cube.h"
 14 
 15 #include "cubedoc.h"
 16 #include "cubeview.h"
 17 #include "mainfrm.h"
 18 
 19 #ifdef _DEBUG
 20 #undef THIS_FILE
 21 static char BASED_CODE THIS_FILE[] = __FILE__;
 22 #endif
 23 
 24 /////////////////////////////////////////////////////////////////////////////
 25 // CMainFrame
 26 
Top
  27 IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  27   return new CMainFrame
   27 }
Top
32   27 FUNCTION CMainFrame::_GetBaseClass()
32   27   return ( CFrameWnd::GetThisClass ( ) )
   27 }
Top
  27 FUNCTION CMainFrame::GetThisClass()
  27   return ( ( CRuntimeClass * ) ( & CMainFrame::classCMainFrame ) )
   27 }
Top
38132   27 FUNCTION CMainFrame::GetRuntimeClass()
38132   27   return ( ( CRuntimeClass * ) ( & CMainFrame::classCMainFrame ) )
   27 }
 28 
Top
32470   29 BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
32470   29   return GetThisMessageMap ( )
   29 }
Top
32470   29 FUNCTION CMainFrame::GetThisMessageMap()
 30    //{{AFX_MSG_MAP(CMainFrame)
 31    ON_WM_CREATE()
 32    ON_WM_PALETTECHANGED()
 33    ON_WM_QUERYNEWPALETTE()
 34    //}}AFX_MSG_MAP
32470   35 END_MESSAGE_MAP()
   35 }
 36 
 37 /////////////////////////////////////////////////////////////////////////////
 38 // arrays of IDs used to initialize control bars
 39 
 40 // toolbar buttons - IDs are command buttons
 41 static UINT BASED_CODE buttons[] =
 42 {
 43    // same order as in the bitmap 'toolbar.bmp'
 44    ID_FILE_PLAY,
 45    ID_APP_ABOUT,
 46 };
 47 
 48 /////////////////////////////////////////////////////////////////////////////
 49 // CMainFrame construction/destruction
 50 
Top
  51 CMainFrame::CMainFrame()
 52 {
 53    // TODO: add member initialization code here
 54 
  55 }
 56 
Top
  57 CMainFrame::~CMainFrame()
 58 {
  59 }
 60 
Top
  61 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 62 {
-63    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
 -64       return -1;
 65 
 66    if (!m_wndToolBar.Create(this) ||
 67       !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) ||
 68       !m_wndToolBar.SetButtons(buttons,
-69         sizeof(buttons)/sizeof(UINT)))
 -69     1: T || _ || _
 -69     2: F || T || _
 -69     3: F || F || T
  69     4: F || F || F
 70    {
 71       TRACE0("Failed to create toolbar\n");
 -72       return -1;      // fail to create
 73    }
 74 
 75    // TODO: Delete these three lines if you don't want the toolbar to
 76    //  be dockable
 77    m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
 78    EnableDocking(CBRS_ALIGN_ANY);
 79    DockControlBar(&m_wndToolBar);
 80 
 81    // TODO: Remove this if you don't want tool tips
 82    m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
 83       CBRS_TOOLTIPS | CBRS_FLYBY);
 84 
  85    return 0;
   86 }
 87 
 88 /////////////////////////////////////////////////////////////////////////////
 89 // CMainFrame diagnostics
 90 
 91 #ifdef _DEBUG
Top
38087   92 void CMainFrame::AssertValid() const
 93 {
 94    CFrameWnd::AssertValid();
38087   95 }
 96 
Top
 -97 void CMainFrame::Dump(CDumpContext& dc) const
 98 {
 99    CFrameWnd::Dump(dc);
 -100 }
 101 
 102 #endif //_DEBUG
 103 
 104 /////////////////////////////////////////////////////////////////////////////
 105 // CMainFrame message handlers
 106 
Top
 -107 void CMainFrame::OnPaletteChanged(CWnd* pFocusWnd)
 108 {
 109    CFrameWnd::OnPaletteChanged(pFocusWnd);
 110 
-111    if(pFocusWnd != this)
 112       OnQueryNewPalette();
 -113 }
 114 
Top
 -115 BOOL CMainFrame::OnQueryNewPalette()
 116 {
 117    int        i;
 118    CPalette    *pOldPal;
 119    CCubeView   *pView = (CCubeView *)GetActiveView();
 120    CClientDC   dc(pView);
 121 
 122 
 123    pOldPal = dc.SelectPalette(&pView->m_cPalette, FALSE);
 124    i = dc.RealizePalette();
 125    dc.SelectPalette(pOldPal, FALSE);
 126 
-127    if(i > 0)
 128       InvalidateRect(NULL);
 129 
 130 
 -131    return CFrameWnd::OnQueryNewPalette();
   132 }
 133 
Top
  134 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
 135 {
 136    // remove this flag to remove " - Untitled" from the frame's caption
 137 
 138    cs.style &= ~ FWS_ADDTOTITLE;
 139 
  140    return CFrameWnd::PreCreateWindow(cs);
   141 }
***TER 60% (25/42) of SOURCE FILE mainfrm.cpp
56% (22/39) statement

Directory Summary | Files Summary | Functions Summary | Untested Code | Execution Profile
To files: First | Previous | Next | Last | Top | Index | No Index