New FTDN December/Diciembre 2017 (FWH 17.12)

New FTDN December/Diciembre 2017 (FWH 17.12)

Postby Antonio Linares » Tue Dec 26, 2017 6:07 pm

December 2017
=============

* Enhancement: cGetFile(), aGetFiles() and cGetDir() now
work with Unicode file and directory names also, even in
an ANSI application (i.e., even when FW_SetUnicode(.F.) )

* Added clause LEFT to allow align SEPARATOR item with prompt

* XBROWSE
-------
Enhancements to BarGet:
- If uBarGetVal is logical, oBarGet is created as a Checkbox.

- If new DATA aBarGetList is assigned an array of character
values, oGetGet is created as a ComboBox wih the array as
items.

- If new DATA bBarGetAction is assigned with a codeblock,
oBarGet is created with button with the assigned action.

- If new DATA cBarGetBmp is assigned with a bitmap file/resource
the bitmap is used for the Get Button

- If new DATA bBarGetChange is assigned with a codeblock, this
is assigned as oBarGet:bChange.

- If new DATA lBarGetOnKey (default .f.) is set to .T., then
when a key is pressed oBarGet is activated with the key as input.

- Fix: Change of font with :SelFont() or Ctrl+/- results in
SetCheck() columns display .T./.F. text. Fixed.

- Fix: When oBrw:lTransparent is set to .T. and row is highlighted
gaps in between cells are left while painting of highlight bar.
Fixed.

* TDATAROW:
--------
New methods Copy(), Paste()
It is possible to Copy() values from one Record object and Paste()
into another record object. The two objects can belong to the
same table or different tables of same or different data sources.
Paste() method ignores nil values and does not overwrite autoinc
and timestamp fields (i.e, datatypes +,=,@)

Example:
( cAlias )->( DBGOTO( 10 ) )
oSrcRec := TDataRow():New( , cFieldList )
oSrcRec:Copy()
oDstRec := TDataRow():New( oAdoRecordSet, , lNew )
oDstRec:Paste()
oDstRec:Edit()
oDstRec:Save()

* New functions to copy records from any table of any database/RDD
and paste/append to same or any table of any database/RDD/browse.

[hRec := ] FW_CopyRecord( uSrcTable, [cFieldList] )
FW_EditHash( hRec ) // optional
FW_PasteRecord( uDstTable, [hRec], [lAppend] )

These function work across all databases. Source table and destination
tables can belong to different databases. Values are pasted to the
corresponding field names. Readonly fields (+=@) are not overwritten.
Programmer can optionally modify some values before pasting. It may
be necessary to ensure unique values for unique/primary fields to
avoid errors in saving pasted data. Also fields with "nil" values
are not pasted.

Example:
1)
FW_CopyRecord( oQry, cFieldList )
FW_SaveRecord( oRowSet )
2)
hRec := FW_CopyRecord( oAdoRecordSet, cFieldList )
hRec[ "code" ] := <newcode> // unique value
hRec[ "remarks" ] := nil // do not copy
FW_PasteRecord( oRowSet, .T. ) // append

* TDATABASE:
---------
Many useful RDD functions are already provided as methods of the
class. There are many other rdd and dbf related functions which
do not have corresponding methods. Such functions need to called
as ( oDbf:cAlias )->( <function>( <params> ) ).
Now, any such function can be called as a method.

Examples:
Instead of
(oDbf:cAlias)->(DBRLOCKLIST())
(oDbf:cAlias)->(OrdKeyVal())
(oDbf:cAlias)->(FW_DbfToExcel(<params>))
We can now write:
oDbf:DbrLockList()
oDbf:OrdKeyVal()
oDbf:DbfToExcel( <params ) // we can ommit "FW_"

* FWMARIADB:
---------
- New Method oCn:Upsert( cTable, [acFlds], aValues )
(meaning Update or Insert, is same as method Insert
with 4th parameter set to .T.)

- Enhancement to Method oCn:Insert( cTable, [cFldList], ;
aValues, [lUpdate] )
Present beahvior when lUpdate is .T. is that when
Primary/Unique key does not exist in the table, the
values are inserted and if the key already exists, the
values are updated. In some cases, instead of updating
the values with the new values, it may be required that
the new values should be added to the existing values.
This is now provided. If a fieldname in the field list
has suffix "+", then the corresponding value is added
to the existing value in case of updation.

Example:
oCn:Insert( "debtors", "custid,lastdate,due+", ;
{ CustID, dSaleDate, nSaleAmount }, .T. )
If the CustID does not already exist in the table,
the entire row is inserted. If exists, then `lastdate`
is replaced with dSaleDate and `due` is replaced by
`due` + nSaleAmount.

- Enhancement: Rowset Methods Update( acFields, aValues )
and Insert( acFields, aValues )
Presently, if the fields contain any readonly fields
runtime error occurs. Now such fields are ignored
and other fields are inserted/updated. So, now it is
possible to
aRow := oRs:CopyRec()
oRs:Append( aRow )

* REPORT:
New clause HELPID <nHelpId) in report command. When
specified the nHelpId is used when creating Preview Window.

* RPREVIEW:
- New: Uses oReport:nHelpID if specified
- Fix: Toolbar displays excel bitmap instead of OnePage bitmap.
fixed.
- New CLASSDATA bButtonBar
It is possible for programmer to implement his own custom
buttonbar. Usage:
TPreview():bButtonBar := { |oPrev| MyButtonBar( oPrev ) }

* ButtonBar 3D style: Fixed issues of backward compatibility
of painting buttonbar 3D style

* New: function FW_YMDLAPSED( dDate1, [dDate2] ) --> { Y, M, D }
Difference between two dates in years, months and days

* Fix: Class TProgress now supports animations properly:

viewtopic.php?p=208412#p208412

many thanks to AntoninoP

* Enhancement: Class TProgress Method SetMarquee( lOnOff ):

viewtopic.php?p=208420#p208420

many thanks to AntoninoP

* TEXPLORERBAR
------------
- New clauses
#xcommand @ <nRow>, <nCol> EXPLORERBAR <oExBar> ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
[ BRUSH <oBrush> ];

- New parameters in method AddPanel
nTitleh: height of title
nRound: round box of panel
aGrad: Gradient array
oFnt: Font for panel ( title and items, if not defined it )
METHOD AddPanel( cName, cBmpName, nTitleH, nRound, aGrad, oFnt, ;
nClrT, nClrP )
and TTaskPanel():New()

Sample:
Local aGrad := { { CLR_WHITE, METRO_STEEL },;
{ CLR_WHITE, METRO_STEEL } }

DEFINE FONT oFont NAME "Calibri" SIZE 0, -14 //BOLD
oPanel2 := oExBar:AddPanel( "PANEL 2", "C:\Fwh\bitmaps\pngs\image2.png", , 40, 0, aGrad, oFont, CLR_WHITE )

- News paramter font and others for items link
METHOD AddLink( cPrompt, bAction, cBitmap, oFnt, nClrT, nClrP, nClrO )
nClrT: nClrText
nClrP: nClrPane
nClrO nClrOver

- New DATA nOffSetX: left spaces title panel
- New DATA nOffSetY: height between items link

* function nRGB() can now be used also for converting color constants
of the format #rrggbb to nRGB.
nRGB( "#rrggbb" ) --> nRGB
nRGB( r, g, b ) --> nRGB

* New function GetDeskTopArea() --> aRect. Returns coordinates of
Desktop window excluding Taskbar, etc.
regards, saludos

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