New FTDN July/Julio 2009 (9.07)

New FTDN July/Julio 2009 (9.07)

Postby Antonio Linares » Thu Jul 30, 2009 9:14 am

July 2009
=========

* New: FWH own Class TRibbonBar: Create Office 2007 style RibbonBars without having to use any
external DLL, OCX or libraries! Also this new Classes are available too: Class TRBGroup, TRBtn,
and TRPanel.

You can also use these new controls, as standalone controls. Please review samples\Ribbon.prg
for a working example. If you click on "Paste" button in this example, you will see how these
new powerfull controls can be used as a standalone controls too.

* New: Class TTitle. A great looking Title Class for your applications. Please review
samples\TestTitl.prg

* Enhancement: Class TActiveX Method OnEvent() now receives an extra pParams with the original
pParams ( DISPPARAMS * pParams ) so you can directly manage the original VARIANTs parameters
array that is supplied to the ActiveX event.

* XBROWSE
a) Inherited classes from XBrowse:
It may be necessary to have a modified behaviour of xbrowse for a specific browse or an application.
In such cases it is desirable to create one or mroe child classes derived from TXBrowse and use them.
It is now very easy to implement this globally or for specific browses.

[bPrev := ] SetXBrowse( { || ChildBrowse() } ). After this all xbrowse commands create and use this
child class.
command equivalent is :
SET XBRROWSE TO ChildBrowse() [ SAVE PREVIOUS TO bPrevXbr ]

To use child class for a speicific browse :
@ r, c, XBROWSE oBrw CLASS ChildBrowse() OF ownd .... can be used.
It is possible to use different child classes or standard FWH txbrowse for different browses displayed at
the same time.

If browse is created in Oops syntax, TXBrows():New(oWnd) may be used instead of TXBrowse():New( oWnd ).

Sample:
xbrchild.prg demonstrates use of child browses and switching between child and parent classes as well as
provides a template for creation of child xbrowse class.

b) DateTime Type:
(i) Due to incosistant behaviour of hb_isDateTime() function of xHarbour between different versions,
appropriate modifications are made to retain the same functionality irrespective of the version of xHarbour

(ii) Recent versions of Harbour provide DateTime data type ( ValType -> 'T' ). The version of Harbour
provided with this build does not provide this. XBrowse and ValBlank.prg are modified to use the datetime
variables depending on the version of Harbour used in the application.

(iii) New datatypes 'T' and '@' ( for datetime and timestamp ) provided in DBFCDX are now properly
recoginised and handled depending on the version of harbour or xharbour used.

(iv) Similar modifications are made for ADT tables

(v) Time only values of datetime variables are properly recoginized and timepart only is shown.

c) MethodsToExcel and ToCalc: Additional paramter aCols is provided. If an array of column objects is
provided, the export will be of that columns only and in that order.

d) PostEdit cursor movement in Fast Edit mode ( default ):
(i) The intended behavior is that after editing a cell, the cursor should move to the next editble cell
in the same row and if the edited cell is the last cell of the row, the cursor goes to the first
editabel cell of the next row.

Editable cell means where the columns's nEditType is nonzero and bEditWhen is evaluated to true.
In earlier versions the movement was not honoring the bEditWhen. Now the cursor is moved to the next
cell where bEditWhen also evaluates to true. This change provides the truely intended behavior.

(ii) In the same manner, after the last editable cell of last row is edited, if bPastEof is assigned,
this codeblock is evaluated and the cursor moves to the first editable cell of the newly created row.

If bPastEof specifically positions the cursor to any specific column, the cursor stays on that column
only if the cell is editable. Otherwise cursor moves to the next right editable column.

e) While painting the column's data, binary data is automatically recognized and if the data is valid image
data, image is paainted in the cell,

f) Method SetCheck( aBmps, lEdit/bPostEditBlock, aPrompts )

If the first paramters is ommitted, XBrowse provides internally created bitmaps. These bitmaps are
alpha blended and appear bright on dark backgrounds and black on bright backgrounds automatically.
Examples can be seen in Testxbr3.prg.

g) New Data: oBrw:lContastClr INIT .t.

