New FTDN May/Mayo 2017 (FWH 17.05)

New FTDN May/Mayo 2017 (FWH 17.05)

Postby Antonio Linares » Sat May 20, 2017 10:15 am

May 2017
========

* Enhancement: samples\rbdesign.prg now allows to edit the colors of the buttons.

* Enhancement: Improved integration of datarow with fwmariarowset.

* Enhancement: bar.prg: Painting of group labels now work well with dialogs
and buttonbars created from source code as well as resources.

* New: \samples\mariainv.prg: A sample invoicing program using FWMARIADB
adapted from yunus.prg

* FWMARIADB:
- Enhancement: Now CHECK constraint is supported by methods CreateTable().
Useful for MariaDB servers version 10.2.1 and above.
i.e, when oCn:IsMariaDB() is .T. and oCn:nVersion >= 10.21
This constraint is ignored on other servers without producing any errors.

- RowSet: Update() and Delete() operations fail, when the rowset does not
contain a primary/unique key and the values of the current row are not
unique. Now this is raised as an error. The error can be viewed if
:lShowErrors is .t. or :lLogErr is set to .t.

- New method: oCn:TableStructure( cTable ) --> aStructure
cTable should be a table in the curreent db. We can query the
structure of a table without opening the table. The result is
identical to oRs:aStructure. oCn:ListColumns( [db.]cTable ) gives
more information about the columns.

- New method; oCn:CopyStructure( [dbsrc.]srctable, [dbdst.]dsttable )
--> lSuccess
For creating a new table in the same or other database with the
same structure as the source table. This function fails if
(a) srctable does not exist or (b) dsttable already exits or
(c) the table has a foreign key and the referred table is not
availble in the destination db.

