Methods of the ListControl Class

The following sections describe the individual methods.

ReplaceStyle

                                               +-------------------+
                                               V                   |
>>-aListControl~ReplaceStyle(--oldStyle--,--"----+-ICON----------+-+--"--)-><
                                                 +-SMALLICON-----+
                                                 +-LIST----------+
                                                 +-REPORT--------+
                                                 +-ALIGNLEFT-----+
                                                 +-ALIGNTOP------+
                                                 +-AUTOARRANGE---+
                                                 +-ASCENDING-----+
                                                 +-DESCENDING----+
                                                 +-EDIT----------+
                                                 +-HSCROLL-------+
                                                 +-VSCROLL-------+
                                                 +-NOSCROLL------+
                                                 +-NOHEADER------+
                                                 +-NOSORTHEADER--+
                                                 +-NOWRAP--------+
                                                 +-SINGLESEL-----+
                                                 +-SHOWSELALWAYS-+
                                                 +-SHAREIMAGES---+
                                                 +-GROUP---------+
                                                 +-HIDDEN--------+
                                                 +-NOTAB---------+
                                                 +-NOBORDER------+


The ReplaceStyle method removes a window style of a list view control and sets new styles.

Arguments:

The arguments are:

oldStyle

The window style to be removed.

newStyle

The new window styles to be set, which is one or more of the styles listed in the syntax diagram, separated by blanks. For an explanation of the different styles, refer to AddListControl.

Return value:

0 if this method fails.

Example:

The following example replaces a small-icon list with an icon list and connects the new bitmap file:

::method Icon
  curList = self~GetListControl(104)
  curList~SetImages("ilist.bmp",16,12)
  curList~ReplaceStyle("SMALLICON","ICON")

AddStyle

                              +-------------------+
                              V                   |
>>-aListControl~AddStyle(--"----+-ICON----------+-+--"--)------><
                                +-SMALLICON-----+
                                +-LIST----------+
                                +-REPORT--------+
                                +-ALIGNLEFT-----+
                                +-ALIGNTOP------+
                                +-AUTOARRANGE---+
                                +-ASCENDING-----+
                                +-DESCENDING----+
                                +-EDIT----------+
                                +-HSCROLL-------+
                                +-VSCROLL-------+
                                +-NOSCROLL------+
                                +-NOHEADER------+
                                +-NOSORTHEADER--+
                                +-NOWRAP--------+
                                +-SINGLESEL-----+
                                +-SHOWSELALWAYS-+
                                +-SHAREIMAGES---+
                                +-GROUP---------+
                                +-HIDDEN--------+
                                +-NOTAB---------+
                                +-NOBORDER------+


The AddStyle method adds new window styles to a list view control.

Arguments:

The only argument is:

style

The window styles to be added, which is one or more of the styles listed in the syntax diagram, separated by blanks. For an explanation of the different styles, refer to AddListControl.

Return value:

0 if this method fails.

RemoveStyle

                                 +-------------------+
                                 V                   |
>>-aListControl~RemoveStyle(--"----+-ICON----------+-+--"--)---><
                                   +-SMALLICON-----+
                                   +-LIST----------+
                                   +-REPORT--------+
                                   +-ALIGNLEFT-----+
                                   +-ALIGNTOP------+
                                   +-AUTOARRANGE---+
                                   +-ASCENDING-----+
                                   +-DESCENDING----+
                                   +-EDIT----------+
                                   +-HSCROLL-------+
                                   +-VSCROLL-------+
                                   +-NOSCROLL------+
                                   +-NOHEADER------+
                                   +-NOSORTHEADER--+
                                   +-NOWRAP--------+
                                   +-SINGLESEL-----+
                                   +-SHOWSELALWAYS-+
                                   +-SHAREIMAGES---+
                                   +-GROUP---------+
                                   +-HIDDEN--------+
                                   +-NOTAB---------+
                                   +-NOBORDER------+


The RemoveStyle method removes one or more window styles of a list view control.

Arguments:

The only argument is:

style

The window styles to be removed, which is one or more of the styles listed in the syntax diagram, separated by blanks. For an explanation of the different styles, refer to AddListControl.

Return value:

0 if this method fails.

AddExtendedStyle

                                     +--------------------+
                                     V                    |
>>-aListControl~AddExtendedStyle(--"---+-BORDERSELECT-----+--"--)------------><
                                       +-CHECKBOXES-------+
                                       +-DOUBLEBUFFER-----+
                                       +-FLATSB-----------+
                                       +-FULLROWSELECT----+
                                       +-GRIDLINES--------+
                                       +-HEADERDRAGDROP---+
                                       +-INFOTIP----------+
                                       +-LABELTIP---------+
                                       +-MULTIWORKAREAS---+
                                       +-ONECLICKACTIVATE-+
                                       +-REGIONAL---------+
                                       +-SIMPLESELECT-----+
                                       +-SUBITEMIMAGES----+
                                       +-TRACKSELECT------+
                                       +-TWOCLICKACTIVATE-+
                                       +-UNDERLINECOLD----+
                                       +-UNDERLINEHOT-----+

The AddExtendedStyle method adds one or more of the extended List-View styles to a ListControl. These styles can not be added until the underlying Windows List-View control has been created. They can be added in the InitDialog method or any time thereafter.

Arguments:

The only argument is:

style

The extended styles to be added. This argument is a list containing one or more of the following style keywords, separated by blanks. Invalid words in the list are ignored. If there are no valid keywords at all in the list, then an error is returned.

BORDERSELECT

When an item is selected the border color of the item changes rather than the item being highlighted.

CHECKBOXES

Check boxes are visible and functional in all list view modes except tile mode.

DOUBLEBUFFER

Windows XP or later only. The list-view control is painted using double buffering. This reduces flicker.

FLATSB

Enables flat scroll bars.

FULLROWSELECT

Report view only. When a row is selected, the whole row is highlighted rather than just the first column.

GRIDLINES

Report view only. Gridlines are drawn around all items and sub-items. This gives a spreadsheet-like appearance to the list view control.

HEADERDRAGDROP

Report view only. The user can drag and drop the headers to rearrange the columns.

INFOTIP

With this style a notification is sent to the parent window before displaying an item's tooltip. (The current version of ooDialog can not take advantage of this style. It is planned for a future enhancement.)

LABELTIP

Windows XP or later only. In any list view mode, if an item's label is only partially visible, the complete label will be displayed in a fashion similar to a tool tip.

MULTIWORKAREAS

The current version of ooDialog can not take advantage of this style. It is planned for a future enhancement.

ONECLICKACTIVATE

Enables the list-view control to send an item activate notification when the user clicks one time on an item. It also enables hot tracking in the list-view control. Both the underline cold and the underline hot styles need either one click activate or two click activate styles to be enabled.

REGIONAL

