April/May 2019
=========
* Fix: Class TWindow method Center() was not updating the window coordinates.
Now it is ok.
* Fix: Minor fix in Class TRibbonBar Method PaintFld() to remove a painting artifact
under some circunstances.
* Fix: source\function\imgtxtio.prg: The functions FW_SayText() and
FW_DrawImage() are not restoring the BkMode of the device context,
after changing to transparent. Fixed now.
* Enhancement: TPrinter class: If method Say() is called with a Text
color, the changed color becomes to default to all subsequent calls
of this method.
New CLASSDATA lResetSayColors INIT .f.
If this is set to .t., calls to Say() with a text color apply to
that say only and does not affect subsequent says.
* Enhancement in display/printing of multi-line text:
Functions DrawTextEx(), FW_SayText() and method SayText() of Window and
Printer classes can output single line or multi line text to fit inside
the rectangle specified. When the entire multi-line text can not fit
inside the specified rectangle, the remaining text is returned in the
parameter cText, if cText is called by reference. If the returned text is
not empty, the programmer can decide where to print the remaining text, ie.,
in a separate page, column or ignore.
Usage:
oPrn:SayText( row, col, @cText, width, height, ... )
* XBrowse:
- New DATA bPaintBack. If specified, this codeblock is used to paint background of
the browse, instead of the inbuilt logic.
- Incremental filter in Array browse can now be used even when lAutoSort is false.
Previously trying to use incremental filters without autosort was giving runtime
errors.
- Enhancement: method EditSource( lNew, cFieldList, aInitVals )
New parameter aInitVals: If specified, non-empty values in the array are
pre-assigned to the corresponding fields in case of new (blank) records.
viewtopic.php?f=3&t=37097&p=221428#p221428
- New DATA clCurrency of TXBrwColumn: Default nil.
Can be set to .T. or any currency symbol. If .t., the default currency symbol or
the assigned currecny symbol is added to the picture clause and dislayed left
aligned in the column.
- Fix to Method GoRight: When oBrw:lTransparent := .t., and cursor is moved right with
arrow key, highlight is not cleared from the previous cells. Fixed
- Autosort: Even autosort is not specified when browse is created, internally
browse is kept ready for autosort. Programmer can toggle oBrw:lAutosort anytime
during runtime to make it work.
- SetCheck() settings are disturbed when the methods SetArray(), etc. are called
during runtime. Fixed.
- Incremental filters with DBF are replacing the existing filters. Now the
existing fitlers are respected and incremental filter is treated as an
additional filter.
* New function AShuffle( aArray ) --> aArray
Sorts a given array in a random order.
* New function DBF_ApplyParams( cExpr, aParams ) --> cExpr
Substitutes the '?' place holders in cExpr with the correspoding values in
aParams and returns the full expression.
Example:
cName := "T"
dDate := DTOS( "20000101" )
cFilter := ;
DBF_ApplyParams( "UPPER(FIRST) = ? .AND. HIREDATE >= ?", ;
{ cName, dDate } ) -->
"UPPER(FIRST) = "T" .AND. HIREDATE >= 0d20000101"
SET FILTER TO &cFilter
* New function FW_DbFilterBlock() --> bFilterExp
Harbour functin DBFILTER() returns the filter condition as string
This function returns the codeblock used for filter
* database.prg.
- New: Method SetFilter( cFilter, aParams ): aParms is added as second parameter.
aParams is an array of values to be inserted in the place holders marked with ?.
aParams can also be a codeblock which returns an array when evaluated.
Usage:
oDbf:SetFilter( "UPPER(FIRST) = ? .AND. HIREDATE >= ?", ;
{ cName, dDate } )
- New: Method Refilter( aParams ): Resets the filter using previously used
filter experession with the new paramters
- Enhancement: When relation is set to another Tdatabase object, using the
method SetRelation(), load method of the related database is automatically
called when the record pointer of the main table is moved. There is no more
any need to call oRelatedTable:Load()
- Fix: oDbf:Blank(), assign values and calling oDbf:Save() is not working when
eof is .t. Fixed now.
- Fix: oDbf:Append() without parameters appends blank. But oDbf:Load() needs to
be called for assigning values and saving. Now oDbf:Append() calls Load() also.
- New method Browse( [cTitle], [acFields] ) --> Self
* adofuncs.prg, xbrowse.prg, datarow.prg: Improved ascertainment of fieldlen,
fielddec in case of types adDouble and adSingle in ADO, where attributes
Precision and NumericScale are left unspecified.
* New function FW_ArrayAsRecordSet( [aArray], [aStruct] ) --> oAdoRecordSet
Either aArray or aStruct or both must be specified.
aArray should be a two-dimensional array.
aStruct can be a structure similar to DBF structure
If aArray is specified, aStruct can be empty or Structure or list of fields.
The function returns an ADO recordset, not connected to any database, but
can be edited, appended, deleted and navigated like any other recordset.
At any time, array of data can be retrieved with aData := RsGetRows( oRs )
Source: \fwh\source\function\adofuncs.prg
Sample: \fwh\samples\arr2rs.prg
* Fix: Method MapCol( cFieldName, cPrompt ) of tdatabase class.
If an earlier field name is longer than the fieldname and its initial
characters match the fieldname (eg. "DATE1", "DATE"), the prompt is mapped
to the earlier column. Fixed.
* Enhancement: command XBREPORT. New additional clause [TO PDF <cPdf>]. If specified,
the report will be saved as cPdf
* New function XEdit( [uSource], [cFieldList], [lNew] )
Provides Edit dialog of the current record (optionally a new record) of uSource.
- uSource: Can be Alias, Array, Hash, RecordSet, MariaDB RowSet, Dolphin,
TMySql,PostGre Query object and defaults to the current Alias()
- cFieldList: Optionally a comma delimited list of fields. Defaults to all fields
- lNew: If .t., display as blank record and appends when saved. Defaults to .f.
* New function XReport( [uSource], [acFields], [cPdf] )
Quickly generates a report for preview. Optionally saves the report to PDF
- uSource: Can be Alias, Array, Hash, RecordSet, MariaDB RowSet, Dolphin,
TMySql,PostGre Query object and defaults to the current Alias().
A dbf file name also can be specified which will be opened via RDDSETDEFAULT()
and closed after generation of the report.
- acFields: Optional comma delimited list or array of fields names.
- cPdf: Optional. if specifed, the report will be saved to the pdf file name
* Fix: bar.prg: Method BtnAdjust() encounters runtime error if a control other than
btnbmp is placed on the buttonbar. Fixed.
* New CLASSDATA bSetup in class TPreview. If assigned, the codeblock is evaluated with
oPreview and oWnd as parameters just before activating the preview window.
Example Usage:
RPrevUserBtns( nil, 2007 )
TPreview():bSetup := <|oPreview, oWnd|
WITH OBJECT oWnd:oBar
:aControls[ 10 ]:End()
ADel( :aControls, 10, .t. )
:BtnAdjust()
END
return nil
>
This removes the Email button from the bar.
* Enhancement: TDataRow class (FW_Record)
- oRec := FW_Record():New( cDataSource, cFieldList, lNew, aInitVals )
New parameter aInitVals. If specified, non empty values in the array
are pre-assigned to the corresponding fields in case of New (append)
records.
- New method SetInitVals( aInitVals ): In case of new (blank record) initial values
can be pre-assigned with this method.
* Enhancement: When the number format "@X" is used, negative numbers are
treated as debits and displayed with suffix of " DB". In some regions, users
prefer displaying " DR" instead of " DB".
If the 6th new parameter of FWNumFormat(...) is set to .T., xbrowse and report
display " DR" in the place of " DB".
* New function CurrencySymbol( [cNewSymbol] ) --> cPreviousSymbol
By default, the currency symbol is $, £, € or Rupee, depending on the Region
set by FWNumFormat( "A/B/E/I" ). Programmer can set any other different symbol.
* New function FW_DBINSERT(). Moves data from current record down and creates a
blank record in place of current record
* Enhancement: uValBlank( aArray ) blank arrays also
- uValBlank( aArray ) --> returns the array with all elements blank
- uValBlank( hHash ) --> returns Hash with all values blank
- uValBlank( number ) --> now preserves the decimal places
* Enhancement: Report class: If numeric values are formatted prefixing currency
symbol, the symbol is printed left aligned in the column.
* Enhancement: XBrowser.prg: Now uses buttonbar instead of individual btnbmps.
* New function SegoeMDL2() --> .t. if Segoe MDL2 Assets font is available
* Case insensitive string comparision and matching:
- New function FW_AT( cSearch, [@]cString, [nStart], [nEnd], [ lWholeWord],
[lSkipQuotes],[@cFound], cReplace, lAll )
--> nAt (or aMatches, if lAll is .t. )
Same as AT() or HB_AT(), but case insensitive, if the first 4 params are used.
Eg: FW_ATI( "O lInA", "Antonio Linares" ) --> 7
Additional features:
cSearch can be a string or array of strings. In case of array, the earliest occurance
is reported.
If lWholeWord is .t., only whole words are matched.
Eg: FW_ATI( "EAR", "Years Hear Ear", nil, nil, .T. ) --> 12, but not 2.
If lSkipQuotes is .t., the search skips any text inside quotes, "...", '...' or [...]
Eg: FW_ATI( "NEAR", 'He said "it is near" but it is not near', nil, nil, nil, .t. )
--> 36 but not 16
If @cFound is specified as 7th parameter by reference, the exact match found in the
string is returned. Eg: In the above case it returns "near".
If cReplace is specified as 8th parameter and cString is by reference, cFound is
replaced by cReplace.
It the 9th parameter lAll is set to .T., all matches are returned as Array. In case of
cReplace, all occurances are replaced by cReplace.
- New function FW_STRICMP(): Compares the two strings ignoring the case.
Respect SET EXACT off/on setting, subject to override
Usage1: FW_StrICmp( cStr1, cStr2, [lExact] ) --> -1,0,+1 for less than,
equal or greater than. 3rd parameter, if specified, overrides SET EXACT
setting
Usage2: FW_StrICmp( cStr1, cCompOperator, cStr2, [lExact] ) --> .f. / .t.
Eg: FW_StrICmp( c1, ">=", c2, [nil,.t.,.f.] ) --> .t./.f.
Operator "==" forces exact comparison. In other cases 4th paramter specifies
if comparision is exact and if omitted, default setting is used.
* FWMariaDB:
- Fix: When the sql query contains "order by field desc " followed by "limit",
rowset object is not recognising the order as descending. Fixed.
* TDataRow (FW_Record):
- Fix: In case of append records, method Undo() is not restoring default values
set by method SetDefault( fld, uDefault ). Fixed
- Fix: In case of append records, default values set by SetDefault() method are
being displayed but not saved, if not modified by the user. Fixed.
- Edit dialog buttons: The wingding fonts used for the buttons are not properly
displayed in the recent versions of Windows10. Resolved by using SegoeMDL2Assets
if installed.
* ORM
Released 1st version ORM, under development.
Supports dbase,foxpro,msaccess,mssql,mysql,oracle with ADO and mysql with ADO,
Dolphin and FWMariaLib.
- Class ORM_Connection
Syntax:
- oConnection := ORM_Connection():New( rdbms, server, database, user, password )
where rdbms can be mysql, mssql, oracle, etc for ADO or dolphin / fwmariadb for
mysql with these libraries
// OR //
- oConnection := ORM_Connection():New( oAdoConn (or) oDolphinServ (or) oFwCon )
Methods:
New()
Tables() // list of tables
HasTable( cTable ) --> lExists
Table( cTable ) --> ORM_Table Object
Close()
- Class ORM_Table()
Table object can be instantiated either by calling
oTable := oConnection:Table( cTableName )
or
oTable := ORM_Table():New( oConnection, cTableName )
Methods:
Navigation: First(), Last(), Next(), Prev(), Move(n), MoveTo( n )
Others:
Select( aFields )
Where( Field, [cOperator], Value )
OrderBy( field )
Get( [field )
XBrowse( [fieldlist] )
Edit()
Sum(field), Max(field), Min(field), Avg(field)
GroupBy( fields )
Find( primarykeyval ) or Find( field, value )
* New Class: TDockPnel
- New style container, please revise code of samples and wiki
http://wiki.fivetechsoft.com/doku.php?i ... _tdockpnel
- Samples: Testdock01.prg, Testdock02.prg, TestDock04.prg
* TGet.prg: When a bitmap is assigned for action clause, the bitmap
resource is not released. Fixed.
* function FW_ArrayToDBF( aArray, cFieldList, ... ): Enhancements:
- cFieldList can contain "*", which is expanded to full list of fields
- cFieldList can contain "RECNO()". In such cases, the records are
written to that RecNo() if not empty and appended if empty.
* New function FW_UTCTOLOCAL( tUtc ) --> tLocalTime
* New function FW_TimeZoneName() --> local time zone name