In case of gradient and image backgrounds with varying brighness in different cells, text in each cell
is painted in the programmer specified color, if that color provides adequate cotrast with background
of that cell and otherwise painted in white on dark backgrounds and in black on bright backgrounds.

The logic is still in development and gives reasonable results in many cases.
This behavior can be suppressed by setting the data oBrw:lContrastClr to .f.

h) Method SetBackGround( uBack, uMode ) now supports Gradient colors also.

(i) Improved: Support for specifying array of Gradient colors as uBack. In this case, uMode can be logical
paramter ( .t. for vertical or .f. for horizontal orientation ) default being vertical or earlier setting.

Gradient colors be set with this function at any time during definition of xbrowse or at runtime
dynamically. It is not necessary to specify gradient colors on init clause of dialog.

Similarly orientation can be changed dynamically at any time.
As in the case of Image backgrounds, grandient also respects window resizing.

(ii) Fixed: Background image was not properly painted in case of dialogs created from resource, in stretch
and fill modes. Now fixed.

(iii) Parameters:

uBack : cImageFile / cResource / hBmpHandle / oBrush / aGradient colors
In case of brushes and bitmap handles, the objects are to be destroyed by the calling program at the end.

uMode : In case of gradient colors logical value and in other cases numeric value BCK_TILED (0),
BCK_STRETCH (1), BCK_FILL (2) ( Default BCK_TILED or previous mode )

oBrw:SetBackGround() without parameters clears any background
oBrw:SetBackGround( nil, uMode ) switches the mode for the existing background

Backgrounds can be easily specified while creating xbrowse ( windows / dialogs from source or resources )
with the new clauses provided in the COMMAND SYNTAX:

Examples:

@ r, c, XBROWSE ( or REDEFINE XBROWSE ) ....... ;
BACKGROUND cImageFile/cResource/hBmphandle/oBrush [TILED/STRETCH/FILL]

For Gradient colors

@ r, c, XBROWSE ( or REDEFINE XBROWSE ) ....... ;
BACKGROUND aClrGradientArray [VERTICAL/HORIZONTAL]

Sample: xbrgrad.prg demonstrates

(a) ease of specifying gradient colors while creating xbrowse
(b) switching the orientation at runtime ( horizontal / vertical )
(c) changing the colors of the gradient during runtime by selecting and substituting any of the three
colors of the gradient,
(d) changing the size of different colors during runtime
(e) view the code of gradient array
(f) Inline editing of the gradient array code to dynamically change the gradient
(g) copy the gradient array code to clipboard that can be pasted and used in other applications
(h) display of text dynamically in contast colors to ensure better visibility
(i) display of FW builtin checkboxes that appear in contrast colors on backgrounds of different bightness.
This small sample program, with its intutive user interface, can also be used as a simple three color
gradient designer for use with xbrowses or other controls.

i) New Data: TXBrwColumn:bGetChange. If assigned, this codeblock is used as bChange codeblock of bEditGet
while editing the cells where nEditType is EDIT_GET.

During editing the bEditGet, this codeblock is evaluated with frist three parameters nKey, nFlats,
oGet in the same manner as the bChange block of Get and in additon receives the column object as the
fourth parameter. The column object can be used to derive other information about oBrw, oBrw:ownd, etc.

* REPORT:

Enhancement: Now images can be printed inside the columns of the report object. It is also possible to
print text over images.

#xcommand COLUMN [ <oRptCol> ] ;
[ TITLE <bTitle, ...> ] ;
[ AT <nCol> ] ;
[ DATA <bData, ...> ] ;
[ SIZE <nSize> ] ;
[ <pict: PICT, PICTURE> <cPicture, ...> ] ;
[ FONT <uFont> ] ;
[ <total: TOTAL> [ FOR <bTotalExpr> ] ] ;
[ <ColFmt:LEFT,CENTER,CENTERED,RIGHT> ] ;
[ <lShadow:SHADOW> ] ;
[ <lGrid:GRID> [ <nPen> ] ] ;
[ <memo: MEMO, MULTILINE> ] ;
[<img:IMAGE> [ IMGDATA <bimg> ] [HEIGHT <h> [<imgpix:PIXEL>] ] [ ALPHALEVEL <nAlpha>] ] ;

