본문 바로가기
Delphi Tip/그리드

델파이 TcxDBTreeList 북마크 Bookmarks 사용하기

by MonoSoft 2021. 8. 27.
728x90
반응형

델파이 TcxDBTreeList 북마크 사용하기

 

억지스럽지만.....모...;

 

 

procedure DBTreeListSelectBookmark_Go(DBTreeLiat:TcxDBTreeList;

iFocus, iFocus0,iFocus1,iFocus2,iFocus3: integer );

begin

case iFocus of

0 : DBTreeLiat.Items[iFocus0].Focused := True;

1 : DBTreeLiat.Items[iFocus0].Items[iFocus1].Focused := True;

2 : DBTreeLiat.Items[iFocus0].Items[iFocus1].Items[iFocus2].Focused := True;

3 : DBTreeLiat.Items[iFocus0].Items[iFocus1].Items[iFocus2].Items[iFocus3].Focused := True;

end;

end;

 

//노드마다 for 추가

function DBTreeListSelectBookmark(DBTreeLiat:TcxDBTreeList;

var iFocus0,iFocus1,iFocus2,iFocus3: integer):Integer;

var

i, o , p, l : integer;

Node,Node1,Node2,Node3 : TcxTreeListNode;

begin

iFocus0 := 0;

iFocus1 := 0;

iFocus2 := 0;

iFocus3 := 0;

 

for i := 0 to CB_grdCable.Count - 1 do

begin

Node := CB_grdCable.Items[i];

if Node.Selected then

begin

iFocus0 := i;

iFocus1 := o;

iFocus2 := p;

iFocus3 := l;

Result := 0;

Break;

exit;

end;

 

for o := 0 to Node.Count-1 do

begin

Node1 := CB_grdCable.Items[i].Items[o];

if Node1.Selected then

begin

iFocus0 := i;

iFocus1 := o;

iFocus2 := p;

iFocus3 := l;

Result := 1;

Break;

exit;

end;

 

for p := 0 to Node1.Count-1 do

begin

Node2 := CB_grdCable.Items[i].Items[o].Items[p];

if Node2.Selected then

begin

iFocus0 := i;

iFocus1 := o;

iFocus2 := p;

iFocus3 := l;

Result := 2;

Break;

exit;

end;

 

for l := 0 to Node2.Count-1 do

begin

Node3 := CB_grdCable.Items[i].Items[o].Items[p].Items[l];

if Node3.Selected then

begin

iFocus0 := i;

iFocus1 := o;

iFocus2 := p;

iFocus3 := l;

Result := 3;

Break;

exit;

end;

end;

end;

end;

end;

end;

728x90
반응형

댓글