listctrlformatter.h
来自「c++单元测试工具!」· C头文件 代码 · 共 72 行
H
72 行
#ifndef LISTCTRLFORMATTER_H#define LISTCTRLFORMATTER_H#include <string>/*! \brief Helper to setup ListCtrl columns format. */class ListCtrlFormatter{public: /*! * Constructor. * \param list List control to setup. */ ListCtrlFormatter( CListCtrl &list ); /*! * Destructeur. */ virtual ~ListCtrlFormatter(); /*! Adds a column to the list control. * \param strHeading Column title. * \param nWidth Column width in pixel. (-1 if not defined). * \param nFormat Text alignment (LVCFMT_LEFT, LVCFMT_RIGHT, LVCFMT_CENTER). * \param nSubItemNo Index of the sub-item associates to the column. */ void AddColumn( const std::string &strHeading, int nWidth =-1, int nFormat = LVCFMT_LEFT, int nSubItemNo =-1 ); /*! Adds a column to the list control. * \param strHeading Column title. * \param nWidth Column width in pixel. (-1 if not defined). * \param nFormat Text alignment (LVCFMT_LEFT, LVCFMT_RIGHT, LVCFMT_CENTER). * \param nSubItemNo Index of the sub-item associates to the column. */ void AddColumn( CString strHeading, int nWidth =-1, int nFormat = LVCFMT_LEFT, int nSubItemNo =-1 ); /*! Adds a column to the list control. * \param nIdStringHeading Resource ID of the column title string (IDS_xxx). * \param nWidth Column width in pixel. (-1 if not defined). * \param nFormat Text alignment (LVCFMT_LEFT, LVCFMT_RIGHT, LVCFMT_CENTER). * \param nSubItemNo Index of the sub-item associates to the column. */ void AddColumn( UINT nIdStringHeading, int nWidth =-1, int nFormat = LVCFMT_LEFT, int nSubItemNo =-1 ); /*! Gets the sub item index of the next column. * \return Sub item index of the next column, starting with 0. */ int GetNextColumnIndex() const;private: /*! Associated list control. */ CListCtrl &m_List; /*! Next column number. */ int m_nColNo;};#endif //WILLISTCTRLFORMATTER_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?