Just popping in
Joined: 2014/2/2 14:52 Last Login
: 2017/3/5 15:07
From Salt Lake City
Group:
Registered Users
|
I'm trying to create a list with check boxes. This is a database. It reads the number and size of fields in the database. So the number and size of fields is variable. Each record is one long fixed-length string of characters. The question I have is interspersing check boxes with the text fields. Some of the fields are just yes / no (logical). I can only get a checkbox in column 0. Any other columns which should have check boxes are blank. The text fields appear in the correct columns. I'm wondering if this is a limitation of Reaction. Can you only have one check box per line and does it have to be in column zero?
I've included a section of code. This works fine except for the missing check boxes. The LBNA_Priority tag is just a place-holder. It doesn't do anything. The LBCIA_Weight probably isn't necessary either. Neither of these have any effect on my problem. (The browser removes the leading spaces.)
recbrowser = new List; IExec->NewList(recbrowser); for(cnt = 0; cnt < cmf->dbheader.numrecs; cnt++) { for(cnt2 = 0; cnt2 < cmf->numfields; cnt2++) { util = 0; cnt3 = 1; for(cnt3 = 1; cnt3 <= cnt2; cnt3++) util += cmf->fieldlist[cnt3 - 1].fieldlen; strncpy(field1[cnt2][cnt].fieldy, &cmf->reclist[cnt * cmf->dbheader.recsize + util], cmf->fieldlist[cnt2].fieldlen); field1[cnt2][cnt].fieldy[cmf->fieldlist[cnt2].fieldlen] = 0; strcpy(test, field1[cnt2][cnt].fieldy); util2 = strlen(test); // fieldtypes: C, character; L, logical switch(cmf->fieldlist[cnt2].fieldtype) { case 'C': i_ti[cnt2 * 3].ti_Tag = LBNA_Column; i_ti[cnt2 * 3].ti_Data = cnt2; i_ti[cnt2 * 3 + 1].ti_Tag = LBNCA_Text; i_ti[cnt2 * 3 + 1].ti_Data = (uint32)field1[cnt2][cnt].fieldy; i_ti[cnt2 * 3 + 2].ti_Tag = LBCIA_Weight; i_ti[cnt2 * 3 + 2].ti_Data = 100; break; case 'L': i_ti[cnt2 * 3].ti_Tag = LBNA_Column; i_ti[cnt2 * 3].ti_Data = (uint32)cnt2; i_ti[cnt2 * 3 + 1].ti_Tag = LBNA_CheckBox; i_ti[cnt2 * 3 + 1].ti_Data = TRUE; i_ti[cnt2 * 3 + 2].ti_Tag = LBNA_Priority; i_ti[cnt2 * 3 + 2].ti_Data = 0; break; } } i_ti[cnt2 * 3].ti_Tag = TAG_END; IExec->AddTail(recbrowser, IListBrowser->AllocListBrowserNodeA(cmf->numfields, i_ti)); }
|