Icon view only. Sets the window region to only include an item's icon and text.

SIMPLESELECT

Windows XP and later only. Icon view only. Moves the state image to the top right of the icon image. If the user changes the state using the space bar, all the selected items cycle, not just the item with the focus.

SUBITEMIMAGES

Report view only. Allows images to be displayed for subitems.

TRACKSELECT

Enables hot track selection. The user can select an item by leaving the mouse over an item for a certain period of time, the "hover" time. This period of time can be changed from the default by using the SetHoverTime method.

TWOCLICKACTIVATE

Enables the list-view control to send an item activate notification when the user clicks on an item after it has been selected. When the user clicks on an item it will be selected. At that point, if the user clicks on the item a second time, the item will be activated. Note that this is different from double-clicking to activate. Any amount of time can pass between the click that selects the item and the click that activates the item. (Provided the item remains selected of course.)

It also works with track select. If track select is enabled, the user can select an item by pausing the mouse over the item. At that point, if the user then clicks on the item it will be activated.

UNDERLINECOLD

Underlining gives the user a visual clue that a single click on an item will activate it. Underlining requires either ONECLICKACTIVATE or TWOCLICKACTIVE to also be enabled. An item becomes hot when the mouse is over it. Underline cold underlines all the cold items when a single click will activate them. When one click activate is enabled, this would then be all items. When two click activate is enabled this would then be only those items that were selected.

UNDERLINEHOT

The underline hot style is similar to the underline cold style. See that style above for the explanation of some of the terms. With underline hot, the item is underlined when the mouse is over it, if one click will activate the item.

Return value:

The return values are:

0

Success.

-1

An (internal) problem with the control's window handle.

-3

The style argument did not contain any of the extended style keywords.

Example:

The following example shows how to initially add the extended styles to a list view control. This is done in the InitDialog method, which executes after the underlying Windows dialog has been created, but before it is displayed on the screen. This is the earliest point in time that the extended style methods can be used. The list view is in the report view and will have check boxes and grid lines. The user will be able to use drag and drop to rearrange the columns. When a row is selected, the full row will be highlighted rather than just the first column.

 

::method initDialog
  expose listView

  ...
  listView = self~getListControl(IDC_LIST)
  if listView == .nil then return

  listView~addExtendedStyle("CHECKBOXES GRIDLINES FULLROWSELECT HEADERDRAGDROP")
  ...

RemoveExtendedStyle

                                         +--------------------+
                                         V                    |
>>-aListControl~RemoveExtendedStyle(--"----+-BORDERSELECT-----+--"--)-------><
                                           +-CHECKBOXES-------+
                                           +-DOUBLEBUFFER-----+
                                           +-FLATSB-----------+
                                           +-FULLROWSELECT----+
                                           +-GRIDLINES--------+
                                           +-HEADERDRAGDROP---+
                                           +-INFOTIP----------+
                                           +-LABELTIP---------+
                                           +-MULTIWORKAREAS---+
                                           +-ONECLICKACTIVATE-+
                                           +-REGIONAL---------+
                                           +-SIMPLESELECT-----+
                                           +-SUBITEMIMAGES----+
                                           +-TRACKSELECT------+
                                           +-TWOCLICKACTIVATE-+
                                           +-UNDERLINECOLD----+
                                           +-UNDERLINEHOT-----+

The RemoveExtendedStyle method removes one or more extended styles of a List-View control.

Arguments:

The only argument is:

style

The extended style(s) to be removed. This is one or more of the styles listed in the syntax diagram, separated by blanks. For an explanation of the different styles, refer to the AddExtendedStyle method.

Return value:

The return values are:

0

Success.

-1

An (internal) problem with the control's window handle.

-3

The style argument did not contain any of the extended style keywords.

Example:

The following example removes the check box style from the list view.


  listView = self~getListControl(IDC_LIST)
  if listView == .nil then return

  listView~removeExtendedStyle("CHECKBOXES")

ReplaceExtendedStyle

                                                     +--------------------+
                                                     V                    |
>>-aListControl~ReplaceExtendedStyle(-oldStyle--,--"---+-BORDERSELECT-----+--"-)-><
                                                       +-CHECKBOXES-------+
                                                       +-DOUBLEBUFFER-----+
                                                       +-FLATSB-----------+
                                                       +-FULLROWSELECT----+
                                                       +-GRIDLINES--------+
                                                       +-HEADERDRAGDROP---+
                                                       +-INFOTIP----------+
                                                       +-LABELTIP---------+
                                                       +-MULTIWORKAREAS---+
                                                       +-ONECLICKACTIVATE-+
                                                       +-REGIONAL---------+
                                                       +-SIMPLESELECT-----+
                                                       +-SUBITEMIMAGES----+
                                                       +-TRACKSELECT------+
                                                       +-TWOCLICKACTIVATE-+
                                                       +-UNDERLINECOLD----+
                                                       +-UNDERLINEHOT-----+


The ReplaceExtendedStyle method removes some of the List-View control's extended styles and adds new extended styles. This is the equivalent of first using the RemoveExtendeStyle method and then using the AddExtendedStyle method.

Arguments:

The arguments are:

oldStyle

The extended style(s) to be removed. This is one or more of the styles listed in the syntax diagram, separated by blanks. For an explanation of the different styles, refer to the AddExtendedStyle method.

newStyle

The extended style(s) to be added. Again, this is one or more of the styles listed in the syntax diagram, separated by blanks. See the AddExtendedStyle method for the style descriptions.

Return value:

The return values are:

0

Success.

-1

An (internal) problem with the control's window handle.

-3

One, or both, of the style arguments had none of the extended style keywords.

Example:

The following example removes the cold and hot underlining and adds check boxes to the list view.


  listView = self~getListControl(IDC_LIST)
  if listView == .nil then return

  removeStyle = "UNDERLINECOLD UNDERLINEHOT"
  addStyle = "CHECKBOXES"

  listView~replaceExtendedStyle(removeStyle, addStyle)

GetExtendedStyle

>>-aListControl~GetExtendedStyle---------------------------------------------><

The GetExtendedStyle method returns the extended styles of a ListControl. The styles are returned as a string of blank delimited style keywords. These are the same keywords as those used to set the styles.

Arguments:

This method takes no arguments.

Return value:

The returned string can contain one or more of the following style keywords. See the AddExtendedStyle method for the style descriptions:

  • BORDERSELECT

  • CHECKBOXES

  • DOUBLEBUFFER

  • FLATSB

  • FULLROWSELECT

  • GRIDLINES

  • HEADERDRAGDROP

  • INFOTIP

  • LABELTIP

  • MULTIWORKAREAS

  • ONECLICKACTIVATE

  • REGIONAL

  • SIMPLESELECT

  • SUBITEMIMAGES

  • TRACKSELECT

  • TWOCLICKACTIVATE

  • UNDERLINECOLD

  • UNDERLINEHOT

