![]() |
CListCtrl / CTreeCtrl in CXTPTaskPanel ??? |
Post Reply
|
| Author | |
mpmooreblvu
Newbie
Joined: 15 June 2006 Location: United States Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Topic: CListCtrl / CTreeCtrl in CXTPTaskPanel ???Posted: 15 June 2006 at 5:28pm |
|
I am trying to put CListView and CTreeView controls into a CXTPTaskPanel. Each list or tree control will be the only item in a group.
My problem is that I would like the tree and list controls to resize to use all of the available space when their group is active. This seems hard. Can anyone point to sample code which does this? The CXTPTaskPanel will also be resizeable. thank you; Matthew P Moore |
|
![]() |
|
hipopotamo
Groupie
Joined: 01 June 2006 Location: Portugal Status: Offline Points: 34 |
Post Options
Thanks(0)
Quote Reply
Posted: 20 June 2006 at 2:20pm |
|
Hi,
I do not know if the lastest updates have this "fixed" or not, but in the 9.80 I had do to this...
I'm not sure if it's 100% correct...
void CMyTaskPanel::UpdateScrollBar()
{ if ( !IsExplorerBehaviour() ) { int nClientHeight = CXTPClientRect(this).Height(); if ( nClientHeight > 0 ) { bool bDefault; for ( int i = 0; ( i < GetGroups()->GetCount() ) && !bDefault; ++i ) if ( pGroup->IsExpanding() ) continue; if ( !pGroup->IsExpanding() ) pItem->SetSize(CSize(0, nItemHeight), false ); }
|
|
![]() |
|
mpmooreblvu
Newbie
Joined: 15 June 2006 Location: United States Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Posted: 20 June 2006 at 2:26pm |
|
Thank you for your reply. It is no longer an issue for me for two reasons:
1) my boss decided he wants different behavior
2) Oleg Chernyahovskii of codejock.com mailed me a much simpler answer:
Solution: ------------------------------------------- Hi,
just call pItem->SetSize (CSize(x, 0), TRUE); method declaration: void SetSize(CSize szItem, BOOL bAutoHeight = FALSE); -----------------------------------------
This gives the behavior I wanted - the CListView / CTreeView item automatically sizes to use the full vertical height available to the group. Unfortunately it doesn't size to take advantage of the full horizontal width available, but if I use CSize( 2000, 0 ) then the controls are wide enough for any practical CXTPTaskPanel, and they grow horizontal scroll bars when needed and behave sensibly.
Thank you;
Matthew P Moore
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |