SetColumnWidth Method (LISTVIEW)


PLBCMP GUI Only

 

The SetColumnWidth method adjusts the width of a column within a LISTVIEW object. The method uses the following format:

 

[label]

{object}.SetColumnWidth

[GIVING {return}] USING [*Index=]{index}:

 

 

[*Width=]{width}[,*Flags={flags}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A LISTVIEW object that is modified.

return

Optional. A Numeric Variable that indicates the success or failure of the method.

index

Required. A decimal number or Numeric Variable that specifies the zero-based column to modify.

width

Required. A decimal number or Numeric Variable that specifies column's new width in pixels.

flags

Optional. A decimal number or Numeric Variable that specifies a bit mask value that controls execution of the method. (9.5A)

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. {width} is the new column width in pixels.

  2. Upon completion, {return} will contain the status of the modification as follows. $TRUE and $FALSE are defined in PLBEQU.INC:

  3.  

    Value

    Constant

    The modification ...

    0

    $FALSE

    failed.

    1

    $TRUE

    was successful.

     

  4. The {flags} bit mask definitions (9.5A) control the operations of the method are described as follows:

  5.  

    Value

    Constant

    This value ...

    0x1

    $LV_SCW_EXTENDED

    causes the SetColumnWidth method to enable expanded operations. Execution of the method with only this bit set causes the column width to be set to the specified {width} value.

    0x3

    $LV_SCW_AUTOSIZE

    requires both the $LV_SCW_EXTENDED bit value plus 0x2 to invoke the action. In this case, the column width is automatically changed to the size of the largest data string found in the column. If there is no data found in the column, the default OS behavior is to resize the column to a small value.

    0x5

    $LV_SCW_AUTOSIZEHEADER

    requires both the $LV_SCW_EXTENDED bit value plus 0x4 to invoke the action. In this case, the column width is automatically changed to the size of column header when there is no data found in the column. However, when there is data found in the column, the column width is set as with the $LV_SCW_AUTOSIZE action. If you use this value with the last column, its width is set to fill the remaining width of the list-view control.

    0x8000

    $LV_SCW_ALLCOLUMNS

    is optional and can be used with the $LV_SCW_EXTENDED, $LV_SCW_AUTOSIZE, or $LV_SCW_AUTOSIZEHEADER actions. This bit mask action is ignored unless the $LV_SCW_EXTENDED bit is being used. When this bit value is used, the extended action is applied to all of the columns in the LISTVIEW. The following bit definition values can be used.:

    $LV_SCWALL_EXTENDED - 0x8001

    $LV_SCWALL_AUTOSIZE - 0x8003

    $LV_SCWALL_AUTOSIZEHEADER - 0x8005

     

  6. If the value returned is zero, the ZERO Condition Flag is set.

  7. The OVER and EOS Condition Flags are always cleared.

  8. For improved performance in the Application Server environment, do not specify the optional return value unless needed.

 

 

See Also: Method Syntax, LISTVIEW Methods

 



PL/B Language Reference SetColumnText Method (LISTVIEW) SetColumnWidths Method (LISTVIEW)