资源简介

实现老外cgridlistctrlex的例子,并加上鼠标响应事件,报错不见按钮和夹按钮的情况,在加按钮的情况下,扩展了先前的库。本代码有相关博客说明。

资源截图

代码片段和文件信息

//------------------------------------------------------------------------
// Author:  Rolf Kristensen
// Source:  http://www.codeproject.com/KB/list/CGridListCtrlEx.aspx
// License: Free to use for all (New BSD License)
//------------------------------------------------------------------------

#include “stdafx.h“
#pragma warning(disable:4100) // unreferenced formal parameter

#include “CGridColumnTraitCombo.h“

#include “CGridColumnTraitVisitor.h“
#include “CGridListCtrlEx.h“

//------------------------------------------------------------------------
//! CGridColumnTraitCombo - Constructor
//------------------------------------------------------------------------
CGridColumnTraitCombo::CGridColumnTraitCombo()
:m_MaxItems(7)
m_MaxWidth(200)
m_ComboBoxstyle(WS_VSCROLL | WS_HSCROLL | CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_NOINTEGRALHEIGHT)
m_pComboBox(NULL)
m_ShowDropDown(FALSE)
{}

//------------------------------------------------------------------------
//! Accept Visitor Pattern
//------------------------------------------------------------------------
void CGridColumnTraitCombo::Accept(CGridColumnTraitVisitor& visitor)
{
visitor.Visit(*this);
}

//------------------------------------------------------------------------
//! Set max height (in items) of the CComboBox when doing dropdown
//!
//! @param nMaxItems Max number of items to show at once in the dropdown list
//------------------------------------------------------------------------
void CGridColumnTraitCombo::SetMaxItems(UINT nMaxItems)
{
m_MaxItems = nMaxItems;
}

//------------------------------------------------------------------------
//! Retrieves max height (in items) of the CComboBox when doing dropdown
//!
//! @return Number of items
//------------------------------------------------------------------------
UINT CGridColumnTraitCombo::GetMaxItems() const
{
return m_MaxItems;
}

//------------------------------------------------------------------------
//! Set max width (in pixels) of the CComboBox when doing dropdown
//!
//! @param nMaxWidth Max pixels in width to show when expanding the dropdown list
//------------------------------------------------------------------------
void CGridColumnTraitCombo::SetMaxWidth(UINT nMaxWidth)
{
m_MaxWidth = nMaxWidth;
}

//------------------------------------------------------------------------
//! Retrieves max width (in pixels) of the CComboBox when doing dropdown
//!
//! @return Number of items
//------------------------------------------------------------------------
UINT CGridColumnTraitCombo::GetMaxWidth() const
{
return m_MaxWidth;
}

//------------------------------------------------------------------------
//! Set whether to show drop down of the CComboBox at edit begin
//!
//! @param bShowIt Show drop down of the CComboBox at edit begin
//------------------------------------------------------------------------
void CGridColumnTraitCombo::Set

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-12-11 15:22  newgridlist\
     目录           0  2019-12-11 22:07  newgridlist\Gridlist\
     目录           0  2019-12-11 17:49  newgridlist\Gridlist\CGridListCtrlEx\
     文件        6980  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTrait.h
     文件       21096  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitCombo.cpp
     文件        4706  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitCombo.h
     文件       14553  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitDateTime.cpp
     文件        3370  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitDateTime.h
     文件        9322  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitEdit.cpp
     文件        2437  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitEdit.h
     文件       11746  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitHyperlink.cpp
     文件        2572  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitHyperlink.h
     文件       21808  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitImage.cpp
     文件        3455  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitImage.h
     文件        5285  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitMultilineEdit.cpp
     文件        1603  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitMultilineEdit.h
     文件        8658  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitText.cpp
     文件        1986  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitText.h
     文件        1063  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridColumnTraitVisitor.h
     文件      148702  2019-12-11 17:01  newgridlist\Gridlist\CGridListCtrlEx\CGridListCtrlEx.cpp
     文件       19163  2019-12-11 17:01  newgridlist\Gridlist\CGridListCtrlEx\CGridListCtrlEx.h
     文件       46952  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridListCtrlGroups.cpp
     文件        4917  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridListCtrlGroups.h
     文件        1199  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridRowTrait.h
     文件        9304  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridRowTraitText.cpp
     文件        1801  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridRowTraitText.h
     文件         818  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridRowTraitVisitor.h
     文件        6610  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridRowTraitXP.cpp
     文件         833  2015-03-17 07:23  newgridlist\Gridlist\CGridListCtrlEx\CGridRowTraitXP.h
     文件        1060  2019-12-11 17:49  newgridlist\Gridlist\CGridListCtrlEx\MButton.cpp
     文件         544  2013-08-02 13:17  newgridlist\Gridlist\CGridListCtrlEx\MButton.h
............此处省略27个文件信息

评论

共有 条评论