Subject Re: [IBO] searchpanel question
Author Helen Borrie
At 03:21 PM 5/10/2003 +0200, you wrote:
>table has domain (BOOLEAN), which implements bool type for the Firebird DB
>Now, then using such table with searchpanel, bool field is displayed as 0
>or 1 value. How to set searchpanel, that bool field would be represented as
>radiogroup with 2 states according (true/false) with my desired caption for
>each choise (for example: NETTO - true (1), BRUTTO - false (0))?
>Is it possible to set up this with searchpanel at all ? if not, is the only
>way to write own descendant component from the searchpanel?
>or other ideas, thoughts are welcome

IBO's default GUI for Booleans is a TIB_Checkbox. To implement it for the
whole domain, you must set the attribute in the ColumnAttributes property
of your ib_connection object and include fetDomainName in the
FieldEntryTypes set. Read the details in the IBO help for the
ColumnAttributes property of TIB_Statement.

After that, you don't need to worry about them at field-level at all
(unless you want to override it in specific data sets).

'BOOLEAN' is a bad choice for this domain name, because it is a reserved
word, soon to be a data type!! Let's say your domain is called D_BOOLEAN -
your ColumnAttributes property should include a line like this:

D_BOOLEAN=BOOLEAN=1,0

If you need to implement this with radio buttons instead, you will have to
do it manually - radio buttons are not the standard interface for two-state
booleans.

If you want this to be your standard Boolean interface everywhere, a
TIB_RadioBox descendant restricted to two buttons seems like a good
idea. If all of your Booleans are to be handled this way, it would be
simpler not to have IBO treat them as Booleans but just use the (1,0)
values directly with the ItemIndex of the RadioGroup.

Helen