Page 1 of 1
undefined object button in Xbrowse in RecalWH method
Posted: Sat Nov 22, 2025 6:06 pm
by mauri.menabue
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
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
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.
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sat Nov 22, 2025 7:28 pm
by Antonio Linares
Please copy here the error that you get, thanks
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sat Nov 22, 2025 8:57 pm
by mauri.menabue
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
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sun Nov 23, 2025 4:54 am
by Antonio Linares
Dear Mauri,
Please download FWH 25.09 again and try it again
many thanks for your feedback
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sun Nov 23, 2025 10:30 am
by mauri.menabue
Hi Antonio,
I downloaded the last build of FWH, the error in object persist, xbrowse.prg is not changed.
Thanks
Maurizio Menabue
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sun Nov 23, 2025 5:52 pm
by Antonio Linares
Dear Mauri,
Could you provide a small PRG to reproduce the error ?
many thanks
Re: undefined object button in Xbrowse in RecalWH method
Posted: Sun Nov 23, 2025 10:35 pm
by mauri.menabue
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.
Code: Select all | Expand
#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})
-
Re: undefined object button in Xbrowse in RecalWH method
Posted: Mon Nov 24, 2025 7:02 am
by Antonio Linares
Bug fixed:
In xbrowse.prg line 10008 METHOD ReCalcWH() apply this change:
Code: Select all | Expand
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 