New FTDN August / Agosto 2008 (8.08)

New FTDN August / Agosto 2008 (8.08)

Postby Antonio Linares » Wed Aug 20, 2008 6:23 pm

August 2008
===========

* Fix: Class TDbCombo minor change in Method KeyChar().

* New: An interesting example showing how to manage a non modal dialogbox from a Tree. Please review samples\TestTre4.prg

* New: An interesting example showing how to dinamically change the alias of a xbrowse in runtime. Please review samples\XBrwAlias.prg.

* New: An interesting example showing how to use a folder with two XBrowses working on arrays, with different editing capabilities in each one. Please review samples\FoldXBrw.prg.

* New: FWPPC, Class TControl Method GetDlgCode(). Now controls can set its DATA nDlgCode and its properly processed, the same way as in FWH.

* New: FWPPC: OleAuto support is already available for FiveWin for Pocket PC. You can use CreateObject() or TOleAuto():New().

* Enhancement: Class TXBrowse Method KeyDown() and KeyChar() have been modified so pressing escape will cancel a current editing operation but will not close the container dialog.

* New function SetDialogEsc( lOnOff ) lets you control if your applications dialogs could be closed pressing ESC. FiveWin allows this behavior by default. In case that you want to change it, simply call SetDialogEsc( .F. ) from the beginning of your application. SetDialogEsc() also returns the
previous state, so you can store it and change it dynamically along the execution of your application.

* New: An interesting example showing how to build a values inspector using a TXBrowse object. Please review samples\Inspect.prg

* New: Class TComboBox DATA lIncSearch, false by default, lets use or not the incremental search. When lIncSearch is .F., then Class TComboBox uses Windows API standard behavior.

* New: New clauses ACTION ... [ BITMAP ... ] for GETs. FiveWin automatically creates a themed button on the GET which fires an ACTION, and you can change the GET contents from it too. Please review samples\getbtn.prg and getbtnr.prg. No need to change your current resources files! :-)

* New: REDEFINE SAY ... TRANSPARENT already available. No need to declare a variable to hold the SAY object to set its transparency.

* New: A new example showing how to use gradient colors with dialogs and folders. Please review samples\FoldGrad.prg

* New: In the folder FWH\UEStudio we have included the config file to build applications using xHarbour and FWH. Previously only Harbour config file was provided.

* Fix: Class TButton Method Click() was not properly setting the focus before to executing its action.

* New: font.ch, added STRIKEOUT clause for creation of fonts

* New: font.prg new Methods: Bold( lOnOff ), Italic( lOnOff ), UnderLine( lOnOff ), StrikeOff( lOnOff ), Escapement( nNew ), Rotate( nRotateBy ), Modify( lBold, lItalic, lUnderline, lStrikeOut, nNewEsc ) return new font object with the modification.

Example:

DEFINE FONT oFont NAME 'ARIAL' SIZE 0,-10
oFontB := oFont:Bold() // defaults to .t.
oFontS := oFont:StrikeOut( .t. )
oFontLeft := oFont:Escapement( 2700 )
oFont2 := oFont:Rotate( 900 )

Overloaded "==": oFont1 == oFont2 --> .t. or .f.

* Enhancements in BUTTONBAR:

- Improvement: Bar is painted properly in 2007 style, irrespective of l3D setting.

- Fix: In 2007 style, position of buttons was shifted by 8 pixels to the right after any readjustment/relocation of the bar. Now fixed.

- Improvement: Change of gradient colors at runtime are now propagated to buttons also, unless a different gradient is assigned to the button.

* Enhancements in BTNBMP:

- New: 2007 style :Individual buttons can now be created with 2007 style. Default gradient colors can be overridden by assinging new gradient colors and can be changed at runtime.

- Bitmaps can be positioned TOP, LEFT, RIGHT, BOTTOM in 2007 style also. This works for both buttons on bars and individual buttons

* Class TDataBase:

1) Improved New( [ncArea], [cDbfFile], [cDriver], [lShared], [lReadOnly] )
TDataBase():new() or TDataBase():New( nSelectArea ) works the same way as in the earlier versions with an already open dbf.

