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

📄 listview.h

📁 minigui 开源代码 非常实用 对学习嵌入式GUI开发有一定的实用的参考价值
💻 H
📖 第 1 页 / 共 3 页
字号:
 * UINT mask;
 * HLVITEM pi;
 *
 * wParam = (WPARAM)pi;
 * lParam = (LPARAM)mask;
 * \endcode
 *
 * \param pi Handle of the target item.
 * \param mask Contains state information to retrieve, can be the combination
 *             of the following values.
 *
 * \return Returns the current state of the specified item.
 */
#define LVM_GETITEMSTATE	0xF128 

/**
 * \def LVM_GETSELECTEDCOLUMN
 * \brief Retrieves the index of the currently selected column of a listview.
 *
 * \code
 * LVM_GETSELECTEDCOLUMN
 *
 * wParam = 0;
 * lParam = 0;
 * \endcode
 *
 * \return Returns the index of the selected column.
 */
#define LVM_GETSELECTEDCOLUMN	0xF129 

/**
 * \def LVM_GETSELECTEDCOUNT
 * \brief Retrieves the number of the selected items in a listview.
 *
 * \code
 * LVM_GETSELECTEDCOUNT
 *
 * wParam = 0;
 * lParam = 0;
 * \endcode
 *
 * \return Returns the number of the selected items.
 */
#define LVM_GETSELECTEDCOUNT	0xF130 

/**
 * \def LVM_GETTOPVISIBLE
 * \brief Retrieves the index of the topmost visible item in a listview.
 *
 * \code
 * LVM_GETTOPVISIBLE
 *
 * wParam = 0;
 * lParam = 0;
 * \endcode
 *
 * \return Returns the index of the topmost visible item if successful, or zero.
 */
#define LVM_GETTOPVISIBLE	0xF131 

#define LVM_NULL		0xF132 

#define LVM_SETITEMSTATE	0xF133 

/**
 * \def LVM_SORTITEMS
 * \brief Uses an application-defined comparision function to sort the items.
 *
 * \code
 * LVM_SORTITEMS
 * PLVSORTDATA sortData;
 * PFNLVCOMPARE pfnCompare;
 *
 * wParam = (WPARAM)sortData;
 * lParam = (LPARAM)pfnCompare;
 * \endcode
 *
 * \param sortData Sorting datas passed to the comparision function.
 * \param pfnCompare Pointer to the application-defined comparision function. The
 *                   comparision function is called during the sort operation
 *                   each time the relative order of the two items needs to be 
 *                   compared.
 *
 *                   The comparison function must return a negative value if the 
 *                   first item precedes the second, a positive value if 
 *                   the first item follows the second, or zero if the two 
 *                   items are equivalent.
 *
 *                   The comparision function has the following form:
 *
 *                   int CompareFunction(int nItem1, int nItem2, PLVSORTDATA sortData);
 *
 *                   nItem1 is the handle of the first item, nItem2 is the handle
 *                   of the second item, and sortData is passed to CompareFunction
 *                   as the third parameter.
 *
 * \return Returns TRUE if successful, or FALSE otherwise.
 */
#define LVM_SORTITEMS		0xF134 

/**
 * \def LVM_SETITEMHEIGHT
 * \brief Changes the height of a item.
 *
 * \code
 * LVM_SETITEMHEIGHT
 * int height;
 * HLVITEM pi;
 *
 * wParam = (WPARAM)pi;
 * lParam = (LPARAM)height;
 * \endcode
 *
 * \param height The new height of the item.
 * \param pi Handle of the target item.
 *
 * \return Returns TRUE if successful, or FALSE otherwise.
 */
#define LVM_SETITEMHEIGHT	0xF135 

/**
 * \def LVM_SETHEADHEIGHT
 * \brief Changes the height of the header.
 *
 * \code
 * LVM_SETHEADHEIGHT
 * int height;
 *
 * wParam = (WPARAM)height;
 * lParam = 0;
 * \endcode
 *
 * \param height The new height of the header.
 * \return Returns TRUE if successful, or FALSE otherwise.
 */
