Page 1 of 1

Setting a Standard

PostPosted: Thu Jul 18, 2013 7:54 pm
by arthursilvestre
Well folks, I need to set a standard for the entire system that is like that.

In my case is the vlthumbtrack of xbrowser.

It comes default false xbrowser in all, I would let him true.

from already thank you

Re: Setting a Standard

PostPosted: Thu Jul 18, 2013 8:45 pm
by sambomb
Defina uma diretiva de compilação para o seu projeto e altere a classe com essa diretiva.

Exemplo:
Diretiva -> __MEUPROJETO__

#IFDEF __MEUPROJETO__
::vlthumbtrack := .T.
#ENDIF

Re: Setting a Standard

PostPosted: Fri Jul 19, 2013 12:56 am
by nageswaragunupudi
arthursilvestre wrote:Well folks, I need to set a standard for the entire system that is like that.

In my case is the vlthumbtrack of xbrowser.

It comes default false xbrowser in all, I would let him true.

from already thank you


Setting lVThumbTrack to .t. works well with fast access data sources. For slow access datasources, it is not desirable to set this data to .t.

For Array and Recordset browses, lVThumbTrack is set to .t. by default in the SetArray() and SetADO() methods, because in both cases the data resides in the memory.

Because it is not possible for xbrowse to decide the data access speeds in case of DBFs the choice is left to the programmer who alone can decide the suitability on the basis of the size of the DBF, location of the file ( local or network ), network speeds etc.

Re: Setting a Standard

PostPosted: Fri Jul 19, 2013 11:41 am
by arthursilvestre
Good morning, I thank everyone's attention.

Sambomb what you said I oughta add prg xbrowse.prg in my project right? But I do not wish it, since I want to avoid that prg's more to be added in my project.

I would like to recompile the lib FiveWin? trough of the source folder? as if someone could give me a light?

thks

Re: Setting a Standard

PostPosted: Fri Jul 19, 2013 12:29 pm
by nageswaragunupudi
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.

Re: Setting a Standard

PostPosted: Fri Jul 19, 2013 1:28 pm
by arthursilvestre
Guys, I got a bat from a topic antonio atraz a few years, but it seems it does not work with the latest versions as FWH not handle all functions, dabe someone say something?

follows the bat:

Code: Select all  Expand view

for %%f in (*.prg) do c:\xhb121\bin\harbour %%f /n /ic:\fwh.13.02\include;c:\xhb121\include
for %%f in (*.c) do c:\bcc582\bin\bcc32 -c -Ic:\bcc582\include;c:\xhb121\include %%f
for %%f in (*.obj) do c:\bcc582\bin\tlib fiveh.lib -+ %%f /0 /P32,,
 

Re: Setting a Standard

PostPosted: Fri Jul 19, 2013 2:31 pm
by Antonio Linares
Arthur,

If you run that batch file on source/classes, source/function and source/winapi, you will rebuild the library, except some internals modules whose source code is not provided, so you can not erase the lib and rebuild it from scratch, but you can update it as many times as needed.