FWH 9.02 - panel

FWH 9.02 - panel

Postby Otto » Thu Mar 12, 2009 6:44 pm

Tpanel gives this error:
If I commend out
// FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
it works but the brush is missing

Regards,
Otto


Error description: Error BASE/1004 Class: 'NIL' has no exported method: HBRUSH
Args:
[ 1] = U

Stack Calls
===========
Called from: => HBRUSH(0)
Called from: .\source\classes\TPanel.PRG => TPANEL:PAINT(0)
Called from: .\source\classes\TPanel.PRG => (b)TPANEL:TPANEL(0)
Called from: => TPANEL:DISPLAY(0)
Called from: c:\develop8\WH_Fwh\xplan\control.prg => TPANEL:HANDLEEVENT(1452)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)

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

Re: FWH 9.02 - panel

Postby Antonio Linares » Fri Mar 13, 2009 8:23 pm

Otto,

Could you please post a small and self contained example to reproduce the error ? 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: FWH 9.02 - panel

Postby Otto » Fri Mar 13, 2009 10:34 pm

Hello Antonio,
here is the example to reproduce the error.
Thanks in advance
Otto


Code: Select all  Expand view
#include "fivewin.ch"

function main()
    local oBuchen
    local oWnd1  

    oBuchen := TBuchen():New()
 

   DEFINE WINDOW oWnd1 TITLE "oWnd1"  FROM 5, 5 TO 24, 64
   
  @ 4, 2 BUTTON "&Ok" ACTION oBuchen:ClickBuchung()
   ACTIVATE WINDOW oWnd1

return nil
 
CLASS TBuchen

   METHOD New() CONSTRUCTOR

   METHOD ClickBuchung()

   METHOD BTNBar()

   METHOD end() virtual

ENDCLASS

//-----------------------------------------------------------------//

METHOD New() CLASS TBuchen


return Self

 //----------------------------------------------------------------------------//


METHOD BTNBar( oDlg,oPanel,oPanel2,oPanel3,oPanel4,oPanel5)
      local oSay,oBar,oBar2,oBar3,oBar4,oBar5

      DEFINE BUTTONBAR oBar size 60,60 TOP  of oPanel
      oBar:bRClicked = {|| NIL }
      oBar:l2007 = .T.

      DEFINE BUTTONBAR oBar2 OF oPanel2 SIZE 75, 75 2007

      return nil
//----------------------------------------------------------------------------//

METHOD ClickBuchung()
   local oDlg
   local oTabs2
   local oPanel
   local oPanel2
   local oPanel3
   local oPanel4
   local oPanel5
   local nColAnzeige   :=0
   local nRowAnzeige   :=0
   local oSelf         := self
   local oBtn

   DEFINE DIALOG oDlg FROM 40,1 TO  550,680 TITLE "B u c h u n g: " PIXEL
   oDlg:lHelpicon := .F.

   @ 8, 0 TABS oTabs2 PROMPTS "&Buchungsdaten ", "&Leistungen ", "&Korrespondenz ", "&MeldeMax ","Rechnung" ;
      OF oDlg;
      BITMAPS "..\bitmaps\16x16\people.bmp", "..\bitmaps\16x16\open2.bmp",;
      "..\bitmaps\16x16\print.bmp", "..\bitmaps\16x16\zoom2.bmp", "..\bitmaps\16x16\report.bmp" ;
      ACTION  f_tab(oTabs2:nOption,oPanel,oPanel2,oPanel3,oPanel4,oPanel5)

   oDlg:oTop = oTabs2

   oPanel  := TPanel():New( 8, 0, 237, 1000, oDlg )
   oPanel2 := TPanel():New( 8, 0, 237, 1000, oDlg )
   oPanel3 := TPanel():New( 8, 0, 237, 1000, oDlg )
   oPanel4 := TPanel():New( 8, 0, 237, 1000, oDlg )
   oPanel5 := TPanel():New( 8, 0, 237, 1000, oDlg )


   ACTIVATE DIALOG oDlg ;
      ON INIT (;
      oPanel2:hide(),;
      oPanel3:hide(),;
      oPanel4:hide(),;
      oPanel5:hide(),;
      oSelf:BTNBar(oDlg,oPanel,oPanel2,oPanel3,oPanel4,oPanel5) )

return nil
//----------------------------------------------------------------------------//
function  f_tab(nOption,oPanel,oPanel2,oPanel3,oPanel4,oPanel5)
    oPanel:hide()
    oPanel2:hide()
    oPanel3:hide()
    oPanel4:hide()
    oPanel5:hide()

    if nOption = 1
        oPanel:show()
    elseif nOption = 2
        oPanel2:show()
    elseif nOption = 3
        oPanel3:show()
    elseif nOption = 4
        oPanel4:show()
    elseif nOption = 5
        oPanel5:show()
    endif

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

Re: FWH 9.02 - panel

Postby Antonio Linares » Sat Mar 14, 2009 12:19 am

Otto,

To create the panels, oDlg must have a valid hWnd:
Code: Select all  Expand view

   ACTIVATE DIALOG oDlg ;
      ON INIT (;
                 oPanel  := TPanel():New( 8, 0, 237, 1000, oDlg ),;
                 oPanel2 := TPanel():New( 8, 0, 237, 1000, oDlg ),;
                 oPanel3 := TPanel():New( 8, 0, 237, 1000, oDlg ),;
                 oPanel4 := TPanel():New( 8, 0, 237, 1000, oDlg ),;
                 oPanel5 := TPanel():New( 8, 0, 237, 1000, oDlg ),;
                 oPanel2:hide(),;
                 oPanel3:hide(),;
                 oPanel4:hide(),;
                 oPanel5:hide(),;
                 oSelf:BTNBar(oDlg,oPanel,oPanel2,oPanel3,oPanel4,oPanel5 ) )
 
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: FWH 9.02 - panel

Postby Otto » Sat Mar 14, 2009 8:03 am

Antonio, thank you. Now it is ok.
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: 6328
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 85 guests