If clause IMAGE is specified without the clause IMGDATA, the column data is treated as binary image data.

If clauses IMAGE IMGDATA <bdata> are specified, imgdata is printed in the background and any text data
in the column data is printed over the background

Height can be specified in equivalent number of data lines or in pixels as well as alpha level.

This functionality is still under development is not tested on different kinds of printers. Feedback
if any is highly appreciated to improve the functionality.

* Enhancement: Bitmaps: Some bitmaps containing alpha channel in the bitmaps\32x32 folder are not premultiplied.
They are now converted and provided in the AlphaBmp folder for use.
regards, saludos

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

Re: New FTDN July/Julio 2009 (9.07)

Postby Antonio Linares » Wed Aug 05, 2009 3:27 pm

Julio 2009
==========

* Nuevo: Nuestra propia clase TRibbonBar en FWH: Se ha credo la clase RibbonBar al estilo de la
de Office 2007 sin tener que usar ninguna DLL, OCX o librería ! También las siguientes nuevas
clases estan disponibles: TRBGroup, TRBtn y TRPanel.

Puedes usar también estos nuevos controles, como control independiente. Por favor revisa el
ejemplo samples\Ribbon.prg para un ejemplo en funcionamiento. Si haces clic en el botón "Paste"
en este ejemplo, verás como estos nuevos y potentes constroles se pueden usar como controles
independientes también.

* Nuevo: Nueva clase TTitle. Una gran clase Title para sus aplicaciones. Por favor revisa
samples\TestTitl.prg

* Mejora: En el método OnEvent() de la clase TActiveX, ahora recibe un parámetro extra pParams con
el original pParams ( DISPPARAMS * pParams ), así que puedes manejar directamente la matriz de
parámetros originales VARIANT que se suministra al evento del ActiveX.

* XBROWSE

a) Clases derivadas de XBrowse:

Puede ser necesario modificar el comportamiento de xbrowse para un browse específico o una aplicación.
En tales casos, es conveniente crear una o más clases hijas derivadas de TXBrowse y utilizarlas.
Ahora es muy fácil implementar esto globalmente o para "browses" específicos.

[bPrev := ] SetXBrowse( { || ChildBrowse() } ). Después de esto todos los comandos de xbrowse crean y usan
estas clases hijas.

El comando equivalente es:

SET XBRROWSE TO ChildBrowse() [ SAVE PREVIOUS TO bPrevXbr ]

Para usar las clases hijas para un browse específico:

@ r, c, XBROWSE oBrw CLASS ChildBrowse() OF ownd .... se puede usar.

Es posible usar diferentes clases hijas ó el estandar TXBrowse de FWH para diferentes browses mostrados al
mismo tiempo.

Si el browse es creado desde sintáxis POO, TXBrows():New(oWnd) se puedes usar en lugar de TXBrowse():New( oWnd ).

Ejemplo:

El ejemplo xbrchild.prg demuestra el uso de browses hijos y el cambio entre las clases padre e hijas, proporciona
una plantilla para la creación de una clase xbrowse hija.

b) Tipo DateTime:

(i) Debido al comportamiento inconsistente de la función hb_isDateTime() de xHarbour entre diferentes versiones, se
han hecho las oportunas modificaciones para mantener la misma funcionalidad independientemente de la versión de
xHarbour.

(ii) Recientes versiones de Harbour proporcionan el tipo de dato DateTime ( ValType -> 'T' ). La versión de Harbour
proporcionada por FiveTech no proporciona esto. XBrowse y ValBlank.prg se han modificado para usar variables
datetime dependiendo de la versión de Harbour usada en la aplicación.

(iii) Nuevos tipos de datos 'T' y '@' ( para datetime y timestamp ) proporcionados ene el RDD DBFCDX ahora se reconocen y
manejan correctamente dependiendo de la versión de Harbour ó xHarbour usada.

(iV) Modificaciones similares se han hecho para tablas de ADS.

