Hello,
Working with Windows 10/11, SQLite 3.47, ZeosdBO 7.2.14 and Lazarus '4'...
In my previous post, I mentioned that the test of the vacation photo management software I use regularly was working well. But here's the problem!
Wanting a more modern interface, I tested the following code (from “USING THE LAZARUS GRIDS”, Michaël Van Canneyt, August 4, 2008):
procedure TFEssVue64.DBGrid10ColExit(Sender : TObject) ;
begin
if DBGrid10.SelectedField.FieldName = DBLookupComboBox2.DataField then
DBLookupComboBox2.Visible := False ;
end ;
procedure TFEssVue64.DBGrid10DrawColumnCell(Sender : TObject ; const Rect : TRect ; DataCol : Integer ; Column : TColumn ; State : TGridDrawState) ;
begin
if (gdFocused in State) then
begin
if (Column.Field.FieldName = DBLookupComboBox2.DataField) then
with DBLookupComboBox2 do
begin
Left := Rect.Left + DBGrid10.Left + 2 ;
Top := Rect.Top + DBGrid10.Top + 2 ;
Width := Rect.Right - Rect.Left ;
Height := Rect.Bottom - Rect.Top ;
Visible := True ;
end ;
DataCol := 1 ; //Me signale un avertissement...
end ;
end ;
procedure TFEssVue64.DBGrid10KeyPress(Sender : TObject ; var Key : char) ;
begin
if (key = Chr(9)) then Exit ;
if (DBGrid10.SelectedField.FieldName = DBLookupComboBox2.DataField) then
begin
DBLookupComboBox2.SetFocus ;
SendMessage(DBLookupComboBox2.Handle, WM_Char, word(Key), 0) ;
end ;
end ;
If it works correctly with version 3.6, with version '4', and without any change in the code, if dBGrid's 'Edit' field accepts letters and displays the corresponding text in the search field, datas are not displayed in the drop-down list. When I click on the ButtonStyle, all I get is an empty line in the drawn rectangle...
To find out more, I tried adding an OnDblClick event to the dBGrid. The event doesn't respond in the data zone, but only if I click in the title...
I tested version 4 with Zeosdbo 7.2.14 and 8.00 with, unfortunately, the same result.
Best regards,