ListViewGroups Interface Reference

Defines Groups for ListView. More...

List of all members.

Public Member Functions

 Remove ([in] VARIANT Index)
 Call this method to remove one item from the collection.
 Clear ()
 Removes all of the items from the collection.
 Add ([in] BSTR Name,[out, retval] IDispatch **Item)
 Call this method to create a new item in the collection.

Properties

LPUNKNOWN R _NewEnum []
 Returns the enumerator for the collection.
VARIANT R Item [[in] long Index] []
 Returns the specified item in the collection.
long R Count []
 Returns the number of items in the collection.


Detailed Description

Defines Groups for ListView.

The method Groups returns a ListViewGroups object. An ListViewGroups object is a collection of the ListViewGroup objects. Requires Comctl32.dll version 6. Requires visual styles (Themes). Without visual styles groups not visible. Example:

o = new ActiveXObject("Scripting.WindowSystemObject")
o.EnableVisualStyles = true

fs = new ActiveXObject("Scripting.FileSystemObject")

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 550
f.ClientHeight = 650
f.CenterControl()

Box = f.CreateListView(10,10,250,300)
Box.HotTrack = true
Box.Align = o.Translate("AL_CLIENT")

Ext = new ActiveXObject("Scripting.WindowSystemObjectExtensions")
Box.LargeImages = Ext.SystemImageListLarge
Box.SmallImages = Ext.SystemImageListSmall
Box.Style = o.Translate("LV_VIEW_ICON")

var Data = ["1.txt","1.jpg","1.png","1.exe","1.bat","1.com","1.js","1.vbs","1.bmp","1.ini","1.xml"]

Group1 = Box.Groups.Add("Group 1")
Group2 = Box.Groups.Add("Group 2")

Group1.SubTitle = "The group 1 description where"
Group1.Task = "Task"
Group1.DescriptionTop = "DescriptionTop"
Group1.DescriptionBottom = "DescriptionBottom"
Group1.SubsetTitle = "SubsetTitle"
Group1.HeaderAlign = o.Translate("AL_CENTER")
Group1.FooterAlign = o.Translate("AL_CENTER")
Group1.Collapsible = true
Group1.Footer = "Group 1 Footer Text"
Group2.Footer = "Group 2 Footer Text"

for (i = 0; i<Data.length; i++)
{
        Item = Box.Add("Item "+i+": "+Data[i])
        Item.ImageIndex = Ext.GetFileSysIconIndexLarge(Data[i],o.Translate("FILE_ATTRIBUTE_ARCHIVE"))
        Item.SubItems(0) = "The first line for "+i
        Item.SubItems(1) = "The second line for (a b c d e f g h j k)"+i
        Item.Group = i % 2
}

Box.OnGroupLinkClick = OnGroupLinkClick

function OnGroupLinkClick(Sender,Group){
        f.MessageBox(Group.Header + " clicked")
}


f.Show()

o.Run()

Result:
ListViewGroups.jpg

More function example you can see in Demo\JScript\Small\ListView\ListViewGroups.js.

Since:
1.1.10.


Member Function Documentation

Add ( [in] BSTR  Name,
[out, retval] IDispatch **  Item 
)

Call this method to create a new item in the collection.

Parameters:
Name the header text for a new group.
Return values:
Item A new ListViewGroup object.
Since:
1.1.10.

Clear (  ) 

Removes all of the items from the collection.

Since:
1.1.10.

Remove ( [in] VARIANT  Index  ) 

Call this method to remove one item from the collection.

Parameters:
Index The index of the element to remove or the element itself.
Since:
1.1.10.


Property Documentation

LPUNKNOWN R _NewEnum

Returns the enumerator for the collection.

Since:
1.1.10.

long R Count

Returns the number of items in the collection.

Since:
1.1.10.

VARIANT R Item[[in] long Index] (  ) 

Returns the specified item in the collection.

Since:
1.1.10.


WSO 1.1 Documentation. Date modified:Wed Aug 12 18:12:52 2015. (C) Veretennikov A. B. 2004-2015