You've already forked lazarus-ccr
JvclLaz: Improve usability of the JvDBTreeView at designtime.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8182 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -658,9 +658,8 @@ procedure TJvCustomDBTreeView.LinkActive(Value: Boolean);
|
|||||||
begin
|
begin
|
||||||
if not Value then
|
if not Value then
|
||||||
HideEditor;
|
HideEditor;
|
||||||
if not AllFieldsValid then
|
if (not AllFieldsValid) and (not (csDesigning in ComponentState)) then
|
||||||
Exit;
|
Exit;
|
||||||
//if ( csDesigning in ComponentState ) then Exit;
|
|
||||||
if ValidDataSet then
|
if ValidDataSet then
|
||||||
begin
|
begin
|
||||||
RefreshChild(nil);
|
RefreshChild(nil);
|
||||||
@ -704,6 +703,8 @@ var
|
|||||||
cNode: TTreeNode;
|
cNode: TTreeNode;
|
||||||
fbnString: string;
|
fbnString: string;
|
||||||
flt: String;
|
flt: String;
|
||||||
|
|
||||||
|
lItemField, lDetailField: TField;
|
||||||
begin
|
begin
|
||||||
// CheckDataSet;
|
// CheckDataSet;
|
||||||
if not ValidDataSet or UpdateLocked then
|
if not ValidDataSet or UpdateLocked then
|
||||||
@ -711,6 +712,9 @@ begin
|
|||||||
Inc(FUpdateLock);
|
Inc(FUpdateLock);
|
||||||
with FDataLink.DataSet do
|
with FDataLink.DataSet do
|
||||||
begin
|
begin
|
||||||
|
lItemField := FieldByName(FItemField);
|
||||||
|
lDetailField := FieldByName(FDetailField);
|
||||||
|
|
||||||
BK := GetBookmark;
|
BK := GetBookmark;
|
||||||
try
|
try
|
||||||
DisableControls;
|
DisableControls;
|
||||||
@ -747,14 +751,14 @@ begin
|
|||||||
First;
|
First;
|
||||||
while not Eof do
|
while not Eof do
|
||||||
begin
|
begin
|
||||||
fbnString := FieldByName(FDetailField).AsString; // avoid overhead
|
fbnString := lDetailField.AsString; // avoid overhead
|
||||||
if FUseFilter or
|
if FUseFilter or
|
||||||
(((ParentValue = Null) and
|
(((ParentValue = Null) and
|
||||||
((fbnString = '') or
|
((fbnString = '') or
|
||||||
(Copy(Trim(fbnString), 1, 1) = '-'))) or
|
(Copy(Trim(fbnString), 1, 1) = '-'))) or
|
||||||
(FieldByName(FDetailField).Value = ParentValue)) then
|
(lDetailField.Value = ParentValue)) then
|
||||||
begin
|
begin
|
||||||
with Items.AddChild(ANode, FieldByName(FItemField).Text) as TJvDBTreeNode do
|
with Items.AddChild(ANode, lItemField.Text) as TJvDBTreeNode do
|
||||||
begin
|
begin
|
||||||
FMasterValue := FieldValues[FMasterField];
|
FMasterValue := FieldValues[FMasterField];
|
||||||
if FIconField <> '' then
|
if FIconField <> '' then
|
||||||
|
Reference in New Issue
Block a user