View previous topic :: View next topic |
Author |
Message |
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Thu Feb 15, 2007 4:17 pm Post subject: DFL Listview suggestion |
|
|
Greetings!
listview should allow calling values by their column name. Ie,
col1 | col2 | col3 | col 4| col5
so when I double click on an item, if I say,
char[] str = lview.focusedItem.col1;
would set str to whatever
lview.focusedItem.subItems.opIndex(0).text
contains. It would make the code easier to read and understand. This,
Code: | UniqueID = lview.focusedItem.text; // set the record number;
IDlabel.text = UniqueID;
ProjID.text = lview.focusedItem.subItems.opIndex(0).text; // ProjID
Parent = lview.focusedItem.subItems.opIndex(1).text; // parent
Children = lview.focusedItem.subItems.opIndex(2).text; // Children
login = lview.focusedItem.subItems.opIndex(3).text; // login
txtCust.text = lview.focusedItem.subItems.opIndex(4).text; // Cust
txtProj.text = lview.focusedItem.subItems.opIndex(5).text; //
PClass.selectedIndex(PClassInt[lview.focusedItem.subItems.opIndex(6).text]); // Class
ProjBranch.selectedIndex(PSubClassInt[lview.focusedItem.subItems.opIndex(7).text]); // Class
txtbDate.text = lview.focusedItem.subItems.opIndex(8).text; //
txtdDate.text = lview.focusedItem.subItems.opIndex(9).text; //
txteDate.text = lview.focusedItem.subItems.opIndex(10).text; //
txtPM.text = lview.focusedItem.subItems.opIndex(11).text; //
txtPMUK.text = lview.focusedItem.subItems.opIndex(12).text; //
txtLang.text = lview.focusedItem.subItems.opIndex(13).text; //
txtVendor.text = lview.focusedItem.subItems.opIndex(14).text; //
vEmail.text = lview.focusedItem.subItems.opIndex(15).text; //
txtInvoice.text = lview.focusedItem.subItems.opIndex(16).text; //
txtProjFund.text = lview.focusedItem.subItems.opIndex(17).text; //
txtA_No.text = lview.focusedItem.subItems.opIndex(18).text; //
wDir.text = lview.focusedItem.subItems.opIndex(19).text; //
txtNotes.text = lview.focusedItem.subItems.opIndex(20).text; //
txtStatus.text = lview.focusedItem.subItems.opIndex(21).text; //
wDirDisplay.text = DisplayWorkingDir(wDir.text);
|
is hard to make a sequence change and I have to keep re-figure out which one is which. While, if I know their heading, then I know what values it contains.
Just a thought...
thanks,
jic |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Fri Feb 16, 2007 1:58 am Post subject: Re: DFL Listview suggestion |
|
|
But might writing your own helper function be good enough?
I'm not sure if I agree with adding this to ListView itself. Columns and items aren't necessarily just strings/text. Also, you're calling .opIndex(0) directly, but this can be shortened to [0]. |
|
Back to top |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Fri Feb 16, 2007 8:17 am Post subject: |
|
|
I guess... |
|
Back to top |
|
|
|