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
[20282] Re:Re:ListView에다가 TreeView를 합치려고 하는데요..
유영인.Chris [cuperido] 1199 읽음    2002-07-22 17:14
작성해놓은 소스 코드는 없구요.. 그리고, 상당히 손이 많이 가는 작업이라서, 이런 작업을 해놓은 것들은 대부분 컴포넌트로 배포되고 있습니다.

아래 컴포넌트도 꽤 괜찮구요..
http://www.delphi-gems.com/VirtualTreeview/VT.html

제일 문제가 TreeNode의 Width를 조절할 수 있는 프로퍼티가 없다는 것인데, 메시지를 이용해서 조작이 가능합니다. 아래는 뉴스그룹에서 관한 기사구요.

As long the target platform has comctl32 of at 4.71 (IE4+), then you can use the
TVM_SETITEM message with the TVITEMEX structure. Specifically, the TVITEMEX
structure has an iIntegral data member that you can use to set per-node
heights. Here's a quick example of setting the height of the selected node to 3
times the default height...

#include <cassert>

   TTreeNode* pItem = TreeView1->Selected;
   assert(pItem != NULL);

   TVITEMEX tvix;
   tvix.mask = TVIF_INTEGRAL | TVIF_HANDLE;
   tvix.hItem = pItem->ItemId;
   tvix.iIntegral = 3; // 3x height

   const int res = SNDMSG(
      TreeView1->Handle, TVM_SETITEM, 0,
      reinterpret_cast<LPARAM>(&tvix)
      );
   assert(res != 0);
   TreeView1->Invalidate();

You might also want to use the TVM_SETITEMHEIGHT message to set the default
height (the iIntegral data member will then specify multiples of that height)...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/treeview/messages/tvm_setitemheight.asp

Good luck,
--
Damon C. (TeamB)



유영인.Chris 님이 쓰신 글 :
: 위와 같은 경우에는, ListView를 사용하시기 보다 HeaderControl을 사용하시는 것이 좋을것 같습니다.
:
: HeaderControl을 하나 놓으신 다음에 더블클릭을 하시면, Report 형식의 ListView 처럼 열을 꾸미실 수가 있습니다.
:
: 그 다음, TreeView의 열의 너비를 시작할때와 HeaderControl의 각각의 열의 Width를 조절할 때마다 바꿔 주시면 될 것 같습니다.
:
:
:
: Monkey D Ruphy 님이 쓰신 글 :
: : 아래 첨부파일과 같이 하려고 하는데 조언좀 부탁드립니다..(__)

+ -

관련 글 리스트
30228         Re:Re:ListView에다가 TreeView를 합치려고 하는데요.. Monkey D Ruphy 967 2002/07/22
20282         Re:Re:ListView에다가 TreeView를 합치려고 하는데요.. 유영인.Chris 1199 2002/07/22
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.