SetIconSpacing Method (LISTVIEW)


PLBCMP GUI Only, 9.6

 

The SetIconSpacing method allows the horizontal and vertical pixel distance between icons presented by a LISTVIEW using the ICON viewstyle to be set. By default the Windows automatically controls the icon spacing based on the icon sizes used in conjunction with the current font size. The SetIconSpacing can provide a more flexible presentation for icon and text. In addition, this method allows definition of minimum and maximum parameters that provide restrictions when scaling a WINDOW that has a LISTVIEW using the ICON viewstyle. The method uses the following format:

 

[label]

{object}.SetIconSpacing

[GIVING {return}]:

 

 

USING [*Width=]{cx}:

 

 

[*Height=]{cy}[:

 

 

[*WidthMin=]{cxmin}][:

 

 

[*WidthMax=]{cxmax}][:

 

 

[*HeightMin=]{cymin}][:

 

 

[*HeightMax=]{cymax}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A LISTVIEW object that is accessed.

return

Optional. A Numeric Variable that gives the {cx} and {cy} settings before the method was executed.

cx

Required. A Numeric Variable decimal number that specifies the horizontal width for the icon spacing.

cy

Required. A Numeric Variable decimal number that specifies the vertical height for the icon spacing.

cxmin

Optional. A Numeric Variable decimal number that specifies the minimum horizontal width for the icon spacing when scaling.

cxmax

Optional. A Numeric Variable decimal number that specifies the maximum horizontal width for the icon spacing when scaling.

cymin

Optional. A Numeric Variable decimal number that specifies the minimum vertical height for the icon spacing when scaling.

cymax

Optional. A Numeric Variable decimal number that specifies the maximum vertical height for the icon spacing when scaling.

Flags Affected: OVER, ZERO

Note the following:

  1. The ZERO flag is set when the method return value is zero.

  2. The OVER flag is set if the returned value is two large for {return} variable.

  3. The Microsoft MSDN documentation for the SetIconSpacing method is described as follows:

  4.  

    "The cx and cy parameters are relative to the upper-left corner of an icon bitmap. Therefore, to set spacing between icons that do not overlap, the cx or cy values must include the size of the icon, plus the amount of empty space desired between icons. Values that do not include the width of the icon will result in overlaps.

     

    When defining the icon spacing, cx and cy must set to 4 or larger. Smaller values will not yield the desired layout. You can reset cx and cy to the default spacing by setting both values to -1. This approach only allows you to reset both default settings. You cannot reset only cx or cy to the default setting by setting one of them to -1."

     

  5. The SetIconSpacing method only used for a LISTVIEW object using the ICON VIEWSTYLE property.

  6. If either the {cx} or {cy} input values are zero or -1, the current icon spacing settings are reset to controlled by the Windows operating system.

  7. 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 SetExtendedStyle Method (LISTVIEW) SetImageList Method (LISTVIEW)