New FTDN September/Septiembre 2019 (FWH 19.09)

New FTDN September/Septiembre 2019 (FWH 19.09)

Postby Antonio Linares » Sun Oct 13, 2019 11:14 am

July/August/September 2019
=========

* TDataRow (FW_Record):

- While reading ADO, memo fields with null values are read
as nil. Now fixed and they are read as "".

- New Data bOnRead: If assigned, the codeblock is executed with Self
as parameter soon after the data is loaded.

- When one of the fields is an array, method Modified() was returning
.t. always. Fixed.

* FWMariaDBConnection:

- New method InTransaction() --> .t. / .f.
Indicates if a transaction is already in progress.
It is desirable to check this before starting a new transaction.
This is compatible with MariaDB server and MySql server versions
before and after 8.0.

- Enhanced method BeginTransaction() --> .t. / .f.
This method starts a new transaction only if no transaction is already in
progress. Returns whether a new transaction is started or not.

- Support for SAVEPOINT (nested transacions). This feature is
available with MariaDB and MySql server verson 5.0.3 and above.

New Methods:
SavePoint( cSavePt )
RollBack( cSavePt )
CommitTransaction( cSavePt )

- Method SaveToDBF() improved.
In case of non-utf connection to the server, fields with
utf8 charset are saved to smaller field length and the
values are truncated. In case of utf connection, fields
with non-utf8 (eg.latin1) are also created with 3 times the
length required.
This is fixed now. The fields are now created with length
that matches the charset of the field.
viewtopic.php?f=3&t=37513&p=224462#p224462

- New method MainTable( cSql ) --> cTableName
Returns the name of the main table from a sql statement using
multiple tables.

- method Execute() enhancement: Calling Execute() with no parameters
immediately after calling Execute( cSql ) returns the structure of
the table.

- Method Explain( cSql, aParams ) was not compatible with the new version of
MySql 8.0 and above. Now this method compatible with both old and new
versions.

- While attempting connection, sql_mode is set to PAD_CHAR_TO_FULL_LENGTH.
It is reported that some older versions of MySql server are not accepting
this setting. In such cases, this setting is made only if there is no error.

- New function FWMARIA_SET_PAD_CHAR_TO_FULL_LENGTH( lSet )
To prevent setting sql_mode to SET_PAD_CHAR_TO_FULL_LENGTH.
viewtopic.php?f=6&t=37663

* FWMariaDB RowSet:
- Recently added new methods First(),Last() as synonyms for
GoTop() and GoBottom() are clashing with some field names
in some tables. These methods are now dropped.

- Method Eval( bAction, [bFor], [bWhile], [nNext], [nRecord], [lRest] )
All codeblocks are evaluated with Self as parameter.
Recordpointer is restored after execution.

- After a requery, if the sql does not contain "order by" clause,
the existing sort order is restored only if the order is on a single
field. Now the order is restored even on multi-field sort asc/desc.

* NEW: FWMariaRowset
BATCHMODE
In the batch mode, all edits, appends and deletes are retained in
the memory only and nothing is written to the database, till
all the changes are written in one call to SaveBatch()

- method SetBatchMode( lSet ) --> new batchmode

- method SaveBatch() --> lSucess
Saves all changes (edits,appends,deletes) to the database. The changes
are saved in a transaction and so either all the changes are saved or
none. If the changes are successfully changed, the rowset is refreshed
with a ReQuery. If not, the error is displayed and the changes are left
as it is for the user to make further changes and save.

- method CancelBatch():
Discards all changes made in the batch mode and the rowset is refrshed
with Requery()

- method IsBatchEdited() --> lYesNo
Returns if any modifications/appends/deletes are made in the batchmode
that are yet to be written to the database

* SAVING WORK AND RESTORING
- At any time, (in cases like losing connection), unsaved work can be saved
to a dbf file with
oRs:SaveWork( cDbfFile )
and close the Rowset.

Later, the work in progress can be opened with oCn:RowSet( cDbfFile ) and
resumed from where left.

* MDI Enhancement:
- MENUINFO menu, with UNICODE chars: fixed

- TMdiFrame class:
New DATA: bDlgSelectChild ( default ::bDlgSelectChild := { || ::DlgSelectChild() } )
For user setup dialog selection child window active.
New METHOD: DlgSelectChild()
Dialog for show list of childs windows
( click in "More Windows" item when the list of windows childs is greater than ten )

* TRichEdt5 Class:
- GPF in method Destroy when open several instances of Richedit5: Fixed

* FW_Record (TDataRow) class:
- Navigation methods GoTop(), GoUp(), GoDown(), GoLast(), GoNew() were
available only when the method Edit() is called. Now, these methods
are available to be used when the record object is created.

* TARRAYDATA (\source\classes\tarrdata.prg)
- Eof() is not being set to .T. when skipped past the last record. Fixed.
viewtopic.php?f=3&t=37514
- Bof() is not being set to .T., when skipped past before the first
record. Fixed.

- Skip( n ) now returns nSkipped records.

- Eval( bAction, [bFor], [bWhile], [nNext], [nRecNo], [lRest] ) --> Self
Extended syntax. All parameters have the same functionality of DBEVAL()
bAction is evaluated with Self as paramter.
After execution record pointer is restored.

- New method FieldDefault( ncFld, uDefaultValue ): The default value
will be used in all appended records.

