[Lazarus] Break in 'case...of' block.

Dave Coventry dgcoventry at gmail.com
Sun Aug 22 09:10:10 CEST 2010


On 21.08.2010 18:03, Bernd Kreuss wrote:
> On 21.08.2010 16:02, Bernd Kreuss wrote:
>>  * the grid is eating and ignoring keystrokes
> 
> This seems to be related to the losing of the focus. If i call setfocus
> everytime the datasource OnDataChange event fires  then the problem goes
> away but I'm not sure whether this is the optimal workaround.

(after patching the LCL to have the OnEditingDone event in the DBGrid)

procedure TForm1.DBGrid1EditingDone(Sender: TObject);
begin
  writeln('editing done ', DBGrid1.Focused);
  //DBGrid1.SetFocus;
end;

procedure TForm1.Datasource1UpdateData(Sender: TObject);
begin
  writeln('data update ', DBGrid1.Focused);
  //DBGrid1.SetFocus;
end;

it shows that whenever I have entered data and press enter or move away
from that cell using the arrow keys the DBGrid is in a state where it
does not have the focus anymore. But it also *wont* trigger the OnExit
event! Using the arrow up/down some more times will eventually give it
focus again so I can continue.

Forcing the focus back with SetFocus seems to work but I don't like this
workaround. Also in unpatched LCL there is no OnEditingDone for the
TDBGrid for some reason and also no other event that would let me track
selection changes or anything that is going on while working with the
grid in any way [hint! hint! hint!].

data update FALSE
data update FALSE
editing done FALSE
editing done FALSE
data update FALSE
data update FALSE
editing done FALSE


I will file some bugs tomorrow.




More information about the Lazarus mailing list