Example:

The following example comes from a fictious application where the user can elect to use the track select style, or not. With this style, an item can be selected by pausing the mouse over it for a period of time specified by the hover time. The application also allows the user to increase or decrease the hover time. In this example when the methods to increment or decrement the hover time are invoked, the application first checks to see if the list view control has the track select style. Then the change is only made if the list view control does have the style.

 

::method initDialog
  expose listView

  ...
  listView = self~getListControl(IDC_LIST)
  if listView == .nil then return

  listView~addExtendedStyle("CHECKBOXES FULLROWSELECT TRACKSELECT")
  ...

::method onCheckboxClick
  expose listView

  chkBox = self~getCheckControl(IDC_CHECK_USETRACKSELECT)
  if chkBox~isChecked == "CHECKED" then
    listView~addExtendedStyle("TRACKSELECT")
  else
    listView~removeExtendedStyle("TRACKSELECT")

::method onDecrement
  expose listView

  styles = listView~getExtendedStyle
  if styles~wordpos("TRACKSELECT") == 0 then return

  time = listView~getHoverTime - 100
  if time > 0 then listView~setHoverTime(time)

::method onIncrement
  expose listView

  styles = listView~getExtendedStyle
  if styles~wordpos("TRACKSELECT") == 0 then return

  -- Let the user increase the hover time to any length they want.
  listView~setHoverTime(list~getHoverTime + 100)

GetExtendedStyleRaw

>>-aListControl~GetExtendedStyleRaw------------------------------------------><

The GetExtendedStyleRaw method returns the extended styles of a ListControl as the numeric value of the extended style flags. This method is provided for programmers familiar with the Windows API who may wish to know, or to work with, the actual value of the flags.

Arguments:

This method takes no arguments.

Return value:

The returned value is the numeric value of the extended style flags currently in effect for the list-view control.

Example:

The following example is the same example as the GetExtendedStyle example. It simply replaces the GetExtendedStyle invocation with a GetExtendedStyleRaw invocation.

 

::method initDialog
  expose listView

  ...
  listView = self~getListControl(IDC_LIST)
  if listView == .nil then return

  listView~addExtendedStyle("CHECKBOXES FULLROWSELECT TRACKSELECT")
  ...

::method onCheckboxClick
  expose listView

  chkBox = self~getCheckControl(IDC_CHECK_USETRACKSELECT)
  if chkBox~isChecked == "CHECKED" then
    listView~addExtendedStyle("TRACKSELECT")
  else
    listView~removeExtendedStyle("TRACKSELECT")

::method onDecrement
  expose listView

  if binaryAnd(listView~getExtendedStyleRaw, "0x00000008") <> 0 then return

  time = listView~getHoverTime - 100
  if time > 0 then listView~setHoverTime(time)

::method onIncrement
  expose listView

  if binaryAnd(listView~getExtendedStyleRaw, "0x00000008") <> 0 then return

  -- Let the user increase the hover time to any length they want.
  listView~setHoverTime(list~getHoverTime + 100)

GetHoverTime

>>-aListControl~GetHoverTime-----------------------------------><

This method retrieves the current hover time. The hover time is expressed as milliseconds. The hover time only affects list view controls that have the track select, one click activate, or two click activate extended list view styles. See the AddExtendedStyle for a description of these styles.

Arguments:

This method takes no arguments

Return value:

The hover time. A value of -1 indicates the hover time is the system default hover time.

Example:

The following example comes from a program where the one click activate and track select styles are enabled. Orignally the hover time is set to .4 seconds. However the application allows the users to increase or decrease this time to match their preference. A menu item (or a button could be used) is connected to the onIncrement and onDecrement methods. When either of the methods is invoked, the current hover time is examined and then either incremented or decremented by .1 of a second.

 

::method initDilaog
  expose list

  ...
  list = self~getListControl(IDC_LIST)
  list~addExtendedStyle("ONECLICKACTIVATE TRACKSELECT FULLROWSELECT")
  list~setHoverTime(400)
  ...

::method onDecrement
  expose list

  time = list~getHoverTime - 100
  if time > 0 then list~setHoverTime(time)

::method onIncrement
  expose list

  -- Let the user increase the hover time to any length they want.
  list~setHoverTime(list~getHoverTime + 100)

SetHoverTime

>>-aListControl~SetHoverTime(--+------+--)---------------------><
                               +-time-+

This method is used to change the hover time. The hover time only affects list view controls that have the track select, one click activate, or two click activate extended list view styles. See the AddExtendedStyle for a description of these styles.

Arguments:

The only optional argument is:

time

Specify the hover time in milliseconds. If this argument is omitted, the hover time is set to the system default. A negative number will also set the hover time back to the system defualt.

Return value:

The previous hover time. A value of -1 indicates the previous hover time was the system default.

Example:

The following example adds the one click activate, the track select, and the full row select extended list view styles to a ListControl. The hover time is set to .4 seconds. If the user pauses his mouse over a row in the list view for .4 of a second the row is automatically selectd.

 
::method initDilaog

  ...
  list = self~getListControl(IDC_LIST)
  list~addExtendedStyle("ONECLICKACTIVATE FULLROWSELECT TRACKSELECT")

  oldTime = list~setHoverTime(400)
  ...

Check

>>-aListControl~Check(--index--)--------------------------------------------><

The Check method sets the check mark for a list view item. This method is only valid for list view controls that have the check boxes extended style. (See the AddExtendedStyle method for a description of the check boxes extended style.)

Arguments:

The only argument is:

index

The index of the item for which to set the check mark.

Return value:

The return values are:

0

Success.

-1

An (internal) problem with the control's window handle.

-2

The list view control does not have the check boxes extended style.

-3

The index is invalid.

Example:

The following example is from a mailing list application. The user selects which entries to include in any mailing. All items in a list view that have their check boxes checked are included in the mailing. The application has a feature that allows the user to automatically select all items with a specified zip code.


::method onUseZip

  text = self~getEditControl(IDC_EDIT_ZIPCODE)~getText
  if self~validateZip(text) then do
     list = self~getListControl(IDC_LIST)
     do i = 0 to addresses~items - 1
       infoTable = address[i + 1]
       if infoTable['zip'] == text then list~check(i)
     end
  end

Uncheck

>>-aListControl~Uncheck(--index--)------------------------------------------><

The Uncheck method removes the check mark for a list view item. This method is only valid for list view controls that have the check boxes extended style. (See the AddExtendedStyle method for a description of the check boxes extended style.)

Arguments:

The only argument is:

index

The index of the item where the check box check is to be removed.

Return value:

The return values are:

0

Success.

-1

An (internal) problem with the control's window handle.

-2

The list view control does not have the check boxes extended style.

-3

The index is invalid.

Example:

