FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DFL Listview suggestion

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Thu Feb 15, 2007 4:17 pm    Post subject: DFL Listview suggestion Reply with quote

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
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Fri Feb 16, 2007 1:58 am    Post subject: Re: DFL Listview suggestion Reply with quote

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
View user's profile Send private message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Fri Feb 16, 2007 8:17 am    Post subject: Reply with quote

I guess... Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group