(a) TDataBase():New( cAlias ) also works on an already open dbf.
(b) New method called with 2 or more paramters constructs the instance without opening the table. Use() method should be used to open the table.
(c) cDriver, lShared and lReadOnly default to RddSetDefault(), !Set(_SET_EXCLUSIVE) and .f.

2) New() can be called with 0 or "" as the only parameter to instantiate an object without assigning any table. Data cFile, etc. can be directly assigned and Use() can be called to open the table.

3) New Method Use() to Open table specfied with New(..) method or by directly assigning datas

4) New method Open( ... ) with the same parameters is equivalent to calling New() and use() methods. Success of opening the table can be checked with Used() method.

5) Datas cFile, lShared, lReadOnly, cDriver return the correct values if the table is opened and otherwise use the values assigned to Open the file.

6) Improved: RecLock( nRecNo ) now uses DBRLock(), to facilitate additive record locking.

7) New: RecUnLock( [nRecNo] ): If nRecNo is specified, unlocks the specified record only and otherwise unlocks all records.

8) New:IsRecLocked( nRecNo ): Returns true if the specifed record is locked or the tentire file is locked.

9) Delete, Recall, FieldPut, Save methods locks the record automatically if not already locked. After the action, the record is left in the original locked condition before calling the method.

10) New Methods: KeyNo, KeyGoTo( nKey ), KeyCount() are mapped to OrdkeyNo, OrdkeyGoTo, OrdkeyCount()

11) Improved: Blank(): Now uses uValBlank to improve speed.

12) Improved: DBEval() now works without having to save and restore lBuffer values.

13) New Method: RollBack(): In (x)Harbour applications, this command rollsback uncommited changes to DBF and in all cases it reloads the buffer, cancelling the changes made to the buffer (Equivalent to calling :Load() )

14) Modified(): Returns .t. only when :lBuffer is true and buffered values are different from the dbf field values

15) New Method: Updated(): Returns .t. when either Modified() is true or any dbf fields are changed but not yet committed. RollBack() can be called to restore the original record.

16) Improved: SetRelation( cnoArea, cExp, [lScoped] ). First parameter can be another tdatbase object. Added new optional parameter lScoped ( defaults to .f. )

17) SetFilter( <cFilter> )

Class TXBrowse:

1) Improved Refresh(): Now Refresh method checks if the current record is deleted and if deleted, repositions the display row to the next record. If the deleted record is the last record, the row is positioned on the last record. This applies only to RDDs. XBrowse is the only browse at present doing this automatically.

2) ReArrangeCols( aSeq, lRetainRest )
This method is useful to rearrange the order of selected columns to appear in the beginning, after creating a browse ( very likely after including all columns automatically ). if the second parameter is true ( default ) remaining columns are retained after the given sequence and otherwie the remaining columns are totally deleted.
aSeq is an array containing either Headers or Creationorder of the columns and they can be intermixed.

3) New Method: CurrentRow() returns an object containing values of the row at the time of call. Even for some unexpected reasons the browse navigates to any other row, the values returned by the object remain static. The values of the object can be accessed and assigned with the names of headers, eg: oRow:First, oRow:City, etc.

In addition, the row object provides the following data and methods:

DATA:
oBrw .. Parent XBrowse object
nRecNo .. RecordNo ( In case of ADO BookMark )
nKeyNo .. OrdKeyNo ( In case of ADO AbsolutePosition )
aHeaders.. Array of Headers
aOriginals Array of Values of columns at the time of creation of the object
Values of this array may not be changed by the programmer directly aValues .. Array of Values ., These values can be changed / edited in dialog
bSave .. User provided optional codeblock, which is evaluated with oBrw as parameter while executing the Save method

METHODS:
1. Modified() . Returns .t. if the data is edited / changed. This can be used for enabling or disabling Save / Undo buttons.
2. Undo() .. Copies original values to aValues, undoing any edit / changes to values
3. Save() .. Repositions the data source to nRecNo, if necessary, and saves modified data. For saving data, this method compares the edited values with the originals and evaluates bOnPostEdit block if defined and
if bOnPostEdit is nil, evaluates bEditValue ( in case this is a setget block ) only for the changed values. After evaluating for each column, the bSave codeblock is evaluated if provided, where the user can specify any other logic. Since this method saves data only if different from the original values and only the changed values, the programmer need not include logic to check if the data is edited.