#define LVM_SETHEADHEIGHT	0xF136 

/**
 * \def LVM_GETITEMADDDATA
 * \brief Gets the 32-bit data value associated with an item.
 * 
 * An application sends an LVM_GETITEMADDDATA message to a listview to get the 
 * 32-bit data value stored for the item with index of \a wParam; 
 * By default this is zero. An application must set the 
 * item data value by sending an LVM_SETITEMADDDATA message to the listview for 
 * this value to have meaning.
 *
 * \code
 * LVM_GETITEMADDDATA
 * int index;
 * HLVITEM pi;
 *
 * wParam = (WPARAM)index;
 * lParam = (LPARAM)pi;
 * \endcode
 *
 * \param pi Handle of the target item.
 * \param index The index of the specified item. If pi is not zero, use pi instead.
 *
 * \return The 32-bit data value associated with an item on success, otherwise
 *         -1 to indicate an error.
 */
#define LVM_GETITEMADDDATA       0xF137

/**
 * \def LVM_SETITEMADDDATA
 * \brief Associates a 32-bit data value with an item.
 * 
 * An application sends an LVM_SETITEMADDDATA message to associate a 32-bit data 
 * value specified in the \a lParam parameter with an item in the listview.
 *
 * \code
 * LVM_SETITEMADDDATA
 * HLVITEM pi;
 * DWORD addData;
 *
 * wParam = (WPARAM)pi;
 * lParam = (LPARAM)addData;
 * \endcode
 *
 * \param pi Handle of the target item.
 * \param addData The 32-bit data value which will associated with the item.
 *
 * \return One of the following values:
 *          - LV_OKAY\n         Success
 *          - LV_ERR\n          Invalid item index
 *
 */
#define LVM_SETITEMADDDATA       0xF138

/**
 * \def LVM_CHOOSEITEM
 * \brief Selects and shows an item.
 *
 * \code
 * LVM_CHOOSEITEM
 * int nRow;
 * HLVITEM pi;
 *
 * wParam = (WPARAM)nRow;
 * lParam = (LPARAM)pi;
 * \endcode
 *
 * \param nRow If pi is zero, nRow specified the row index of the target item to choose.
 * \param pi Handle of the target item.
 *
 * \return Always returns 0.
 */
#define LVM_CHOOSEITEM		0xF139

/**
 * \def LVM_SETSTRCMPFUNC
 * \brief Sets the STRCMP function used to sort items.
 *
 * An application sends a LVM_SETSTRCMPFUNC message to set a 
 * new STRCMP function to sort items in the Listview control.
 *
 * Note that you should send this message before adding 
 * any item to the Listview control.
 *
 * \code
 * static int my_strcmp (const char* s1, const char* s2, size_t n)
 * {
 *      ...
 *      return 0;
 * }
 *
 * LVM_SETSTRCMPFUNC
 *
 * wParam = 0;
 * lParam = (LPARAM) my_strcmp;
 * \endcode
 *
 * \param my_strcmp Your own function to compare two strings.
 *
 * \return One of the following values:
 *          - 0\n     Success
 *          - -1\n    Not an empty TreeView control
 */
#define LVM_SETSTRCMPFUNC       0xF140

#define LVIR_PARENT             1
#define LVIR_FIRSTCHILD         2
#define LVIR_NEXTSIBLING        3
#define LVIR_PREVSIBLING        4

/**
 * \def LVM_GETRELATEDITEM
 * \brief Retrives related item of specific item.
 *
 * \code
 * LVM_GETRELATEDITEM
 * int related;
 * GHANDLE item;
 *
 * wParam = (WPARAM)related;
 * lParam = (LPARAM)item;
 * \endcode
 *
 * \param related A integer which indicates the relationship between 
 *        the item to retrive and the specified item, can be one of the following values:
 *          - TVIR_PARENT\n
 *              To retrive the parent item of the specified item.
 *          - TVIR_FIRSTCHILD\n
 *              To retrive the first child item of the specified item.
 *          - TVIR_NEXTSIBLING\n
 *              To retrive the next sibling item of the specified item.
 *          - TVIR_PREVSIBLING\n
 *              To retrive the previous sibling item of the specified item.
 *
 * \param item The handle to the known item.
 *
 * \return The handle of the related item on success, otherwise 0.
 */
