Description
Set or retrieve styles of one or more columns in an edit table control.
Applies to
Edit table.
Syntax
styles = Send_Message(controlID, "COLSTYLE", columnno, newstyle)
Parameters
Parameters are as follows.
Parameter | Description | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Columnno | Column position, beginning from 1. Use 0 to specify all columns. | ||||||||||||||||||||||||||||||||||||||||||||||
Newstyle | If columnno > 0, newstyle indicates the style for the column. If columnno is 0, passes an @FM-delimited array of styles to replace existing styles for each column in the edit table. Pass null to leave style intact.
|
Return value
Style for the specified column(s) (if multiple columns, in an @FM-delimited array).
See also
STYLE property, Bit-wise operators, Edit Table Column Styles, AUTOSIZECOL property, COLDATA property, COLLABEL message, COLWIDTH message, PSStyle property, IConv( expression, "MX"), [expression, "MX")], RTI_Style_Equates
Example
declare subroutine LockColumns(Table, Lock) * This function horizontally locks the specified * number of edit-table columns Parameters: Table - [in] id of edit table control Lock - [in] number of columns to lock */ declare function Send_Message declare subroutine Send_Message equ LOCK_STYLE$ to 8192 ColCount = Get_Property(Table, "LIMIT") <1> Styles = Send_Message(Table, "COLSTYLE", 0, "") for i = 1 to ColCount if i <= Lock then Styles<i> = bitor(Styles<i>, LOCK_STYLE$) end else Styles<i> = bitand(Styles<i>, bitnot(LOCK_STYLE$)) end next i Send_Message(Table, "COLSTYLE", 0, Styles) return
Example 2
* Create a dropdown in column 1 Declare function Send_Message EditTable = @Window:".TABLE_1" // Column 1 is the column being set up as a drop down. // Flag the column as a drop down column. ColStyle = Send_Message(EditTable, "COLSTYLE", 1) ColStyle = bitor(ColStyle, 0x20000) ColStyle = Send_Message(EditTable, "COLSTYLE", 1, ColStyle) // Establish the list of values in the drop down. ColFormat = Send_Message(EditTable, "COLFORMAT", 1, "Item One":@VM:"Item Two":@VM:"Item Three")
Example 3
* Create a checkbox in column 2 Declare function Send_Message EditTable = @Window:".TABLE_1" // This establishes the check box style for column two. ColStyle = Send_Message(EditTable, "COLSTYLE", 2) Colstyle = 65536 ColStyle = Send_Message(EditTable, "COLSTYLE", 2, ColStyle) // This establishes the check box text for column two. ColFormat = Send_Message(EditTable, "COLFORMAT", 2, "Check this box")
Example 4
* Add Drag and Drop to Columns within an Edittable EditTable = @Window:".TABLE_1" * Enable drag and drop to Column 1 ColStyle = Send_Message(EditTable, "COLSTYLE", 1) ColStyle = bitor(ColStyle, 0x10000000) ; * enabledrag ColStyle = bitor(ColStyle, 0x20000000) ; * enabledrop ColStyle = Send_Message(EditTable, "COLSTYLE", 1, ColStyle) * Enable drag and drop to Column 2 ColStyle = Send_Message(EditTable, "COLSTYLE", 2) ColStyle = bitor(ColStyle, 0x10000000) ; * enabledrag ColStyle = bitor(ColStyle, 0x20000000) ; * enabledrop ColStyle = Send_Message(EditTable, "COLSTYLE", 2, ColStyle)
Example 5
* Multi-line column headings * Change the Column Headers to multi-line and place data within the header tableCtrl = @window:".TEST_TABLE" * Set the column header for column 1 to multi-line ColStyle = Send_Message(tableCtrl, "COLSTYLE", 1) ColStyle = bitor(colstyle,262144) ColStyle = Send_Message(tableCtrl, "COLSTYLE", 1, ColStyle) * Set the column header for column 2 to multi-line ColStyle = Send_Message(tableCtrl, "COLSTYLE", 2) ColStyle = bitor(colstyle,262144) ColStyle = Send_Message(tableCtrl, "COLSTYLE", 2, ColStyle) * Set the height of the column headers for the edittable x = set_property(tableCtrl,'HEADERHEIGHT',60) * Set the header text headerText<1> = "This line will wrap within the header." headerText<2> = "This line contains":char(13): "carriage returns." x = Set_Property(tableCtrl,"LABEL",headerText)