Subject RE: [IBO] Very simple question
Author Daniel Jimenez
> I'm not fussed what gets used. I know I said I'd send
> something off the list, but I've just finished 3 hours sleep
> after another 18 hour day.
>
> Here are my requirements: (if you want my current source code
> let me know and I'll send privately).
>
> We have a field in a table that is a small int. We have 16
> bits available to us, so we use this in our application to
> indicate up to 16 different logging options (where it is
> possible to indicate more than one logging type is available
> at any given time).
>
> My code currently does this:
>
> - At construction time, the object is passed a list of
> strings and associated bit positions. I'd be happy to remove
> the bit position option and just pass blank strings for the
> bits not currently set (to 1).
>
> - The control has properties to indicate the number of
> columns and width of each column
>
> - The control has a 'MaskValue' property that does the following:
>
> Read method : Converts 'checked' states to a bit mask
> value and returns to user
>
> Write Method : Converts a bit mask value to 'checked'
> states and updates the checkbox controls
>
> - When we update our data in the database we write the value
> from the 'Read' method.
>
> Hence we need to associate the entire control to a single
> field in a table.
> I have not used TCheckListBox so if this can accomodate the
> same features then that's fine.
>
> Let me know if you need more information or want to look at
> my code (which is in C++). I can whip up a small
> non-data-aware demo if you require.
>

Jason,

I work with Malcolm, and after reading this post, I notice that a small
detail may have been left out.

Malcolm wrote the code for this control, however, I have been using it lots
lately.

Normally there is two tables associated to the control. One table will
contain a field which stores a bitmask, and the other table will contain the
data used to populate the text associated to each checkbox used to represent
the meaning of each bit.

Example:

Say table one from the above description may be:

LOGPARAMS
LP_PROCESSNAME VARCHAR(16) NOT NULL,
LP_LOGMASK SMALLINT NOT NULL /*Store the bitmask as per user selection
of check box*/
....

Table two from the example above may be:

LOGLEVELS
LL_ID D_NOT_NULL_ONE ,
LL_DESCRIPTION VARCHAR(16) NOT NULL /* Data used for the construction of the
checkbox list*/


Hope I have not confused you.

danieL.
____________________________
Comvision Pty. Ltd.

www.comvision.net.au