- Now this class can be used to read a batch of records from a DBF or MYSQL
table. These records can be edited in memory, appended and deleted and
then save (or discard) all changes including additions and deletions
together to DBF or MySql table.

- Method New() now has 3 alternative syntaxes
New( aData, aStruct ) // use simple array
New( [cAlias], [bFor], [bWhile], [nNext], [nRecord], [lRest] ) // DBF
New( oCn, cTable, [cWhere] ) // MySql table
New( oCn, cSql, [aParams] ) // mysql complex queries

- Editing: Fields with types +,=,^ can not be edited. In case of MySql
tables, primary key values of existing records can not be changed, but
newly appended records can be changed.

- Method Load() Alternative syntaxes
Load( [bFor], [bWhile], [nNext], [nRecord], [lRest] ) // DBF
Load( [cWhere] ) // MySql table
Load( [aParams] ) // mysql query
Reloads the data with the new condition / or existing condition
Eg:
oData:Load() // reloads the data using the exsiting bFor/cWhere
oData:Load( "INVNUM=99" / { || "INVNUM=99" } )

- FieldDefault( cField, uValue ) : Uses the default values for all new
appended rows.
Eg:
oData:FieldDefault( "INVNUM", 99 )

- Method SaveData() --> lSuccess: Saves all modifications to all records, appends and
deletes to the DBF/MySql table

In case of MySql, all changes,appends and deletions are saved inside a
transaction. In case of any errors (eg. primarykey/unique viloations), the
error is displayed and the transaction is rolled back. Either all changes are
saved or none.

If :SaveData() is called inside a transaction, then this method uses savepoints.

- New data lAutoAppend. When set to .t., navigation past the end of browse
adds a new row.
- New method Sum( fieldname ) --> sum of the field
Returns zero if the field is not numeric.

* function FW_DbfToExcel(). Enhancement: All values of character fields are
trimmed while exporting to Excel.

* function FW_ArrayToDBF(). When storing into a memo field of DBFCDX, the data
can be an array also.

* XBROWSE:
- New data bArrayData: If specified, evaluated during refresh and resets the
value of aArrayData if the value is not the same.

* HARUPDF:

- New class FWPdf (derived from class TPdf contributed by Mr. Carlos Mora
and improved and adapted for FWH.).
\fwh\source\classes\fwpdf.prg and tpdf.prg

Usage:
oPdf := FWPdf():New( cPdfFileName )
// write text, images, barcodes and other graphics with the same methods
// like Priner class.
oPdf:End() // saves the pdffile and ends the object

- In normal course, it is not necessary to instantiate the object
separately and instead we can use PRINT/ENDPRINT commands to write
portable code.

At present, the command:
PRINT oPrn [PREVIEW] FILE "filename.pdf"
// code
ENDPRINT
will save the printed matter to filename.pdf and display if the
clause PREVIEW is used.
This behaviour will continue.

If TPrinter():lUseHaruPDF is set to .T., and linked with harupdf
by REQUEST FWHARU, the above print command will generate the pdf file
using harupdf.

- With this setting, the command:
REPORT oRep TO FILE ( cPdf )
will create the pdf using Harupdf.

- Present limitations:
- No Unicode support (may not be available soon).
- Some FWH graphics like TGraph, progress bars, charts, etc. which can be
printed on printer can not be output using Harupdf. All such limiatations
will be removed soon.
- Setting alphalevel for images.

- Samples: pdfharu1.prg, pdfharu2.prg

- Linking: Please check samples\build*.bat for the additional libraries
to be linked for different compilers.

* Fix: TPen: When created for a device, hPen is not created for the
corresponding dimension of the device. Now fixed.

* New function MOVETOEX( x, y ) --> { startingX, startingY }

* XImage: bPainted was not working before. Now it works.

* Meter class: Enhancements:
The existing syntax for creating Meter contol is:

@ <nRow>, <nCol> METER [ <oMeter> VAR ] <nActual> ;
[ TOTAL <nTotal> ] ;
[ SIZE <nWidth>, <nHeight> ];
[ OF <oWnd> ] ;
[ <update: UPDATE > ] ;
[ <lPixel: PIXEL > ] ;
[ FONT <oFont> ] ;
[ PROMPT <cPrompt> ] ;
[ <lNoPercentage: NOPERCENTAGE > ] ;
[ <color: COLOR, COLORS> <nClrPane>, <nClrText> ] ;
[ BARCOLOR <nClrBar>, <nClrBText> ] ;
[ <lDesign: DESIGN> ] ;


The meter is displayed as a horizontal bar.
BARCOLOR <nClrBar> (default CLR_BLUE) is used to display the progress.
COLORS <nClrPane> (default oWnd:nClrPane) is used to display the remaining part.
Both the colors need to be RGB color constants.

Enhancements:
1) Both <nClrBar> and <nClrPane> can now be any combination of the
following:
a) Standard RGB colors (present behaviour continues)
b) Alpha colors (transparent) Range 0x01000000 to 0xffffffff
c) Color Gradient (as arrays) consisting of RGB colors and Alpha colors
d) Brush objects of bitmaps/images or any other style
e) Bitmap/Image file or resource.
and
f) Codeblocks returning any colors or gradients. This enables changing
colors during the progress depending on the progress or other variables.

2) PROMPT <cText> can also be a codeblock.

All the codeblocks are evaluated with progress exressed as a fraction
(0.0 to 1.0) as parameter.

3) Fix: UPDATE clause had no effect. Now working

4) New clause BORDER <nBorderClr>
nBorderClr can be an RGB color constant or array of {color,width} or a
Pen Object. If specified, border is drawn around the meter using the
color and thickness.

5) New Optional clause BMPARRAY
If this clause is specified, <nClrBar> and <nClrPane> can be assigned
with bitmap handles or bmp files. The meter will display an array of
5 or 10 of these bitmaps depending on the relative width of the control.
Progress is displayed with the first bitmap and remaining part is
displayed with second bitmap. If only colors are specified, STAR shaped
bitmaps are generated internally and displayed using the colors specified.

Circular Meter:

CIRCULAR [INNERDIA <nDia>] [FILLCOLOR <nInnerColor>]

By default, the appearance is like a pie chart.
If innerdia is specified, either in pixels or as a ratio (0.1 to 0.9) to
the outer diameter, the inner cicle is painted separately with fillcolor.
If no fillcolor is specified, the inner circle is left transparent.

In this case also, the three colors nClrBar, nClrPane and nFillColor can be
a) RGB colors
b) alpha colors
c) gradients of RGB colors (alpha color gradients not supported)
d) Brush objects
e) Images
and also
f) codeblocks returning any color.


Full syntax:
@ <nRow>, <nCol> METER [ <oMeter> VAR ] <nActual> ;
[ TOTAL <nTotal> ] ;
[ SIZE <nWidth>, <nHeight> ];
[ OF <oWnd> ] ;
[ <update: UPDATE > ] ;
[ <lPixel: PIXEL > ] ;
[ FONT <oFont> ] ;
[ PROMPT <cPrompt> ] ;
[ <lNoPercentage: NOPERCENTAGE > ] ;
[ <color: COLOR, COLORS> <nClrPane>, <nClrText> ] ;
[ BARCOLOR <nClrBar>, <nClrBText> ] ;
[ <circ:CIRCULAR> [INNERDIA <nInnerDia> ] ] ;
[ FILLCOLOR <nClrFill> ] ;
[ BORDER <clrBorder> ] ;
[ <bmpArray:BMPARRAY> ] ;
[ <lDesign: DESIGN> ] ;

// nClrBar, nClrPane, nClrFill can be RGB or Alpha color, oBrush,
// hBitmap, aGradient or any Image source( file/resource/webaddress)
// Options CIRCULR and BMPARRAY or mutually exclusve.

Circulr Meter without creating as Control:

It is also possible to draw circular meters, in any window, dialog or
inside any other control, without actually creating a meter contol,
by using this function:

PaintCircularMeter( oWnd, aRect, nInnerDia, nActual, nTotal, aColors, aPen )
viewtopic.php?f=3&t=37806
\fwh\samples\meter01.prg, meter02.prg, meter03.prg

* TBrush:

- New method GdipBrush() --> pBrush (returns GDI+ color or texured brush).
Caller should not destroy the brush. This will be deleted when the brush
object is destroyed.

* TPrinter class Enhancements:
- Textured brushes (image brushes) tiled and untiled are not working properly
on the printer. Now, this is rectified. It is now possible to use alpha
color and alpha gradient brushes also.

- Text with outlined fonts (hollow fonts):
METHOD SayText( nRow, nCol, cText, nWidth, nHeight, oFont, cAlign, nClrText,
nClrBack, cUnits, nOutLineClr, nPenSize )
The last 2 parameters, nOutlineClr and [ nPenSize (default 1)] are added.
If specified, the text is printed with the outline of nOutLineClr with a
thickness of nPenSize. If nClrText is a Brush, the text is filled with the brush.

Command:
@ <nRow>, <nCol> PRINT TO <prn> TEXT <cText> ;
[SIZE <nWidth> [,<nHeight>] ] ;
[<unit: PIXEL,MM,CM,INCHES,SCREEN>] ;
[FONT <fnt>] ;
[ALIGN <aln>] ;
[COLOR <nTxt> [,<nBck> ] ] ;
[OUTLINE <nClr> SIZE <nSize> ] ;
[LASTROW <lrow>] ;

Clauses OUTLINE and SIZE are the new clauses.

- Method RoundBox() was not working correctly. Fixed and enhanced. Methods
Box and Ellipse are also enhanced.

METHOD Box( nTop, nLeft, nBottom, nRight, [uPen], [uBrush], [aText], ;
[cUnits] )
METHOD RoundBox( nRow, nCol, nBottom, nRight, nWidth, nHeight, [uPen], ;
[uBrush], [aText], [cUnits] )
METHOD Ellipse( nTop, nLeft, nBottom, nRight, [uPen], [uBrush], [aText], ;
[cUnits] )
METHOD FillRect( aRect, uBrush, [cUnits] )

uPen: Used for drawing the border. Can be oPen object or Color value or array
of { color, thickness }. Defaults to { CLR_BLACK, 1 }
uBrush: If specified, fills the area. If omitted, the inner area is left
transparent. uBrush can be Brush object, nRGB color or Alpha Color,
Gradient Array with RGB and Alpha colors.
aText: Optional array of { text, font, color }. If specified, prints the
text at the center of the shape
cUnits: Can be "INCHES", "CM", "MM" or "PIXEL". If omitted, defaults to PIXEL.

- New methods:

- METHOD PieChart( aRect, aValues, [aColors], [aPen], [nStartAngle], [cUnits] )
For quickly diplaying a Piechart of values given in aValues array.
aColors: Array of colors or Brush objects. If not specified or if any element
is nil, default colors are used.

