Better way is to use your own derived class for all your projects.
Actually we advise not to use TXBrowse class directly. But to have your own derived class and use it across your projects. That's what I do too.
A template for the derived class is given in \fwh\samples\xbrchild.prg.
- Code: Select all Expand view
#include "fivewin.ch"
#include "xbrowse.ch"
//------------------------------------------------------------------//
CLASS MyBrowse FROM TXBrowse
CLASSDATA lRegistered AS LOGICAL // This is compulsory for derived classes
DATA bColClass INIT { || MyXBrCol() }
METHOD New( oWnd ) CONSTRUCTOR
ENDCLASS
METHOD New( oWnd ) CLASS MyBrowse
Super:New( oWnd )
::lVThumbTrack := .t.
return Self
//------------------------------------------------------------------//
CLASS MyXbrCol FROM TXBrwColumn
ENDCLASS
We include this module in our project and then at the beginnning of the function Main()
- Code: Select all Expand view
function Main()
<code>
SET XBROWSE TO MyBrowse()
<other code>
After this there is no need for any change in the code in the project.
All commands like @ r,c, XBROWSE, REDEFINE XBROWSE, XBROWSER, etc will use our personal derived class instead of the main xbrowse.
We can choose our favourite naem for the derived class instead of MyBrowse.
Notes:
1. There need not be any change in the code if COMMAND syntax is used.
2. In Ooops syntax, we need to use TXBrows():New( oWnd ) instead of TXBrowse():New(). (Advised in whatsnew.txt and in the forums years back)
3. In all RC files we need to use MyBrowse instead of TXBrowse
4. Name of the derived class should contain "browse" as part of the name for older versions.