📄 mgext.h
字号:
* \def LVM_MODIFYHEAD * \brief Changes the title of a column. * * \code * LVM_MODIFYHEAD * PLVCOLUMN pcol; * * wParam = 0; * lParam = (LPARAM)pcol; * \endcode * * \param pcol Pointer to a LVCOLUMN struct. * \return Returns LV_OKAY if successfull, or LV_ERR otherwise. */#define LVM_MODIFYHEAD 0xF11E/** * \def LVM_SELECTITEM * \brief Selects an item. * * \code * LVM_SELECTITEM * int nItem; * * wParam = (WPARAM)nItem; * lParam = 0; * \endcode * * \param nItem Index of the item to select. * \return Always returns 0. */#define LVM_SELECTITEM 0xF11F /** * \def LVM_SHOWITEM * \brief Makes the item is entirely visible in the list view. * * \code * LVM_SHOWITEM * int nRow; * * wParam = (WPARAM)nRow; * lParam = 0; * \endcode * * \param nRow Index of the item to show. * \return Always returns 0. */#define LVM_SHOWITEM 0xF120 /** * \def LVM_GETSUBITEMLEN * \brief Gets the text len of the subitem. * * \code * LVM_GETSUBITEMLEN * PLVSUBITEM psub; * * wParam = 0; * lParam = (LPARAM)psub; * \endcode * * \param psub Pointer to a LVSUBITEM struct containing subitem information. * \return Returns the text len if successful, or LV_ERR otherwise. */#define LVM_GETSUBITEMLEN 0xF121/** * \def LVM_SETCOLUMN * \brief Sets the attributes of a listview column. * * \code * LVM_SETCOLUMN * PLVCOLUMN pcol; * * wParam = 0; * lParam = (LPARAM)pcol; * \endcode * * \param pcol Points to a LVCOLUMN structure containing the new column information. * * \return Returns LV_OKAY if successful, or LV_ERR otherwise. */#define LVM_SETCOLUMN 0xF122/** * \def LVM_SETSUBITEMTEXT * \brief Sets the text of a subitem. * * \code * LVM_SETSUBITEMTEXT * PLVSUBITEM psub; * * wParam = 0; * lParam = (LPARAM)psub; * \endcode * * \param psub constains the information of the subitem to set. * \return Returns LV_OKAY if successful, or LV_ERR otherwise. */#define LVM_SETSUBITEMTEXT 0xF123/** * \def LVM_SETSUBITEM * \brief Sets the attributes of a subitem. * * \code * LVM_SETSUBITEM * PLVSUBITEM psub; * * wParam = 0; * lParam = (LPARAM)psub; * \endcode * * \param psub constains the information of the subitem to set. * \return Returns LV_OKAY if successful, or LV_ERR otherwise. */#define LVM_SETSUBITEM 0xF124/** * \def LVM_GETCOLUMN * \brief Retrieves the information about a listview column. * * \code * LVM_GETCOLUMN * int nCol; * PLVCOLUMN pcol; * * wParam = (WPARAM)nCol; * lParam = (LPARAM)pcol; * \endcode * * \param nCol Index of the column. * \param pcol Points to a LVCOLUMN structure for retrieving the information * about the column. * * \return Returns TRUE if successful, or FALSE otherwise. */#define LVM_GETCOLUMN 0xF125 /** * \def LVM_GETCOLUMNWIDTH * \brief Retrieves the width of a listview column. * * \code * LVM_GETCOLUMNWIDTH * int nCol; * * wParam = (WPARAM)nCol; * lParam = (LPARAM)0; * \endcode * * \param nCol Index of the column. * * \return Returns the column width if successful, or -1 otherwise. */#define LVM_GETCOLUMNWIDTH 0xF126 /** * \def LVM_GETITEM * \brief Retrieves the item's attributes. * * \code * LVM_GETITEM * PLVITEM pitem; * * wParam = 0; * lParam = (LPARAM)pitem; * \endcode * * \param pitem Points to an LVITEM structure for retrieving the information * about an item, the nItem field identifies the item. * * \return Returns LV_OKAY if successful, or LV_ERR otherwise. */#define LVM_GETITEM 0xF127 /** * \def LVM_GETITEMSTATE * \brief Retrieves the state of a listview item. * * \code * LVM_GETITEMSTATE * int nRow; * UINT mask; * * wParam = (WPARAM)nRow; * lParam = (LPARAM)mask; * \endcode * * \param nRow Index of the 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 index of the first item, nItem2 is the index * 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 all the items. * * \code * LVM_SETITEMHEIGHT * int height; * * wParam = (WPARAM)height; * lParam = 0; * \endcode * * \param height The new height of the 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; * * wParam = (WPARAM)index; * lParam = 0; * \endcode * * \param index The index of the specified item. * * \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 * int index; * DWORD addData; * * wParam = (WPARAM)index; * lParam = (LPARAM)addData; * \endcode * * \param index The index of the specified 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 * \Selects and shows an item. * * \code * LVM_CHOOSEITEM * int nItem; * * wParam = (WPARAM)Item; * lParam = 0; * \endcode * * \param nItem Index of the item to choose. * \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 /** @} end of mgext_ctrl_listview_msgs */ /** * \defgroup mgext_ctrl_listview_ncs Notification code of ListView control * @{ *//** * \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_SELCHANGE * \brief This notification code informs parent window the current selected item * has changed. */#define LVN_SELCHANGE 11/** * \def LVN_COLCHANGE * \brief This notification code informs parent window the current selected column * has changed. */#define LVN_COLCHANGE 12 /** @} end of mgext_ctrl_listview_ncs */ /** @} end of mgext_ctrl_listview */#endif /* _EXT_CTRL_LISTVIEW */#ifdef _EXT_CTRL_GRID /** * \defgroup mgext_ctrl_grid Grid control * @{ */#define CTRL_GRID ("Grid")/** Grid return value */#define GRID_OKAY 0#define GRID_ERR (-1)#define GRID_ERRSPACE (-2)/** Column and header flags */#define GRIDCF_LEFTALIGN 0x0000 // column text left align, default#define GRIDCF_RIGHTALIGN 0x0001 // column text right align#define GRIDCF_CENTERALIGN 0x0002 // column text center align #define GRIDHF_LEFTALIGN 0x0000 // header text left align, default#define GRIDHF_RIGHTALIGN 0x0004 // header text right align#define GRIDHF_CENTERALIGN 0x0008 // header text center align #define GRID_COL_PRIORTY 0x0010/** * Structure of the grid column header info, contains column header informations. * This structure is used for creating or retrieving column header. */typedef struct _GRIDCOLHEADER{ /** Width of the header*/ int nWidth; /** The column number */ int nCols; /** The title of this column */ char *pTitle; /** Image of the header */ DWORD image; /** Header flags */ DWORD flags; /** Cell infomations */ DWORD cellflags;} GRIDCOLHEADER;typedef GRIDCOLHEADER *PGRIDCOLHEADER;/** * Structure of the grid row header info, contains row header informations. * This structure is used for creating or retrieving row header. */typedef struct _GRIDROWHEADER{ /** Height of the header*/ int nHeight; /** The row number */ int nRows; /** The title of this row*/ char *pTitle; /** Image of the header */ DWORD image; /** Header flags */ DWORD flags; /** Cell infomations*/ DWORD cellflags;} GRIDROWHEADER;typedef GRIDROWHEADER *PGRIDROWHEADER;/** * Structure of cell, contains text info. * Use this structure when set a certain cell. */typedef struct _GRIDCELL{ /** Text in cell */ char *pszInfo; /** Text color */ int nTextColor; /** Additional data */ DWORD addData;} GRIDCELL;typedef GRIDCELL *PGRIDCELL;#define GRIDM_GETGRIDCOLS 0xF210#define GRIDM_SETGRIDCOLS 0xF211#define GRIDM_GETGRIDROWS 0xF212#define GRIDM_SETGRIDROWS 0xF213#define GRIDM_ADDCOL 0xF214#define GRIDM_DELCOL 0xF215#define GRIDM_ADDROW 0xF216#define GRIDM_DELROW 0xF217#define GRIDM_SETHEADHEIGHT 0xF218#define GRIDM_SETHEADWIDTH 0xF219#define GRIDM_GETHEADWIDTH 0xF21A#define GRIDM_GETHEADHEIGHT 0xF21B#define GRIDM_SETCOLDATA 0xF21C#define GRIDM_GETCOLDATA 0xF21D#define GRIDM_SETROWDATA 0xF21E#define GRIDM_GETROWDATA 0xF21F#define GRIDM_SETCOLWIDTH 0xF220#define GRIDM_GETCOLWIDTH 0xF221#define GRIDM_SETROWHEIGHT 0xF222#define GRIDM_GETROWHEIGHT 0xF223#define GRIDM_SETCELLDATA 0xF224#define GRIDM_GETCELLDATA 0xF225#define GRIDM_SETCELLFOCUS 0xF226#define GRIDM_SETCELLEDIT 0xF227 //not implement/** @} end of mgext_ctrl_grid_ncs *//** @} end of mgext_ctrl_grid */#endif /** @} end of mgext_controls */ /** @} end of mgext_fns */#ifdef __cplusplus}#endif#endif /* MGEXT_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -