Subject PreventEditing doesn't affect TIB_LookupCombo
Author guido.klapperich@t-online.de
I have two tables contacts and opening. Every contact has an opening, so
I have a Foreign Key CTOPID in contacts, that points to the Primary key
of opening OPID. I display the contacts in a TIB_LookupCombo. When I
want to prevent the user from editing the opening of a contact, I add
the following entry in the FieldsReadOnly-property of the
contacts-query:
CTOPID=NOEDIT
After that, the user cannot change the opening of a contact, but he can
delete the opening with the delete-button. I have done some debugging
and found in the IB_Grid.pas

procedure TIB_CustomCombo.KeyDown(var Key: Word; Shift: TShiftState);
var
tmpWord: word;
ii: integer;
tmpString: string;
begin
if ( Key = VK_DELETE ) and Assigned( PopupList ) then
begin
ClearSelection( TRUE );
Key := 0;
Exit; //<=-no further processing required
end;

I think, that there misses a check wether the selection can be cleared
or not, but it's just a guess.


Guido