C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[46130] Re:트리뷰에서 MoveTo() 이용하여 노드 이동방법...
장성호 [nasilso] 1251 읽음    2006-08-10 19:29
뭐 다른방법이 있는지 모르겠지만
ChildNode만 하나씩 모두 옮기면 되지 않을까요?

void __fastcall TForm1::Button2Click(TObject *Sender)
{
    TTreeNode *pNode=TreeView1->Items->Item[0];//맨 첫번재 Node아래로 옮긴다.
    TTreeNode *Node=TreeView1->Selected; //옮길 Node의 Parent

    if(Node==pNode)return;
    if(Node==NULL)return;

    TTreeNode *cNode;
    cNode=Node->GetLastChild(); //맨 마지막 Child노드부터 옮긴다.
    while(cNode)
    {
        cNode->MoveTo(pNode,naAddChildFirst); //첫번째 Child노드로 옮긴다.
        cNode=Node->GetLastChild();
    }
}

naAddChildFirst 옵션으로 옮길경우
GetLastChild()를 이용해 맨끝에것 부터 옮겨야 순서가 꼬이지 않기 때문이니다.



//옵션은 Help정보에서...
naAdd    The new or relocated node becomes the last sibling of the other node.
naAddFirst    The new or relocated node becomes the first sibling of the other node.
naInsert    The new or relocated node becomes the sibling immediately before the other node.
naAddChild    The new or relocated node becomes the last child of the other node.
naAddChildFirst    The new or relocated node becomes the first child of the other node.


이범상 님이 쓰신 글 :
: 트리노드에서 MoveTo()를 사용하면 특정 노드를 다른 노드로 이동시킬수 있는데
:
: 여기서 자식노드만 이동되고 자기자신은 이동 안되게 가능합니까???
:
: 파라메터에 모드가 있긴하던데 그건 현재 노드를 이동하는 모드죠???
:
: 답변 부탁드립니다. ^^

+ -

관련 글 리스트
46126 트리뷰에서 MoveTo() 이용하여 노드 이동방법... 이범상 732 2006/08/10
46130     Re:트리뷰에서 MoveTo() 이용하여 노드 이동방법... 장성호 1251 2006/08/10
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.