New FTDN September/Septiembre 2019 (FWH 19.09)
Posted: 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.
http://forums.fivetechsupport.com/viewt ... 62#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.
http://forums.fivetechsupport.com/viewt ... =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.
http://forums.fivetechsupport.com/viewt ... =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 )
http://forums.fivetechsupport.com/viewt ... =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.
http://forums.fivetechsupport.com/viewt ... t=progress
=========
* 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.
http://forums.fivetechsupport.com/viewt ... 62#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.
http://forums.fivetechsupport.com/viewt ... =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.
http://forums.fivetechsupport.com/viewt ... =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 )
http://forums.fivetechsupport.com/viewt ... =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.
http://forums.fivetechsupport.com/viewt ... t=progress