The following example is from a doctor's office custom accounting application. A list box is filled with information for every patient. One button in the application checks every patient with an outstanding balance, they will be mailed a statement for that balance. The doctor does not believe in sending billing statements to patients that have a very low balance. However what a "low" balance is depends on how he is feeling at statement time. Therefore the application allows the office manager to dynamically remove some patients from the statement list.


::method onDeferBilling
  expose billingList

  text = self~getEditControl(IDC_EDIT_MINAMOUNT)~getText
  minimun = self~decimalNumber(text)

  if minimum > 0 then do i = 0 to billingList~items
    if billingList~isChecked(i) then do

      -- Column 6 in the list is the patient's current balance.
      owes = billingList~itemText(i, 6)
      if self~decimalNumber(owes) <= minimum then billingList~uncheck(i)

    end
  end

CheckAll

>>-aListControl~CheckAll----------------------------------------------------><

The CheckAll method sets the check mark for every list view item. This method is only valid for list view controls that have the check boxes extended style. (See the AddExtendedStyle method for a description of the check boxes extended style.)

Arguments:

This method takes no arguments.

Return value:

The return values are:

0

Success.

-1

An (internal) problem with the control's window handle.

-2

The list view control does not have the check boxes extended style.

Example:

The following example is from a program that has a push button that allows the user to check all the check boxes:


::method onCheckAll

  list = self~getListControl(IDC_LIST_REPUBLICANS)
  list~checkAll

UncheckAll

>>-aListControl~UncheckAll--------------------------------------------------><

The UncheckAll method clears the check mark for every list view item. This method is only valid for list view controls that have the check boxes extended style. (See the AddExtendedStyle method for a description of the check boxes extended style.)

Arguments:

This method takes no arguments.

Return value:

The return values are:

0

Success.

-1

An (internal) problem with the control's window handle.

-2

The list view control does not have the check boxes extended style.

Example:

The following example is from a program that has a push button that allows the user to remove the check mark from all the check boxes:


::method onUncheckAll

  list = self~getListControl(IDC_LIST_REPUBLICANS)
  list~uncheckAll

GetCheck

>>-aListControl~GetCheck(--index--)-----------------------------------------><

The GetCheck method determines if the item at the specified list index has a checked check box. This method will return a code indicating that the list view control does not have the check boxes extended style, if appropriate. (See the AddExtendedStyle method for a description of the check boxes extended style.)

Arguments:

The only argument is:

index

The index of the item to query.

Return value:

The return values are:

1

The item has a check box that is checked.

0

The item has a check box, and it is not checked.

-1

An (internal) problem with the control's window handle.

-2

The list view control does not have the check boxes extended style.

-3

The index is invalid.

Example:

The following example could be used as a shortcut method to determine if a list view control currently has the check box extended style.


  ...
  list = self~getListControl(IDC_LV_DOCTORS)
  if list~getCheck(0) == -2 then
    return   -- The list view does not currently have the check box style in effect

  do i = 0 to list~items - 1
    ...
  end


IsChecked

>>-aListControl~IsChecked(--index--)----------------------------------------><

The IsChecked method determines if a check box for a list view item is checked or not. This method will always return true or false. It can be used if the list view control has or does not have the check boxes extended style. (See theAddExtendedStyle method for a description of the check boxes extended style.)

Arguments:

The only argument is:

index

The index of the item to query.

Return value:

The return values are:

true

The list view item has a check box and it is checked.

false

There is no check mark for the list view item. Either the list view has check boxes and the check box is not checked, the index is out of range or not valid, or the list view does not have the check box extended style.

Example:

The following example is from a doctor's office custom accounting application. A list box is filled with information for every patient. After the office mananger has finished working with the accounts a mail merge is done to produce statements for all patients that are to receive statements for the month. For every patient item in the list view, if the item has a check mark, then that patient is mailed a statement.

 

::method onCreateMailMerge
  expose patientList

  do i = 0 to patientList~items
    if billingList~isChecked(i) then do
      self~addToMailMerge(billingList, i)
    end
  end

InsertColumn

                               +-0------+
>>-aListControl~InsertColumn(--+--------+--,--text--,-->
                               +-column-+

>--,--width--+---------------------+--)---------------><
             |       +-LEFT---+    |
             +-,--"--+-CENTER-+--"-+
                     +-RIGHT--+


The InsertColumn method sets the attributes of a report list view column.

Arguments:

The arguments are:

column

The number of the column. 0 is the first column and the default.

text

The text of the column heading.

width

The width of the column, in pixels.

align

The alignment of the column heading and the subitem text within the column. It can be one of the following values:

CENTER

The text is centered.

LEFT

The text is left-aligned, which is the default.

RIGHT

The text is right-aligned.

Return value:

The number of the new column, or 0 if this method fails.

Example:

The following example adds three columns to a report list:

::method InitReport
  curList = self~GetListControl(102)
  if curList \= .Nil then
  do
    curList~InsertColumn(0,"First Name",50)
    curList~InsertColumn(1,"Last Name",50)
    curList~InsertColumn(2,"Age",50)
  end

DeleteColumn

>>-aListControl~DeleteColumn(--column--)-----------------------><


The DeleteColumn method removes a column from a list view control.

Arguments:

The only argument is:

column

The number of the column to be deleted. The first column must be deleted last.

Return value:

0

The column was deleted.

-1

You did not specify column.

1

For all other cases.

ModifyColumn

>>-aListControl~ModifyColumn(--column--,--+------+--,--width---->
                                          +-text-+

>--+---------------------+--)----------------------------------><
   |       +-LEFT---.    |
   +-,--"--+-CENTER-+--"-+
           +-RIGHT--+


The ModifyColumn method sets new attributes for a column of a list view control.

Arguments:

The arguments are:

column

The number of the column. 0 is the first column.

text

The text of the column heading. If you omit this argument, the heading is not changed.

width

The width of the column, in pixels.

align

The alignment of the column heading and the subitem text within the column. It can be one of the following values:

CENTER

The text is centered.

LEFT

The text is left-aligned, which is the default.

RIGHT

The text is right-aligned.

Return value:

0

The column was modified.

-1

You did not specify column.

1

For all other cases.

Example:

The following example changes the title, size, and alignment of the first column in a report list:

::method ChangeColumn
  curList = self~GetListControl(102)
  curList~ModifyColumn(0,"New Title",100,"RIGHT")

ColumnInfo

>>-aListControl~ColumnInfo(--column--)-------------------------><


The ColumnInfo method retrieves the attributes of a column of a list view control.

Arguments:

The only argument is:

column

The number of the column of which the attributes are to be retrieved. 0 is the first column.

Return value:

A compound variable that stores the attributes of the item. If attributes for a column are not available or an error occurs, then the RetStem.!WIDTH variable will be set to 0.

RetStem.!TEXT

