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

Luiz Americo Pereira Camara luizmed at oi.com.br
Sat Dec 24 16:05:00 CET 2011


On 14/12/2011 09:17, michael at freepascal.org wrote:
>
>
> 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'.

Implemented as ScrollListDataset. Defaults to false

Luiz




More information about the Lazarus mailing list