Documentation for Win32lib v0.60.6
Table of Contents

ListView Control

These routines deal with the ListView common control.


It is important to know that each item in a list view has a unique ID number. In other words, no two listview items have the same ID value, regardless of which listview it they are in. The item ID is not the same as its index value. The index value is where in a list view the item is positioned. The ID is used as a way to identify an item without referring to its column values or position. When you add an item using addLVItem, you get the item's ID returned.
The following routines support ListView as well as other controls:
  • deleteItem
  • eraseItems
  • getIndex
  • getItem
  • getData
  • findItem

    The following routines are specific to the ListView control.

  • addLVItem
  • getLVAllChecked
  • getLVAllText
  • getLVChecked
  • getLVCount
  • getLVItem
  • getLVItemlParam
  • getLVItemText
  • getLVSelected
  • getLVSelectedCount
  • getLVSelectedText
  • hitTestLV
  • insertLVColumn
  • insertLVItem
  • setLVAttr
  • setLVChecked
  • setLVInsert
  • setLVItem
  • setLVItemlParam
  • setLVItemText
  • setLVStyle
  • struct_LVCOLUMN
  • struct_LVFINDINFO
  • struct_LVITEM

  • func addLVItem( object id, atom iIcon, sequence text )    Add an item to a ListView
  • proc deleteLVColumn(id,index,mask,fmt,cx,text, ColumnNumber )   Removes a column from a listview control.
  • proc getColumnHeadings( integer id )   Gets a list of headings for each column in a list view.
  • func getLVAllChecked( integer id)   Returns a list of those rows that are Checked.
  • func getLVAllText( integer id, integer row )   Gets the text associated with every column in a listview row.
  • func getLVChecked( integer id, integer index )   Gets whether or not an row has its checkbox ticked.
  • func getLVCount( integer id )   Gets the number of rows in a list view.
  • func getLVItem( integer id, atom LV_ITEM)   Gets various attributes of a listview item.
  • func getLVItemlParam( integer id, integer iItem )   Gets the user-defined data for this specific row in the list.
  • func getLVItemText( integer id, integer item, object column)   Gets the text associated with a listview item.
  • func getLVSelected( object id )   get a list of the selected items' indexes
  • func getLVSelectedCount( integer id )   Gets the number of selected items in a list view.
  • func getLVSelectedText( integer id )   Gets the column-1 text for each selected item in the listview.
  • func hitTestLV( id )    Check to see if mouse is over a ListView item
  • proc insertLVColumn(id,index,mask,fmt,cx,text, ColumnNumber )   Inserts a new column into a listview control.
  • func insertLVItem(id,mask,row,column,state,stateMask,text,image,lparam)    Low-Level version of addLVItem
  • proc loadLVInfo(integer id, sequence pNewData)   Used to bulk load data into a list view control
  • proc setColumn( integer id, integer column, sequence text )   Changes the column header text, or width, or alignment.
  • proc setColumnHeadings( integer id, sequence text )    Sets the heading text for the columns in a ListView Control.
  • proc setImageList( integer id, atom IL, atom size )   
  • func setLVAttr(integer id, sequence pNewData)   Set (some) attributes of a ListView control
  • proc setLVChecked( integer id, integer Row, atom checked )    Sets the checked state for a ListView Item
  • func setLVInsert(integer pFlag )   Sets the default position for ListView inserts.
  • proc setLVItem(id, mask, Row, Column, state, stateMask, text, image, lparam)   Enables you to set a number of the properties of a ListView item in one call.
  • proc setLVItemlParam( integer id, integer iItem )   Sets the user-defined data for this specific row in the list.
  • proc setLVItemText(integer LV, integer position, integer subitem, object text)   
  • proc setLVStyle(integer ID, object StyleFlags)   Sets the extended style flags on a listview
  • func struct_LVCOLUMN(atom mask, atom fmt, atom cx, object text, object Column )   Allocates RAM for a LVCOLUMN structure and initialises it.
  • func struct_LVFINDINFO(atom flags, sequence text, atom lparam,atom x, atom y, atom direction)   
  • func struct_LVITEM(mask,item,iSubItem,state,stateMask,text,image,lparam)   Builds a LVITEM structure in RAM

    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    addLVItem
    ( object id, atom iIcon, sequence text )

    Add an item to a ListView

    Returns: The new item's ID.

    Category: ListView Control

    id: This is either the id of ListView or a two-element sequence that specifies the ListView id and the position in the list to insert the new item. 1 is the first position, 2 is the second position, etc... and -1 is the last position.
    iIcon: index of image from addIcon, addEuBmp, addXpm, or addDIB
    text: sequence of strings or numbers to be displayed in listview columns. The number of columns is set by the number of strings in this parameter.

    Note: Each item placed into a listview is given a unique ID. The ID is unique for the application, not just the ListView the item is in. Also, the ID is not the same as the position of the item in the ListView.

    Example:

            sequence idx idx = {}
            setColumnHeadings(myLV, {"Given Name","Family Name","Playing Position", "Number"})
            idx &= addLVItem(myLV, iconCaptain, {"Brett","Ratten", "Center", 7})
            idx &= addLVItem(myLV, iconPlayer, {"Scott","Camporeale", "Wing", 16})
            idx &= addLVItem(myLV, iconPlayer, {"Jim","Plunkett", "Rover", 44})
            -- Insert an item at position 2.
            idx &= addLVItem({myLV,2}, iconPlayer, {"Andrew","McKay", "Back Pocket", 5})
    

    See Also: deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    deleteLVColumn
    (id,index,mask,fmt,cx,text, ColumnNumber )

    Removes a column from a listview control.

    Category: ListView Control

    Example:

          -- Delete the third column
          deleteLVColumn( myListView, 3 )
    

    See Also: addLVItem, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    getColumnHeadings
    ( integer id )

    Gets a list of headings for each column in a list view.

    Category: ListView Control

    The headings are returned in the same left-to-right order as they are currently displayed. Note because the user can sometimes change the order of the columns, the 'column number' may not always be the same as the order that they appear in.

    The returned sequence contains one entry per heading. Each entry contains two-elements: the first is the true column number and the second is the heading text. The true column number can be used to get the values from the column. See example below ...

    Example:

          -- Output the columns in the right order
          lheads = getColumnHeadings(myListView)
          puts(fh, '\n')
          for i = 1 to length(lheads) do
              printf(fh, "%-25s", {lheads[i][2]})
          end for
          printf(fh, "\n%s\n", {repeat('-', 75)})
          for i = 1 to getLVCount(myListView) do
              for j = 1 to length(lheads) do
                  lData = getLVItemText(myListView, i, lheads[j][1])
                  printf(fh, "%-25s", lData)
              end for
              puts(fh, '\n')
          end for
    

    See Also: addLVItem, deleteLVColumn, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getLVAllChecked
    ( integer id)

    Returns a list of those rows that are Checked.

    Returns: SEQUENCE: A list of rows.

    Category: ListView Control

    Example:

          sequence items
          items = getLVAllChecked(myLV)
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getLVAllText
    ( integer id, integer row )

    Gets the text associated with every column in a listview row.

    Returns: Sequence: A sequence of text strings.

    Category: ListView Control

    id is the ListView control,
    row is the list view row in question,

    Example:

           sequence theText
           -- Get the text from row 1.
           theText = getLVAllText(myLV, 1 )
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getLVChecked
    ( integer id, integer index )

    Gets whether or not an row has its checkbox ticked.

    Returns: INTEGER: w32False if not checked, otherwise w32True.

    Category: ListView Control

    Example:

          integer cnt
          -- See if row #2 is checked.
          cnt = getLVChecked(myLV, 2)
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getLVCount
    ( integer id )

    Gets the number of rows in a list view.

    Returns: INTEGER: The count of rows.

    Category: ListView Control

    Example:

          integer cnt
          cnt = getLVCount(myLV)
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getLVItem
    ( integer id, atom LV_ITEM)

    Gets various attributes of a listview item.

    Returns: ATOM: 0 if routine was successful.

    Category: ListView Control

    LV_ITEM is the address of a LVITEM structure that you have to correctly fill out before you call this routine.

    Example:

         atom lOK
         atom lvitem
         lvitem = w32acquire_mem(0, SIZEOF_LVITEM)
         w32store(lvitem, LVITEM_iItem, 1)
         w32store(lvitem, LVITEM_mask, LVIF_TEXT)
         lOK = getLVItem(myLV, lvitem)
         . . .
         w32release_mem(lvitem)
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getLVItemlParam
    ( integer id, integer iItem )

    Gets the user-defined data for this specific row in the list.

    Returns: ATOM: The user-defined data associated with this iItem.

    Category: ListView Control

    This data is set by setLVItemlParam and can be any 32-bit integer.

    Example

           atom lVal
           -- Get the data for the second row in the list.
           lVal = getLVItemlParam(myLV, 2)
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getLVItemText
    ( integer id, integer item, object column)

    Gets the text associated with a listview item.

    Returns: Sequence: The text for an item.

    Category: ListView Control

    id is the ListView control,
    row is the list view row in question,
    column is either the number of the column whose text you want, or -1 if you want the text from all columns, in which case a sequence of strings is returned, or a sequence of column numbers.

    Example:

           sequence theText
           -- Get the text from column 1 in row 2.
           theText = getLVItemText(myLV, 2, 1)
           -- Get the text from columns 3 and 2 in row 1.
           theText = getLVItemText(myLV, 1, {3,2} )
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getLVSelected
    ( object id )

    get a list of the selected items' indexes

    Category: ListView Control

    return SEQUENCE: A List of items. This can return either a simple list of item index values or a list of 2-element sequences where the first element is the index of the selected item and the second elements is the id of the selected item.

    Remember that each item in a list view has a unique item id. The index is the item's current position within the listview.

    To return just a list of item indexes, id is the ListView control id.
    To return a list of {index, item id} sequences, then id must be a sequence in the form {LVid, style}. LVid is the listview's control id and style is either 1 for the sequence list return value style, or 0 for the simple list return value style.

    Example:

              sequence indexes
              -- Get a list of selected items' id.
              idxs = getLVSelected( myListView)
    

    -- Get a list of selected items AND their indexes. idxs = getLVSelected( {myListView, 1} )

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getLVSelectedCount
    ( integer id )

    Gets the number of selected items in a list view.

    Returns: INTEGER: The count of selected items.

    Category: ListView Control

    Example:

          integer cnt
          cnt = getLVSelectedCount(myLV)
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getLVSelectedText
    ( integer id )

    Gets the column-1 text for each selected item in the listview.

    Returns: SEQUENCE: Each element returned is a text sequence.

    Category: ListView Control

    Note that an empty sequence returned means that there is no selected items.

    Example:

          sequence strings
          strings = getLVSelectedText(myListView)
          for i = 1 to length(strings) do
              puts(1, strings[i] & '\n')
          end for
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    hitTestLV
    ( id )

    Check to see if mouse is over a ListView item

    Returns: Id of ListView item under mouse, or zero, if none

    Category: ListView Control

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    insertLVColumn
    (id,index,mask,fmt,cx,text, ColumnNumber )

    Inserts a new column into a listview control.

    Category: ListView Control

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    insertLVItem
    (id,mask,row,column,state,stateMask,text,image,lparam)

    Low-Level version of addLVItem

    Returns: SEQUENCE: {index, itemid}

    Category: ListView Control

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    loadLVInfo
    (integer id, sequence pNewData)

    Used to bulk load data into a list view control

    Category: ListView Control

    id is the ID of the ListView control
    pNewData is a list of row data and optional image ids. Each element is either a list of column data or an image id as returned from addIcon(). An image id applies to all the row data that follows until the next image id.

    Example:

          sequence theData
          integer iconMale, iconFemale
          iconMale = addIcon(loadBitmapFromFile("male.ico"))
          iconFemale = addIcon(loadBitmapFromFile("female.ico"))
          theData = {}
          theData &= iconMale
          theData = append(theData, {"George", 95.4, "Judo"})
          theData = append(theData, {"Harry", 97.2, "Karate"})
          theData &= iconFemale
          theData = append(theData, {"Wendy", 65.1, "Kendo"})
          theData = append(theData, {"Jill", 75.8, "Ice Hockey"})
          theData &= iconMale
          theData = append(theData, {"Horatio", 105.1, "Chess"})
          theData = append(theData, {"Felix", 87.0, "Butterflies"})
          loadLVInfo(myLV, theData)
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setColumn
    ( integer id, integer column, sequence text )

    Changes the column header text, or width, or alignment.

    Category: ListView Control

    See struct_LVCOLUMN for a description of what format text can take.

    Example:

         -- Set the width of the third column to 230
         setColumn(myListView, 3, {"",230,-1} )
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setColumnHeadings
    ( integer id, sequence text )

    Sets the heading text for the columns in a ListView Control.

    Category: ListView Control

    The text parameter is a sequence list of column formatting options, one per column. Each column formatting option is either a simple text heading, or a 3-element sequence: {heading-text, column-width, alignment-code}. The alignment code is a single character (integer) and can be one of '<', '^', or '>' meaning left, center, and right alignment respectively.
    When calling this routine, sometimes you might need to leave the current setting for heading text, width or alignment alone. To leave the text alone, use an empty string. To leave the width alone, use -1. To leave the alignment alone, use -1.

    Example:

           -- Set the heading text for each column.
           setColumnHeadings(myLV, {"Title","Author","Publisher","When"})
           -- Change the width of the second column
           setColumnHeadings(myLV, { {}, {"",200,-1} })
           -- Another way to change the width of the second column
           setColumn(myLV, 2, { {"",200,-1} })
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setImageList
    ( integer id, atom IL, atom size )

    Category: ListView Control

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    setLVAttr
    (integer id, sequence pNewData)

    Set (some) attributes of a ListView control

    Returns: SEQUENCE: The current attributes.

    Category: ListView Control

    id is the ListView's id
    pNewData is a list of two-element sequences. The first element is the code name for the attribute being changed, and the second is the new value for it.

    Example:

        sequence ov
        -- Indicate that col 1 is case-insensitive, and col 2 is numeric.
        -- Indicate that col 1 swaps directions, and col 2 is always ascending.
        ov = setLVAttr( myLV, {{kLVColTypes, {'i','n'}},
                               {kLVSortSeq, {-2, 1}},
                               {kLVSortRtn, {-2, routine_id("lvsort")}}
                           })
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setLVChecked
    ( integer id, integer Row, atom checked )

    Sets the checked state for a ListView Item

    Category: ListView Control

    id is the win32lib id for the list view.
    Row is the listview item to check/uncheck.
    checked is the checked/unchecked state (<>0=checked,0=unchecked).

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    setLVInsert
    (integer pFlag )

    Sets the default position for ListView inserts.

    Returns: The flag setting before this change.

    Category: ListView Control

    If pFLag is zero, addLVItem() adds new items to the top of the list, else new items are added at the end. The default is to add items to the top of lists.

    Example:

         integer lvInsert
         -- Make listviews add to end of lists.
         lvInsert = setLVInsert( 1 )
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setLVItem
    (id, mask, Row, Column, state, stateMask, text, image, lparam)

    Enables you to set a number of the properties of a ListView item in one call.

    Category: ListView Control

    Example:

          setLVItem (myListView, w32or_all({LVIF_TEXT, LVIF_IMAGE}), 2,1,
                        0, 0, "The Great Gatsby", bookImage, 0)
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setLVItemlParam
    ( integer id, integer iItem )

    Sets the user-defined data for this specific row in the list.

    Category: ListView Control

    This data is got by getLVItemlParam and can be any 32-bit integer.

    Example

           -- Set the data for the second row in the list.
           setLVItemlParam(myLV, 2, 17)
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setLVItemText
    (integer LV, integer position, integer subitem, object text)

    Category: ListView Control

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setLVStyle
    (integer ID, object StyleFlags)

    Sets the extended style flags on a listview

    Category: ListView Control

    StyleFlags can either be an atom containing all then flag bits set to a sequence of flag names. The valid names are... \n

  • LVS_EX_GRIDLINES
  • LVS_EX_SUBITEMIMAGES
  • LVS_EX_CHECKBOXES
  • LVS_EX_TRACKSELECT
  • LVS_EX_HEADERDRAGDROP
  • LVS_EX_FULLROWSELECT
  • LVS_EX_ONECLICKACTIVATE
  • LVS_EX_TWOCLICKACTIVATE
  • LVS_EX_FLATSB
  • LVS_EX_REGIONAL
  • LVS_EX_NFOTIP
  • LVS_EX_UNDERLINEHOT
  • LVS_EX_UNDERLINECOLD
  • LVS_EX_MULTIWORKAREAS

    Example

          setLVStyle(myListView, {LVS_EX_FULLROWSELECT,
                                  LVS_EX_GRIDLINES,
                                  LVS_EX_HEADERDRAGDROP})
    

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, struct_LVCOLUMN, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    struct_LVCOLUMN
    (atom mask, atom fmt, atom cx, object text, object Column )

    Allocates RAM for a LVCOLUMN structure and initialises it.

    Returns: ATOM: Address of a LVCOLUMN structure.

    Category: ListView Control

    text can be a 3-element sequence in the form { headingtext, width, alignment } where headingtext is the text for the column heading, width is the column width in pixels, and alignment is a code for Left, Center, or Right aligned text ('<', '^', '>' respectively).
    In this form, if width or alignment is -1, it is ignored and the existing settings for the column are not changed. If headingtext is "" it is ignored. This means that to blank out a column's heading you must specify a space character as the heading text value.

    Column is either ...

  • an integer column number for the new column
  • a two-element sequence {column#, image#}. This form lets you specify the column number and the image list id for the column's image.
  • a three-element sequence {column#, image#, order}. This form lets you specify the column number, the image list id for the column's image (zero for no image, and the order value.

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVFINDINFO, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    struct_LVFINDINFO
    (atom flags, sequence text, atom lparam,atom x, atom y, atom direction)

    Category: ListView Control

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVITEM


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    struct_LVITEM
    (mask,item,iSubItem,state,stateMask,text,image,lparam)

    Builds a LVITEM structure in RAM

    Returns: ATOM: The address of the structure.

    Category: ListView Control

    See Also: addLVItem, deleteLVColumn, getColumnHeadings, getLVAllChecked, getLVAllText, getLVChecked, getLVCount, getLVItem, getLVItemlParam, getLVItemText, getLVSelected, getLVSelectedCount, getLVSelectedText, hitTestLV, insertLVColumn, insertLVItem, loadLVInfo, setColumn, setColumnHeadings, setImageList, setLVAttr, setLVChecked, setLVInsert, setLVItem, setLVItemlParam, setLVItemText, setLVStyle, struct_LVCOLUMN, struct_LVFINDINFO