The heading of the column.

RetStem.!COLUMN

The column number.

RetStem.!WIDTH

The width of the column.

RetStem.!ALIGN

The alignment of the column: "LEFT", "RIGHT", or "CENTER".

Example:

The following example displays the column attributes in an information box when the column is clicked on:

::method OnColumnClick
  use arg id, column
  curList = self~GetListControl(102)
  info. = curList~ColumnInfo(column)
  call InfoDialog("Column Title : " info.!Text"d"x,
                  "Column Number: " info.!Column"d"x,
                  "Column Width : " info.!Width"d"x,
                  "Alignment    : " info.!Align)

ColumnWidth

>>-aListControl~ColumnWidth(--column--)------------------------><


The ColumnWidth method retrieves the width of a column in a report or list view.

Arguments:

The only argument is:

column

The number of the column of which the width is to be retrieved. 0 is the first column.

Return value:

The column width, or -1 if you did not specify column, or 0 in all other cases.

Example:

The following example displays the column width in an information box when the column is clicked on:

::method OnColumnClick
  use arg id, column
  curList = self~GetListControl(102)
  call InfoDialog(curList~ColumnWidth(column))

SetColumnWidth

>>-aListControl~SetColumnWidth(--column--+----------+--)-------><
                                         +-,--width-+


The SetColumnWidth method sets the width of a column in a report or list view.

Arguments:

The arguments are:

column

The number of the column of which the width is to be set. 0 is the first column.

width

The width of the column, in pixels. If you omit this argument, the column is sized automatically.

Return value:

0

The column width was set.

-1

You did not specify column.

1

For all other cases.

Example:

The following example enlarges the selected column by 10:

::method OnColumnClick
  use arg id, column
  curList = self~GetListControl(102)
  curList~SetColumnWidth(column,curList~ColumnWidth(column)+10)

StringWidth

>>-aListControl~StringWidth(--text--)--------------------------><


The StringWidth method determines the width of a specified string using the current font of the list view control.

Arguments:

The only argument is:

text

The text string of which the width is to be determined.

Return value:

The string width, or -1 if you did not specify a text, or 0 in all other cases.

Insert

                                      +-0------+              +-0----+
>>-aListControl~Insert(--+------+--,--+--------+--,--text--,--+------+--)-><
                         +-item-+     +-column-+              +-icon-+


The Insert method inserts a new item in a list view control.

Arguments:

The arguments are:

item

The number of the item. If you omit this argument, the number of the last item is increased by 1.

column

The number of the column. If you omit this argument, 0 is assumed. This argument only applies to report views.

text

The text of the item.

icon

The index of the icon of the list view item within the bitmap file, set with the SetImages or SetSmallImages method (see page SetSmallImages). The SetImages method must be used for the icon view and the SetSmallImages for the list, report, and small-icon views.

In a report view, this argument can only be used for the first column.

If you omit this argument, 0 is assumed.

Return value:

The index of the new item, or -1 in all other cases.

Example:

The following example inserts items in a list:

::method InitReport
  curList = self~GetListControl(102)
  if curList \= .Nil then
  do
    curList~Insert(, ,"First")
    curList~Insert(, ,"Second")
    curList~Insert(, ,"Third")
  end

Modify

                                      +-0------+
>>-aListControl~Modify(--+------+--,--+--------+--,--text--------->
                         +-item-+     +-column-+

      +-0----+
>--,--+------+--)------------------------------------------------><
      +-icon-+


The Modify method sets some or all attributes of a list view item.

Arguments:

The arguments are:

item

The number of the item. If you omit this argument, the selected item is used.

column

The number of the column. If you omit this argument, 0 is assumed. This argument only applies to report views.

text

The new text for the item.

icon

The new index for the icon of the list view item within the bitmap file, set with the SetImages or SetSmallImages method (see page SetSmallImages). The SetImages method must be used for the icon view and the SetSmallImages method for the list, report, and small-icon views.

In a report view, this argument can only be used for the first column.

If you omit this argument, 0 is assumed.

Return value:

0

The modification was successful.

1

For all other cases.

Example:

The following example modifies the icon of the item that is double-clicked:

::method OnActivate
  curList = self~GetListControl(102)
  if curList \= .Nil then
  do
    si = curlist~Focused
    curList~Modify(si, , ,2)
  end

SetItemText

                                       +-0------+
>>-aListControl~SetItemText(--item--,--+--------+--,--text--)--><
                                       +-column-+


The SetItemText method changes the text of a list view item or a column.

Arguments:

The arguments are:

item

The number of the item.

column

The number of the column. If you omit this argument, 0 is assumed. This argument only applies to report views.

text

The text of the item or a column.

Return value:

0

The change was successful.

-1

You did not specify column.

1

For all other cases.

SetItemState

>>-aListControl~SetItemState(--item--+------------------------------+--)-><
                                     |       +-----------------+    |
                                     |       V                 |    |
                                     +-,--"----+-CUT---------+-+--"-+
                                               +-NOTCUT------+
                                               +-DROP--------+
                                               +-NOTDROP-----+
                                               +-FOCUSED-----+
                                               +-NOTFOCUSED--+
                                               +-SELECTED----+
                                               +-NOTSELECTED-+


The SetItemState method sets the state of a list view item.

Arguments:

The arguments are:

item

The number of the item.

state

The state of the item, which can be one or more of the following values, separated by blanks:

CUT

The item is marked for a cut-and-paste operation.

NOTCUT

The item cannot be used for a cut-and-paste operation.

DROP

The item is highlighted as a drag-and-drop target.

NOTDROP

The item is not highlighted as a drag-and-drop target.

FOCUSED

The item has the focus and is therefore surrounded by the standard focus rectangle. Only one item can have the focus.

NOTFOCUSED

The item does not have the focus.

SELECTED

The item is selected. Its appearance depends on whether it has the focus and on the system colors used for a selection.

NOTSELECTED

The item is not selected.

Return value:

0

The state was set successfully.

-1

You did not specify item.

1

For all other cases.

Add

                      +-------+
                      V       |              +-0----+
>>-aListControl~Add(----+---+-+--,--text--,--+------+--)-------><
                        +-,-+                +-icon-+


The Add method adds a new item to the report view. It can be used to fill a list view or report view sequentially.

Arguments:

The arguments are:

,

The number of commas specifies in which column the text of the item is to be placed. For example, one comma specifies that the text of the item is to be placed in the first column.

text

The text for the item.

icon

The index of the icon of the list view item within the bitmap file, set with the SetImages or SetSmallImages method (see page SetSmallImages). The SetImages method must be used for the icon view and the SetSmallImages method for the list, report, and small-icon views.

In a report view, this argument can only be used for the first column.

If you omit this argument, 0 is assumed.

Example:

The following example adds three columns and two items to a report list control. To get the following result:

