trichview.com

trichview.support




Re: Method for enumerating all items


Return to index


Author

Message

David Novo

Posted: 08/27/2004 3:43:55


Hi Sergey,


A couple of questions about this method.


1) How would I use it to enumerate only the selected items?


2) Is it possible to have a method to enumerate items (both selected,

and not selected) that does not require a method pointer. For instance,

I need to get a to get a list of all the label Items in a document.


If I use a TRVEnumItemsProc I have to create a list that is global to

the form,


i.e.


globalList.clear;

rv.rvData.enumItem(<some method>, userdata1, userdata2)

<some Method> updates the global list based on characteristics I have

to

pass in with the user data

.. now access the items in the global list


it would be much nicer if I could have

rv.rvData.initializeEnum;// set to the beginning

while rv.Rvdata.doneEnum do begin

       rv.rvData.getCurEnum(rvData,itemNo);

      // now choose to add my data to the list if I want

       rv.RvData.incEnum;

end;


in the case above, I can do everything locally instead of relying on

the existence of global lists. Is that hard to implement?






Sergey Tkachenko wrote:


> Create a form method with the following parameters:

>

> TRVEnumItemsProc = procedure (RVData: TCustomRVData; ItemNo: Integer;

>     var UserData1: Integer; const UserData2: String;

>     var ContinueEnum: Boolean) of object;

>

> Then call

>

> rv.RVData.EnumItems(<your method>, UserData1, UserData2);

>

> Your method will be called for each item (RVData, ItemNo)

> UserData1, UserData2 - any values, will be passed in your method.

> You can stop enumeration by assigning ContinueEnum = False.





Powered by ABC Amber Outlook Express Converter