Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
92 user(s) are online (55 user(s) are browsing Forums)

Members: 0
Guests: 92

more...

Headlines

 
  Register To Post  

List browser with check boxes
Just popping in
Just popping in


See User information
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));
}

Go to top
Re: List browser with check boxes
Just can't stay away
Just can't stay away


See User information
@GarbageOut

Quote:
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?

Yes. ReAction indeed has this limitation.

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: List browser with check boxes
Just can't stay away
Just can't stay away


See User information
@GarbageOut

LBNA_#? tags apply to the entire node, only LBNCA_#? tags apply to the current column of the node.

LBNA is ListBrowser Node Attribute
LBNCA is ListBrowser Node Column Attribute

Go to top
Re: List browser with check boxes
Just popping in
Just popping in


See User information
@trixie

Thanks. I can quit trying to figure out what I'm doing wrong. Also thanks to salass00. That's good to know. It explains why the check box applies to the whole node.

Go to top
Re: List browser with check boxes
Just can't stay away
Just can't stay away


See User information
@GarbageOut

when posting code you have to use the DHTML editer and enclose it with [ code ] [ /code ] without the spaces eg.

if testing
    
do nothing
else
    do 
even_less
endif

Amiga user since 1985
AOS4, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
Go to top
Re: List browser with check boxes
Just popping in
Just popping in


See User information

I know from working on the win32 listview control the same limitation applies - one checkbox per row - always in the first column. For column-level controls you start getting heavy into custom draw code. Been there. Lived to tell the tale. A few souvenir scars.

Hopefully OS4 has a more elegant way to implement this type of hook.

Cheers!

Go to top
Re: List browser with check boxes
Just popping in
Just popping in


See User information
@gregthecanuck

What's a "win32"??

Is it classic, or NG?
:)


Go to top
Re: List browser with check boxes
Just popping in
Just popping in


See User information
@LyleHaze

It's a nightmare is what it is!!

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project