LCL-CustomDrawn: Now writing db data via a TDBEdit also works, as I fixed the CM_TEXTCHANGED signal sending

git-svn-id: trunk@39474 -
This commit is contained in:
sekelsenmat 2012-12-07 15:32:30 +00:00
parent ceaecc704b
commit 9b8ffbeb1f
2 changed files with 22 additions and 1 deletions

View File

@ -1406,6 +1406,7 @@ procedure TCDEdit.SetLines(AValue: TStrings);
begin
if FLines=AValue then Exit;
FLines.Assign(AValue);
DoChange();
Invalidate;
end;
@ -2001,6 +2002,7 @@ begin
FEditState.CaretPos.Y := 0;
end
else FLines.Strings[FEditState.CaretPos.Y] := AStr;
DoChange();
end;
function TCDEdit.GetSelStartX: Integer;

View File

@ -10,7 +10,7 @@ uses
// LCL
Controls, Graphics, stdctrls, extctrls, comctrls,
customdrawnproc, customdrawncontrols, lcltype, lclproc, lclintf,
spin;
lmessages, spin;
type
@ -23,7 +23,12 @@ type
LCLControl: TCustomButton;
end;
{ TCDIntfEdit }
TCDIntfEdit = class(TCDEdit)
protected
// for descendents to override
procedure DoChange; override;
public
LCLControl: TCustomEdit;
end;
@ -318,5 +323,19 @@ begin
(AControl is TCDIntfPageControl);}
end;
{ TCDIntfEdit }
procedure TCDIntfEdit.DoChange;
var
Msg: TLMessage;
begin
inherited DoChange;
// TCustomEdit responds only to CM_TEXTCHANGED, it doesn't respond to LM_CHANGED. TComboBox responds to LM_CHANGED
FillChar(Msg{%H-}, SizeOf(Msg), 0);
Msg.Msg := CM_TEXTCHANGED;
DeliverMessage(LCLControl, Msg);
end;
end.