Subject Re: IB_LookupCombo bug?
Author fingerclick2000
Oh Helen, thanks for all help. Since i started with ibo i see you
are amazing in the forum. But unhappily my problem continues.
Well, i found out that this problem occurs with the last fetched
column, and in my case, i only fetch one column, that i think to ibo
this is the last one. I looks like ibo stretch the dropdowncolumn.
I opened the source coded and i didn't go any longer, but there, i
realize something like "GridFields[ StretchColNum ].DefaultWidth" and
the delphi pointer was going over it. is this stretch caused by
anything i did? Thanks since now for all help.

By the way i found this insede the source. I looks a bg like this was
fixed by Luis Alves:

{ Luiz Alves <cprmlao@...> }
{ 01-out-2002 }
{ -Fix to tib_lookupcombo showing incorrect width during dropdown }
{ -Fix to tib_lookupcombo doesn't paint bottom line of external }
{ rectangle during dropdown }

--- In, Helen Borrie <helebor@t...> wrote:
> 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
> 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
> in the dropdown part will try to display all of the columns other
than the
> keylinks.
> --- 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
> with an attribute called GridsDisplayWidth or something similar. I
> what it was meant to do. There was also GridsDisplayLabel. At some
> as a workaround, Jason deprecated the "Grids..." attributes and made
> so that they worked the same as the corresponding "Fields.."
> attributes. They seem to have disappeared altogether now.
> Helen