Locking and unlocking is automatically taken care by evaluating oBrw:bLock and oBrw:bUnlock data.

The purpose of this method is to provide data of the browse for editing in dialogs, which will not change even in the rare circumstances of the browse getting refreshed due to unexpected reasons.

This object can not be directly created by the user, since the class is declared static to xbrowse.prg. It is not also desirable.

4) Displaying xBrowse without defining any columns was resulting in runtime error. Now in such cases, one blank column displayed, avoiding runtime error.

5) Improvements to SetODbf():
(a) New 4th parameter lAutoCols, defaults to .f. f the object has data cAlias and nArea or oRs or oRecSet, lAutoCols can be used optionally to add all column data automatically to the browse.

(b) If the data object has defined methods 'KeyNo', 'KeyGoTo', 'KeyCount', these methods are used for browse navigation consistant with SetRDD and SetADO methods. Revised TDataBase class maps these methods to OrdKeyNo,
OrdKeyGoTo and OrdKeyCount. In case of DataClasses for ADO RecordSets, defining the 'Key' methods to be based on AbsolutePosition and 'Rec' methods to be based on BookMark give the proper results for browse.

6) XBrowse function Improvements:
XBrowse function works as Quick XBrowse of any datasource. By using the third paramter bSetUp, full power of xBrowse can be exploited. Syntax:
XBrowse( [uData], [cTitle], [lAutoSort], [bSetUp], [bSelect] )

(a) Now XBrowse function works with TDatabase ( or similar objects ) also.
(b) By default XBrowse function provides three buttons Print, Excel and Close. If a fifth parameter bSelect is specified, 'Select' button also is displayed and when pressed bSelect codeblock is evaluated with oBrw and SelectedCol as parameters. This is useful to make Quick Pick Lists from any datasource.

* New: Class TTreeItem: New data bAction added. Now the action defined by TREEITEM command is assigned to this data.

* Fix: Class TTimePick now displays Time properly and returns correctly formatted time value.

* New: XBROWSE Commands:

1. @ 0,0 XBROWSE and REDEFINE XBROWSE:
Now list of columns, fields, headers, etc. can also be specified as arrays in line or array variables can be used. Example:
REDEFINE XBROWSE <clauses> HEADERS 'First', 'Last', ....

can also be written as

REDEFINE XBROWSE <clauses> HEADERS aHdrs .... ( where aHdrs := { 'First', 'Last', .... } )

This applies to all lists in xbrowse creation commands.

2. New command: XBROWSER
Very quick way to create xbrowse of any data and picklists. This is the command syntax using the XBrowse( ... ) function. This command automatically creates appropriate dialog and presents the fully functional browse.

Syntax:
XBROWSER [ <cAlias>/<oDbf>/<oRs>/<aArray> ] ; // defaults to active alias
[ TITLE <cTitle> ] ;
[ AUTOSORT ] ; // default false
[ SETUP <fnSetUp(oBrw)> ] ; // optional function for user specified setup
[ COLUMNS <listof columns> ] ; // optionally specify columns to be shown
[ SELECT <fnSelect(oBrw,oCol)> ] // optional function for pick lists

Examples:

1. Use Sales
XBROWSER // shows xbrowse of Sales table in a dialog
or
XBROWSER 'Sales'

2. Use Customer
DATABASE oDbf

XBROWSER oDbf TITLE 'Customers' ;
SETUP oBrw:SetBackGround( '\fwh\bitmaps\backgrnd\beige2.bmp' ) ;
COLUMNS 'State', 'City', 'First'

3. To create a quick pick list

USE States

XBROWSER TITLE 'Select State' SELECT cState := Field->State

or

States->( XBrowse( , 'Select State', , , , { || cState := States->State } ) )

This creates a browse of States.dbf and presents in a dialog sized to fit the width of browse at the center of the screen, with buttons 'Select' and 'Close'. Click on 'Select' button evaluates the bSelect codeblock.

* New: functions nRGBReset( nClr, nRed, nGreen, nBlue ) and nRGBAdd( nClr, nRed, nGreen, nBlue ) New colors can be derived from existing colors by chaging or modifiying individual color components.

* Enhancement: Improved cGenPrg() methods in TFont and TBrush.