(v) De momento sólo los valores de las variables datetime son correctamente reconocidas y la parte del tiempo sólo se
muestra.

c) Métodos ToExcel y ToCalc: Se proporciona el parámetro adicional aCols. Si se proporciona una matriz
de objetos columna, la exportación será sólo de esas columnas y en ese orden.

d) Por defecto el movimiento del cursor en PostEdit se pone en modo Fast Edit:

d) PostEdit cursor movement in Fast Edit mode ( default ):

(i) El comportamiento es que después de editar una celda, el cursor debe moverse a la siguiente celda editable en la
misma fila y si la celda editada la es última celda de la fila, el cursor va a la primera celda editable de la
siguiente fila.

Celda editable significa que dónde los nEditType de las columnas son no cero y bEditWhen se evalua a verdadero.
En anteriores versiones el movimiento no se hacía en función de bEditWhen. Ahora el cursor se mueve a la siguiente
celda cuando bEditWhen también se evalua a verdadero. Este cambio proporciona un comportamiento más real.

(ii) De la misma manera, después de la última celda editable de la última fila es editada, si bPastEof está asignada,
este bloque de código es evaluado y el cursor se mueve a la primera columna editable de la nueva fila creada.

Si bPastEof contiene la posición a cualquier columna, el cursor permanece en la columna sólo si la celda es editable.
De otro modo cursor se mueve a la siguiente columna editable de la derecha.

e) Durante el pintado de los datos de la columna, los datos binarios son reconocidos automáticamente y si el dato
es de una imagen valida, la imagen es pintada en la celda.

f) Método SetCheck( aBmps, lEdit/bPostEditBlock, aPrompts )

Si se omite el primer parámetro, XBrowse proporciona unos ficheros de mapas de bits creados internamente.
Estos ficheros de mapas de bits son de canal alfa y aparecen brillantes sobre fondos oscuros y oscuros sobre fondos
brillantes automáticamente. Se puede ver el ejemplo Testxbr3.prg.

g) Nuevo Data: oBrw:lContastClr INIT .t.

En el caso del fondo del gradiente y de la imagen con variación del brillo en diferentes celdas, el texto en cada celda
es pintado con el color especificado por el programador, si ese color proporciona un adecuado contraste con el fondo
de esa celda y en otro caso es pintado en blanco sobre fondo oscuro y en negro sobre fondo brillante.

La lógica está todavía en desarrollo y en la mayoría de los casos da un resultado razonable. Este comportamiento se puede
suprimir configurando la data oBrw:lContrastClr a .F.

h) El método SetBackGround( uBack, uMode ) ahora soporta gradiente de colores también.

(i) Mejora: Soporte para especificar una matriz de gradiente de colores como uBack. En este caso, uMode puede ser un
parámetro lógico ( .T. para orientación vertical ó .F. para orientación horizontal ) siendo por defecto vertical ó la
configuración anterior.

El gradiente de colores se establece con esta función en cualquier momento durante la definición de xbrowse ó dinámicamente
en tiempo de ejecución. No es necesario especificar el gradiente de colores en la cláusula init del diálogo.

Del mismo modo se puede cambiar la orientación dinámicamente en cualquier momento. Como en el caso de fondos de imagen, el
grandiente también con respecto al tamaño de la ventana.

(ii) Corregido: Las imágenes de fondo no se estaban pintando correctamente en caso de usar diálogos creados desde recursos.

(iii) Parámetros:

uBack : colores cImageFile / cResource / hBmpHandle / oBrush / aGradient
En el caso de los manejadores de brochas y ficheros de mapas de bits, los objetos se destruirán al finalizar el programa.

uMode : En el caso de gradiente de colores con valor lógico y en otros casos de valor numérico BCK_TILED (0),
BCK_STRETCH (1), BCK_FILL (2) (por defecto BCK_TILED o modo anterior )

oBrw:SetBackGround() sin parámetros limpia cualquier fondo
oBrw:SetBackGround( nil, uMode ) cambia el modo para los fondos existentes

