MSFlexGrid完全参考手册:
Elysium's BLOG: http://blog.csdn.net/elysium
Object FlexGrid
The Microsoft FlexGrid (MSFlexGrid) control displays and operates on tabular data. It allows complete flexibility to sort, merge, and format tables containing strings and pictures. When bound to a Data control, MSFlexGrid displays read-only data.
You can put text, a picture, or both, in any cell of an MSFlexGrid. The Row and Col properties specify the current cell in an MSFlexGrid. You can specify the current cell in code, or the user can change it at run time using the mouse or the arrow keys. The Text property references the contents of the current cell.
If the text in a cell is too long to display in the cell, and the WordWrap property is set to True, the text wraps to the next line within the same cell. To display the wrapped text, you may need to increase the cell’s column width (ColWidth property) or row height (RowHeight property).
Use the Col and Row properties to determine the number of columns and rows in an FlexGrid.
Properties
FlexGrid support Common properties of objects.
Styles
FlexGrid support Common WINDOWS styles .
Methods
FlexGrid support Common Windows methods, and also own:
Methods of strings and columns
GETROWS | Returns number of strings in the table. |
SETROWS | Sets number of strings in the table. |
GETCOLS | Returns number of columns in the table. |
SETCOLS | Sets number of columns in the table. |
GETFIXEDROWS | Returns number of the fixed strings in the table. |
SETFIXEDROWS | Sets number of the fixed strings in the table. |
GETFIXEDCOLS | Returns number of the fixed columns in the table. |
SETFIXEDCOLS | Sets number of the fixed columns in the table. |
GETFIXEDALIGNMENT | Returns a flag of alignment of the text the fixed cells of a column. |
SETFIXEDALIGNMENT | Sets a flag of alignment of the text the fixed cells of a column. |
GETTOPROW | Returns value of o-coordinate of the top left corner of the first seen string. |
SETTOPROW | Sets value of o-coordinate of the top left corner of the first seen string. |
GETLEFTCOL | Returns value of at - Coordinate of the top left corner of the first seen column. |
SETLEFTCOL | Sets value of at - Coordinate of the top left corner of the first seen column. |
GETROW | Returns number of the current string. |
SETROW | Sets number of the current string. |
GETCOL | Returns number of the current column. |
SETCOL | Sets number of the current column. |
GETROWSEL | Returns number of the chosen string. |
SETROWSEL | Sets the chosen string. |
GETCOLSEL | Returns number of the chosen column. |
SETCOLSEL | Sets number of the chosen column. |
GETMOUSEROW | Returns a position of the cursor of the mouse in coordinates of strings. |
GETMOUSECOL | Returns a position of the cursor of the mouse in coordinates of columns. |
GETROWHEIGHTMIN | Returns the minimal value of height of a string (in pixels). |
SETROWHEIGHTMIN | Sets the minimal value of height of a string (in pixels). |
SETROWPOSITION | Changes the order of strings in the table. |
GETCOLALIGNMENT | Returns a flag of alignment of the text of a column. |
SETCOLALIGNMENT | Sets a flag of alignment of the text of a column. |
GETCOLWIDTH | Returns value of width of a column. |
SETCOLWIDTH | Sets value of width of a column. |
GETROWHEIGHT | Returns value of height of a string. |
SETROWHEIGHT | Sets value of height of a string. |
GETMERGEROW | Returns value of a flag of association of strings. |
SETMERGEROW | Sets value of a flag of association of strings. |
GETMERGECOL | Returns value of a flag of association of columns. |
SETMERGECOL | Sets value of a flag of association of columns. |
SETCOLPOSITION | Changes the order of columns in the table. |
GETROWDATA | Returns the established number for the specified string. |
SETROWDATA | Sets number for the specified string. |
GETCOLDATA | Returns the established number for the specified column. |
SETCOLDATA | Sets number for the specified column. |
GETROWISVISIBLE | determines, whether the specified string is seen. |
GETCOLISVISIBLE | determines, whether we see the specified column. |
GETROWPOS | determines distance (in pixels) between left top a corner of the table and left top a corner of the specified string. |
GETCOLPOS | determines distance (in pixels) between left top a corner of the table and left top a corner of the specified column. |
GETPOSINFO | Returns a dynamic array which elements contain results of a call of methods. |
ADDCOLUMN | Adds a column. |
DELETECOL | Removes a column. |
DELETECOLS | Removes columns. |
DELETEROW | Removes a string. |
DELETEROWS | Removes strings. |
REMOVECOLUMN | Removes a column. |
Methods of work with color
GETBACKCOLOR | Returns value of color of a background of elements of the table in system R, G, B. |
SETBACKCOLOR | Sets value of color of a background of elements of the table in system R, G, B. |
GETFORECOLOR | Returns value of color of the text of elements of the table in system (R, G, B). |
SETFORECOLOR | Sets value of color of the text of elements of the table in system (R, G, B). |
GETBACKCOLORFIXED | Returns value of color of the fixed part of the table in system R, G, B. |
SETBACKCOLORFIXED | Sets value of color of the fixed part of the table in system R, G, B. |
GETFORECOLORFIXED | Returns value of color of the text of the fixed part of the table in system R, G, B. |
SETFORECOLORFIXED | Sets value of color of the text of the fixed part of the table in system R, G, B. |
GETBACKCOLORSEL | Returns value of the color, the selected strings (columns) of the table in system R, G, B. |
SETBACKCOLORSEL | Sets value of the color, the selected strings (columns) of the table in system R, G, B. |
GETFORECOLORSEL | Returns value of color of the text, the selected strings (columns) of the table in system R, G, B. |
SETFORECOLORSEL | Sets value of color of the text, the selected strings (columns) of the table in system R, G, B. |
GETBACKCOLORBKG | Returns value of color of the table in system R, G, B. |
SETBACKCOLORBKG | Sets value of color of the table in system R, G, B. |
GETMOUSEPOINTER | Returns value of the index of the cursor of the mouse. |
SETMOUSEPOINTER | Sets value of the index of the cursor of the mouse. |
GETMOUSEICON | Returns the index of the cursor of the mouse. |
SETMOUSEICON | Sets the index of the cursor of the mouse |
GETPICTURETYPE | Returns type of a graphic representation. |
SETPICTURETYPE | Sets type of a graphic representation. |
GetPicture | Returns the image of the table. |
GETCOLORINFO | Returns the information color installations of object. With color. |
Methods of work with the text
GETWORDWRAP | Returns value of a flag "wordwrap". |
SETWORDWRAP | Sets value of a flag "wordwrap". |
GetText | Returns value of a cell. |
SETTEXT | Sets value to a cell or set of cells. |
GETFONT | Returns the established font. |
SETFONT | Sets a font for the table. |
GETFONTWIDTH | Returns value of width of a font. |
SETFONTWIDTH | Sets width of a font. |
GETTEXTSTYLE | returns style of the text |
SETTEXTSTYLE | Sets style of the text. |
GETTEXTSTYLEFIXED | Returns value of a flag of style of the text of the fixed part |
SETTEXTSTYLEFIXED | Sets value of a flag of style of the text of the fixed part. |
GETTEXTARRAY | Returns value of an any cell |
SETTEXTARRAY | Sets value of an any cell. |
GETTEXTMATRIX | Returns value of an any cell |
SETTEXTMATRIX | Sets value of an any cell |
REPLACETEXT | Finds and replace the text |
REPLACETEXTEXACT | - " - |
REPLACENEXTTEXT | - " - |
REPLACEALLTEXT | - " - |
SETITEMTEXT | Sets the text of a string |
SETITEMSTEXT | - " - |
SETITEMTEXTEX | - " - |
SETITEMSTEXTEX | - " - |
Methods of work with cells of the table
GETCELLLEFT | Returns value of o-coordinate of the left top corner of a cell. |
GETCELLTOP | Returns value of Y-coordinate of the left top corner of a cell. |
GETCELLWIDTH | Returns value of width of a cell. |
GETCELLHEIGHT | Returns value of height of a cell. |
GETCELLFONTNAME | Returns value of a name of a font of a cell. |
SETCELLFONTNAME | Sets value of a name of a font of a cell |
GETCELLFONTSIZE | Returns value of the size of a font of a cell |
SETCELLFONTSIZE | Sets value of the size of a font of a cell. |
GETCELLFONTBOLD | Returns value of style of a font of a cell |
SETCELLFONTBOLD | Sets value of style of a font of a cell (bold) |
GETCELLFONTITALIC | Returns value of style of a font of a cell |
SETCELLFONTITALIC | Sets value of style of a font of a cell (italics) |
GETCELLFONTUNDERLINE | Returns value of style of a font of a cell |
SETCELLFONTUNDERLINE | Sets value of style of a font of a cell (underlining) |
GETCELLFONTSTRIKETHROUGH | Returns value of style of a font of a cell |
SETCELLFONTSTRIKETHROUGH | Sets value of style of a font of a cell (deletion) |
GETCELLFONTWIDTH | Returns value of width of a font of a cell |
SETCELLFONTWIDTH | Sets value of width of a font of a cell |
GETCELLBACKCOLOR | Returns value of color of a cell |
SETCELLBACKCOLOR | Sets value of color of a cell |
GETCELLFORECOLOR | Returns value of color of a font of a cell |
SETCELLFORECOLOR | Sets value of color of a font of a cell |
GETCELLALIGNMENT | Returns value of a flag of alignment of the text of a cell. |
SETCELLALIGNMENT | Sets value of a flag of alignment of the text of a cell. |
GETCELLTEXTSTYLE | Returns style of the text of a cell |
SETCELLTEXTSTYLE | Sets style of the text of a cell |
GETCELLPICTUREALIGNMENT | Returns value of a flag of alignment of the image in a cell |
SETCELLPICTUREALIGNMENT | Sets value of a flag of alignment of the image in a cell |
GETMERGECELLS | Returns a flag of association of cells |
SETMERGECELLS | Sets a flag of association of cells |
GETCELLPICTURE | Returns a file name of the image for the current cell |
SETCELLPICTURE | Sets a file of the image for the current cell |
SETCELLSTEXT | Sets value to cells from the given rectangular area |
FINDCELL | Search of a cell |
FINDCELLEXACT | Search of a cell |
FINDNEXTCELL | Search of a cell |
REPLACECELL | Search and replace |
REPLACECELLEXACT | Search and replace |
REPLACENEXTCELL | Search and replace |
REPLACEALLCELLS | Search and replace |
Methods of work with the table
GETFILLSTYLE | Returns value of the flag determining installation of property Text |
SETFILLSTYLE | Sets a flag, whether which determines property Text to one or all selected cells of object is applied |
GETGRIDLINES | Returns type of lines |
SETGRIDLINES | Sets type of a line between cells, heading, empty areas |
GETGRIDLINESFIXED | Returns type of a line |
SETGRIDLINESFIXED | Sets type of a line between cells of the fixed strings and columns |
GETGRIDCOLOR | Returns color of lines between cells |
SETGRIDCOLOR | Sets color of lines between cells of object |
GETGRIDCOLORFIXED | Returns color of lines between cells of the fixed part of the table |
SETGRIDCOLORFIXED | Sets color of lines between cells of the fixed part of the table |
GETGRIDLINEWIDTH | Returns thickness of lines |
SETGRIDLINEWIDTH | Sets thickness of lines |
GETBORDERSTYLE | Returns style of a framework |
SETBORDERSTYLE | Sets style of a framework of the table |
Other methods
GETLISTCONTENTS | Returns the contents of the table limited to a given rectangular |
CLEARREGION | Clears contents of a rectangular |
GETSCROLLTRACK | returns value of a flag of scrolling |
SETSCROLLTRACK | Sets value of a flag, whether which specifies the table should scroll contents when the user moves a scroll box of a strip of scrolling |
GETFOCUSRECT | Returns value of a flag of a portrayal of a rectangular |
SETFOCUSRECT | Sets a flag, whether which specifies the rectangular around of the current cell |
GETHIGHLIGHT | Returns value of a flag of illumination |
SETHIGHLIGHT | Sets a flag, whether which determines the selected cells highlighted |
GETREDRAW | returns a flag of automatic copying |
SETREDRAW | Sets a flag: whether to carry out automatic copying object at various changes |
GETSCROLLBARS | returns type of a strip of scrolling |
SETSCROLLBARS | Sets type of strips of scrolling of object |
GETVERSION | Returns the version of object which is loaded in memories |
GETFORMATSTRING | Returns a string of formatting |
SETFORMATSTRING | Sets: values of width of columns, flags of alignment, the text of the fixed string, the text of the fixed column |
GETCLIP | returns value of the chosen area of object |
SETCLIP | Sets value of the chosen area of object |
SETSORT | Sets type of sorting |
GETSELECTIONMODE | Returns a flag of a choice |
SETSELECTIONMODE | Sets a flag allowing to carry out a choice of cells, strings, columns |
ADDITEM | Adds an element of the table |
ADDITEMS | Adds elements of the table |
ADDITEMEX | Adds an element of the table |
ADDITEMSEX | Adds elements of the table |
Clear | Clears values of cells, strings of formatting |
REFRESH | Draws again contents of object. |
REMOVEITEM | Deletes the specified string of the table |
GETALLOWBIGSELECTION | Returns a flag of full selection |
SETALLOWBIGSELECTION | Sets a flag, whether which specifies the column (string) completely should be selected |
GETALLOWUSERRESIZING | Returns a flag of change of the size of strings and columns |
SETALLOWUSERRESIZING | Sets a flag of an opportunity to change the size of strings and columns |
GETENABLED | Returns a flag of access |
SETENABLED | Sets a flag, whether which determines the object is accessible to change |
GETAPPEARANCE | Returns a flag of 3 measured effects |
SETAPPEARANCE | Sets a flag, whether which determines the object by 3 measured effects should be painted |
GETRIGHTTOLEFT | Returns a flag of a direction of the text |
SETRIGHTTOLEFT | Sets a flag of a direction of the text |
GETOLEDROPMODE | |
SETOLEDROPMODE | |
OLEDrag | |
GetSel | Returns a dynamic array which contains values of cells of the selected area |
SETFINDPOSITION | Sets the beginning of search |
SETFINDDIRECTION | Sets a flag of a direction of search |
SAVELISTCONTENTS | |
SAVELISTCONTENTSH | |
AddFromSpr | Adds the data in the table of the BRIZ table |
FillFromSpr | Fills the data in the table of the BRIZ table |
ReplaceFromSpr | Fills in object the data from the BRIZ table with code conversion |
Events
FLEXGRID support Common WINDOWS events , Common events of objects , and also own.
OnFGClick | - click of the button of the mouse on a cell |
OnColumnClick | - at click by the button of the mouse on the fixed string |
ONDROP | - arises at end of operation Drag-and-Drop |
ONDROPHOVER | - arises at end of operation Drag-and-Drop |
OnFGDblClick | - a double click of the button of the mouse on a cell |
OnFGEnterCell | - at occurrence in a cell |
OnFGKeyDown | - pressing of any key |
OnFGKeyPress | - pressing of nonfunctional keys |
OnFGKeyUp | - a release of a key of the keyboard |
OnFGLeaveCell | - at a leave of a cell |
OnFGMouseDown | - arises by pressing a key of the mouse |
OnFGMouseMove | - at cursor movement of the mouse |
OnFGMouseUp | - arises at a release of a key of the mouse |
OnFGOLECompleteDrag | - |
OnFGOLEDragDrop | - |
OnFGOLEDragOver | - |
OnFGOLEGiveFeedback | - |
OnFGOLESetData | - |
OnFGOLEStartDrag | - |
OnFGRowColChange | - at change of the current string (column) |
OnFGScroll | - arises by pressing indexes of a strip of scrolling |
OnFGSelChange | - at change of the selected cell |
OnRowClick | - at click by the button of the mouse on the cell following after a fixed column |
OnTimer | - the timer |
Returns a dynamic array:
Indus | Description | ||||
1 | a name of dialog (screen) | ||||
2 | a name of object | ||||
3 | Type of the message
| ||||
4 | the identifier of dialog | ||||
5 | the identifier of object in dialog | ||||
6 | the name of the message | ||||
for OnFGMouseDown, OnFGMouseUp, OnFGMouseMove | |||||
7 | a flag of the button of the mouse | ||||
8 | a flag of pressing of key Shift | ||||
9 | GetMouseCol | ||||
10 | GetMouseRow | ||||
11 | x-coordinate of the cursor of the mouse | ||||
12 | y-coordinate of the cursor of the mouse | ||||
for OnFGDblClick | |||||
7 | GetMouseCol | ||||
8 | GetMouseRow | ||||
9 | x-coordinate of the cursor of the mouse | ||||
10 | y-coordinate of the cursor of the mouse | ||||
for OnFGKeyDown, OnFGKeyUp | |||||
7 | KeyCode | ||||
8 | Shift | ||||
9 | GetCol | ||||
10 | GetRow | ||||
for OnFGKeyPress | |||||
7 | KeyAscii | ||||
8 | GetCol | ||||
9 | GetRow | ||||
for OnFGSelChange | |||||
7 | GetRow | ||||
8 | GetCol | ||||
9 | GetRowSel | ||||
10 | GetColSel | ||||
for OnRowColChange | |||||
7 | GetRow | ||||
8 | GetCol | ||||
9 | GetRowSel | ||||
10 | GetColSel | ||||
for OnFGEnterCell, OnFGLeaveCell | |||||
7 | GetRow | ||||
8 | GetCol | ||||
9 | GetText | ||||
for OnFGScroll | |||||
7 | GetTopRow | ||||
8 | GetLeftCol | ||||
9 | GetRow | ||||
10 | GetCol | ||||
for OnFGClick, OnRowClick, OnColumnClick | |||||
7 | GetMouseCol | ||||
8 | GetMouseRow | ||||
9 | x-coordinate of the cursor of the mouse | ||||
10 | y-coordinate of the cursor of the mouse |
Remark:
The call of a method can be made by number.
CALL GP.DlgObjectFn(1,3,"21",RET)
OR
CALL GP.DlgObjectFn(1,3,"GetColSel",RET)
Numbers of methods are given in the table:
0-GetRows | 1-SetRows | 2-GetCols | 3-SetCols |
4-GetFixedRows | 5-SetFixedRows | 6-GetFixedCols | 7-SetFixedCols |
8-GetVersion | 9-GetFormatString | 10-SetFormatString | 11-GetTopRow |
12-SetTopRow | 13-GetLeftCol | 14-SetLeftCol | 15-GetRow |
16-SetRow | 17-GetCol | 18-SetCol | 19-GetRowSel |
20-SetRowSel | 21-GetColSel | 22-SetColSel | 23-GetText |
24-SetText | 25-GetBackColor | 26-SetBackColor | 27-GetForeColor |
28-SetForeColor | 29-GetBackColorFixed | 30-SetBackColorFixed | 31-GetForeColorFixed |
32-SetForeColorFixed | 33-GetBackColorSel | 34-SetBackColorSel | 35-GetForeColorSel |
36-SetForeColorSel | 37-GetBackColorBkg | 38-SetBackColorBkg | 39-GetWordWrap |
40-SetWordWrap | 41-GetFont | 42-SetFont | 43-GetFontWidth |
44-SetFontWidth | 45-GetCellFontName | 46-SetCellFontName | 47-GetCellFontSize |
48-SetCellFontSize | 49-GetCellFontBold | 50-SetCellFontBold | 51-GetCellFontItalic |
52-SetCellFontItalic | 53-GetCellFontUnderline | 54-SetCellFontUnderline | 55-GetCellFontStrikeThrough |
56-SetCellFontStrikeThrough | 57-GetCellFontWidth | 58-SetCellFontWidth | 59-GetTextStyle |
60-SetTextStyle | 61-GetTextStyleFixed | 62-SetTextStyleFixed | 63-GetScrollTrack |
64-SetScrollTrack | 65-GetFocusRect | 66-SetFocusRect | 67-GetHighLight |
68-SetHighLight | 69-GetRedraw | 70-SetRedraw | 71-GetScrollBars |
72-SetScrollBars | 73-GetMouseRow | 74-GetMouseCol | 75-GetCellLeft |
76-GetCellTop | 77-GetCellWidth | 78-GetCellHeight | 79-GetRowHeightMin |
80-SetRowHeightMin | 81-GetFillStyle | 82-SetFillStyle | 83-GetGridLines |
84-SetGridLines | 85-GetGridLinesFixed | 86-SetGridLinesFixed | 87-GetGridColor |
88-SetGridColor | 89-GetGridColorFixed | 90-SetGridColorFixed | 91-GetCellBackColor |
92-SetCellBackColor | 93-GetCellForeColor | 94-SetCellForeColor | 95-GetCellAlignment |
96-SetCellAlignment | 97-GetCellTextStyle | 98-SetCellTextStyle | 99-GetCellPictureAlignment |
100-SetCellPictureAlignment | 101-GetClip | 102-SetClip | 103-SetSort |
104-GetSelectionMode | 105-SetSelectionMode | 106-GetMergeCells | 109-SetMergeCells |
108-GetAllowBigSelection | 109-SetAllowBigSelection | 110-GetAllowUserResizing | 111-SetAllowUserResizing |
112-GetBorderStyle | 113-SetBorderStyle | 114-GetEnabled | 115-SetEnabled |
116-GetAppearance | 117-SetAppearance | 118-GetMousePointer | 119-SetMousePointer |
120-GetMouseIcon | 121-SetMouseIcon | 122-GetPictureType | 123-SetPictureType |
124-GetPicture | 125-GetCellPicture | 126-SetCellPicture | 127-GetTextArray |
128-SetTextArray | 129-GetColAlignment | 130-SetColAlignment | 131-GetColWidth |
132-SetColWidth | 133-GetRowHeight | 134-SetRowHeight | 135-GetMergeRow |
136-SetMergeRow | 137-GetMergeCol | 140-SetMergeCol | 141-SetColPosition |
142-GetRowData | 143-SetRowData | 144-GetColData | 145-SetColData |
146-GetTextMatrix | 147-SetTextMatrix | 148-AddItem | 149-RemoveItem |
150-Clear | 151-Refresh | 152-GetDataSource | 153-SetDataSource |
154-owIsVisible | 155-GetColIsVisible | 156-GetRowPos | 157-GetColPos |
158-ridLineWidth | 159-SetGridLineWidth | 160-GetFixedAlignment | 161-SetFixedAlignment |
162-ightToLeft | 163-SetRightToLeft | 164-GetOLEDropMode | 165-SetOLEDropMode |
166-OLEDrag | 167-SetRowPosition | 168-AddItems | 169-AddItemEx |
170-AddItemsEx | 171-GetPosInfo | 172-GetColorInfo | 173-GetSel |
174-SetCellsText | 175-GetCellRect | 176-SetSel | 177-SetSelText |
178-FindCell | 177-FindCellExact | 178-FindNextCell | 179-SetFindPosition |
182-SetFindDirection | 181-ReplaceCell | 182-ReplaceCellExact | 183-ReplaceNextCell |
186-ReplaceAllCells | 185-ReplaceText | 186-ReplaceTextExact | 187-ReplaceNextText |
190-ReplaceAllText | 189-SetItemText | 190-SetItemsText | 191-SetItemTextEx |
194-SetItemsTextEx | 193-AddColumn | 194-RemoveColumn | 195-SaveListContents |
196-SaveListContentsH | 197-ReplaceFromSpr | 198-AddFromSpr | 199-FillFromSpr |
200-SetDefEditor | 201-GetDefEditor | 204-SetEditorPerColumn | 205-SetEditorPerRow |
206-SetEditOnOff | 207-SetEditCell | 208-GetEditCell | 209-GetEditResult |
210-SetAutoUpdate | 211-SetEditPosParam | 212-EnsureVisible | 213-GetListContents |
214-ClearRegion | 215-DeleteRow | 216-DeleteCol | 217-DeleteRows |
218-DeleteCols | - | - |