- METHOD PrintTable( nRow, nCol, oTable, nWidth, nHeight, [oFont], [lBorder], ;
[cTitle], [cUnits] )
Useful for embedding a simple and small table within a specified area in a ;
print document.
oTable: Data to the displayed as table. Can be specified as an array or
TArrayData object.

- METHOD PrintChart( nRow, nCol, oTable, nWidth, nHeight, cType, [aColors], ;
[cTitle], [cUnits] )
Useful for embedding a simple chart in a specified area in a print document.

oTable: Data to be charted. Can be an array or TArrayData object.
cType: Type of chart. Possible values are
"LINE, BAR, PIE, DOUGHNUT, STACK (Stacked Bar),
STACKL (Stacked bar with first of the series as Line)"

The above methods are also availabe as commands, which are easier to use.
<nRow>, <nCol> PRINT TO <prn> ;
      [<ctype: BAR,LINE,STACK,STACKL,PIE,DOUGHNUT>] CHART <otbl> ;
      [SIZE <nWidth> [,<nHeight>] ] ;
      [COLORS <aClrs> ] ;
      [TITLE <title> ] ;
      [<unit: PIXEL,MM,CM,INCHES,SCREEN>] ;

<nRow>, <nCol> PRINT TO <prn> TABLE <otbl> ;
      [SIZE <nWidth> [,<nHeight>] ] ;
      [FONT <ofnt>] ;
      [<lBorder:BORDER>] ;
      [TITLE <title> ] ;
      [<unit: PIXEL,MM,CM,INCHES,SCREEN>] ;

* GDI+. New GDO+ functions contributed by Mr. Antonio Perricone.
see \fwh\source\winapi\gdiplus.cpp.

* New: TProgressWheel class contributed by Mr Silvio, adapted with
needed modifications. This is another circulr meter class completely
based on GDI+. (not available for some compilers like xhb.com)

Command:
<nRow>, <nCol> WHEELMETER <oMeter> ;
[ <wnd: OF, DIALOG, WINDOW> <oWnd> ]
[ <pos: POS, POSITION> <nPos> ] ;
[ RANGE <min>, <max> ] ;
[ INNERCOLOR <nColorInner> ] ;
[ ANIMACOLOR <nColorDoneMin> ] ;
[ BACKCOLOR <nColorRemain> ] ;
[ INNERDIA <nInnerDia> ] ;
[ <pixel: PIXEL> ] ;
[ <design: DESIGN> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <prmt:TEXT,PROMPT> <cPrompt> ] ;
[ TEXTCOLOR <nColorText> ] ;
[ <lNoPercentage: NOPERCENTAGE > ] ;
[ FONT <oFont>]

<nColorInner>: Color to paint inner circle, default CLR_GRAY. Can be a
RGB or Alpha color.
<nColorDone>, <nColorRemain>: Default: GRAY,RED. Can specify any RGB
color, Alpha color, Color Gradient containing both normal and alpha
colors, or a bitmap file name, or a TBrush object or pointer to GDi+ brush.
<nInnerDia>: Numeric value indicating the ratio to the outer diameter
(0.05 to 0.95) or number of pixels.
<cPrompt> can be a codeblock.
viewtopic.php?f=3&t=37732&hilit=progress
regards, saludos

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

Re: New FTDN September/Septiembre 2019 (FWH 19.09)

Postby Antonio Linares » Fri Oct 18, 2019 8:38 am

Julio/Agosto/Septiembre 2019
============================

* TDataRow (FW_Record):

- Mientras se lee ADO, campos memo con valores nulos. son leidos como
NIL. Ahora está corregido, son leidos como "".

- Nuevo DATA bOnRead: Si se asigna, el bloque de código es ejecutado con
Self como parámetro poco después de que los datos sean cargados.

- Cuando uno de los campos es una matriz, el método Modified() estaba
devolviendo .T. siempre. Corregido.

* FWMariaDBConnection:

- Nuevo método InTransaction() --> .T. / .F.
Indica si una transacción está en curso. Es deseable comprobar esto
antes de comenzar una nueva transacción.
Es compatible con MariaDB y MySQL anteriores y posteriores a la versión 8.0

- Mejorado el método BeginTransaction() --> .T. / .F.
Este método inicia una nueva transacción sólo si no hay una transacción en
curso. Nos devuelve .T. o .F. en función si una nueva transacción ha podido
ser comenzada.

- Soporte para SAVEPOINT (transacciones anidadas). Esta característica está
disponible con MariaDB y MySql versión 5.0.3 y versiones superiores.

Nuevos métodos:
SavePoint( cSavePt )
RollBack( cSavePt )
CommitTransaction( cSavePt )

- Mejorado el método SaveToDBF().
En el caso de una conexión no UTF al servidor, los campos con el conjunto de caracteres
UTF8 se guardan en una longitud de campo menor y los valores se truncan.
En caso de conexión UTF, los campos con no UTF8 (por ejemplo, Latin1) también se crean
con 3 veces la longitud requerida.
Corregido. Los campos ahora se crean con una longitud que coincide con el juego de
caracteres del campo.
viewtopic.php?f=3&t=37513&p=224462#p224462

- Nuevo método MainTable( cSql ) --> cTableName
Devuelve el nombre de la tabla principal de una instrucción SQL usando
varias tablas.

- Mejorado el método Execute().
Llamando a Execute() sin parámetros después de llamas a Execute( cSql ) devuelve
la estructura d la tabla.