Se pueden especificar fácilmente los fondos la creación del xbrowse (ventanas / o cuadros de diálogo desde recursos)
con las nuevas cláusulas proporcionadas en la sintaxis del comando:

Ejemplos:

@ r, c, XBROWSE ( o REDEFINE XBROWSE ) ....... ;
BACKGROUND cImageFile/cResource/hBmphandle/oBrush [TILED/STRETCH/FILL]

Para gradiente de colores

@ r, c, XBROWSE ( o REDEFINE XBROWSE ) ....... ;
BACKGROUND aClrGradientArray [VERTICAL/HORIZONTAL]

Ejemplo: xbrgrad.prg demuestra

(a) La facilidad de especificar el gradiente de colores durante la creación del xbrowse.
(b) Cambiar la orientación en tiempo de ejecución ( horizontal / vertical ).
(c) Cambiar los colores del gradiente en tiempo de ejecución, seleccionando y sustituyendo cualquiera de los
tres coloresdel gradiente.
(d) Cambiar el tamaño de los diferentes colores en tiempo de ejecución.
(e) Ver el código de la matriz del gradiente.
(f) La edición en línea del código de la matriz del gradientes para cambiar dinámicamente el gradiente.
(g) Copiar el código de la matriz del gradiente que puede ser pegado y utilizado en otras aplicaciones.
(h) Mostrar texto dinámicamente en el contraste de colores para asegurar una mejor visibilidad.
(i) Mostrar las casillas de verificación de FW que aparecen en contraste con los colores de fondo de los
diferentes brillos.

Este pequeño programa, con su interface de usuario intuitivo, puede ser también usado como un simple diseñador
de un gradiente de tres colores para ser usado con xbrowses u otros controles.

i) Nuevo Data: TXBrwColumn:bGetChange. Si ha sido asignado, este bloque de código se utiliza como bloque de código
bChange de bEditGet durante la edición de las celdas donde nEditType es EDIT_GET.

Durante la edición del bEditGet, este bloque de código se evalúa con los tres primeros parámetros nKey, nFlats,
oGet de la misma manera que el bloque bChange de oGet y en adición recibe el objeto columna como el cuarto
parámetro. El objeto columna puede utilizarse para obtener información acerca de oBrw, oBrw:ownd, etc.

* REPORT:

Mejora: Ahora las imágenes se pueden imprimir dentro de las columnas del informe objeto. También es
posible imprimir texto sobre las imágenes.

#xcommand COLUMN [ <oRptCol> ] ;
[ TITLE <bTitle, ...> ] ;
[ AT <nCol> ] ;
[ DATA <bData, ...> ] ;
[ SIZE <nSize> ] ;
[ <pict: PICT, PICTURE> <cPicture, ...> ] ;
[ FONT <uFont> ] ;
[ <total: TOTAL> [ FOR <bTotalExpr> ] ] ;
[ <ColFmt:LEFT,CENTER,CENTERED,RIGHT> ] ;
[ <lShadow:SHADOW> ] ;
[ <lGrid:GRID> [ <nPen> ] ] ;
[ <memo: MEMO, MULTILINE> ] ;
[<img:IMAGE> [ IMGDATA <bimg> ] [HEIGHT <h> [<imgpix:PIXEL>] ] [ ALPHALEVEL <nAlpha>] ] ;

Si se especifica la cláusula IMAGE sin la cláusula IMGDATA, la columna de datos se trata como datos de
imagen binarios.

Si se especifican las cláusulas IMAGEN IMGDATA <bdata>, imgdata se imprime en el fondo y los datos de
cualquier texto en la columna de datos se imprime sobre el fondo.

La altura se puede especificar en el número equivalente de líneas de datos o en píxeles, así como el nivel alfa.

Esta funcionalidad está todavía bajo desarrollo y no está probada en diferentes clases de impresoras. Se apreciará
cualquier ayuda para mejorar la funcionalidad.

* Mejora: Bitmaps: Algunos ficheros de mapas de bits con canal alfa en la carpeta bitmaps\32x32 no son
premultiplicados. Ahora se convierteny se proporcionan en la carpeta AlphaBmp para su us.
regards, saludos

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

cron