June 2009
=========
* Fix: recent enhancements in Class TBtnBmp were not properly releasing GDI objects. Now it is ok.
* Enhancement: Class TBtnBmp enhanced painting, very similar to Office 2007 buttons look.
Please review FWH\samples\TestBtn3.prg.
* Fix: Class TXBrowse was not properly releasing GDI objects. Now it is ok.
* New: function BmpToStr( hBitmap ) --> cBitmapAsString, this function allows to convert any bitmap
into a string that you can save into a memo field, to SQL servers, to disk, etc. Example of use:
#include "FiveWin.ch"
function Main()
local hBmp := ReadBitmap( 0, "test.bmp" )
MsgInfo( hBmp )
MemoWrit( "another.bmp", BmpToStr( hBmp ) )
DeleteObject( hBmp )
return nil
* Enhancements: Class TBrush
a. Now any image file ( jpg, png, etc. ) can be used to create a Brush.
b. Brush can also be created from a bitmap handle by specifying the handle as the fifth parameter of TBrush():New() method. Command support for this is not provided.
* Enhancement: Class TRichEdit:
a. When more than one richedit control was used simultaneously, windows exception error used to occur after
closing the application window.
b. Now this is fixed. Any number of richedit controls can be used simultaneously.
* Enhancement: function MemoEdit():
a. Memoedit is improved to handle richedit text also automatically.
* Enhancement: Class TWindow Method lValid(), added Self as parameter while evaluating bValid. This ensures that
in all valid codeblocks, we can expect the control object as the first parameter. This is very convenient while
writing valid functions. This does not break existing code, but useful for those who use it.
* Fix: Class TSay, SAY … TRANSPARENT were not working on a Window, if the application is Themed. Now it is ok.
* Enhancements: Class TXBrowse:
a. GDI resource leaks in previous versions of xBrowse are now prevented.
b. XBrowse can now browse almost all kinds of data ( collection objects). Simplest way of invoking browse of
any data is by XBrowse( uData ) or XBROWSER uData.
c. Arrays:
i. Array Handling capacities are revamped. It is possible to browse blank arrays, single and multi
dimensional arrays and ragged arrays.
ii. Different rows of ragged arrays can have either arrays of different sizes or any normal data-types.
Individual array elements of any row can contain any data-type including nested arrays, record sets,
data objects or hashes. Double click on a nested array ( or hash, object ) invokes xbrowse of that
array / hash/ object.
iii. By default, xbrowse allocates columns for the maximum number of columns contained in any row. Data
alignment is decided on the basis of the type of each array element. Different data-types in the same
column in different rows are aligned appropriate to that value.
iv. Bug in SetCheck method for arrays is now fixed.
d. Hashes and Array of Hashes, Now browsing of hashes and array of hashes work both in Harbour and xHarbour
e. Trees constructed with LinkList class of FWH
f. Objects:
i. Any object, including a user created class, which contains the necessary navigational methods, viz.,
GoTop(), GoBottom(), Bof(), Eof(), Skip(), RecNo(), GoTo() and Skipper() can be browsed like a table.
Examples are TDataBase, TTxtFile(), etc.
ii. TOleObject: At present only ADODB.RecordSet objects are supported. Double clicking on Child
RecordSets ( type : adChapter ) invokes browse of the child.
iii. When any other kind of object is browsed, all Datas and their values are shown. By default, the
values can be edited and if the values refer to any collection object, double clicking invokes xbrowse
of that object. (This can be of use during development for inspection of object data).
Examples : XBrowse( oWnd ), XBrowse( oBrw ).
Can be tested while defining any object with code like oDlg:bRclicked := {|r,c,f,o| XBrowse( o ) }.
g. Image rendering
i. In the previous versions, if a column contains file name of a picture, the picture is read from the
file and displayed inline, if oCol:nEditType is set to EDIT_IMAGE ( -1 ). However the programmer was
required to set adequate width of the column and row height of the browse. If the size of image was
larger, it used to overflow to other rows and columns.
ii. Inline Image rendering in columns is now revamped and improved.
Xbrowse automatically allocates adequate column width and row height ( not exceeding 1/10th of screen width
and height ) on the basis of the image in the first row. The default dimensions can be overridden in the program.
While rendering, if the image size exceeds the column width and height, the image is resized to fit the column
dimensions, keeping the proportions in tact.
Now the columns value need not be a file name but can also be an image buffer. Image buffer is directly
rendered in the cell as image, without any disk operation. This suits browsing of tables containing image data
in memo fields or blob columns.
If the columns value is either file name of image or image data, oCol:cDataType should be set to "F".
This is the recommended method instead of assigning -1 to nEditType, though this is retained for backward
compatibility. When datatype is set to "F", xbrowse first checks if the file exists and if so, it reads the
file and renders the image. If it can not find the file, it tries to treat the value as image data and tries
to render the image from the data. Otherwise the cell is left blank.
If the columns value is image data, oCol:cDataType may be set to "P". In this case, image data is directly
rendered in the cell, without any disk access.
In case of browsing ADT tables, if the columns type is Image ( or "P" ) xbrowse automatically recognizes the
value as image data and sets the data-type to "P", No coding is required from the programmer.
Exporting to Excel will export images also to the respective cells with proper dimensions based on the xbrowse
cell dimensions.
h. Background Image for xbrowse:
oBrw:SetBackGround( <brush/bitmap/resource> ) was accepting only brush / bitmap / resource only and painting the background in tiled mode only.
Data cBmpAdjBrush was provided to paint a stretched background from any image file. But the functionality was very limited.
Now the SetBackGround method is revamped and improved to handle any type of image and different types of painting. Now the background works well both for dialogs and windows and compatible with resizing the windows.
New Syntax:
oBrw:SetBackGround( <oBrush/cAnyImageFile/cResource/hBitmap/NIL>, <NIL/ 0 / 1 / 2 > )
Second parameter indicates the background paint mode.
0 : Tiled mode : Paints the image in tiled mode. ( Default )
1 : Stretch mode : Stretches the image to fill the entire data area ( does not maintain proportions of the image )
2 : Fill mode: Stretches or compresses the image, keeping proportions intact, just enough to fill the entire data area.
oBrw:SetBackGround() with no parameters or both parameters set to NIL, cancels background painting
oBrw:SetBackGround( uImage ) sets the new image as background, without changing the paint mode set earlier.
oBrw:SetBackGround( nil, nPaintMode ) changes the paintmode of the image already set as background image.
i. Pasting and saving images from clipborad the Image type columns:
It was possible to paste any data from the clipboard into xbrowse cells ( copy ranges from excel into group of xbrowse cells or any data into individual cells) if pasting is enabled by setting oBrw:lCanPaste := .t..
This feature was limited to data only. Now images can be pasted into Image type columns and saved, if oBrw:lCanPaste is .t. and the oCol:nEditType is 1 and the columns cDataType is 'P'
The images in Wwonders.dbf in the samples folder are copied and pasted from the web directly into the dbf through xbrowse.
Export to Excel:
i. Export of memo field contents are now properly handled. Tabs are converted to spaces and CRLFs are
coverted to line-feeds.
ii. At present, export to Excel is performed by copying blocks of rows and columns to clipboard and pasting
into excel sheet. This method is faster but does not suit all situations and at times is language dependant.
iii. New data lExcelCellWise ( defaults to .f. ) is provided to change this behavior. If this data is set
to .t., individual values row-wise and column-wise are assigned to corresponding cells in the excel sheet.
This data can be set to .T., if the default method does not suit the needs. This method is also language
independent. XBrowse automatically switches to this method while browsing arrays or the data contains images.
Report method now handles memo values properly.
Inline edit of multiline memo fields:
i. Up and down arrow keys do not exit the multiline edit, unlike in previous versions.
ii. Bug fixed: Earlier edit was not allowing adding more text and lines Now fixed.
Method oCol(cHeader): This method used to raise run-time error, when headers for some columns are not set to
character value. Now this is fixed.
Improved Multiple row selection: Now multiple rows can be selected by Shift-Up and Shift-Down arrow keys also.
TXBrwColumn class:
i. Method SetCheck( aBmp, uEdit, aPrompts )
Bug while using setcheck method for arrays is fixed.
Second Paramter: uEdit
a. If this parameter is a codeblock, this is taken as bOnPostEdit block of the column and nEditType is set
to 1. It may be noted that in most cases, this is not necessary because the default bOnPostEdit block
provided by XBrowse works satisfactorily. This code block is necessary only while creating the column in
full OOPs way or if a different behavior is desired.
b. Alternatively this can be a logical value. If set to True, the column?s nEditType is set to EDIT_GET.
c. If this parameter is numeric, nEditType is set to the value provided. Zero value does not permit edit
and a non-zero value permits edit.
Third parameter; aPrompts. If provided, the prompts will be used to display in addition to the check bitmaps.
Example: oCol:SetCheck( { "ON", "OFF" }, .t., { "Male", "Female" } )
ii. DATA bOnChange ( New ). Executed when the column?s data is changed with two parameters, (1) Column
object and (2) pre-edit value. This code block can be used for any operations depending on change of
value of a cell.
iii. DATA nDataLen: (New) Optionally length of data can be specified in number of characters. This may be
easier than specifying the nWidth in pixels, which depends mostly on the font size and the device
context. If specified, this value is used for specifying the column size in Report method also. While
creating XBrowse with command syntax, if negative value is specified in COLSIZES clause, the value is
taken as column size in number of characters otherwise in pixels.
* Enhancement: XBROWSER Command:
New clause FASTEDIT. If this clause is specified, the browse is set to fast-edit mode and all columns are
made editable.