guides:programming:programmers_reference_manual:colstyle_message

COLSTYLE message

Set or retrieve styles of one or more columns in an edit table control.

Edit table.

styles = Send_Message(controlID, "COLSTYLE", columnno, newstyle)

Parameters are as follows.

ParameterDescription
ColumnnoColumn position, beginning from 1. Use 0 to specify all columns.
NewstyleIf 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.
Column StyleValue
Resizeable1
Fixed2
Editable4
Protected8
Uppercase20
Hidden32
Left Just0 (default)
Center Just64
Right Just128
Heading Left0 (default)
Heading Center256
Heading Right512
Skipped4100
Locked8192
Sort Asc16384
Sort Desc32768
Checkbox65536
Dropdown131072
Multi-line header (See Example 5)262144
Right-aligned checkboxes524288
Enable drag (See Example 4)0x10000000
Enable drop (See Example 4)0x20000000

Style for the specified column(s) (if multiple columns, in an @FM-delimited array).

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)
 
  • guides/programming/programmers_reference_manual/colstyle_message.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1