Subject Re: [IBO] IB_LookupCombo bug?
Author Helen Borrie
At 07:53 PM 6/08/2005 +0000, you wrote:
> I read the entire board and didn't find the answer for it.
> Its simple, during dropdown, in IB_LookupCombo there are
>insufficient width to show records, issuing scrollbars horizontal and
>vertical to appear unnecessarily.
> I read that was a bug in 4.1 version( but im using now "4.5.Ai"
>with delphi 4).
> Is it still a bug or am i doing anything wrong to cause that? I set
>dropdownwidth, set display width, but nothing solves that. Please, if
>it s a bug, does anyone has a trick to solve it? Thanks in advance to
>all board.

The DisplayWidth of the field in the dropdown should do it. Some
possibilities, though:
1) Are you assuming that the DisplayWidth and DropDownWidth represent the
number of characters?
--- It's pixels - so this number will be somewhat larger. How much larger
depends on the average width of a character image for the font you are
using. Unless you are a font image guru, it will take trial and error to
work out what that magic multiplying factor is for the font you are
using. Don't forget to allow for the whitespace that displays around each
character image; and that pixels-per-character varies for proportional
fonts, e.g. data with a lot of "m's" will occupy more space.

2) Do you return multiple columns in the lookup query? If so, the IB_Grid
in the dropdown part will try to display all of the columns other than the
--- If you need multiple columns in the dropdown, don't forget to set the
FieldsDisplayWidths for all of them.
--- If you don't, either eliminate the ones you don't want or set the
FieldsVisible to false for the unwanted columns.

3) DropDownWidth is an override unless it is set to 0 (the default).
--- You'll need to leave this at 0 if you want the FieldsDisplayWidths of
the dropdown column to prevail. If you have multiple columns in the
dropdown, the total width will be more than the sum of the individual
FieldsDisplayWidths because of gridlines and margins.

As for any bug, I do recall in the early days of IBO 4, there were problems
with an attribute called GridsDisplayWidth or something similar. I forget
what it was meant to do. There was also GridsDisplayLabel. At some point,
as a workaround, Jason deprecated the "Grids..." attributes and made them
so that they worked the same as the corresponding "Fields.."
attributes. They seem to have disappeared altogether now.