First NameLast NameAge
MikeMiller30
SueThaxtor29

you must specify the following:

::method InitDialog
  InitDlgRet = self~InitDialog:super

  curList = self~GetListControl("IDC_LIST_REP")
  if curList \= .Nil then
  do
    curList~SetSmallImages("E:\oodlist\oodlist.BMP",16,12)
    curList~InsertColumn(0,"First Name",50)
    curList~InsertColumn(1,"Last Name",50)
    curList~InsertColumn(2,"Age",50)
    curList~Add("Mike")
    curList~Add(,"Miller")
    curList~Add(, ,"30")
    curList~~Add("Sue")~~Add(,"Thaxton")~~Add(, ,"29")
  end
  return InitDlgRet

AddRow

                                               +-,----+
                                               V      |
>>-aListControl~AddRow(--+------+--,--icon--,----text-+--)-----><
                         +-item-+


The AddRow method adds a new item to a list.

Arguments:

The arguments are:

item

The number of the item. If you omit this argument, the number of the last item is increased by 1.

icon

The index of the icon of the list view item within the bitmap file, set with the SetImages or SetSmallImages method (see page SetSmallImages). The SetImages method must be used for the icon view and the SetSmallImages method for the list, report, and small icon views.

In a report view, this argument can only be used for the first column.

text

Any number of text strings. The first is used for the first column, the second for the second column, and so on. If you specify more text entries than there are columns, the extra entries are ignored.

Return value:

The index of the new item, or -1 in all other cases.

Example:

The following example adds three items to a report list with two columns:

::method InitList
  curList = self~GetListControl(101)
  curList~AddRow(, ,"Mike","Miller")
  curList~AddRow(, ,"Sue","Muller")
  curList~AddRow(, ,"Chris","Watson")

Delete

>>-aListControl~Delete(--item--)-------------------------------><


The Delete method removes an item from a list view control.

Arguments:

The only argument is:

item

The number of the item.

Return value:

0

The item was deleted.

-1

You did not specify item.

1

For all other cases.

Example:

The following example deletes the selected item in a list control:

::method DeleteSelectedItem
  curList = self~GetListControl(102)
  curList~Delete(curList~Selected)

DeleteAll

>>-aListControl~DeleteAll--------------------------------------><


The DeleteAll method removes all items from a list view control.

Return value:

0

The items were deleted.

-1

No item was available.

1

For all other cases.

Items

>>-aListControl~Items------------------------------------------><


The Items method retrieves the number of items in a list view control.

Return value:

The number of items.

Last

>>-aListControl~Last-------------------------------------------><


The Last method retrieves the number of the last item in a list view control.

Return value:

The number of the last item.

Prepare4nItems

>>-aListControl~Prepare4nItems(--items--)----------------------><


The Prepare4nItems method prepares a list view control for adding a large number of items.

Arguments:

The only argument is:

items

The number of the items to be added later.

Return value:

0

The list view control was prepared.

-1

You did not specify items.

SelectedItems

>>-aListControl~SelectedItems----------------------------------><


The SelectedItems method determines the number of selected items in a list view control.

Return value:

The number of selected items.

ItemInfo

                                    +-0------+
>>-aListControl~ItemInfo(--item--,--+--------+--)--------------><
                                    +-column-+


The ItemInfo method retrieves the attributes of a list view item.

Arguments:

The arguments are:

item

The number of the item.

column

The number of the column. If you omit this argument, 0 is assumed.

Return value:

A compound variable that stores the attributes of the item, or -1 in all other cases. The compound variable can be:

RetStem.!TEXT

The item text.

RetStem.!IMAGE

The index of the icon of the list view item within the bitmap file, set with the SetImages or SetSmallImages method (see page SetSmallImages). The SetImages method must be used for the icon view and the SetSmallImages method for the list, report, and small icon views.

In a report view, this argument can only be used for the first column.

RetStem.!STATE

One or more of the following values:

CUT

The item is marked for a cut-and-paste operation.

DROPPED

The item is highlighted as a drag-and-drop target.

FOCUSED

The item has the focus and is therefore surrounded by the standard focus rectangle. Only one item can have the focus.

SELECTED

The item is selected. Its appearance depends on whether it has the focus and on the system colors used for a selection.

Example:

The following example displays the item text, icon index, and the item state in a message box:

::method DisplayItemInfo
  curList = self~GetListControl(104)
  itemInfo. = curList~ItemInfo(curList~Selected)
  call InfoDialog("Item Text   : " itemInfo.!Text"d"x,
                  "Image Index : " itemInfo.!Image"d"x,
                  "Item State  : " itemInfo.!State)

ItemText

                                    +-0------+
>>-aListControl~ItemText(--item--,--+--------+--)--------------><
                                    +-column-+


The ItemText method retrieves the text of a list view item or a column.

Arguments:

The arguments are:

item

The number of the item.

column

The number of the column. If you omit this argument, 0 is assumed.

Return value:

The item or column text, or -1 if you did not specify item.

ItemState

>>-aListControl~ItemState(--item--)----------------------------><


The ItemState method retrieves the state of a list view item.

Arguments:

The only argument is:

item

The number of the item.

Return value:

The state of the item, which can be one or more of the following values:

CUT

The item can be used in a cut-and-paste operation.

DROPPED

The item is highlighted as a drag-and-drop target.

FOCUSED

The item has the focus and is therefore surrounded by the standard focus rectangle. Only one item can have the focus.

SELECTED

The item is selected. Its appearance depends on whether it has the focus and on the system colors used for a selection.

Select

>>-aListControl~Select(--item--)-------------------------------><


The Select method selects an item.

Arguments:

The only argument is:

item

The number of the item.

Return value:

0

The item was selected.

-1

You did not specify item.

1

For all other cases.

Deselect

>>-aListControl~Deselect(--item--)-----------------------------><


The Deselect method deselects an item.

Arguments:

The only argument is:

item

The number of the item.

Return value:

0

The item was selected.

-1

You did not specify item.

1

For all other cases.

Selected

>>-aListControl~Selected---------------------------------------><


The Selected method returns the number of the selected item.

Return value:

The number of the item selected last, or -1 in all other cases.

LastSelected

>>-aListControl~LastSelected-----------------------------------><


The LastSelected method returns the number of the item selected last.

Return value:

The number of the item selected last, or -1 in all other cases.

Focused

>>-aListControl~Focused----------------------------------------><


The Focused method retrieves the number of the item that has currently the focus.

Return value:

The number of the item with the focus, or -1 in all other cases.

Focus

>>-aListControl~Focus(--item--)--------------------------------><


The Focus method assigns the focus to the specified item, which is then surrounded by the standard focus rectangle. Although more than one item can be selected, only one item can have the focus.

Arguments:

The only argument is:

item

The number of the item to receive the focus.

Return value:

