15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CTreeCtrl & CHeaderCtrl - Combination

Babette Frank -- bf@condat.de
Friday, June 21, 1996

Win95, MFC 4.0

Hello,

I've been developing an application which receives a lot of data and I =
want to put the data in a TreeCtrl with different columns. What I need =
is a CTreeCtrl combined with a CHeaderCtrl (like CListCtrl). I've seen =
such a combination in the 'Mail and News Beta 1.0' from Microsoft or in =
'Exchange Public Folders'. Does anybody have a sample or suggestions?=20

Regards, Babette

-------------------------------------------------------------------------=
------------
Babette Frank                                          Telefon.:   =
+49.30.39094-152
Condat GmbH                                          Fax:            =
+49.30.39094-300
Alt-Moabit 91 d                                         e-mail:        =
bf@condat.de
10559 Berlin, Germany



Roger Onslow -- Roger_Onslow@compsys.com.au
Monday, June 24, 1996

>I've been developing an application which receives a lot of data
>and I want to put the data in a TreeCtrl with different columns.
>What I need is a CTreeCtrl combined with a CHeaderCtrl (like CListCtrl).
>I've seen such a combination in the 'Mail and News Beta 1.0' from
>Microsoft or in 'Exchange Public Folders'. Does anybody have a
>sample or suggestions? 

A couple of thoughts here (but no actual solutions unless I can find the time 
to experiment)

(1) use a CTreeCtrl and CHeadCtrl and make the CTreeCtrl owner drawn and get 
the column sizes from the header control.  There is an example of an owner 
drawn list control (yeah-- Iknow its not a tree control) which use owner draw 
to simulate a "full row" selection (like search history in developer studio)

(2) use a CTreeCtrl and CListCtrl together and synchronise the two.  ie. ensure 
that row-n of tree control and row-n of list are for same data.

(3) make the list control owner-drawn so it shows the hiearchy as appropriate.  
There are example of owner-drawn list controls (but not with hierachy display 
that I know of) and also of combo-boxes/list-boxes which owner draw to give the 
hierachy effect -- just combine the two and you should be right!!

But a tree control with columns would be nice -- maybe one day -- after all, MS 
gave us list control, tree control etc so why not this one?

Hope this helps point you at a solution (If you manage to do this, please send 
me code -- I'd also be intereseted)

Roger Onslow
Computer Systems Australia
eMail: RogerO@compsys.com.au





Roland Pasternack -- rep@jupiter.Legato.COM
Monday, June 24, 1996

If a 3rd party solution is acceptible to you, you can check out the SftTree
tree control that does exactly what you want (about $270).  Their web site
is at www.softelvdm.com.  It is not perfect but it does work pretty well.
Their phone number is (201) 366-9618 (in the USA).

-Roland

>>Win95, MFC 4.0
>>
>>Hello,
>>
>>I've been developing an application which receives a lot of data and I want
>to put the data in a TreeCtrl with different columns. What I need is a
>CTreeCtrl combined with a CHeaderCtrl (like CListCtrl). I've seen such a
>combination in the 'Mail and News Beta 1.0' from Microsoft or in 'Exchange
>Public Folders'. Does anybody have a sample or suggestions? 
>>
>>Regards, Babette
>>
>>---------------------------------------------------------------------------
>----------
>>Babette Frank                                          Telefon.:
>+49.30.39094-152
>>Condat GmbH                                          Fax:
>+49.30.39094-300
>>Alt-Moabit 91 d                                         e-mail:
>bf@condat.de
>>10559 Berlin, Germany





| Вернуться в корень Архива |