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

📄 mgext.h

📁 libminigui-1.3.0.tar.gz。 miniGUI的库函数源代码!
💻 H
📖 第 1 页 / 共 4 页
字号:
    /** @} end of mgext_ctrl_spinbox */#endif /* _EXT_CTRL_SPINBOX *//************************** Cool Bar control **********************************/#ifdef _EXT_CTRL_COOLBAR    /**     * \defgroup mgext_ctrl_coolbar CoolBar control     * @{     *//** * \def CTRL_COOLBAR * \brief The class name of coolbar control. */#define CTRL_COOLBAR            ("CoolBar")#define TYPE_BARITEM            1#define TYPE_BMPITEM            2#define TYPE_TEXTITEM           3/** Structure of the coolbar item info */typedef struct _COOLBARITEMINFO{    /** Reserved, do not use. */    int insPos;    /**     * Identifier of the item. When the user clicked the item, this control     * will send a notification message to the parent window     * with the notification code to be equal to this identifier.     */    int id;    /**     * Type of the item, can be one of the following values:     * - TYPE_BARITEM     *   The item is a separator (a vertical line).     * - TYPE_BMPITEM     *   The item is a bitmap.     * - TYPE_TEXTITEM     *   The item is text.     */    int ItemType;    /**     * Pointer to the bitmap of the item, valid when the type is TYPE_BMPITEM.     */    PBITMAP Bmp;    /**     * Hint text of the item, will be displayed in the tooltip window.     */    const char *ItemHint;    /**     * Caption of the item, valid when the type is TPYE_TEXTITEM.     */    const char *Caption;    /** Additional data of the item */    DWORD dwAddData;} COOLBARITEMINFO;/** * \var typedef struct COOLBARITEMINFO *PCOOLBARITEMINFO; * \brief Data type of the pointer to a COOLBARITEMINFO. */typedef COOLBARITEMINFO *PCOOLBARITEMINFO;    /**     * \defgroup mgext_ctrl_coolbar_styles Styles of coolbar control     * @{     *//** * \def CBS_BMP_16X16 * \brief The size of the item bitmap is 16x16. */#define CBS_BMP_16X16           0x0000/** * \def CBS_BMP_32X32 * \brief The size of the item bitmap is 32x32. */#define CBS_BMP_32X32           0x0001/** * \def CBS_BMP_CUSTOM * \brief The item bitmap has customized size. * * \note For the control with this style, you should pass *       the width and the height of the item bitmap by  *       the argument \a dwAddData of \a CreateWindowEx function. * * \code * int item_width = 20; * int item_height = 20; * * CreateWindowEx (CTRL_COOLBAR, ..., MAKELONG (item_width, item_height))); * \endcode */#define CBS_BMP_CUSTOM          0x0002/** * \def CBS_USEBKBMP * \brief The control has a background bitmap. * * \note For a CoolBar control with this style, you should pass the bitmap file name *       by the argument \a spCaption of \a CreateWindowEx function. * * \code * const char* file_bkgnd = "res/my_bkgnd.gif"; * * CreateWindowEx (CTRL_COOLBAR, file_bkgnd, ...); * \endcode */#define CBS_USEBKBMP            0x0004    /** @} end of mgext_ctrl_coolbar_styles */    /**     * \defgroup mgext_ctrl_coolbar_msgs Messages of coolbar control     * @{     *//** * \def CBM_ADDITEM * \brief Adds a new item in a coolbar control. * * \code * CBM_ADDITEM * COOLBARITEMINFO *newIteminfo; * * wParam = 0; * lParam = (LPARAM)newIteminfo; * \endcode * * \param newIteminfo Pointer to the item info structure of the new item  *             to be added. * * \return Zero when success, otherwise less than 0; */#define CBM_ADDITEM             0xFE00/** * \def CBM_ENABLE * \brief Sets an item to be enabled or disabled. * * \code * CBM_ENABLE * int id; * BOOL enabled; * * wParam = (WPARAM)id; * lParam = (LPARAM)enabled; * \endcode * * \param id The identifier of the item to change. * \param enabled TRUE to enable the item, FALSE to disable the item. * * \return Zero when success, otherwise less than 0. */#define CBM_ENABLE              0xFE01    /** @} end of mgext_ctrl_coolbar_msgs */    /** @} end of mgext_ctrl_coolbar */#endif /* _CTRL_COOLBAR *//************************** List View control ********************************/#ifdef _EXT_CTRL_LISTVIEW    /**     * \defgroup mgext_ctrl_listview ListView control     * @{     */#define CTRL_LISTVIEW       ("ListView")/** Listview return value */#define LV_OKAY                 0#define LV_ERR                  (-1)#define LV_ERRSPACE             (-2)/**  * Structure of the listview item info, contains information about an item. * This structure is used for creating or retrieving an item.  */typedef struct _LVITEM{    /** the rows of the item */    int nItem;    /** attached additional data of this item */    DWORD itemData;} LVITEM;typedef LVITEM *PLVITEM;/** listview icon flags */#define LVFLAG_BITMAP	0x0001#define LVFLAG_ICON	0x0002/**  * Struct of the listview subitem info, contains information about a subitem. * This structure is used for creating or retrieving a subitem. */ typedef struct _LVSUBITEM{    /** subitem flags */    DWORD flags;    /** the Subitem vertical position(rows) */    int nItem;    /** the Subitem horizontal position(columns) */    int subItem;    /** text content of this subitem */    char *pszText;    /** max text len */    int nTextMax;    /** text color of the subitem */    int nTextColor;    /** image of the subitem, can be bitmap or icon */    DWORD image; } LVSUBITEM;typedef LVSUBITEM *PLVSUBITEM;//FIXME//TODO/** Contains information for sorting listview */typedef struct _LVSORTDATA{    /** Sorting column index */    int ncol;    /** low sorted or high sorted */    int losorted;} LVSORTDATA;typedef LVSORTDATA *PLVSORTDATA;typedef int (*PFNLVCOMPARE) (int nItem1, int nItem2, PLVSORTDATA sortData);/** Column and header flags */#define LVCF_LEFTALIGN		0x0000         // column text left align, default#define LVCF_RIGHTALIGN		0x0001         // column text right align#define LVCF_CENTERALIGN	0x0002         // column text center align#define LVHF_LEFTALIGN		0x0000         // header text left align, default#define LVHF_RIGHTALIGN		0x0004         // header text right align#define LVHF_CENTERALIGN	0x0008         // header text center align/**  * Struct of the listview column info, contains information about a column. * This structure is used for creating or retrieving a column. */typedef struct _LVCOLUMN{    /** the horizontal position */    int nCols;    /** column's width */    int width;    /** the title of this column */    char *pszHeadText;    /** max text len */    int nTextMax;    /** image of the column header, can be bitmap or icon */    DWORD image;     /** Comparision function associated with the column */    PFNLVCOMPARE pfnCompare;    /** Column and header flags */    DWORD colFlags;} LVCOLUMN;typedef LVCOLUMN *PLVCOLUMN;/** listview search flags */#define LVFF_TEXT	0x0001#define LVFF_ADDDATA	0x0002/** Contains information for finding a certain item info */typedef struct _LVFINDINFO{    /**      * Type of search to perform.      * This member can be set to one or more of the following values:     * - LVFF_TEXT     *   Searches based on the item(subitems) text.     * - LVFF_ADDDATA     *   Searches based on the attached additional item data.     */    DWORD flags;    /** Search index to begin with, 0 from the beginning */    int iStart;    /** pszInfo containing nCols columns' text */    int nCols;    /** all the subitem's content of this item */    char **pszInfo;    /** the additional item data */    DWORD addData;    /** The found item's row, reserved */    int nItem;    /** The found subitem's column, reserved */    int nSubitem;} LVFINDINFO;typedef LVFINDINFO *PLVFINDINFO;/** Contains listview general notification information */typedef struct _LVNM_NORMAL{    /** wParam parameter of the message */    WPARAM wParam;    /** lParam parameter of the message */    LPARAM lParam;} LVNM_NORMAL;typedef LVNM_NORMAL *PLVNM_NORMAL;/** keydown notification information */typedef LVNM_NORMAL LVNM_KEYDOWN;typedef LVNM_KEYDOWN *PLVNM_KEYDOWN;/** Contains listview notification information when mouse down on the header  */typedef LVNM_NORMAL LVNM_HEADRDOWN;typedef LVNM_HEADRDOWN *PLVNM_HEADRDOWN;/** Contains listview notification information when mouse up on the header  */typedef LVNM_NORMAL LVNM_HEADRUP;typedef LVNM_HEADRUP *PLVNM_HEADUP;/** Contains listview notification information when mouse down on the item area */typedef LVNM_NORMAL LVNM_ITEMRDOWN;typedef LVNM_ITEMRDOWN *PLVNM_ITEMRDOWN;/** Contains listview notification information when mouse up on the item area */typedef LVNM_NORMAL LVNM_ITEMRUP;typedef LVNM_ITEMRUP *PLVNM_ITEMRUP;    /**     * \defgroup mgext_ctrl_listview_styles Styles of listview control     * @{     *//** * \def LVS_NOTIFY * \brief Notifies the parent window. * * Causes the listview to notify the listview parent window  * with a notification message when the user make actions, such as clicks, doubleclicks, ...,etc. */#define LVS_NOTIFY              0x0001L/** * \def LVS_SORT * \brief Sorts strings automatically. * * Causes the listview to sort strings automatically.  */#define LVS_SORT                0x0002L/** * \def LVS_MULTIPLESEL * \brief Causes the listview to allow the user to select multiple items. */#define LVS_MULTIPLESEL         0x0008L              //reserved/** * \def LVS_CHECKBOX * \brief Displays a check box in an item. */#define LVS_CHECKBOX            0x1000L              //reserved/** * \def LVS_AUTOCHECK * \brief If the list box has LVS_CHECKBOX style, this *        style tell the box to auto-switch the check box between  *        checked or un-checked when the user click the check mark box of an item. */#define LVS_AUTOCHECK           0x2000L              //reserved#define LVS_AUTOCHECKBOX        (LVS_CHECKBOX | LVS_AUTOCHECK)    //reserved    /** @} end of mgext_ctrl_listview_styles */    /**     * \defgroup mgext_ctrl_listview_msgs Messages of ListView control     * @{     *//** *  \def LVM_ADDITEM *  \brief Adds a item to listview, this item is also called a row.  *   *  \code  *  LVM_ADDITEM *  PLVITEM p; * *  wParam = 0; *  lParam =(LPARAM)p; *  \endcode * *  \param p Pointes to a LVITEM structure that contains the information of  *           the new item to be added. *  \return Returns the index of the new item if successful, or -1 otherwise. */#define LVM_ADDITEM            0xF110/** * \def LVM_FILLSUBITEM * \brief Sets the content of a subitem, indentified by rows and columns. *  * \code * LVM_FILLSUBITEM * PLVSUBITEM p; * * lParam = (LPARAM)p; * wParam = 0; * \endcode * * \param p the Pointer of the subitem to be added. * \return Returns LV_OKAY if successful, or LV_ERR otherwise. */#define LVM_FILLSUBITEM        0xF111/** * \def LVM_ADDCOLUMN * \brief Adds a new column to listview, indentified by column. *  * \code *  LVM_ADDCOLUMN *  PLVCOLUMN p; * *  wParam = 0; *  lParam =(LPARAM)p; * \endcode * * \param p Pointes to a LVCOLUMN structure that contains the information about the new  *          column to be added. */#define LVM_ADDCOLUMN          0xF112/** * \def LVM_DELITEM * \brief Deletes an item form listview, also called a row. * * \code * LVM_DELITEM * int nRow; * * wParam = (WPARAM)nRow; * lParam = 0; * \endcode * * \param nRow the index of the item to be removed. * \return Returns LV_OKAY if successful, or LV_ERR otherwise. */#define LVM_DELITEM            0xF113/** * \def LVM_CLEARSUBITEM * \brief Clears the content of a subitem, indentified by rows and columns. *  * \code * LVM_CLEARSUBITEM * PLVSUBITEM p * * lParam = (LPARAM)p; * wParam = 0; * \endcode * * \param p the Pointer of the subitem. * \return Returns LV_OKAY if successful, or LV_ERR otherwise. */#define LVM_CLEARSUBITEM       0xF114/** * \def LVM_DELCOLUMN * \brief Deletes a column from listview, all subitem in this column will be removed.   * * \code * LVM_DELCOLUMN * int nCols; * * wParam = (WPARAM)nCol; * lParam = 0; * \endcode * * \param nCol the index of the column to be removed. * \return Returns LV_OKAY if successful, or LV_ERR otherwise. */#define LVM_DELCOLUMN          0xF115/** * \def LVM_COLSORT * \brief Sorts all subitems according to a certain column.  * * \code * LVM_COLSORT * int ncol; * * wParam = (WPARAM)ncol; * lParam = 0; * \endcode * * \param ncol Index of the column. * \return Returns LV_OKAY if successful, or LV_ERR otherwise. */#define LVM_COLSORT            0xF116/** * \def LVM_SETSUBITEMCOLOR * \brief Sets the text color of a subitem. * * \code * LVM_SETSUBITEMCOLOR * PLVSUBITEM psub; * * lParam = (LPARAM)psub; * \endcode * * \param psub constains the information of the subitem to set. * \return Always returns 0; */#define LVM_SETSUBITEMCOLOR       0xF117/** * \def LVM_FINDITEM * * \code * LVM_FINDITEM * PLVFINDINFO plvfi; * * wParam = 0; * lParam = (LPARAM)plvfi; * \endcode * * \param plvfi Points to a LVFINDINFO structure containing information for searching. * * \return Returns the index of the found item if successful, or -1 otherwise. */#define LVM_FINDITEM           0xF118/** * * \def LVM_GETSUBITEMTEXT * \brief Retrieves the text of a listview subitem. * * \code  * LVM_GETSUBITEMTEXT * PLVSUBITEM p; * * wParam = 0; * lParam = (LPARAM)p; * \endcode *  * \param p Points to a LVSUBITEM structure. * * \return Returns len of the text if successful, -1 otherwise. */#define LVM_GETSUBITEMTEXT         0xF119/** * \def LVM_GETITEMCOUNT * \brief Gets the number of all the items(rows) in a listview. * * \code * LVM_GETITEMCOUNT * * wParam = 0; * lParam = 0; * \endcode * * \return The number of the items. */#define LVM_GETITEMCOUNT       0xF11A/** * \def LVM_GETCOLUMNCOUNT * \brief Gets the number of all the columns in listview. * * \code * LVM_GETCOLUMNCOUNT * * wParam = 0; * lParam = 0; * \endcode * * \return the number of all the columns in listview. */#define LVM_GETCOLUMNCOUNT     0xF11B/** * \def LVM_GETSELECTEDITEM * \brief Gets the current selected item. This message is a internal message of listview. * * \code * LVM_GETSELECTEDITEM * * wParam = 0; * lParam = 0; * \endcode * * \return the current selected item. */#define LVM_GETSELECTEDITEM    0xF11C/** * \def LVM_DELALLITEM * \brief Removes all the items in listview. * * \code * LVM_DEALLITEM * * wParam = 0; * lParam = 0; * \endcode * * \return Returns TRUE if successful, or FALSE otherwise. */#define LVM_DELALLITEM           0xF11D/**

⌨️ 快捷键说明

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