- El método Explain(cSql, aParams) no era compatible con las nuevas versiones de
MySql 8.0 y superiores. Ahora este método es compatible con versiones antiguas y nuevas.

- Al intentar una conexión, sql_mode se establece en PAD_CHAR_TO_FULL_LENGTH.
Se informa que algunas versiones anteriores del MySQL no aceptan esta configuración.
En tales casos, esta configuración se realiza sólo si no hay error.

- Nueva función FWMARIA_SET_PAD_CHAR_TO_FULL_LENGTH( lSet ).
Para evitar establecer sql_mode en SET_PAD_CHAR_TO_FULL_LENGTH.
viewtopic.php?f=6&t=37663

* FWMariaDB RowSet:

- Los nuevos métodos recientemente añadidos First(), Last() como sinónimos
de GoTop() y GoBottom() están en conflicto con algunos nombres de campo
en algunas tablas. Estos métodos ahora son descartados.

- Método Eval( bAction, [bFor], [bWhile], [nNext], [nRecord], [lRest] )
Todos los bloques de código son evaluados con Self como parámetro.
el puntero al registro es restaurado después de la ejecución.

- Después de una consulta, si el SQL no contiene la cláusula "ordenar por",
el orden de clasificación existente se restaurará sólo si el orden está
sólo en un campo. Ahora el orden se restablece incluso en la clasificación
de campos múltiples asc/desc.

* Nuevo: FWMariaRowset
BATCHMODE/Modo por lotes
En el modo por lotes, todas las ediciones, anexos y eliminaciones se retienen
sólo en la memoria y no se escribe nada en la base de datos, hasta que todos
los cambios se escriben en una llamada a SaveBatch ()

- Método SetBatchMode( lSet ) --> nuevo modo por lotes

- Método SaveBatch() --> lSuccess
Guarda todos los cambios (ediciones, añadidos, eliminaciones) en la base de datos.
Los cambios se guardan en una transacción y, por lo tanto, se guardan todos los
cambios o ninguno. Si los cambios se cambian con éxito, el conjunto de filas se
actualiza con ReQuery(). De lo contrario, se muestra el error y los
cambios se dejan para que el usuario haga más cambios y los guarde.

- Método CancelBatch():
Descarta todos los cambios realizados en el modo por lotes y el conjunto de filas
se actualiza con ReQuery().

- Método IsBatchEdited() --> lYesNo
Devuelve .T. /.F. en función de si se han realizado modificaciones/añadidos/eliminaciones
en el modo por lotes que aún no se han escrito en la base de datos

* SAVING WORK AND RESTORING/Grabando y restaurando

- En cualquier momento (en casos como la pérdida de conexión), el trabajo no guardado
se puede guardar en un archivo dbf con oRs:SaveWork( cDbfFile ) y cerrar el RowSet.
Más tarde, el trabajo en progreso puede abrirse con oCn: RowSet (cDbfFile) y reanudarse
desde donde se dejó.

* Mejoras MDI:

- MENUINFO menu, con caractéres UNICODE. Corregido.

- Clase TMdiFrame:
Nueva DATA: bDlgSelectChild ( default ::bDlgSelectChild := { || ::DlgSelectChild() } )
Para el diálogo de configuración del usuario, la ventana secundaria está activa.
Nuevo método: DlgSelectChild()
Diálogo para mostrar la lista de ventanas secundarias (haga clic en el elemento "Más ventanas"
cuando la lista de ventanas secundarios sea mayor que diez).

* Clase TRichEdt5:

- GPF en el método Destroy al abrir varias instancias de Richedit5: Solucionado.

* Clase FW_Record (TDataRow):

- Los métodos de navegación GoTop(), GoBottom(), GoUp(), GoDown(), GoLast() y GoNew() estaban
disponibles sólo cuando el método Edit() era llamado. Ahora, estos métodos estan
disponibles para ser usados cuando el objeto registro es creado.


* TARRAYDATA (\source\classes\tarrdata.prg)

- Eof() no se está poniendo a .T. cuando saltamos después del ultimo registro. Solucionado.
viewtopic.php?f=3&t=37514

- Bof() no se está poniendo a .T. cuando saltamos antes del primer registro. Solucionado.

- Skip( n ) ahora devuelve el número de registros saltados.

- Eval( bAction, [bFor], [bWhile], [nNext], [nRecNo], [lRest] ) --> Self
Sintaxis extendida. Todos los parámetros tienen la misma funcionalidad de DBEVAL (),
bAction se evalúa con Self como parámetro.
Después de la ejecución, el puntero al registro se restaura.

- Nuevo método FieldDefault( ncFld, uDefaultValue )
El valor por defecto será usado en todos los registros añadidos.

- Ahora esta clase se puede usar para leer un lote de registros de una tabla DBF o MYSQL.
Estos registros pueden ser editados en memoria, añadidos y borrados y luego guardar
(o descartar) todos los cambios, incluidas las adiciones y eliminaciones, en la tabla DBF o MySQL.

- El método New(), ahora tiene 3 alternativas de sintaxis
New( aData, aStruct ) // usa una matriz simple
New( [cAlias], [bFor], [bWhile], [nNext], [nRecord], [lRest] ) // DBF
New( oCn, cTable, [cWhere] ) // Tabla MySQL
New( oCn, cSql, [aParams] ) // Consultas complejas MySQL