#define LVM_GETRELATEDITEM      0xF141

/**
 * \def LVM_FOLDITEM
 * \brief Folds or unfolds an item.
 *
 * \code
 * LVM_FOLDITEM
 * int bFold;
 * HLVITEM pi;
 *
 * wParam = (WPARAM)bFold;
 * lParam = (LPARAM)pi;
 * \endcode
 *
 * \param bFold To fold or to unfold, TRUE is to fold.
 * \param pi Handle of the target item.
 *
 * \return Always returns 0.
 */
#define LVM_FOLDITEM            0xF142

/**
 * \def LVM_SETCUSTOMDRAW
 * \brief Sets the customized drawing functions of listview.
 *
 * \code
 * LVM_SETCUSTOMDRAW
 * LVCUSTOMDRAWFUNCS myFuncs;
 *
 * wParam = (WPARAM)0;
 * lParam = (LPARAM)&myFuncs;
 * \endcode
 *
 * \param myFuncs Pointer to a customized drawing functions structure.
 *
 * \return Always returns 0.
 */
#define LVM_SETCUSTOMDRAW       0xF143


    /** @} end of mgext_ctrl_listview_msgs */

    /**
     * \defgroup mgext_ctrl_listview_ncs Notification code of ListView control
     * @{
     */
/**
 * \def LVN_CLICKED
 * \brief This notification code informs parent window the mouse clicked
 */
#define LVN_CLICKED            1    /* must be the same as SVN_CLICKED */

/**
 * \def LVN_SELCHANGE
 * \brief This notification code informs parent window the current selected item 
 *        has changed.
 */
#define LVN_SELCHANGE          2    /* must be the same as SVN_SELCHANGED */

/**
 * \def LVN_ITEMRDOWN
 * \brief This notification code informs parent window the right mouse button down
 *        on a listview item.
 */
#define LVN_ITEMRDOWN          4

/**
 * \def LVN_ITEMRUP
 * \brief This notification code informs parent window the right mouse button up
 *        on a listview item.
 */
#define LVN_ITEMRUP            5

/**
 * \def LVN_HEADRDOWN
 * \brief This notification code informs parent window the right mouse button down
 *        on the listview header.
 */
#define LVN_HEADRDOWN          6

/**
 * \def LVN_HEADRUP
 * \brief This notification code informs parent window the right mouse button up
 *        on the listview header.
 */
#define LVN_HEADRUP            7

/**
 * \def LVN_KEYDOWN
 * \brief This notification code informs parent window that a key has been pressed.
 */
#define LVN_KEYDOWN            8

/**
 *
 * \def LVN_ITEMDBCLK
 * \brief This notification code informs parent window the current selected item 
 *        has be double clicked.
 */
#define LVN_ITEMDBCLK          9

/**
 * \def LVN_ITEMCLK
 * \brief This notification code informs parent window the current selected item 
 *        has been clicked.
 */
#define LVN_ITEMCLK            10

/**
 * \def LVN_COLCHANGE
 * \brief This notification code informs parent window the current selected column 
 *        has changed.
 */
#define LVN_COLCHANGE          11

/**
 * \def LVN_FOLDED
 * \brief This notification code informs that user folds an item by mouse
 *        clicking.
 */
#define LVN_FOLDED             12

/**
 * \def LVN_UNFOLDED
 * \brief This notification code informs that user unfolds an item by mouse
 *        clicking.
 */
#define LVN_UNFOLDED           13

    /** @} end of mgext_ctrl_listview_ncs */

    /** @} end of mgext_ctrl_listview */

    /** @} end of mgext_controls */

    /** @} end of mgext_fns */

#ifdef  __cplusplus
}
#endif

#endif /* EXT_LISTVIEW_H */

⌨️ 快捷键说明

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