0

The specified item received the focus.

-1

You did not specify item.

1

For all other cases.

DropHighlighted

>>-aListControl~DropHighlighted--------------------------------><


The DropHighlighted method retrieves the item that is highlighted as a drag-and-drop target.

Return value:

The number of the selected item, or -1 in all other cases.

FirstVisible

>>-aListControl~FirstVisible-----------------------------------><


The FirstVisible method retrieves the number of the first item visible in a list or report view.

Return value:

The number of the first item visible, or 0 if the list view control is in icon or small-icon view.

NextSelected

>>-aListControl~NextSelected(--item--)-------------------------><


The NextSelected method retrieves the selected item that follows, or is to the right of, item.

Arguments:

The only argument is:

item

The number of the item at which the search is to start. The specified item itself is excluded from the search.

Return value:

The number of the selected item, or -1 in all other cases.

PreviousSelected

>>-aListControl~PreviousSelected(--item--)---------------------><


The PreviousSelected method retrieves the selected item that precedes, or is to the left of, item.

Arguments:

The only argument is:

item

The number of the item at which the search is to start. The specified item itself is excluded from the search.

Return value:

The number of the selected item, or -1 in all other cases.

Next

>>-aListControl~Next(--item--)---------------------------------><


The Next method retrieves the item that follows, or is to the right of, item.

Arguments:

The only argument is:

item

The number of the item at which the search is to start.

Return value:

The number of the following item, or -1 in all other cases.

Previous

>>-aListControl~Previous(--item--)-----------------------------><


The Previous method retrieves the item that precedes, or is to the left of, item.

Arguments:

The only argument is:

item

The number of the item at which the search is to start.

Return value:

The number of the previous item, or -1 in all other cases.

NextLeft

>>-aListControl~NextLeft(--item--)-----------------------------><


The NextLeft method retrieves the item left to item.

Arguments:

The only argument is:

item

The number of the item at which the search is to start. The specified item itself is excluded from the search.

Return value:

The number of the next item to the left, or -1 in all other cases.

NextRight

>>-aListControl~NextRight(--item--)----------------------------><


The NextRight method retrieves the item right to item.

Arguments:

The only argument is:

item

The number of the item at which the search is to start. The specified item itself is excluded from the search.

Return value:

The number of the next item to the right, or -1 in all other cases.

SmallSpacing

>>-aListControl~SmallSpacing-----------------------------------><


The SmallSpacing method determines the spacing between items in a small-icon list view control.

Return value:

The amount of spacing between the items.

Spacing

>>-aListControl~Spacing----------------------------------------><


The Spacing method determines the spacing between items in an icon list view control.

Return value:

The amount of spacing between the items.

RedrawItems

>>-aListControl~RedrawItems--+--------------------------+------><
                             +-(--first--+---------+--)-+
                                         +-,--last-+


The RedrawItems method forces a list view control to redraw a range of items.

Arguments:

The arguments are:

first

The number of the first item to be redrawn. The default is 0.

last

The number of the last item to be redrawn. The default is 0.

Return value:

0

The specified range of items was redrawn.

1

For all other cases.

UpdateItem

>>-aListControl~UpdateItem(--item--)---------------------------><


The UpdateItem method updates a list view item.

Arguments:

The only argument is:

item

The number of the item to be updated.

Return value:

0

The item was updated.

-1

You did not specify item.

1

For all other cases.

Update

>>-aListControl~Update-----------------------------------------><


The Update method updates a list view control.

Return value:

0.

EnsureVisible

                                         +-0-+
>>-aListControl~EnsureVisible(--item--,--+---+--)--------------><
                                         +-1-+


The EnsureVisible method ensures that a list view item is entirely or partially visible by scrolling the list view control, if necessary.

Arguments:

The arguments are:

item

The number of the item visible.

partial

Specifies whether the item must be entirely visible:

1

The list view control is not scrolled if the item is at least partially visible.

0

The list view control is scrolled if the item is only partially visible. This is the default.

Return value:

0

The item is visible.

-1

You did not specify item.

1

For all other cases.

SetSmallImages

>>-aListControl~SetSmallImages(--bitmap--+-----------------------------+--)-><
                                         +-,--+-------+--+-----------+-+
                                              +-width-+  +-,--height-+


The SetSmallImages method assigns an image list to a small-icon list view control.

Arguments:

The arguments are:

bitmap

The name of, or handle to, a bitmap file that has already been loaded using the LoadBitmap method.

width

The width of each image, in pixels. If you do not specify this argument or specify 0, the width of the image in the image file is used.

height

The height of each image, in pixels. If you do not specify this argument or specify 0, the height of the image in the image file is used.

Return value:

The handle to the image list, or -1 if you did not specify bitmap, or 0 in all other cases.

Example:

The following example connects a bitmap file with a small-icon list:

::method InitSmallIconList
  curList = self~GetListControl(104)
  curList~SetSmallImages("oodlist.BMP",16,12)

SetImages

>>-aListControl~SetImages(--bitmap--+-----------------------------+--)-><
                                    +-,--+-------+--+-----------+-+
                                         +-width-+  +-,--height-+


The SetImages method assigns an image list to an icon list view control.

Arguments:

The arguments are:

bitmap

The name of, or handle to, a bitmap file that has already been loaded using the LoadBitmap method.

width

The width of each image, in pixels. If you do not specify this argument or specify 0, the width of the image in the image file is used.

height

The height of each image, in pixels. If you do not specify this argument or specify 0, the height of the image in the image file is used.

Return value:

The handle to the image list, or -1 if you did not specify bitmap, or 0 in all other cases.

Example:

The following example connects a bitmap file with an icon list:

::method InitIconList
  curList = self~GetListControl(104)
  curList~SetImages("oodlist.BMP",16,12)

RemoveSmallImages

>>-aListControl~RemoveSmallImages------------------------------><


The RemoveSmallImages method erases an image list of a small-icon list view control.

Return value:

0

The image list was erased.

1

For all other cases.

RemoveImages

>>-aListControl~RemoveImages-----------------------------------><


The RemoveImages method erases an image list of an icon list view control.

Return value:

0

The image list was erased.

1

For all other cases.

Find

                                +- -1--+     +-0-+
>>-aListControl~Find(--text--,--+------+--,--+---+--)----------><
                                +-item-+     +-1-+


The Find method searches for a list view item containing text. The text of this item must exactly match text.

Arguments:

The arguments are:

text

The text of the item to be searched for.

item

Specify the number of the item at which the search is to be started. Specify -1 or omit this argument to start the search at the beginning.

wrap

Specify 1 if the search is to be continued at the beginning if no match is found. Specify 0 or omit this argument if the search is to stop at the end of the list.

Return value:

The number of the item, or -1 in all other cases.

FindPartial

                                       +- -1--+     +-0-+
