yrs90
2005-05-19 04:29:51 UTC
I am at the point where I need to the ability to filter a list. I considered
overriding iterators, but it looks pretty complicated. I considered
avoiding the problem by simply creating new underlying data, a new string
vector, to populate the filtered list, but I can't create a rule that allows
me to connect an item selected from the filtered list back to the original
list. For example the following rule won't work:
RULE("xrcFullList.Items", make_expr<accessor>("m_FullData"))
RULE("xrcFilteredList.Items", make_expr<accessor>("m_FilteredData"))
RULE("xrcTextCtrl.Text",
make_expr<wxString>("m_FullData[xrcFilteredList.Current].Details"))
where m_FullData is map<wxString,ComplexDataType> and m_FilteredData is
vector<wxString>. (I'm trying to avoid duplicating the entire data set.)
I am considering creating a Condition property in the lwListAdapterBase. The
idea is that an item is inserted in the list only if the Condition evaluates
true.
Currently there isn't any rule syntax that would allow me to refer to the
current item such that I could evaluate a Boolean rule for each list item.
Also, I am not sure how to cause a rule to be reevaluated.
Alternatively, (but more restrictively) I could require that the Condition
be a string value referring to a member of the aggregate currently being
inserted. In that case I think I could reference the member via
ag[GetCondition()]. Also, in this case I'm not sure yet how to invoke the
aggregate member.
Any suggestions on the easiest way to add this functionality?
Thanks,
Joel
---
[This E-mail scanned for viruses by Declude Virus]
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
overriding iterators, but it looks pretty complicated. I considered
avoiding the problem by simply creating new underlying data, a new string
vector, to populate the filtered list, but I can't create a rule that allows
me to connect an item selected from the filtered list back to the original
list. For example the following rule won't work:
RULE("xrcFullList.Items", make_expr<accessor>("m_FullData"))
RULE("xrcFilteredList.Items", make_expr<accessor>("m_FilteredData"))
RULE("xrcTextCtrl.Text",
make_expr<wxString>("m_FullData[xrcFilteredList.Current].Details"))
where m_FullData is map<wxString,ComplexDataType> and m_FilteredData is
vector<wxString>. (I'm trying to avoid duplicating the entire data set.)
I am considering creating a Condition property in the lwListAdapterBase. The
idea is that an item is inserted in the list only if the Condition evaluates
true.
Currently there isn't any rule syntax that would allow me to refer to the
current item such that I could evaluate a Boolean rule for each list item.
Also, I am not sure how to cause a rule to be reevaluated.
Alternatively, (but more restrictively) I could require that the Condition
be a string value referring to a member of the aggregate currently being
inserted. In that case I think I could reference the member via
ag[GetCondition()]. Also, in this case I'm not sure yet how to invoke the
aggregate member.
Any suggestions on the easiest way to add this functionality?
Thanks,
Joel
---
[This E-mail scanned for viruses by Declude Virus]
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click