* New: cClrtoChar( uClr ) this function accepts any color constant, color pair array, array of color gradient or codeblock evaluating to any of the above and generates compilable code.
Last edited by Antonio Linares on Sat Sep 06, 2008 2:15 pm, edited 1 time in total.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Fri Aug 29, 2008 7:22 am

Agosto 2008
=========

* Corrección: Pequeño cambio en el método KeyChar() de la clase TDbCombo.

* Nuevo: Un ejemplo interesante que muestra como manejar cajas de diálogo no modales desde un árbol "Tree". Por favor, revisa el ejemplo samples\TestTre4.prg.

* Nuevo: Un ejemplo interesante que muestra como cambiar dinámicamente el alias de un "xbrowse" en tiempo de ejecución. Por favor, revisa el ejemplo samples\XBrwAlias.prg.

* Nuevo: Un ejemplo interesante que muestra el uso de carpetas con dos "XBrowses" trabajando con matrices, con diferentes capacidades de edición en cada uno de ellos. Por favor, revisa el ejemplo samples\FoldXBrw.prg.

* Nuevo: En FWPPC, método GetDlgCode() en la clase TControl. Ahora los controles pueden establecer su DATA nDlgCode y procesarla correctamente, de la misma manera que en Fivewin para Harbour.

* Nuevo: En FWPPC, ya está disponible el soporte de OleAuto en Fivewin para Pocket PC. Puedes usar CreateObject() ó TOleAuto():New().

* Mejora: Se han modificado los métodos KeyDown() y KeyChar() de la clase TXBrowse para que al presionar la tecla ESC se cancelará la operación actual de edición pero no se cerrará el diálogo contenedor.

* Nuevo: Nueva función SetDialogEsc( lOnOff ), esta te permite controlar si los diálogos se podrían cerrar pulsando la tecla ESC. Fivewin permite por defecto este comportamiento. En caso de que quieras cambiarlo, sólo tendrás que llamar a SetDialogEsc (.F. ) en el comienzo de tu aplicación. Esta función también devuelve el estado previo, así que puedes almacenarlo y cambiarlo dinámicamente a lo largo de la ejecución de la aplicación.

* Nuevo: Un ejemplo interesante que muestra como construir un inspector de valores usando un objeto TXBrowse. Por favor, revisa el ejemplo samples\Inspect.prg.

* Nuevo: La DATA lIncSearch de la clase TComboBox es puesta a "FALSO" por defecto, permite el uso o nó de la busqueda incremental. Cuando lIncSearch es ".F.", entoces la clase TComboBox usa el comportamiento estandar del API de Windows.

* Nuevo: Nuevas clausulas ACTION ... [ BITMAP ... ] para los GETs. Fivewin automáticamente crea un botón con "temas" en el GET que lanza
una acción "ACTION", y puedes cambiar el contenido del GET también. Por favor, revisa los ejemplos samples\getbtn.prg y getbtnr.prg.
No necesitas cambiar tus ficheros de recursos actuales. Sonrie ;-)

* Nuevo: Ya disponible REDEFINE SAY ... TRANSPARENT. No necesitas declarar una variable para mantener el objeto SAY al establecer su transparencia.

* Nuevo: Un ejemplo que muestra como usar gradiente de colores con diálogos y carpetas. Por favor, revisa el ejemplo samples\FoldGrad.prg.

* Nuevo: En la carpeta FWH\UEStudio hemos incluido ficheros de configuración para construir aplicaciones usando xHarbour y FWH. Anteriormente sólo se proporcionaban estos ficheros para su uso con Harbour y FWH.

* Corrección: Del método Click() de la clase TButton, antes no ajustaba correctamente el foco antes de ejecutar su acción.

* Nuevo: En font.c, se ha añadido la clausula STRIKEOUT para la creación de fuentes.

* Nuevo: En font.prg nuevos métodos: Bold( lOnOff ), Italic( lOnOff ), UnderLine( lOnOff ), StrikeOff( lOnOff ), Escapement( nNew ),
Rotate( nRotateBy ), Modify( lBold, lItalic, lUnderline, lStrikeOut, nNewEsc ) devuelven el nuevo objeto fuente con la modificación.

Ejemplo:

