Subject Alignment of Combos
Author Lele Gaifax
Hi all,

with PopupAlignment=puAuto, when the form is near the left side of the
screen the dropdown menu shows up at negative X coordinate. It seems
to me more reasonable to prevent this, as usually one puts important
fields first in the lookup table, and currently they get cutted off.

The code below is a simple but effective fix to
IB_Grid.pas::TIB_CustomCombo.DropDown. Maybe it could even try to find
out the best fit between ParentLeft and ParentRight...

case FPopupAlignment of
puAuto:
if ListWidth > ( Parent.ClientOrigin.X +
Parent.ClientRect.Right - P.X ) then
begin
LeftPos := Parent.ClientOrigin.X + Parent.ClientRect.Right -
ListWidth;
if LeftPos < 0 then
LeftPos := 0;
end;

bye, lele.
--
nickname: Lele Gaifax | Quando vivro' di quello che ho pensato ieri
real: Emanuele Gaifas | comincero' ad aver paura di chi mi copia.
email: lele@... | -- Fortunato Depero, 1929.