>>-aListControl~FindPartial(--text--,--+------+--,--+---+--)---><
                                       +-item-+     +-1-+


The FindPartial method searches for a list view item containing text. An item matches if its text begins with text.

Arguments:

The arguments are:

text

The text of the item to be searched for.

item

Specify the number of the item at which the search is to be started. Specify -1 or omit this argument to start the search at the beginning.

wrap

Specify 1 if the search is to be continued at the beginning if no match is found. Specify 0 or omit this argument if the search is to stop at the end of the list.

Return value:

The number of the item, or -1 in all other cases.

FindNearestXY

>>-aListControl~FindNearestXY(--x--,--y--+--------------------+--)-><
                                         |       +-DOWN--+    |
                                         +-,--"--+-UP----+--"-+
                                                 +-LEFT--+
                                                 +-RIGHT-+


The FindNearestXY method searches, in the specified direction, for the item nearest to the specified position.

Arguments:

The arguments are:

x

The x-coordinate of the position at which the search is to be started.

y

The y-coordinate of the position at which the search is to be started.

direction

The direction in which the search should proceed.

Return value:

The index of the item, or -1 in all other cases.

Arrange

>>-aListControl~Arrange----------------------------------------><


The Arrange method aligns items according to the current alignment style of the list view control.

Return value:

0

The items were aligned.

1

For all other cases.

SnapToGrid

>>-aListControl~SnapToGrid-------------------------------------><


The SnapToGrid method snaps all icons to the nearest grid position.

Return value:

0

The items were snapped.

1

For all other cases.

AlignLeft

>>-aListControl~AlignLeft--------------------------------------><


The AlignLeft method aligns items along the left window border.

Return value:

0

The items were aligned.

1

For all other cases.

AlignTop

>>-aListControl~AlignTop---------------------------------------><


The AlignTop method aligns items along the upper window border.

Return value:

0

The items were aligned.

1

For all other cases.

ItemPos

>>-aListControl~ItemPos(--item--)------------------------------><


The ItemPos method retrieves the position of the upper left corner of the item.

Arguments:

The only argument is:

item

The number of the item.

Return value:

The x- and y-coordinates of the upper left corner of the item, or -1 if you did not specify item, or 0 in all other cases.

Note: Use DefListDragHandler to support default dragging:

self~ConnectListNotify(104,"BEGINDRAG","DefListDragHandler")

SetItemPos

                                      +-0-+     +-0-+
>>-aListControl~SetItemPos(--item--,--+---+--,--+---+--)-------><
                                      +-x-+     +-y-+


The SetItemPos method moves an item to a specified position in a list view control, which must be in icon or small-icon view.

Arguments:

The arguments are:

item

The number of the item.

x

The x-coordinate of the new position of the upper left corner of the item, in view coordinates. The default is 0.

y

The y-coordinate of the new position of the upper left corner of the item, in view coordinates. The default is 0.

Return value:

0

The item was moved.

-1

You did not specify item.

1

For all other cases.

Note: Use DefListDragHandler to support default dragging:

self~ConnectListNotify(104,"BEGINDRAG","DefListDragHandler")

Edit

>>-aListControl~Edit(--item--)---------------------------------><


The Edit method begins editing of the text of the specified list view item.

Arguments:

The only argument is:

item

The number of the item.

Return value:

The handle of the edit control used to edit the item text, or 0 in all other cases.

EndEdit

>>-aListControl~EndEdit----------------------------------------><


The EndEdit method cancels editing of the list view item that is being edited.

SubclassEdit

>>-aListControl~SubclassEdit-----------------------------------><


The SubclassEdit method is used by the DefListEditHandler to correct an operating system problem if the Esc or Enter key was pressed in an active edit control.

RestoreEditClass

>>-aListControl~RestoreEditClass-------------------------------><


The RestoreEditClass method is used by the DefListEditHandler to correct an operating system problem if the Esc or Enter key was pressed in an active edit item.

ItemsPerPage

>>-aListControl~ItemsPerPage-----------------------------------><


The ItemsPerPage method calculates the number of items that vertically fit the visible area of a list view control that is in list or report view. Only fully visible items are counted.

Return value:

The number of fully visible items. If the current view is an icon or small-icon view, the return value is the total number of items in the list view control.

Scroll

                         +-0-+     +-0-+
>>-aListControl~Scroll(--+---+--,--+---+--)--------------------><
                         +-x-+     +-y-+


The Scroll method scrolls the content of a list view control.

Arguments:

The arguments are:

x

An integer value specifying the amount of horizontal scrolling. If the control is in icon, small-icon, or report view, this value specifies the number of pixels to be scrolled. If it is in list view, this value specifies the number of columns to be scrolled. The default value is 0.

y

An integer value specifying the amount of vertical scrolling. If the control is in icon, small-icon, or report view, this value specifies the number of pixels to be scrolled. If it is in list view, this value specifies the number of lines to be scrolled. The default value is 0.

Return value:

0

Scrolling was successful.

1

Scrolling failed.

BkColor

>>-aListControl~BkColor----------------------------------------><


The BkColor method retrieves the background color for a list view control.

Return value:

The color-palette index specifier (0 to 18). For more information on color palettes, refer to Definition of Terms.

BkColor=

>>-aListControl~BkColor=(--color--)----------------------------><


The BkColor= method sets the background color of a list view control.

Arguments:

The only argument is:

color

The new background color. Specify the color-palette index specifier (0 to 18). For more information on color palettes, refer to Definition of Terms.

Example:

The following example sets the background color of a list control to yellow:

::method Yellow
  curList = self~GetListControl(104)
  curList~BkColor = 15
  curList~Update

TextColor

>>-aListControl~TextColor--------------------------------------><


The TextColor method retrieves the text color of a list view control.

Return value:

The color-palette index specifier (0 to 18). For more information on color palettes, refer to Definition of Terms.

TextColor=

>>-aListControl~TextColor=(--color--)--------------------------><


The TextColor= method sets the text color of a list view control.

Arguments:

The only argument is:

color

The new text color. Specify the color-palette index specifier (0 to 18). For more information on color palettes, refer to Definition of Terms.

Example:

The following example sets the text color of a list control to light blue:

::method LightBlue
  curList = self~GetListControl(104)
  curList~BkColor = 9
  curList~Update

TextBkColor

>>-aListControl~TextBkColor------------------------------------><


The TextBkColor method retrieves the background color of the text in a list view control.

Return value:

The color-palette index specifier (0 to 18). For more information on color palettes, refer to Definition of Terms.

TextBkColor=

>>-aListControl~TextBkColor=(--color--)------------------------><


The TextBkColor= method sets the background color for the text in a list view control.

Arguments:

The only argument is:

color

The new background color for text. Specify the color-palette index specifier (0 to 18). For more information on color palettes, refer to Definition of Terms.