FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TPanel
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
TPanel
Posted: Wed Dec 30, 2009 07:26 PM
Should

Code (fw): Select all Collapse
DrawText( oPanel:hDC, cChartCaption,{ nTxtTop, nTxtLeft, nTxtBottom, nTxtRight }, nStyle  )
FillRect(oPanel:hDc, aRect1 ,oBrush)
RoundBox etc.
work with TPanel.

Thanks in advance
Otto
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: TPanel
Posted: Wed Dec 30, 2009 09:51 PM

Otto,

If they work with windows then they should work with panels. Have you tried them and they don't work, or have you not tried them yet?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: TPanel
Posted: Wed Dec 30, 2009 10:33 PM

Hello James,
thank you for your answer.
I tried but I don’t see anything on the panel.
Best regards,
Otto

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: TPanel
Posted: Wed Dec 30, 2009 11:01 PM

Otto,

Did you try oPanel:refresh() after drawing the text?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: TPanel
Posted: Wed Dec 30, 2009 11:22 PM

Hello James,
Refresh() does not help.
Best regards,
Otto

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: TPanel
Posted: Thu Dec 31, 2009 01:21 AM

Otto,

Can you create a small self-contained sample to show the problem?

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TPanel
Posted: Thu Dec 31, 2009 05:29 AM
Mr. Otto

The code you propose to use should normally be used in the bPainted code block of TPanel. But this not work because TPanel's Paint method, which overrides the parent's paint method, does not evaluate bPainted code block.

If this has to work, a small modification in tpanel.prg is needed.
Towards the end of TPanel.prg's Paint method these lines are to be inserted.
Code (fw): Select all Collapse
   endif

   if ValType( ::bPainted ) == 'B'   // inserted
      Eval( ::bPainted, ::hDC, ::cPS, Self ) // inserted
   endif // inserted

   ::DispEnd( aInfo )


In the application we may now use
Code (fw): Select all Collapse
oPanel:bPainted := { |hDC, cPS, oPanel| MyPanelPaint( hDC, cPS, oPanel )


Your code now works in MyPanelPaint( hDC, cPS, oPanel ) function.
Regards



G. N. Rao.

Hyderabad, India
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TPanel
Posted: Thu Dec 31, 2009 09:38 AM

Rao.

Already included for next FWH build, thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: TPanel
Posted: Thu Dec 31, 2009 09:59 AM

Hello Mr. Rao,

thank you very much for your explanation and the source code.
Now I understand how it is working.
I inserted the evaluation of the bPaint-block into TPanel and now I can do what I want.
Thank you again and best regards,
Otto

Continue the discussion