- Edición: los campos con los tipos +,=,^ no se pueden editar. En el caso de las tablas MySQL,
los valores de clave primaria de los registros existentes no se pueden cambiar, pero los registros
recién añadidos pueden ser cambiados.

- Método Load(). Sintaxis alternativas
Load( [bFor], [bWhile], [nNext], [nRecord], [lRest] ) // DBF
Load( [cWhere] ) // Tabla MySQL
Load( [aParams] ) // Consulta MySQL
Recarga los datos con la nueva condición o con la condición existente.
Ejemplo:
oData:Load() // Recarga el dato usando bFor/cWhere existente
oData:Load( "INVNUM=99" / { || "INVNUM=99" } )

- FieldDefault( cField, uValue )
Usa el valor por defecto para todos los nuevos registros añadidos.
Ejemplo:
oData:FieldDefault( "INVNUM", 99 )

- Método SaveData() --> lSuccess
Guarda todas las modificaciones en todos los registros, los añadidos y los eliminados
a la tabla DBF / MySQL.

En el caso de MySQL, todos los cambios, añadidos y eliminados se guardan dentro de una
transacción. En caso de cualquier error (Por ejemplo, clave principal / infracciones de
restricciones únicas), se muestra el error y la transacción se revierte.
O se guardan todos los cambios o ninguno.

Si se llama a SaveData () dentro de una transacción, este método usa puntos de restauración.

- Nueva DATA lAutoAppend.
Cuando se establece a .T., la navegación más allá del final añade una nueva fila.

- Nuevo método Sum( fieldname ) --> Suma del campo
Devuelve cero si el campo no es numérico.

* Función FW_DbfToExcel(). Mejora:
Todos los valores de los campos de tipo carácter se recortan al exportar a Excel.

* Función FW_ArrayToDBF().
Cuando se almacena en un campo memo de DBFCDX, el dato también puede ser una matriz.

* XBROWSE:

- Nueva DATA bArrayData:
Si se especifica, se evalúa durante la actualización y restablece el valor de
bArrayData si el valor no es el mismo.

* HARUPDF:

- Nueva clase FWPdf.
Derivada de la clase TPdf de Carlos Mora.
Mejorada y adaptada por el equipo de FWH.
Los fuentes de ambas en \fwh\source\classes\fwpdf.prg y tpdf.prg.

Uso:
oPdf := FWPdf():New( cPdfFileName )
// escribe texto, imágenes, códigos de barra y otros gráficos con los mismos métodos
// como la clase Printer..
oPdf:End() // guarda el fichero PDF y finaliza (destruye) el objeto

- En el curso normal, no es necesario instanciar el objeto por separado y en su
lugar podemos usar los comandos PRINT / ENDPRINT para escribir código portátil.

Ahora el comando:
PRINT oPrn [PREVIEW] FILE "filename.pdf"
// código
ENDPRINT
guardará el material impreso en filename.pdf y lo mostrará si se usa la cláusula PREVIEW.
Este comportamiento continuará.

Si TPrinter():lUseHaruPDF se establece a .T., y es enlazado con HaruPDF mediante
REQUEST FWHARU, el comando de impresión anterior generará el archivo pdf usando HaruPDF.

- Con esta configuración, el comando:
REPORT oRep TO FILE ( cPdf )
creará el fichero pdf usando HaruPDF.

- Limitaciones actuales:
- No hay soporte Unicode (puede no estar disponible pronto).
- Algunos gráficos FWH como TGraph, barras de progreso, gráficas, etc. que
se pueden imprimir en la impresora no se pueden imprimir con Harupdf.
Todas esas limitaciones se eliminarán pronto.
- Configuración de nivel alfa para imágenes.

- Ejemplos: pdfharu1.prg, pdfharu2.prg

- Enlazado:
Por favor, comprueba samples\build*.bat par ver las librerías adicionales
necesarias para el enlazado con distintos compiladores.

- Solucionado: TPen:
Cuando se crea para un dispositivo, hPen no se crea para la dimensión
correspondiente del dispositivo. Solucionado.

* Nueva función MOVETOEX( x, y ) --> { startingX, startingY }

* XImage: bPainted no funcionaba antes. Ahora funciona.

* Clase Meter: Mejoras:
La sintaxis existente para crear el control del medidor(Meter) es:

@ <nRow>, <nCol> METER [ <oMeter> VAR ] <nActual> ;
[ TOTAL <nTotal> ] ;
[ SIZE <nWidth>, <nHeight> ];
[ OF <oWnd> ] ;
[ <update: UPDATE > ] ;
[ <lPixel: PIXEL > ] ;
[ FONT <oFont> ] ;
[ PROMPT <cPrompt> ] ;
[ <lNoPercentage: NOPERCENTAGE > ] ;
[ <color: COLOR, COLORS> <nClrPane>, <nClrText> ] ;
[ BARCOLOR <nClrBar>, <nClrBText> ] ;
[ <lDesign: DESIGN> ] ;

El medidor se muestra como una barra horizontal.
BARCOLOR <nClrBar> (valor por defecto CLR_BLUE predeterminado) se utiliza para mostrar el progreso.
COLORES <nClrPane> (valor por defecto oWnd:nClrPane) se utiliza para mostrar la parte restante.
Ambos colores deben ser constantes de color RGB.

