TPanel

TPanel

Postby Otto » Wed Dec 30, 2009 7:26 pm

Should

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

Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: TPanel

Postby James Bott » Wed Dec 30, 2009 9: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TPanel

Postby Otto » 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: TPanel

Postby James Bott » Wed Dec 30, 2009 11:01 pm

Otto,

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

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TPanel

Postby Otto » Wed Dec 30, 2009 11:22 pm

Hello James,
Refresh() does not help.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: TPanel

Postby James Bott » Thu Dec 31, 2009 1:21 am

Otto,

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

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TPanel

Postby nageswaragunupudi » Thu Dec 31, 2009 5: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: Select all  Expand view
  endif

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

   ::DispEnd( aInfo )
 


In the application we may now use
Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10626
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TPanel

Postby Antonio Linares » Thu Dec 31, 2009 9:38 am

Rao.

Already included for next FWH build, thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TPanel

Postby Otto » Thu Dec 31, 2009 9: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 91 guests