Decal Development Forums Forum Index Decal Development Forums
www.decaldev.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

c++ (VS 6.0) - Adding Rows to a List Control

 
Post new topic   Reply to topic    Decal Development Forums Forum Index -> AC FAQ's and Howtos (Archive)
View previous topic :: View next topic  
Author Message
Zyrca



Joined: 19 Apr 2002
Posts: 219
Location: MA

PostPosted: Tue Jun 17, 2003 8:48 am    Post subject: c++ (VS 6.0) - Adding Rows to a List Control Reply with quote

Syntax:

m_lstList->PutData(col, row, subVal, data);

col = column number
row = row number
subVal = 1 if it's an image from portal.dat, the apps hinstance if it's a custom icon, and 0 otherwise
data = the icon id from the portal.dat, text or value for a check column

Example:

// Create the row that you will be changing
m_lstList->AddRow();
// Set the icon in an icon column
m_lstList->PutData(0,0,1, &_variant_t( 0x06001FF4L ));
// Set the text in a text column
m_lstList->PutData(1,0,0, &_variant_t( "Some Text" ));
// Set the check box in a check column
m_lstList->PutData(2,0,0, &_variant_t( VARIANT_TRUE ));
_________________
-Zyrca
Back to top
View user's profile Send private message Visit poster's website
paradox
Teh Decal L33T!
Teh Decal L33T!


Joined: 19 Apr 2002
Posts: 333

PostPosted: Tue Sep 30, 2003 1:39 pm    Post subject: err Reply with quote

the above post is in error reguarding subval

subval may only ever be 0 or 1 currently.

for icon columns that use icons from the portal.dat
m_lstList->PutData(0,0,1, &_variant_t( 0x06001FF4L ));
is correct.

if you want to use custom resouces do the following
m_lstList->PutData(0,0,0, &_variant_t( hInst ));
m_lstList->PutData(0,0,1, &_variant_t( RES_ID ));
Back to top
View user's profile Send private message Visit poster's website
deadeye-we



Joined: 10 Nov 2002
Posts: 69

PostPosted: Fri Oct 03, 2003 11:01 am    Post subject: Reply with quote

The above example by Zyrca should be:

Code:
long nRow;

// Create the row that you will be changing
nRow = m_lstList->AddRow();
// Set the icon in an icon column
m_lstList->PutData(0,nRow,1, &_variant_t( 0x06001FF4L ));
// Set the text in a text column
m_lstList->PutData(1,nRow,0, &_variant_t( "Some Text" ));
// Set the check box in a check column
m_lstList->PutData(2,nRow,0, &_variant_t( VARIANT_TRUE ));


othwise the first row would be overlaid each time since rows are added to the end.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Decal Development Forums Forum Index -> AC FAQ's and Howtos (Archive) All times are GMT - 5 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