v12.0 (2014)
Sets a column definition
GridData.SetColumnDef( Int32 in_ColumnIndex, siGridWidgetColumnType in_Type, Object in_pvInDef ); |
GridData.SetColumnDef( Index, Type, [Definition] ); |
Parameter | Type | Description |
---|---|---|
Index | Long | Index of the Column to change. |
Type | siGridWidgetColumnType | The new type for the column. |
Definition | Array of Variant | Array describing the definition of the new column. When a
column definition gets changed using SetColumnDef, default values
are applied, unless the plug-in passes an array of values for the
definition. The array can be empty (use defaults) or contain up to
the maximum number of arguments that are available for a given
column type. Here are the default definition values for supported
column types: siColumnCombo: "name" / value pairs. For example: [ "First", 0, "Second", 2, "Tenth", 10 ] siColumnInt: [ Min, Max, Increment ]. Default values: [ -2147483648, 2147483647, 1 ] siColumnFloat: [ Min, Max, Increment, NbDecimals ]. Default values: [ 2.2250738585072014e-308, 1.7976931348623158e+308, 1.0, 2 ] siColumnImageClip and siColumnShaderBall: [ ThumbnailSize (from 28 to 128 pixels)]. Default values: [ 28 ] siColumnVector: [ VectorSize (2,3 or 4), Min, Max, Increment, NbDecimals ]. Default values: [ 2, 2.2250738585072014e-308, 1.7976931348623158e+308, 1.0, 2 ] siColumnFile: [ BrowserType ("File" or "Folder"), StartupPath, Filter ]. [ "File", "/", ".*" ] |
import win32com.client from win32com.client import constants as C propName = "TheProperty" gridDataName = "TheGrid" siProperty = Application.ActiveSceneRoot.AddProperty( "CustomProperty", False, propName ) gridData = siProperty.AddGridParameter( gridDataName ).Value ; gridData.ColumnCount = 8 gridData.RowCount = 2 for row in range( 2 ): gridData.SetRowLabel( row, "Row %d"%row ) # siColumnCombo gridData.SetColumnLabel( 0, "siColumnCombo" ) gridData.SetColumnDef( 0, C.siColumnCombo, [ "First", 1, "Second", 2, "Tenth", 10 ] ) # siColumnInt gridData.SetColumnLabel( 1, "siColumnInt" ) gridData.SetColumnDef( 1, C.siColumnInt, [ -10, 10, 1 ] ) # siColumnFloat gridData.SetColumnLabel( 2, "siColumnFloat" ) gridData.SetColumnDef( 2, C.siColumnFloat, [ -10, 10, 1, 2 ] ) # siColumnImageClip gridData.SetColumnLabel( 3, "siColumnImageClip" ) gridData.SetColumnDef( 3, C.siColumnImageClip, [ 64 ] ) # siColumnVector gridData.SetColumnLabel( 4, "siColumnVector" ) gridData.SetColumnDef( 4, C.siColumnVector, [ 3, -10, 10, 1, 2 ] ) # siColumnFile gridData.SetColumnLabel( 5, "siColumnFile" ) gridData.SetColumnDef( 5, C.siColumnFile, [ "File", "C:\\", ".exe" ] ) # siColumnShaderBall gridData.SetColumnLabel( 6, "siColumnShaderBall" ) gridData.SetColumnDef( 6, C.siColumnShaderBall, [ 64 ] ) # siColumnMultiLine gridData.SetColumnLabel( 7, "siColumnMultiLine" ) gridData.SetColumnDef( 7, C.siColumnMultiLine, [ ] ) Application.InspectObj( siProperty ) |