Mejoras:
1) Tanto <nClrBar> como <nClrPane> ahora pueden ser cualquier combinación de lo siguiente:
a) Colores RGB estándar (el comportamiento actual continúa).
b) Colores alfa (transparentes). Rango 0x01000000 a 0xffffffff.
c) Degradados de color (como matrices) que consiste en colores RGB y colores alfa.
d) Objetos brocha de mapa de bits / imágenes de cualquier otro estilo.
e) Mapa de bits / Fichero de imagen o recurso.
f) Bloques de código que devuelven cualquier color o degradados. Esto permite cambiar los colores
durante el progreso dependiendo del progreso u otras variables.

2) PROMPT <cText> también puede ser un bloque de código.
Todos los bloques de código se evalúan con el progreso expresado como una fracción (0.0 a 1.0) como parámetro.

3) Corregido: la cláusula UPDATE no tenía ningún efecto. Ahora funcionando.

4) Nueva cláusula BORDER <nBorderClr>
nBorderClr puede ser una constante de color RGB o una matriz de {color, ancho} o un objeto lápiz (Pen).
Si se especifica, el borde se dibuja alrededor del medidor (meter) utilizando el color y el grosor.

5) Nueva cláusula opcional BMPARRAY
Si se especifica esta cláusula, <nClrBar> y <nClrPane> se pueden asignar con identificadores de mapa de
bits o archivos bmp. El medidor mostrará una matriz de 5 o 10 de estos mapas de bits dependiendo del ancho
relativo del control. El progreso se muestra con el primer mapa de bits y la parte restante se muestra con el
segundo mapa de bits.
Si solo se especifican colores, los mapas de bits en forma de estrella se generan internamente y se muestran
utilizando los colores especificados.

Medidor circular (Circular Meter:)

CIRCULAR [INNERDIA <nDia>] [FILLCOLOR <nInnerColor>]

Por defecto, la apariencia es como un gráfico circular.
Si se especifica INNERDIA, ya sea en píxeles o como una relación (0.1 a 0.9) al diámetro exterior,
el círculo interno se pinta por separado con color de relleno.
Si no se especifica color de relleno, el círculo interno se deja transparente.

También en este caso, los tres colores nClrBar, nClrPane y nFillColor pueden ser

a) Colores RGB
b) Colores alfa
c) Degradados de colores RGB (degradados de color alfa no compatibles)
d) Objetos brocha(Brush)
e) Imágenes
f) Bloques de código que devuelven cualquier color.

Sintaxis completa:
@ <nRow>, <nCol> METER [ <oMeter> VAR ] <nActual> ;
[ TOTAL <nTotal> ] ;
[ SIZE <nWidth>, <nHeight> ];
[ OF <oWnd> ] ;
[ <update: UPDATE > ] ;
[ <lPixel: PIXEL > ] ;
[ FONT <oFont> ] ;
[ PROMPT <cPrompt> ] ;
[ <lNoPercentage: NOPERCENTAGE > ] ;
[ <color: COLOR, COLORS> <nClrPane>, <nClrText> ] ;
[ BARCOLOR <nClrBar>, <nClrBText> ] ;
[ <circ:CIRCULAR> [INNERDIA <nInnerDia> ] ] ;
[ FILLCOLOR <nClrFill> ] ;
[ BORDER <clrBorder> ] ;
[ <bmpArray:BMPARRAY> ] ;
[ <lDesign: DESIGN> ] ;

// nClrBar, nClrPane, nClrFill pueden ser color RGB o Alpha, oBrush,
// hBitmap, aGradient o cualquier fuente de imagen (file/resource/webaddress)
// Opcionales CIRCULR y BMPARRAY o mutuamente excluyentes.

Medidor circular creado sin ser control

También es posible dibujar medidores circulares, en cualquier ventana, diálogo o
dentro de cualquier otro control, sin crear realmente un control de medidor,
utilizando esta función:

PaintCircularMeter( oWnd, aRect, nInnerDia, nActual, nTotal, aColors, aPen )

viewtopic.php?f=3&t=37806

Ejemplos: \fwh\samples\meter01.prg, meter02.prg, meter03.prg

* TBrush:

- Nuevo método GdipBrush() --> pBrush
Devuelve un color GDI+ o una brocha/pincel texturizado.
El llamante o debería destruir la brocha/pincel. Este será eliminado cuando
el objeto brocha/pincel(Brush) es destruido.

* Mejoras en la clase TPrinter:

- Los pinceles/brochas con textura (pinceles/brochas de imagen) en mosaico y sin
mosaico no funcionan correctamente en la impresora. Ahora, esto está rectificado.
Ahora es posible usar pinceles de color alfa y degradados alfa también.

- Texto con fuentes perfiladas (fuentes huecas):

METHOD SayText( nRow, nCol, cText, nWidth, nHeight, oFont, cAlign, nClrText,
nClrBack, cUnits, nOutLineClr, nPenSize )

Se añaden los dos últimos parámetros, nOutLineClr y [ nPenSize ( Por defecto 1 ) ].
Si se especifica, el texto se imprime con el contorno de nOutLineClr con un grosor
de nPenSize. Si nClrText es un pincel/brocha, el texto se rellena con el pincel/brocha.


Comando:
@ <nRow>, <nCol> PRINT TO <prn> TEXT <cText> ;
[SIZE <nWidth> [,<nHeight>] ] ;
[<unit: PIXEL,MM,CM,INCHES,SCREEN>] ;
[FONT <fnt>] ;
[ALIGN <aln>] ;
[COLOR <nTxt> [,<nBck> ] ] ;
[OUTLINE <nClr> SIZE <nSize> ] ;
[LASTROW <lrow>] ;

