I now give here my changes to cFooter. I shall follow up with changes for font.
- Code: Select all Expand view
/*
xbrfooter.prg
inhertited class to deal with footer codeblocks
if a few changes are made in the orginal
source, this is not necessary
*/
#include "FiveWin.ch"
#include "InKey.ch"
#include "xbrowse.ch"
#ifdef __XPP__
#define Super ::TControl
#define New _New
#endif
//-------------------------------------------------------------------------//
CLASS TXBRColFt FROM TXBrwColumn
DATA uFooter HIDDEN
METHOD cFooter SETGET
// FOR Comaptibilty with the recent change in FWH
// if the FWH code is reverted to previous code
// this bfooter method is not necessary
METHOD bFooter SETGET
ENDCLASS
//-------------------------------------------------------------------------//
METHOD cFooter( uNew ) CLASS TXBRColFt
LOCAL cFooter
IF PCOUNT() > 0
::uFooter := uNew
ENDIF
IF ::uFooter != NIL
cFooter := IIF( VALTYPE( ::uFooter ) == 'B', EVAL( ::uFooter ), ::uFooter )
IF VALTYPE( cFooter ) != 'C'
cFooter := TRANSFORM( cFooter, ::cEditPicture )
ENDIF
ENDIF
RETURN cFooter
//------------------------------------------------------------------------//
METHOD bFooter( uNew ) CLASS TXBRColFt
IF PCOUNT() > 0 .AND. VALTYPE( uNew ) == 'B'
::uFooter := uNew
ENDIF
// returning nil to avoid evaluation of the block in the paint method
// if the code in paint method is reverted to previous code
// old code : cFooter := ::cFooter <-- this is better
// then we can drop bFooter data and methods
// cfooter can be assigned a value or codeblock
RETURN NIL
//-----------
Actually if we use the TXBrowse version prior to 7.12, the bFooter data / method is not necessary.
I adopted this apporach so that we do not have t o make too many changes in the original source. No dangers of breaking the original code even inadverttantly.
Also there is a minor issue with the 7.12 implementation of bFooter. Even after assigning the oBrw:lFooters := .T., if we do not scpecify Char value to atleast one cFooter, footers are not shown, To do that, we need to change code in many methods like for bRowFont. So was the need for me for this change.