DEFINE FONT oFont NAME 'ARIAL' SIZE 0,-10
oFontB := oFont:Bold() // defaults to .t.
oFontS := oFont:StrikeOut( .t. )
oFontLeft := oFont:Escapement( 2700 )
oFont2 := oFont:Rotate( 900 )

Overloaded "==": oFont1 == oFont2 --> .t. or .f.

* Mejoras en BUTTONBAR:

- Mejora: La barra "Bar" se pinta correctamente con el estilo 2007, independientemente de la fijación de l3D.

- Corrección: Con el estilo 2007, la posición de los botones estaba cambiada 8 pixeles a la derecha después de cualquier reajuste/recolocación de la barra. Ahora corregido.

- Mejora: El cambio de gradiente de colores en tiempo de ejecución ahora también se propaga a los botones, a menos que otro gradiente se asigne al botón.

* Mejoras en BTNBMP:

- Nuevo: Estilo 2007. Los botones se pueden crear independientemente con el estilo 2007. El gradiente de colores por defecto se puede cambiar asignando un nuevo gradiente de colores y se puede cambiar en tiempo de ejecución.

- Los "Bitmaps" ó "Mapas de bits" se pueden posicionar TOP, LEFT, RIGHT, BOTTOM con el estilo 2007 también. Esto funciona con los botones en las barras o con botones individuales.

* Clase TDataBase:

1) Mejora: New( [ncArea], [cDbfFile], [cDriver], [lShared], [lReadOnly] )
TDataBase():new() or TDataBase():New( nSelectArea ) funciona de la misma manera que en versiones anteriores con dbfs ya abiertas.

(a) TDataBase():New( cAlias ) también funciona con dbfs ya abiertas.
(b) El método New llamado con 2 o más parámetros construye la instancia sin abrir la tabla.El método Use() se debería usar para abrir la
tabla.
(c) cDriver, lShared y lReadOnly son puestos por defecto en RddSetDefault(), !Set(_SET_EXCLUSIVE) y .f.

2) New() puede ser llamdo co 0 ó "" como los únicos parámetros para instanciar un objeto sin asignar ninguna tabla. La DATA cFile, etc... pueden ser directamente asignadas y Use() puede ser llamada para abrir la table.

3) Nuevo método Use() para abrir la tabla especificada con el método New(..) ó por la signación directa de datas.

4) Nuevo método Open( ... ) con los mismos parámetros es equivalente a llamar a los métodos New() y Use(). El éxito de la apertura de la tabla se puede comprobar con el método Used().

5) Las DATAS cFile, lShared, lReadOnly, cDriver devuelven los valores correctos si la tablas es abierta en otro caso se usan los valores
asignados para abrir el fichero.

6) Mejora: RecLock( nRecNo ) ahora usa la función DBRLock(), para facilitar el bloqueo aditivo de registros.

7) Nuevo: RecUnLock( [nRecNo] ): Si se especifica nRecNo, desbloquea el registro especificado en otro caso desbloquea todos los registros.

8) Nuevo: IsRecLocked( nRecNo ): Devuelve .T. si el registro especificado está bloqueado ó el fichero completo está bloqueado.

9) Los métodos Delete, Recall, FieldPut, Save bloquean el registro automáticamente si no está ya bloqueado. Después de la acción, el registro se deja en el estado original de bloqueo antes de llamar al método.

10) Nuevos métodos: KeyNo, KeyGoTo( nKey ), KeyCount() son mapeados a OrdkeyNo, OrdkeyGoTo, OrdkeyCount()

11) Mejora: Blank(): Ahora usa uValBlank para mejorar la velocidad.

12) Mejora: DBEval() ahora funciona sin grabar y restaurar los valores de lBuffer.

13) Nuevo: Método RollBack(): En aplicaciones (x)Harbour, deshace los cambios en la DBF y en todos los casos se volverá a cargar el buffer,
cancelando los cambios hechos en el buffer. ( Equivalente a llamar a :Load() ).

14) Modified(): Devuelve .T. sólo cuando :lBuffer es .T. y los valores almacenados en el buffer son diferentes que los valores de lo campos de la DBF.

15) Nuevo: Método Updated(): Devuelve .T. cuando Modified() es .T. ó cualquiera de los campos de la DBF ha sido cambiado pero no han sido
grabados. RollBack() puede ser llamada para restaurar el registro original.

