New FTDN December/Diciembre 2018 (FWH 18.12)

New FTDN December/Diciembre 2018 (FWH 18.12)

Postby Antonio Linares » Sun Dec 30, 2018 7:03 pm

DECEMBER 2018
=============

* New methods in TWindow, applicable to dialogs also, but not controls,
mdichild windows and child windows.

- METHOD SaveState() --> cState //text string of 88 chars containing
encoded information of the postion ans state of window, for saving and
later using with RestoreState

- METHOD RestoreState( cState ) //Restores window to the previusly saved
state.

Usage:
ACTIVATE WINDOW oWnd ;
ON INIT oWnd:RestoreState( MemoRead( "wndstate.txt" ) ) ;
VALID ( MemoWrit( "wndstate.txt", oWnd:SaveState() ), .t. )

- METHOD Arrow( r1, c1, r2, c2, [nClr], [nPenSize] )
Draws an arrow from point r1,c1 to r2,c2 with arrow head pointing to
r2,c2.

* Multiple Monitors support functions:
fwh\source\function\getsysin.prg

- FW_ActiveMonitors() --> nMonitors
Number of extended monitors currently active.

- FW_VirtualScreen() --> oRect
TRect object representing the area of virtual screen covered by all the
extended monitors. (Note: The object has datas nTop, nLeft, nBottom,
nRight, nWidth, nHeight)
The total width of the rectangle is the sum of horizontal resolutions of
all the monitors and height is the maximum of the vertical resolutions
of all the monitors.
Recommended reading for better understanding
https://docs.microsoft.com/en-us/window ... ual-screen
https://docs.microsoft.com/en-us/window ... y-monitors

- FW_GetMonitor(params) --> oMonitor (TMonitor object)
params:
FW_GetMonitor() --> oPrimaryMonitor
FW_GetMonitor( n ) --> nth Monitor object. Defaults to primary monitor
if there is only one active monitor.
FW_GetMonitor( oWnd/hWnd ) --> oMonitor containing max area of the window
FW_GetMonitor( nRow, nCol ) --> oMonitor containing the coordinates

- TMonitor class datas and methods
DATAS:
lPrimary // Is primary monitor
nTop, nLeft, nBottom, nRight, nWidth, nHeight
CenterPt --> { nRow, nCol }

METHODS:
Row( nMonitorRow ) --> nRow on Virtual Screen
Col( nMonitorCol ) --> nCol on Virtual Screen
Center( oWnd/hWnd ) --> Centers the window inside the monitor
Move( oWnd/hWnd ) --> Sets the window in the monitor with the same
relative coordinates

Example Usage:
ACTIVATE WINDOW oWnd ON INIT FW_GetMonitor( 2 ):Center( oWnd )
ACTIVATE WINDOW oWnd ON INIT FW_GetMonitor( 2 ):Move( oWnd )
If the program is run on a single monitor the display defaults to the
primary monitor

* Ximage: Cropping feature. While saving, the bounding dotted rectangle
was also being saved along with the cropped image. Fixed.

* XBrowse:

- Array of hashes: Now the entire array is scanned and all keys found
in any hash in the array are included in the columns.

- Added new style 2018 in addition to existing 2007,2010,2013 and 2015.
which looks like Excel of Office 360.
oBrw:SetStyle( 2018 )

- Method SetStyle( bClrGrad ) now accepts bClrGrad as parameter. This
allows implementation of custom color scheme. bClrHeader and nRecSelColor
are derived from the bClrGrad.

* BtnBmp:
- Fixed repainting issues when button is resized at runtime
(bug introduced in fwh1804).
viewtopic.php?f=3&t=36510

- Improved appearance of focus rect when btnbmp standard style has
focus.

* Enhancement to FW_ExcelToDBF() and FW_ArrayToDBF()
It is now possible to skip some columns in Excel range or array while
saving to dbf.
Example:
Excel range consists of 6 columns A,B,C,D,E,F and we need to save only
columns B,D,F to fields FLD1,FLD2,FLD3.
FW_ExcelToDBF( oRange, ",FLD1,,FLD2,,FLD3" )
or
FW_ExcelToDBF( oRange, "SKIP,FLD1,SKIP,FLD2,SKIP,FLD3" )

* New functions:

- GetWindowPlacement( hWnd ) --> cSave (binary string of 44 bytes)
- SetWindowPlacement( hWnd, cSave )

TWindow methods SaveState() and RestoreState( cState ) use these
functions.

- GDIP_DrawArrow( hDC, r1, c1, r2, c2, [nClr], [nPenSize] )
Draws arrow from r1,c1 to r2,c2 with arrow head pointing to r2,c2.

- FW_ClrToHTML( nClr ) --> cHtmlClr ( format "#rrggbb" )
Example:
? FW_ClrToHTML( CLR_BLUE ) --> #000080
regards, saludos

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

Re: New FTDN December/Diciembre 2018 (FWH 18.12)

Postby Antonio Linares » Mon Dec 31, 2018 2:44 pm

Diciembre 2018
==============
* Nuevos métodos en TWindow, aplicables también a diálogos, pero no a los
controles, ventanas secundarias mdi y ventanas secundarias.

