⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datavsame.cpp

📁 是一个GridTree的控件
💻 CPP
字号:
/*****************************************************************************
    COPYRIGHT (C) 2000, Ken Bertelson <kenbertelson@hotmail.com>


*****************************************************************************/

#include "stdafx.h"
#include "..\Include\DataVSame.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

#include "..\resource.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CDataVSame::CDataVSame()
{
    m_nFormat = DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS;
    m_nFormatRowZero = DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS;
    m_nFormatColZero = DT_RIGHT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS;

    m_nImage = -1;
    m_lParam = 0;

    m_crBkClr = CLR_DEFAULT;
    m_crFgClr = CLR_DEFAULT;

#ifndef _WIN32_WCE
    // Initially use the system message font for the GridCtrl font
    NONCLIENTMETRICS ncm;
    ncm.cbSize = sizeof(NONCLIENTMETRICS);
    VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0));
    memcpy(&m_lfFont, &(ncm.lfMessageFont), sizeof(LOGFONT));
#else
    LOGFONT lf;
    GetObject(GetStockObject(SYSTEM_FONT), sizeof(LOGFONT), &lf);
    memcpy(&m_lfFont, &lf, sizeof(LOGFONT));
#endif

    m_nMargin = 3;

    m_pWnd = NULL;   // key to virtual grid text info
}

CDataVSame::~CDataVSame()
{
}


LPCTSTR CDataVSame::GetText(int nRow, int nCol)
{ 
    if( m_pWnd)
	{
	    static CString strValue;
		strValue.Format( "Virtual %d", nRow);
		return strValue;
	}
    return NULL;
}


void CDataVSame::SetFormat(int nRow, int nCol, DWORD nFormat)
{
    if( nRow == 0)
        m_nFormatRowZero = nFormat;
    else if( nCol == 0)
        m_nFormatColZero = nFormat;
    else
        m_nFormat = nFormat;

}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -