FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour undefined object button in Xbrowse in RecalWH method
Posts: 181
Joined: Thu Apr 17, 2008 02:38 PM
undefined object button in Xbrowse in RecalWH method
Posted: Sat Nov 22, 2025 06:06 PM

Hi Antonio

METHOD ReCalcWH() CLASS TXBrowse

Original


if ::lAdjusted
AEval( ::aCols, { |o| o:oBtnList:SetFont( o:DataFont ), o:oBtnElip:SetFont( o:DataFont ) } )
AEval( ::aCols, { |o| If( o:hChecked .and. o:bStrData == nil, o:bStrData := .f., nil ) } ) // FWH1712
::nWidths := nil
::nCellHeights := nil
::nHeaderHeight := nil
::nRowHeight := nil
::nFooterHeight := nil

  ::lAdjusted       := .f.
  ::Adjust()
  ::Refresh()

endif

Modified

if ::lAdjusted
AEval( ::aCols, { |o| IF(valtype(o:oBtnList) = 'U', NIL, o:oBtnList:SetFont( o:DataFont )) ,; <----------------------------------------------
IF(valtype(o:oBtnElip) = 'U', NIL, o:oBtnElip:SetFont( o:DataFont )) } ) <---------------------------------------------
AEval( ::aCols, { |o| If( o:hChecked .and. o:bStrData == nil, o:bStrData := .f., nil ) } ) // FWH1712
::nWidths := nil
::nCellHeights := nil
::nHeaderHeight := nil
::nRowHeight := nil
::nFooterHeight := nil

  ::lAdjusted       := .f.
  ::Adjust()
  ::Refresh()

endif

return nil

could you modify xbrowse to avoid this error?
o:oBtnList:SetFont method SetFont is not. defined when there is no button in column.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sat Nov 22, 2025 07:28 PM

Please copy here the error that you get, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 181
Joined: Thu Apr 17, 2008 02:38 PM
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sat Nov 22, 2025 08:57 PM

hi Antonio
this is the error

Application

Path and name: c:\Zephir\NwCoge\Sigah.exe (32 bits)
Size: ********* bytes
Compiler version: Harbour 3.2.0dev (r2503251254)
FiveWin version: FWH 25.09
C compiler version: Borland/Embarcadero C++ 7.7 (32-bit)
Windows 10 64 Bits, version: 10.0, Build 26200

Time from start: 9 sec
Error occurred at: 22/11/2025, 21:50:26
Error description: Error BASE/1004 Metodo non disponibile: SETFONT
Args:
[ 1] = U
[ 2] = O TFONT

Stack Calls