- METHOD SaveState() --> cState // cadena de texto de 88 caracteres que
contiene información codificada de la posición y el estado de la ventana,
para guardar y usar posteriormente con RestoreState.
- METHOD RestoreState( cState ) // Restaura la ventana al estado previo
guardado.
Uso:
ACTIVATE WINDOW oWnd ;
ON INIT oWnd:RestoreState( MemoRead( "wndstate.txt" ) ) ;
VALID ( MemoWrit( "wndstate.txt", oWnd:SaveState() ), .t. )
- METHOD Arrow( r1, c1, r2, c2, [nClr], [nPenSize] )
Dibuja una flecha desde el punto r1, c1 a r2, c2 con la punta de la flecha
apuntando a r2, c2.
* Funciones para el soporte de múltiple monitores:
fwh\source\function\getsysin.prg
- FW_ActiveMonitors() --> nMonitors
Número de monitores extendidos actualmente activos.
- FW_VirtualScreen() --> oRect
El objeto TRect representa el área de pantalla virtual cubierta por todos
los monitores extendidos.
(Nota: el objeto tiene las datas nTop, nLeft, nBottom, nRight, nWidth, nHeight).
El ancho total del rectángulo es la suma de las resoluciones horizontales de
todos los monitores y la altura es el máximo de las resoluciones verticales de
todos los monitores.
Para un mejor entendimiento, recomendamos las siguientes lecturas(enlaces):
https://docs.microsoft.com/en-us/window ... ual-screen
https://docs.microsoft.com/en-us/window ... y-monitors
- FW_GetMonitor(params) --> oMonitor (Objeto TMonitor)
params:
FW_GetMonitor() --> oPrimaryMonitor // oPrimaryMonitor -- Monitor principal
FW_GetMonitor( n ) --> monitor (n). Por defecto es el monitor principal
si sólo hay un monitor activo.
FW_GetMonitor( oWnd/hWnd ) --> oMonitor contiene el área máxima de la ventana
FW_GetMonitor( nRow, nCol ) --> oMonitor contiene las coordenadas
- Clase TMonitor datas y métodos
DATAS:
lPrimary // Es el monitor pricipal
nTop, nLeft, nBottom, nRight, nWidth, nHeight
CenterPt --> { nRow, nCol }
METHODS:
Row( nMonitorRow ) --> nRow // Nº de fila en la pantalla virtual
Col( nMonitorCol ) --> nCol // Nº de columna en la pantalla virtual
Center( oWnd/hWnd ) --> Centra la ventana dentro del monitor
Move( oWnd/hWnd ) --> Establece la ventana en el monitor con las mismas
coordenadas relativas
Ejemplo de uso:
ACTIVATE WINDOW oWnd ON INIT FW_GetMonitor( 2 ):Center( oWnd )
ACTIVATE WINDOW oWnd ON INIT FW_GetMonitor( 2 ):Move( oWnd )
Si el programa se ejecuta en un solo monitor, la pantalla muestra por defecto
el monitor principal
* Ximage: característica de recorte. Mientras se guardaba, el rectángulo
punteado delimitador también se estaba guardando junto con la imagen recortada.
Corregido.
* XBrowse:
- Matriz de hashes: Ahora se analiza toda la matriz y todas las claves encontradas
en cualquier hash en la matriz se incluyen en las columnas.
- Se ha añadido un nuevo estilo 2018 a los existentes 2007,2010,2013 y 2015.
Se parece al existente en Excel de Office 360.
oBrw:SetStyle( 2018 )
- El método SetStyle (bClrGrad) ahora acepta bClrGrad como parámetro. Esto permite la
implementación de un esquema de color personalizado. bClrHeader y nRecSelColor se
derivan de bClrGrad.
* BtnBmp:
- Se ha corregido problemas de repintado cuando el botón se redimensiona en tiempo de ejecución
(Error introducido en fwh1804).
viewtopic.php?f=3&t=36510
- Se ha mejorado el aspecto del foco cuando el estilo estándar de btnbmp tiene el foco.
* Se ha mejorado FW_ExcelToDBF() y FW_ArrayToDBF()
Ahora es posible omitir algunas columnas en el rango Excel o matriz mientras se guarda en dbf.

Ejemplo:
El rango de Excel consta de 6 columnas A, B, C, D, E, F y debemos guardar solo las columnas B, D,
F en los campos FLD1, FLD2, FLD3.

FW_ExcelToDBF( oRange, ",FLD1,,FLD2,,FLD3" )
o
FW_ExcelToDBF( oRange, "SKIP,FLD1,SKIP,FLD2,SKIP,FLD3" )
* Nuevas funciones:
- GetWindowPlacement( hWnd ) --> cSave (cadena binaria de 44 bytes)
- SetWindowPlacement( hWnd, cSave )
Los métodos SaveState() y RestoreState( cState ) de TWindow usan estas funciones.
- GDIP_DrawArrow( hDC, r1, c1, r2, c2, [nClr], [nPenSize] )
Dibuja la flecha de r1, c1 a r2, c2 con la punta de la flecha apuntando a r2, c2.
- FW_ClrToHTML( nClr ) --> cHtmlClr ( formato "#rrggbb" )
Ejemplo:
? FW_ClrToHTML( CLR_BLUE ) --> #000080
regards, saludos

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