- New method:
oCn:CopyTable( [dbsrc.]srctable, [dbdst.]dsttable, ;
[cSrcFieldList], [cDstFieldList], [cSrcWhere], ;
["update/ignore'] ) --> lSuccess
Copies contents of all fields or specified fields from srctable to
dsttable for all rows or for selected rows with where condition.

If the destination table does not exist, it is created.
(See CopyStructure)

By default if the dsttable already contains the primary/unique
keys the entire operation fails.

If 6th parameter is "ignore", only non-duplicate values are
copied/inserted.
If 6th parameter is "update", non-duplicate values are inserted
and duplicate rows are updated with the values in the source table.

- RowSet: New method:
oRs:ResyncWhere( cWhere ) or
oRs:ResyncWhere( cField, uVal )
Resyncs only one record satisfying the condition. if the record is
not already in the rowset, it is appended to the rowset.

- RowSet: oRs:WhereLikeCurrentRow() --> cWhere

* Enhancement: function MsgRun() now supports a fourth parameter to specify
a parent window where to center the message:

viewtopic.php?p=201302#p201302

* Fix: There was a bug in function DialogBoxIndirect() used from Class TDialog:

viewtopic.php?p=201380

Luis example is working fine now

* Fix: function ADrives() reported fix by Enrico was not included in FWH 17.04:

viewtopic.php?p=200545#p200545

Now it is ok. Many thanks to Enrico!

* Fix: Fixed bug in Class TGet when using right alignment:

viewtopic.php?p=195256#p195256

* Fix: Width items with bitmaps in items of menu principal and popups

* Enhancement: CLASS TMENU, allow resource of file image to menuitems in methods
METHOD AddEdit( aColors, cFile, cRes )
METHOD AddFile( aColors, cFile, cRes )
METHOD AddHelp( cAbout, cCopyRight, aColors, cFile, cRes )
METHOD AddMdi( aColors, cFile, cRes )

* New function GetClipContentFormat( [aFormats] ) --> nFormat
This function can be used to find if clipboard is empty and if not
the format of the clipboard contents, eg. CF_TEXT (1), CF_BITMAP(2)
Optional parameter aFormats can be either an array of list of
formats queried. If aFormats is specified, format number is returned
only if clipboard contains any of the formats in the array.
If clipboard is empty return value is 0.
If clipboard has contents but not of any format in the aFormats parameter.
the return value is -1.
Once the format of contents is ascertained with this function, the
format can be set to the TClipboard class the retrieve the contents.

* Class TClipboard: New method GetFiles(). It is possible to get the list
of files copied from file explorer by setting nformat to 15 (CF_HDROP)

* MemoEdit and TMultiGet.
For pasting contents of a text file, till now, we need to open it in an
editor copy the contents and then paste into MemoEdit/TMultiGet.
Now, we can copy the file in file explorer and paste the contents
at the cursor position by clicking Ctlr-V or calling :Paste()

* XBrowse - Pasting of text and images:
As always pasting of text of images into xbrowse is possible only
when oBrw:lCanPaste is set to .t.
Till now, for pasting text/image from a file on the disk, we needed
to first open the file in a text/image editor, copy and then paste
into xbrowse.
Now, we can copy the file in the file explorer and paste the contents
into xbrowse by Ctrl-V or oBrw:Paste().
As always, any content that is pasted into xbrowse is also immediately
written into the database.
This makes it easy to assign the contents of text/binary/image files to
memo fields of database.

* New function cNumToChar( nVar ) --> cVar
This is similar to cValToChar( u ) but preserves the full accuracy
of the number unlike cValToChar()

Example:
n := 35/16 // the value is 2.1875
? n, Str( n ), cValToChar( n ) // show 2.19
? cNumToChar( n ) // show 2.1875
Str( n, 6, 4 ) shows full value, but while programming we always do
not know what values to use for length and decimals.
cNumToChar() returns the full accurate value as string.

* FW_ValToSQL() and oCn:ValToSQL() now use cNumToChar( n )

* samples\testage5.prg revised: using autoget with DBFs

* New function: FTranslate
Function for Translate text to others languages
// Params..: Source Text, Language Source, Language Target, .T. if target language is UTF8
// List languages supported
// https://ctrlq.org/code/19899-google-translate-languages

* Add TestTrans.prg to samples folder ( Test FTranslate() function )
regards, saludos

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

Re: New FTDN May/Mayo 2017 (FWH 17.05)

Postby Antonio Linares » Tue May 30, 2017 9:24 am

May 2017 (revised build)
========

* Fix: MultiGet methods GetSel() and Copy() were not Unicode compatible.
Fixed

* FWMARIADB:
Recommended way to obtain connection to Server is to use command syntax
FWCONNECT oCn <clauses>, which translates to maria_Connect(...)
Alternatively the function maria_Connect() also can be used.
Till now, mysql_Connect(..) also is availalbe which is an alias for
maria_Connect(). The alias name mysql_Connect() is now discontinued as
it is reported that this name is conflicting with some libraries.
We request any calls to mysql_Connect() may please be changed as
maria_Connect()

* Fix: samples\testdllp.prg was not properly working. Now it is ok.
testdllp.prg shows how to use pcode DLLs from our EXEs.

* samples\TransFree.prg
Other sample use function FW_TransLang from dialog

* TGET:
New DATA bColor
If specified, bColor will be evaluated with oGet as parameter.
The codeblock should return an array { nTextColor, nBackColor }
TGet uses these colors to display the Get superceding all other
color settings.

This can also be set by command:
@ r,c GET <clauses> COLOR bColor <otherClauses>

Example:

bColor := { |oGet|
If( oGet:lFocused, { CLR_HRED, CLR_YELLOW }, ;
If( !oGet:lActive, { CLR_BLACK, CLR_HGRAY }, ;
If( Empty( oGet:Value ), { CLR_BLACK, CLR_HGREEN }, ;
{ CLR_BLACK, CLR_WHITE } ) ) ) }

CLASSDATA bColorBlock
If specified, every Get's bColor defaults to this codeblock.

If bColor or bColorBlock are not assigned, the normal behavior
of the Gets continue.

* NEW: Support for PostGreSQL using hbpgsql of Harbour or pgsql of
xHarbour:

- XBROWSE and XBROWSER support oQuery object like any other datasources.
- Support AUTOCOLS or specified columns (Limitation: Does not yer support
expressions involving column names)
- AUTOSORT support
- Incremental Seek and wild seek
- Does not yet support Incremental filters
- Inline Editing supported.
- XBrowse method oBrw:Edit() can be used for editing records
- Append is not automtically supported but can be user implemented
- XBrowse recognizes DateTime values, even if the Query class does
not recognize them.
- XBrowse detects AutoInc (serial) column and flags the column as
readonly.
- Other utility functions:
- FWPG_ImportFromDBF( oCn, cDbf, cTable ) --> lSuccess
- FWPG_CreateTableSQL( cTable, aStruct ) --> cSql
- FWPG_AppendFromAlias( oCn, cTable )
- FWPG_Structure( oQry ) --> aStruct (enhanced )
This structure detects autoinc column and timestamp columns

- Source: \fwh\source\function\pgsuport.prg
regards, saludos

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