Called from: => SETFONT( 0 )
Called from: .\source\classes\xbrowse.prg => (b)TXBROWSE_RECALCWH( 10008 )
Called from: => AEVAL( 0 )
Called from: .\source\classes\xbrowse.prg => TXBROWSE:RECALCWH( 10008 )
Called from: .\source\classes\xbrowse.prg => TXBROWSE:FONTSIZE( 9997 )
Called from: .\source\classes\xbrowse.prg => TXBROWSE:KEYDOWN( 3762 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\control.prg => TCONTROL:HANDLEEVENT( 1877 )
Called from: .\source\classes\xbrowse.prg => TXBROWSE:HANDLEEVENT( 12583 )
Called from: .\source\classes\window.prg => _FWH( 3760 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\window.prg => TMDIFRAME:ACTIVATE( 1178 )
Called from: prog\Main.prg => MAIN( 6680 )

the error appears when the user play CTRL and '+' or CTRL and. '-'
same column do not have a button Therefore valtype(o:oBtnList) = "U"
Thank

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sun Nov 23, 2025 04:54 AM

Dear Mauri,

Please download FWH 25.09 again and try it again

many thanks for your feedback

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 181
Joined: Thu Apr 17, 2008 02:38 PM
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sun Nov 23, 2025 10:30 AM

Hi Antonio, I downloaded the last build of FWH, the error in object persist, xbrowse.prg is not changed. Thanks Maurizio Menabue

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sun Nov 23, 2025 05:52 PM

Dear Mauri,

Could you provide a small PRG to reproduce the error ?

many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 181
Joined: Thu Apr 17, 2008 02:38 PM
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sun Nov 23, 2025 10:35 PM

Dear Antonio,

try this program
press the CTRL key at the same time as the + or - key and you will see the error appear
I used the latest libraries downloaded today at 10.00.

#include "FiveWin.ch"

*------------------------------------------------------------------------------------------------
Function GesTps
*------------------------------------------------------------------------------------------------

   LOCAL oDlg
   LOCAL oBrw
   LOCAL oFont    := tFont():new("Tahoma", 0, -12.00,,.F.,,,,.F.)
   LOCAL cRet     := space(50)
   local lRet     := .F.
   local oCol
   local aData    := {}
   local cTipoDoc := "Tipo scadenza"
   local nFiller  := 0
   local oBtn1
   local oBtn2

   aadd(aData,{1,"AVVISO INCASSO"})
   aadd(aData,{2,"BONIFICO"})
   aadd(aData,{3,"RIMESSA DIRETTA"})
   aadd(aData,{4,"RI.BA."})
   aadd(aData,{5,"R.I.D."})
   aadd(aData,{6,"INSOLUTO"})
   aadd(aData,{7,"CESSIONE"})
   aadd(aData,{8,"ACCONTO"})
   aadd(aData,{9,"NOTA DI CREDITO"})
   aadd(aData,{10,"RICEVUTA BANCARIA"})
   aadd(aData,{11,"TRATTA"})
   aadd(aData,{12,"GIA' EVASO"})

   DEFINE DIALOG oDlg FROM 154.00 , 334.00 TO 604.00 , 820.00 ;
                 TITLE cTipoDoc ;
                 PIXEL ;
                 COLOR CLR_HBLUE ;
                 FONT oFont

   @ 2,2 XBROWSE oBrw ;
         COLUMNS 1,2 ;
         HEADERS "Nr.", cTipoDoc ;
         OF oDlg ;
         PIXEL ;
         SIZE -2, -30 ;
         ARRAY aData ;
         AUTOCOLS AUTOSORT LINES CELL

   WITH OBJECT oBrw
        :nStretchCol := STRETCHCOL_LAST
        :CreateFromCode()
   END

   nFiller := ((oDlg:nWidth/2) - 90) / 3

   @   (oDlg:nHeight/2) - 22,  nFiller BUTTON oBtn1 PROMPT "Conferma" ;
                               OF oDlg ;
                               ACTION (cRet := aData[oBrw:nArrayAt,2], odlg:end());
                               SIZE 45.00 , 14.00 ;
                               PIXEL ;
                               FONT oFont;
                               MESSAGE "Conferma"

   @   (oDlg:nHeight/2) - 22,  (nFiller * 2) + oBtn1:nWidth BUTTON oBtn2 PROMPT "Annulla" ;
                               OF oDlg ;
                               ACTION (odlg:end());
                               SIZE 45.00 , 14.00 ;
                               PIXEL ;
                               FONT oFont;
                               MESSAGE "Annulla"

   ACTIVATE DIALOG oDlg CENTER;
                        ON INIT (oDlg:oClient := oBrw, oBrw:SetFocus());
                        VALID (oFont:End(), lRet := .T., .T.)

return({lRet,cRet})

-
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: undefined object button in Xbrowse in RecalWH method
Posted: Mon Nov 24, 2025 07:02 AM

Bug fixed:

In xbrowse.prg line 10008 METHOD ReCalcWH() apply this change:

      AEval( ::aCols, { |o| If( o:oBtnList != nil, o:oBtnList:SetFont( o:DataFont ),),;
                            If( o:oBtnElip != nil, o:oBtnElip:SetFont( o:DataFont ),) } )

Please download FWH 25.09 again and it should work fine :)

Many thanks for your great feedback :!:

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion