[litwindow-users] Re: wxListCtrl and library status
Status: Alpha
Brought to you by:
hajokirchhoff
From: Hajo K. <mai...@ha...> - 2005-04-17 17:42:07
|
Hi Hajo, Thanks for the prompt reply. I spent some time today trying to add ListCtrl support. I was using the 0.3 code but now I've updated to CVS head. I have left the existing interface the same, making minimal modifications and additions to handle multi-columns. I am not yet comfortable with how much of the interface can/should be modified. Originally, I was also trying to leave FillList() unchanged, but I finally realized that since it calls ClearList internally (destroying any columns), that I had to modify FillList. So I've made appropriate modifications in my wxListCtrlAdapter class. My initial strategy seemed elegant but may be flawed. I thought it would be nice to pass an aggregate to a function, say SetColumns(), and have the columns created from the struct elements. Then one would merely pass a container of that aggregate and the elements of each aggregate would be placed into the column associated the respective structure element. The problem, of course, is that the internal names may not be appropriate for use in the UI. I made enough progress that my ListCtrl without distinct columns is being populated. This was a straightforward modeled after wxListBox. When I tried to extend it to include columns I encountered two problems. First, I tried to add two functions, SetColumns and GetColumns. Class wxListCtrlAdapter { ... void SetColumns(const accessor &newValue); const accessor &GetColumns() const; ... } BEGIN_ADAPTER_NO_COPY(wxListCtrlAdapter) PROP_I(lwListAdapterBase) PROP_GetSet(accessor, Columns) END_ADAPTER() However, when I create a rule: RULE("m_IPListWindow.Columns", make_expr<accessor>("m_targetlist")) I get an error thrown stating that the "GetAccessor couldn't find a variable ' m_IPListWindow.Columns'" When I compare to the Items and Column property, I only find a PROP_GetSet declaration. I must be missing something obvious. How do I create a new property? My second problem, is one related to my original design. I am not sure how to initialize the columns if I don't have an instance of the aggregate to pass. Perhaps, though, there is a better way to pass the column names and associations between the columns and the aggregate contents. Any suggestions on this front? Thanks, Joel |