Las cláusulas OUTLINE y SIZE son nuevas.

- Metodo RoundBox()
No estaba funcionando correctamente. Solucionado y mejorado.
Los métodos Box() y Ellipse(9 también se han mejorado.

METHOD Box( nTop, nLeft, nBottom, nRight, [uPen], [uBrush], [aText], ;
[cUnits] )
METHOD RoundBox( nRow, nCol, nBottom, nRight, nWidth, nHeight, [uPen], ;
[uBrush], [aText], [cUnits] )
METHOD Ellipse( nTop, nLeft, nBottom, nRight, [uPen], [uBrush], [aText], ;
[cUnits] )
METHOD FillRect( aRect, uBrush, [cUnits] )

uPen:
Usado para dibujar el borde. Puede ser un objeto oPen, un valor de color o
una matriz de {color, grosor}. Por defecto { CLR_BLACK, 1 }.

uBrush:
Si se especifica, rellena el área. Si se omite el área interna se deja transparente.
uBrush puede ser un objeto Pincel/brocha (oBrush), un color RGB, un color alfa,
un matriz de degradado con colores RGB y alfa.

aText:
Una matriz opcional de { texto, fuente, color }. Si se especifica, imprime el texto
en el centro de la forma.

cUnits:
Puede ser "INCHES", "CM", "MM" o "PIXEL". Si se omite, por defecto es PIXEL.

- Nuevos métodos:

- METHOD PieChart( aRect, aValues, [aColors], [aPen], [nStartAngle], [cUnits] )
Para mostrar rápidamente un gráfico circular de valores dados en una matriz aValues.

aColors: matriz de colores u objetos de pincel/brocha. Si no se especifica o si algún
elemento es nulo, se utilizan colores predeterminados.

- METHOD PrintTable( nRow, nCol, oTable, nWidth, nHeight, [oFont], [lBorder], ;
[cTitle], [cUnits] )
Útil para incrustar una tabla simple y pequeña dentro de un área especificada en un documento impreso.
oTable: Datos que se muestran como una tabla. Se puede especificar como una matriz o un objeto TArrayData.

- METHOD PrintChart( nRow, nCol, oTable, nWidth, nHeight, cType, [aColors], ;
[cTitle], [cUnits] )
Útil para incrustar un gráfico simple en un área específica en un documento impreso.

oTable: Datos a trazar. Pueden ser una matriz o un objeto TArrayData.
cType: Tipo de gráfico. Los valores posibles son
"LINE, BAR, PIE, DOUGHNUT, STACK (Barra apilada),
STACKL (Barra apilada con el primero de la serie como línea)"

Los métodos anteriores también están disponibles como comandos, que son más fáciles de usar.
<nRow>, <nCol> PRINT TO <prn> ;
[<ctype: BAR,LINE,STACK,STACKL,PIE,DOUGHNUT>] CHART <otbl> ;
[SIZE <nWidth> [,<nHeight>] ] ;
[COLORS <aClrs> ] ;
[TITLE <title> ] ;
[<unit: PIXEL,MM,CM,INCHES,SCREEN>] ;

<nRow>, <nCol> PRINT TO <prn> TABLE <otbl> ;
[SIZE <nWidth> [,<nHeight>] ] ;
[FONT <ofnt>] ;
[<lBorder:BORDER>] ;
[TITLE <title> ] ;
[<unit: PIXEL,MM,CM,INCHES,SCREEN>] ;

* GDI+
Nuevas funciones GDI+ aportadas por Antonio Perricone.
Mira en \fwh\source\winapi\gdiplus.cpp.

* Nueva: Clase TProgressWheel
Aportada por Silvio Falconi.
Adaptada con las modificaciones necesarias.
Esta es otra clase de medidor de círculo completamente basada en GDI+.
No está disponible para algunos compiladores como xhb.com


Comando:
<nRow>, <nCol> WHEELMETER <oMeter> ;
[ <wnd: OF, DIALOG, WINDOW> <oWnd> ]
[ <pos: POS, POSITION> <nPos> ] ;
[ RANGE <min>, <max> ] ;
[ INNERCOLOR <nColorInner> ] ;
[ ANIMACOLOR <nColorDoneMin> ] ;
[ BACKCOLOR <nColorRemain> ] ;
[ INNERDIA <nInnerDia> ] ;
[ <pixel: PIXEL> ] ;
[ <design: DESIGN> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <prmt:TEXT,PROMPT> <cPrompt> ] ;
[ TEXTCOLOR <nColorText> ] ;
[ <lNoPercentage: NOPERCENTAGE > ] ;
[ FONT <oFont>]

<nColorInner>:
Color para pintar el círculo interno, por defecto,CLR_GRAY.
Puede ser un color RGB o alfa.

<nColorDone>, <nColorRemain>:
Por defecto: GRAY,RED. Puede especificar cualquier color RGB, color alfa,
degradado de color que contenga colores normales y alfa, o un nombre de
archivo de mapa de bits, o un objeto TBrush o puntero a pincel/brocha GDi+.

<nInnerDia>:
Valor numérico que indica la relación con el diámetro exterior (0.05 a 0.95)
o el número de píxeles.

<cPrompt>:
Puede ser un bloque de código.

viewtopic.php?f=3&t=37732&hilit=progress
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
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 31 guests