16) Mejora: SetRelation( cnoArea, cExp, [lScoped] ). El primer parámetro puede ser otro objeto TDatabase. Añadido un nuevo parámetro opcional
lScoped ( Por defecto a .F. )

17) SetFilter( <cFilter> )

Clase TXBrowse:

1) Mejora: En el método Refresh(), ahora comprueba si el registro actual está borrado (marcado para borrar) y si está borrado se reposiciona en el siguiente registro. Si el registro borrado es el último, se reposiciona en el último registro. Esto es sólo aplicable a los RDDs. XBrowse es el único "browse" que hace esto automáticamente.

2) ReArrangeCols( aSeq, lRetainRest )

Este método es útil para reordenar el orden de las columnas seleccionadas que aparecen al principio, después de la creación del "browse" (incluyendo todas las columnas automáticamente). Si el segundo parámetro es .T. (por defecto) el resto de las columnas se mantienen después de la secuencia dada en otro caso el resto de las columnas serán eliminadas.

aSeq es una matriz que contiene las cabeceras ó el orden de creación de las columnas y se pueden entremezclar.

3) Nuevo: método CurrentRow(), devuelve un objeto conteniendo la fila en el momento de la llamada. Incluso por algunas razones inesperadas al
navegar por cualquier otra fila, los valores devueltos por el objeto permanecen estáticos. Los valores del objeto pueden ser accedidos y
asignados con los nombres de las cabeceras, por ejemplo: oRow:First, oRow:City, etc...

Además, la fila objeto proporciona las siguientes "datas" y métodos:

DATA:
oBrw .. Objeto XBrowse padre
nRecNo .. RecordNo ( En el caso de ADO BookMark )
nKeyNo .. OrdKeyNo ( En el caso de ADO AbsolutePosition )
aHeaders.. Matriz con las cabeceras
aOriginals.. Matriz con los valores de las columnas en el momento de la creación del objeto
Los valores de esta matriz no los puede cambiar el programador directamente
aValues .. Matriz con valores "values", estos valores pueden ser cambiados/editados en un diálogo
bSave .. Bloque de código opcional proporcionado por el usuario, el cual es evaluado con oBrw como parámetro mientras se ejecuta el método Save

METHODS:
1. Modified() .. Devuelve .T. si el dato es editado/cambiado. Esto puede ser usado para activar o desactivar los botones Save / Undo.
2. Undo() .. Copia los valores originales a la matriz aValues, deshaciendo cualquier cambio/edición en los valores.
3. Save() .. Recoloca la fuente de datos para nRecNo, si es necesario, y guarda los datos modificados. Para guardar los datos, este método compara los valores editados con los originales y evalua el bloque de código bOnPostEdit si está definido y si OnPostEdit es nulo, evalua bEditValue (en este caso es un bloque setget) sólo para el cambio de valores. Después de evaluar cada columna, se evalua el bloque de código bSave si es proporcionado, donde el usuario puede especificar cualquier otra lógica. Dado que este método salva los datos sólo si no coinciden con los valores originales y sólo los cambios, el programador no necesita incluir lógica, para comprobar si el dato es editado.

El bloqueo y desbloqueo se hace de manera automáticamente al evaluar oBrw:bLock y oBrw:bUnlock.
El propósito de este método es proporcionar datos del "browse" para su edición en diálogos, los cuales no se cambiarán incluso en raras circustancias de tener refrescos debido a razones inesperadas.

Este objeto no puede ser creado directamente por el usuario, ya que la clase se declara estática en xbrowse.prg. No es deseable.

4) Mostrando un "xBrowse" sin definir ninguna columna, está dando lugar a un error en tiempo de ejecución. Ahora en estos casos, se muestra una
columna en blanco, evitando el error en tiempo de ejecución.

5) Mejoras a SetODbf():

(a) Nuevo cuarto parámetro lAutoCols, por defecto es .F., el objeto tiene las datas cAlias y nArea o oRs o oRecSet, lAutoCols puede ser usado
opcionalmente para añadir todas las columnas al "browse".

(b) Si el objeto ha definido los métodos 'KeyNo', 'KeyGoTo', 'KeyCount', estos métodos se usan para navegar por el "browse" en consonancia con
los métodos SetRDD y SetADO. En el caso de las clases de datos para recordsets de ADO, definir los métodos "Key" para que esten basados en
la posición absoluta "AbsolutePosition" y los métodos "Rec" para que esten basados en los "BookMarks" proporcionan los resultados adecuados
para el browse.

