WideStudio Programming Guide

| WideStudio Programming Guide | WideStudio Index Table of contents

> ## The verbose list

> ### Setting of the items by the method

> Use addItem method to add items to the list which property "type" is WS_VERBOSE with an string and position. If the position is omitted,add it to the last of the list. The following program is a sample adding item to the list. The difference from the list is the item which is punctuated with comma.

> [The verbose list]
> Set 50,100,150 to the property "barValue" to make the list 4-sections like above picture. This property appoints a position of separator of title. Please pay attention, because number of section is fixed by this property. The following program is a sample adding item to the list.

>     #----------------------------------------------------------
>     #Function for the event procedure
>     #----------------------------------------------------------
>     use mpfc;

>     sub btnep1 {
>       my ($object) = @_;
>       # Delete all the items of the list.
>       $newlist_001->delAll();

>       # Add an item to the last of the list.
>       $newlist_001->addItem("item1,aaa,bbb,ccc");
>       $newlist_001->addItem("item2,aaa,bbb,ccc");
>       $newlist_001->addItem("item3,aaa,bbb,ccc");
>       $newlist_001->addItem("item4,aaa,bbb,ccc");

>       # Add an item to the specified position of the list.
>       $newlist_001->updateList();
>       return;
>     }
>     1;

> ### Setting of the items by the property

> the property "data" can be used for setting the items of the list, if it is a comparatively little number of the items. In such case, set the property "dataSource" to WS_DATA_SOURCE_NONE, and set the items which is punctuated with comma every one item to the property "data".

>     #----------------------------------------------------------
>     #Function for the event procedure
>     #----------------------------------------------------------
>     use mpfc;

>     sub btnep1 {
>       my ($object) = @_;
>       # elete all the items of the list.
>       $newlist_001->delAll();
>       # et the items of the list by the property
>       $newlist_001->setProperty("dataSource",$mpfc::WS_DATA_SOURCE_NONE);
>       $newlist_001->setProperty("data",
>          "item1,aaa,bbb,ccc\nitem2,aaa,bbb,ccc\nitem3,aaa,bbb,ccc");
>       return;
>     }
>     1;

> It is possible to indicate the specified ICON by icon file name as following program. Set True to the property "useIcon" and Set the items as following format. If it is omitted,the value of "iconPixmap" is used for default icon.

>       format:
>       ICON1filename,str11,str12,str13,..\nICON2filename,str21,str22,str23,...\n...

>     #----------------------------------------------------------
>     #Function for the event procedure
>     #----------------------------------------------------------
>     use mpfc;

>     sub btnep1 {
>       my ($object) = @_;
>       # Delete all the list of the list
>       $newlist_001->delAll();
>       # Set the items of the list by the property
>       $newlist_001->setProperty("dataSource",$mpfc::WS_DATA_SOURCE_NONE);
>       $newlist_001->setProperty("data",
>          "$(WSDIR)/sys/pixmaps/bi16.xpm,item1,aaa,bbb,ccc\n,item2,aaa,bbb,ccc\n,item3,aaa,bbb,ccc");
>       return;
>     }
>     1;

> ### Setting of the items from the file directly

> It is possible to set the items from the file directly. In such case at first,set WS_DATA_SOURCE_FILE to the property "dataSource", and set the file name to the property "dataSourceName" as following program.

>     #----------------------------------------------------------
>     #Function for the event procedure
>     #----------------------------------------------------------
>     use mpfc;

>     sub btnep1 {
>       my ($object) = @_;
>       # Delete all the items of the list
>       $newlist_001->delAll();

>       # Set the items from file directly
>       $newlist_001->setProperty("dataSource",$mpfc::WS_DATA_SOURCE_FILE);
>       $newlist_001->setProperty("dataSourceName","data.txt");
>       return;
>     }
>     1;
>     #data.txt contains...
>     $(WSDIR)/sys/pixmaps/bi16.xpm,item1,aaa,bbb,ccc
>     item2,aaa,bbb,ccc
>     item3,aaa,bbb,ccc
>     item4,aaa,bbb,ccc
>     $(WSDIR)/sys/pixmaps/bi16.xpm,item5,aaa,bbb,ccc
>     item6,aaa,bbb,ccc
>     item7,aaa,bbb,ccc
>     item8,aaa,bbb,ccc

> ### Setting of the items from the other instance

> It is possible to set the items from the data source target property of the other instances. In such case, set WS_DATA_SOURCE_INSTANCE to the property "dataSource", and set the instance name to the property "dataSourceName". In the following example, a WSCtextField instance are specified to the property "dataSourceName" and then it sets the string data of it to the list.

>     #----------------------------------------------------------
>     #Function for the event procedure
>     #----------------------------------------------------------
>     use mpfc;

>     sub btnep1 {
>       my ($object) = @_;
>       # Delete all the items of the list
>       $newlist_001->delAll();

>       # Set the items from the other instances
>       $newlist_001->setProperty("dataSource",$mpfc::WS_DATA_SOURCE_INSTANCE);
>       $newlist_001->setProperty("dataSourceName","newtext_000");
>       return;
>     }
>     1;

Document Release 3.70 for WideStudio ver 3.70, Feb 2004

WideStudio documents index | Table of contents

Copyright(C) T. Hirabayashi, 2000-2004 | Last modified: Feb 25, 2004