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

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


Printing CTreeView

Edgar Haimerl -- Edgar.Haimerl@mh.sbg.ac.at
Monday, November 04, 1996

Environment: Win95, MSVC++ 4.0, MFC 4.0

Hi,

I am using a CTreeView in a SDI app as view. CMyView, derived from CTreeView
has a OnDraw Method, but it is not called when I resize the application
Window. The Tree is painted as soon as I add the elements with TVinsertItem
- no more calls to OnDraw?

Now I want to print that TreeView - but nothing turns up on the preview page
- nothing is on the printer, exept for a test text written with pDC->TextOut
in OnDraw.

Is there a chance to I make CTreeView use the MFC printing features or do I
have to do it all by hand?

thanks for your answer

Edgar
------------------------------------------------------------------------
Dr. Edgar Haimerl                               UNIVERSITAET SALZBURG
Akademiestr. 24                              INSTITUT FUER ROMANISTIK
A - 5020 Salzburg                            FORSCHUNGSPROJEKT  ALD I
Tel. (#43-662)-8044-4489
Fax  (#43-662)-8044-613
E-Mail: Edgar.Haimerl@SBG.AC.AT
CompuServe: 100407,1724




Alberto Massari -- alby@belva.infomus.dist.unige.it
Thursday, November 07, 1996

At 10.03 04/11/96 +0100, you wrote:
>Now I want to print that TreeView - but nothing turns up on the preview page
>- nothing is on the printer, exept for a test text written with pDC->TextOut
>in OnDraw.

In your OnDraw function, do as follows:

if(pDC->IsPrinting())
{
        GetTreeCtrl()->SendMessage(WM_PAINT,(HDC)pDC->m_hDC,0);
}
// your previous paint code ...


        Alberto
----------------------------
    |\      _,,,--,,_
    /,`.-'`'   ._  \-;;,_
   |,4-  ) )_   .;.(  `'-'
  '---''(_/._)-'(_\_)    
------------------------------------------------------------------
Alby@MusArt.dist.unige.it is: 	Alberto Massari

Laboratorio di Informatica Musicale
D.I.S.T. Dipartimento di Informatica, Sistemistica e Telematica
Universita' di Genova
Via all'Opera Pia 13,
I - 16145 Genova ITALIA		http://MusArt.dist.unige.it/alby/
------------------------------------------------------------------





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