6) Mejora la función XBrowse:

La función XBrowse(), crea un "Browse" rápidamente desde cualquier fuente de datos. Pero si usamos el tercer parámetro bSetUp, accedemos a
todo el poder de los xBrowse. Sintáxis:

XBrowse( [uData], [cTitle], [lAutoSort], [bSetUp], [bSelect] )

(a) Ahora la función XBrowse() funciona también con TDatabase ( u objetos similares).
(b) Por defecto la función XBrowse() proporciona tres botones Print, Excel y Close. Si se especifica el quinto parámetro bSelect, se muestra también el botón 'Select' y cuando es pulsado el bloque de código bSelect es evaluado con oBrw y SelectedCol como parámetros. Esto es útil para hacer las listas de selección rápida desde cualquier fuente de datos.

* Nuevo: Se ha añadido la data bAction a la clase TTreeItem. Ahora la acción definida por el comando TREEITEM es asignada a esta data.

* Corrección: La clase TTimePick ahora muestra correctamente el tiempo y develve el valor del tiempo correctamente formateado.

* Nuevo: Comando XBROWSE:

1. @ 0,0 XBROWSE y REDEFINE XBROWSE:

Ahora la lista de columnas, campos, cabeceras, etc puede especificarse como una matriz en línea o se puede utilizar una matriz de variables.
Ejemplo:

REDEFINE XBROWSE <clauses> HEADERS 'First', 'Last', ....

puede ser escrito como

REDEFINE XBROWSE <clauses> HEADERS aHdrs .... ( where aHdrs := { 'First', 'Last', .... } )

Esto se aplica a toda la lista de comandos de creación en xBrowse.

2. Nuevo comando: XBROWSER

Una manera muy rápida de crear un "browse" de cualquier tipo de dato y lista de selección. Esta es la sintáxis usando la función XBrowse( ... ).
Este comando crea automáticamente el diálogo apropiado y presenta un completo y funcional "browse".

Sintáxis:
XBROWSER [ <cAlias>/<oDbf>/<oRs>/<aArray> ] ; // por defecto los "alias" activos
[ TITLE <cTitle> ] ;
[ AUTOSORT ] ; // por defecto .F.
[ SETUP <fnSetUp(oBrw)> ] ; // función opcional para la configuración especificada por el usuario
[ COLUMNS <listof columns> ] ; // opcionalmente especifica las columnas que se mostrarán
[ SELECT <fnSelect(oBrw,oCol)> ] // función opcional para las listas de selección

Ejemplos:

1. Use Sales

XBROWSER // muestra un "browse" con los datos de la tabla Sales en un diálogo
ó
XBROWSER 'Sales'

2. Use Customer
DATABASE oDbf

XBROWSER oDbf TITLE 'Customers' ;
SETUP oBrw:SetBackGround( '\fwh\bitmaps\backgrnd\beige2.bmp' ) ;
COLUMNS 'State', 'City', 'First'

3. Crear una lista de selección rápida

USE States

XBROWSER TITLE 'Select State' SELECT cState := Field->State

o

States->( XBrowse( , 'Select State', , , , { || cState := States->State } ) )

Esto crea un "Browse" de la tabla States.dbf y muestra en un diálogo ajustado al ancho del "browse" en el centro de la pantalla, con los botones
'Select' y 'Close'. Pulsando en el botón 'Select' se evalua el bloque de código bSelect.

* Nuevo: Las funciones nRGBReset( nClr, nRed, nGreen, nBlue ) y nRGBAdd( nClr, nRed, nGreen, nBlue ). Nuevos colores pueden obtenerse a partir de los colores existentes cambiando o modificando los componentes individuales del color.

* Mejora: Mejoras en el método cGenPrg() de las clases TFont y TBrush.

* Nuevo: Nueva función cClrtoChar( uClr ).

Esta función acepta cualquier color constante, matriz de par de colores, matriz de degradado de color o bloque de código evaluando cualquiera de
las anteriores y genera código compilable.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to WhatsNew / Novedades

Who is online

Users browsing this forum: No registered users and 5 guests