📄 gridview.h
字号:
/** * \file gridview.h * \author Wei Yongming <ymwei@minigui.org> * \date 2002/01/06 * * The header file of MiniGUI extension library. * \verbatim Copyright (C) 2002-2007 Feynman Software Copyright (C) 1998-2002 Wei Yongming All rights reserved by Feynman Software. This file is part of MiniGUI, a compact cross-platform Graphics User Interface (GUI) support system for real-time embedded systems. \endverbatim *//* * $Id: gridview.h 7370 2007-08-16 05:29:44Z xgwang $ * * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks, * pSOS, ThreadX, NuCleus, OSE, and Win32. * * Copyright (C) 2002-2007 Feynman Software. * Copyright (C) 1998-2002 Wei Yongming. */#ifndef EXT_GRIDVIEW_H#define EXT_GRIDVIEW_H#ifdef __cplusplusextern "C" {#endif /** * \addtogroup mgext_fns * @{ */ /** * \addtogroup mgext_controls * @{ */ /** * \defgroup mgext_ctrl_grid GridView control * @{ *//** * \def CTRL_GRIDVIEW * \brief The class name of gridview control. */#define CTRL_GRIDVIEW "gridview"#define GVS_COLFIRST 0x0000#define GVS_ROWFIRST 0x0001/** * \def GRID_OKAY * \brief Gridview return value. */#define GRID_OKAY 0/** * \def GRID_ERR * \brief Gridview return value. */#define GRID_ERR (-1)/** Struct of the whole grid control */typedef struct _GRIDVIEWDATA{ /** The number of the rows */ int nr_rows; /** The number of the columns */ int nr_cols; /** The default height of a row */ int row_height; /** The default width of a column */ int col_width;} GRIDVIEWDATA;/** The alignment of the cell *//** Column text horizontal left align, default */#define GV_HALIGN_LEFT 0x00000001/** Column text horizontal right align */#define GV_HALIGN_RIGHT 0x00000002/** Column text horizontal center align */#define GV_HALIGN_CENTER 0x00000003/** Column text vertical top align */#define GV_VALIGN_TOP 0x00000010/** Column text vertical bottom align */ #define GV_VALIGN_BOTTOM 0x00000020/** Column text vertical center align */ #define GV_VALIGN_CENTER 0x00000030/** Mask of horizontal align type */#define GV_HALIGN_MASK 0x0000000F/** Mask of vertical align type */#define GV_VALIGN_MASK 0x000000F0/** The type of the unknown cell, use unknow type to query cell type */#define GV_TYPE_UNKNOWN 0x00000000/** The text type of the cell */#define GV_TYPE_TEXT 0x00000100/** The digit type of the cell */#define GV_TYPE_NUMBER 0x00000200/** The checkbox type of the cell */#define GV_TYPE_CHECKBOX 0x00000300/** The type of the cell having selection */#define GV_TYPE_SELECTION 0x00000400/** The cell type of the row header or column header */#define GV_TYPE_HEADER 0x00000500/** The cell type of the cell */#define GV_TYPE_TABLEHEADER 0x00000600/** Mask of grid cell type */#define GV_TYPE_MASK 0x0000FF00/** A style of the cell, which has a icon bitmap */#define GVS_WITHICON 0x00010000/** A style of the cell, which contains a checkbox */#define GVS_WITHCHECKBOX 0x00020000/** A style of the cell, which text is multiple line*/#define GVS_MULTLINE 0x00100000/** A status of the cell, which is read only*/#define GVS_READONLY 0x00200000/** A status of the cell which has a checkbox and the checkbox is checked */#define GVS_BOXCHECKED 0x00400000#define GVITEM_STYLE 0x0001#define GVITEM_BGCOLOR 0x0002#define GVITEM_FGCOLOR 0x0004#define GVITEM_FONT 0x0008#define GVITEM_IMAGE 0x0010#define GVITEM_MAINCONTENT 0x0020 #define GVITEM_SIZE 0x0040#define GVITEM_ALLCONTENT 0x00FF/** Struct of the selected cell(s) */typedef struct _GRIDCELLS{ /** The start row of the selected cell(s) */ int row; /** The start column of the selected cell(s) */ int column; /** The number of the column(s) which contain(s) selected cell(s) */ int width; /** The number of the row(s) which contain(s) selected cell(s) */ int height;}GRIDCELLS;typedef int (*GRIDCELLEVALCALLBACK)(GRIDCELLS* target, GRIDCELLS* source, DWORD dwAddData);typedef struct _GRIDCELLDEPENDENCE{ /** The dependence of source cell */ GRIDCELLS source; /** The dependence of target cell */ GRIDCELLS target; /** The callback function of one special cell */ GRIDCELLEVALCALLBACK callback; /** The addition data of cell */ DWORD dwAddData;}GRIDCELLDEPENDENCE;/** Struct of the header type cell */typedef struct _GRIDCELLDATAHEADER{ /** The height of a row or the width of a column */ int size; /** The caption of the row or column */ char* buff; /** The length of the buff string */ int len_buff;}GRIDCELLDATAHEADER;/** Struct of the text type cell */typedef struct _GRIDCELLDATATEXT{ /** The caption of the row or column */ char* buff; /** The length of the buff string */ int len_buff;}GRIDCELLDATATEXT;/** Struct of the number type cell */typedef struct _GRIDCELLDATANUMBER{ /** The value of the number type cell*/ double number; /** The format of the number to display */ char* format; /** The length of the format string */ int len_format;}GRIDCELLDATANUMBER;/** Struct of the checkbox type cell */typedef struct _GRIDCELLDATACHECKBOX{ /** Whether this checkbox is checked */ BOOL checked; /** The text after checkbox */ char* text; /** When used for set, -1 means null-terminated */ int len_text;}GRIDCELLDATACHECKBOX;/** Struct of the selection type cell */typedef struct _GRIDCELLDATASELECTION{ /** The index of the combobox that current selected */ int cur_index; /** "Yes\nNo\n"*/ char* selections; /** When used for set, -1 means null-terminated */ int len_sel;}GRIDCELLDATASELECTION;#if 0/** struct of the evaluation type cell */typedef struct _GRIDCELLDATAEVAL{ /** the value of the evaluation type cell */ double number; /** the evaluation of one special cell */ GRIDCELLS sourcecells; /** the callback function of one special cell */ GRIDCELLEVALCALLBACK eval_callback; /** the format of the number to display */ char* format; /** the length of the format string */ int len_format;}GRIDCELLDATAEVAL;#endif/** Struct of the cell */typedef struct _GRIDCELLDATA{ /** Mask of properties, can be OR'ed with following values: * Set or get a cell style * - GVITEM_STYLE\n * Set or get a cell text color * - GVITEM_FGCOLOR\n * Set or get a cell background color * - GVITEM_BGCOLOR\n * Set or get a cell text font * - GVITEM_FONT\n * Set or get a cell's image * - GVITEM_IMAGE\n * Set or get all of the content of a cell * - GVITEM_ALLCONTENT\n * Set or get the main content of a cell * - GVITEM_MAINCONTENT\n * Set or get the header size * - GVITEM_SIZE */ DWORD mask; /** The style of the cell */ DWORD style; /** Text color */ gal_pixel color_fg; /** The background color */ gal_pixel color_bg; /** Text font */ PLOGFONT font; /** Pointer to the bitmap of one cell */ PBITMAP image; /** The concrete data of one cell */ void* content;}GRIDCELLDATA; /** \defgroup mgext_control_grid_msgs Messages of grid control * @{ *//** * \def GRIDM_SETCELLPROPERTY * * \brief An Application sends a GRIDM_SETCELLPROPERTY message to set the * cells' property in the grid control. * * \code * GRIDM_SETCELLPROPERTY * GRIDCELLS* cells; * GRIDCELLDATA* celldata; * * wParam = (WPARAM)cells; // The cell(s) which you want to set it's(their) property * lParam = (LPARAM)celldata; // The pointer of the property you want to set. * \endcode * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. * \sa GRIDCELLDATA */#define GRIDM_SETCELLPROPERTY 0xF210/** * \def GRIDM_GETCELLPROPERTY * * An Application sends a GRIDM_GETPROPERTY message to get a single cell's property in the grid control. * * \code * GRIDM_GETCELLPROPERTY * GRIDCELLS* cells; * GRIDCELLDATA* celldata; * * wParam = (WPARAM)cell; // The cell(only for one cell now) which you want to get it's property * lParam = (LPARAM)celldata; // The pointer of the property you want to get. * \endcode * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. * \sa GRIDCELLDATA */#define GRIDM_GETCELLPROPERTY 0xF211/** * \def GRIDM_SETCOLWIDTH * * An Application sends a GRIDM_SETCOLWIDTH message to set column width in the grid control. * if (lParam < 1 or lParam > nCols) , if will do nothing. nCows is the columns' count of the grid control. * * \code * GRIDM_SETCOLWIDTH * int index; * int width; * * wParam = (WPARAM)index; // The index of the column which you want to set width.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -