[Lazarus] RE : RE : RE : RE : RE : @DBLookupControls users: call for test

michael at freepascal.org michael at freepascal.org
Wed Dec 14 12:17:32 CET 2011



On Wed, 14 Dec 2011, Ludo Brands wrote:

>>
>> I've got your point.
>>
>> Mine is that the control should keep less intrusive as it was
>> designed
>> earlier (the original author explicitly avoided changing
>> listsource cursor).
>>
>
> Less intrusive became occulted. Not only are we missing an important (for me
> at least) Delphi feature but the current implementation makes it virtually
> impossible to emulate the Delphi behavior since everything related to the
> lookup is private:
> A convoluted workaround for DBLookupComboBox was to create a
> DBLookupComboBox.OnChange, retrieve DBLookupComboBox.ItemIndex and move its
> listsource to that position. Unfortunately, recent changes have made this
> even more difficult since DBLookupComboBox2.ListSource returns nil if
> Datafield is a lookup field. Setting ListSource when Datafield is ftLookup
> was superfluous but possible and useful. Beats me why this was removed.
> Progress? Now I have to get the field information of DataField to get to the
> ListSource :
> DBLookupComboBox.DataSource.DataSet.FieldByName(DBLookupComboBox.DataField).
> LookupDataSet.RecNo:=DBLookupComboBox.ItemIndex+1 :(  I'll create a seperate
> bugreport for this regression. Even if ListSource isn't settable for a
> ftLookup Datafield, it shouldn't return nil.
>
> DBGrid is even worse. For the picklist I haven't found anything (event or
> property) to get to its index or value.
>
> The remedy for being less intrusive is worse than the disease.

I am totally in agreement with Ludo on this one.

I think the users should at least be offered the opportunity to change the
behaviour. I have always counted on the Delphi-compatible behaviour: 
selecting an element in a lookup positions the cursor in the lookup dataset.

So a property 'SyncLookupCursor' or so should maybe be introduced. The
default can be 'False', but I for one would need the 'True'.

Michael.




More information about the Lazarus mailing list