New FTDN December/Diciembre 2020 (FWH 20.12)

New FTDN December/Diciembre 2020 (FWH 20.12)

Postby Antonio Linares » Mon Dec 28, 2020 10:16 am

September to December 2020
==========================

* New: In Class TCalendar Method HandleEvent(), Change(), GetMinReqRect(), SizeRectToMin( aSize ),
SetCurrentView and GetCurrentView have been added and/or modified. Many thanks to AntoninoP
in the forums: viewtopic.php?f=3&t=39715&start=0

* Enhancement: New ACCESS/ASSIGN "cPrompt" method for Class TTVItem

* New: samples\pim.prg a personal information manager using TreeViews

* Fix: samples\xmltree.prg had an error loading the XML file. Already fixed.

* New: Class TTVItem Method Edit() allows inline editing on a TreeView item

* New: Class TTreeView Method EditItem( oItem ) allows inline editing on a TreeView item

* New: Class TTreeView Method GoBottom(), GoNext(), GoPrev(), SwapUp() and SwapDown().
Please review samples\pim.prg for an example of use.

* Fix: Functions FW_AdoPivotArray() and FW_AdoPivotRS() (source\function\adofuncs.prg)
are raising runtime error if the 2nd parameter is a table name but not
an sql query.
viewtopic.php?f=3&p=236838#p236838
Fixed. Now the 2nd parameter can be either a table name or sql query.

* Fix: method SayImage() in printer.prg:
Due to a bug in versions 2007 and 2008, this method raises a runtime
error when executed. Fixed now.
For details and recommended fix for earlier versions please see:
viewtopic.php?f=3&t=39420&p=236845#p236845

* CLASS TRichEdt5
- Modified / New METHOD SaveAs()

- Added New METHOD RtfBarEdit( nR, nC, nT )
Show / Hide ButtonBar

- Added ButtonBar to control RichEdt5 definition
#command @ <nTop>, <nLeft> RICHEDIT5 [ <oRTF> VAR ] <uVar> ;
[ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FONT <oFont> ] ;
[ <pixel: PIXEL> ] ;
[ MESSAGE <cMsg> ] ;
[ <lHScroll: HSCROLL> ] ;
[ <readonly: READONLY, NO MODIFY> ] ;
[ WHEN <uWhen> ] ;
[ VALID <uValid> ] ;
[ ON CHANGE <uChange> ] ;
[ <lDesign: DESIGN> ] ;
[ <lHighlight: HIGHLIGHT> ] ;
[ <file: FILE, FILENAME> <cFileName> ] ;
[ RTFSIZE <nRTFSize> ] ;
[ <lNoURL: NO URL> ] ;
[ <lNoScroll: NO SCROLL> ] ;
[ <lNoBorder: NOBORDER, NO BORDER> ] ;
[ MARGINLEFT <nLeftMargin> ] ;
[ <lBar: BARBUTTON> ] ;

- Added New Method SetPageRotate( n ) // 0 - 90 - 180 - 270

* TTreeView Class:
- Added TVN_BEGINLABELEDIT and TVN_ENDLABELEDIT, allow Edit TVItem.

* MEMOEDIT.PRG
- Changes for better use and implementation of the TRichEdt5 control

* BITMAPS.C
- Added new bitmap: closebn

* Support for Matrix calculations:
viewtopic.php?f=3&t=39736
* New CLASS FW_Matrix (for matrix calculations)
CLASS FW_Matrix:

READ ONLY DATAS AND ACCESS METHODS:

DATA aMatrix READONLY
DATA nRows, nCols READONLY
ACCESS lSquare INLINE ( ::nRows == ::nCols )
ACCESS Determinant INLINE If( ::nRows == ::nCols, m_determinant( ::aMatrix ), 0 )
ACCESS IsIdentity

CONSTRUCTOR METHODS:

METHOD New( aArray ) CONSTRUCTOR
METHOD Identity( nSize ) CONSTRUCTOR
// --> Identity matrix of nSize rows and nSize cols.
METHOD Random( nRows, nCols, nMin, nMax, lInteger ) CONSTRUCTOR
nMin and nMax default to -1 and +1
Returns a matrix with size nRows,nCols with each element initialized with a random value between nMin and nMax. If lInteger is .t., all the values are integers.


METHODS TO PRINT OR VIEW:

METHOD View( [cTitle] ) // Displays the array in xbrowse
METHOD AsText( [lCrlf := .f.] ) // --> string as box or single line

METHODS FOR CALCULATIONS:

METHOD Calc( bCalc, u ) // or ( u, bCalc )
Returns a new matrix object, evaluating bCalc on every element of the
matrix using the operand "u". "u" can be a scalar number of a matrix.
bCalc is evaluated with two params |x,y| where
x is ::aMatrix[ nRow, nCol ] for each row col and
y is the operand if numeric or corresponding u[ nRow, nCol ] if matrix and
nil if u is nil

METHOD Add( u ) INLINE ::Calc( { |x,y| x + y }, u )
METHOD Subtract( u ) INLINE ::Calc( { |x,y| x - y }, u )
METHOD SubtractFrom( u ) INLINE ::Calc( { |x,y| y - x }, u )
METHOD Negative() INLINE ::Calc( { |x| -x } )
METHOD ScalarInverse() INLINE ::Calc( { |x| 1 / x } )
METHOD Exp() INLINE ::Calc( { |x| Exp( x ) } )
METHOD Sigmoid() INLINE ::Calc( { |x| 1 / ( 1 + Exp( -x ) ) } )
METHOD Sigmoid_derivative() INLINE ::Calc( { |x| x * ( 1 - x ) } )

METHOD DevideBy( u )
METHOD DevideFrom( u )
METHOD Transpose()
METHOD SumOfRows()

METHOD LinearMultiply( u ) INLINE ::Calc( { |x,y| x * y }, u )
MESSAGE MatrixMultiply METHOD mmult
METHOD mmult( u )
METHOD Multiply( u )
// Linear multiply if u is numeric or matrix multiply if u is matrix

METHOD Linear( lSet ) INLINE ( ::plLinear := If( lSet == nil, .t., lSet ), Self )
matrix:Linear() operator operand always performs a linear calculation.

METHOD Invert()
METHOD Inverse() INLINE ::Invert()

OPERATOR "+" ARG u INLINE ::Add( u )
OPERATOR "-" ARG u INLINE ::Subtract( u )
OPERATOR "*" ARG u INLINE ::Multiply( u )
OPERATOR "/" ARG u INLINE ::DevideBy( u )
OPERATOR "==" ARG u INLINE ::IsEqual( u )
OPERATOR "^" ARG u INLINE If( u == -1, ::Inverse(), ::Calc( { |x,y| x ^ y }, u ) )

METHOD ByIndex( i ) OPERATOR "[]"
matrix[ nRow ] --> row as a single dimentional array.
Same as ::aMatrix[ nRow ]
matrix[ nRow, nCol ] --> value of ::aMatrix at nRow, nCol

It is recommended to use operators +-*/^ and == instead of calling the
corresponding methods.

OPERATOR *:
matrix1 * matrix2 --> result matrix of matrix multiplication of
matrix1 and matrix2
matrix1 * number --> new matrix with all elements of matrix1
multiplied the number.
matrix1:Linear() * matrix2 --> new matrix with all elements of
matrix1 multiplied by each corresponding element in matrix2

* A library of C functions is provided to build highly efficient
C level programs. These functions are independent of FW_Matrix class.

In this library, matrix is stored in the following structure:
typedef struct _MATRIX
{
int rows;
int cols;
int len;
int xlen;
double * array;
} MATRIX, * PMATRIX;

- Harbour level functions to access the C level functions:
MATRIX_CREATE( aArray ) --> Pointer to Matrix structure using aArray
MATRIX_IDENTITY( nSize ) --> pIdentityMatrix
MATRIX_RANDOM ( nRows, nCols, nMin = -1.0, nMax = 1.0, lIntegers )
--> pRandomMatrix
MATRIX_RELEASE( pMatrix )

MATRIX_TRANSPOSE( pMatrix ) --> pTransposedMatrix
MATRIX_VAL( pMatrix, nRow, nCol ) --> Value
MATRIX_ROW( pMatrix, nRow ) --> aRow
MATRIX_ARRAY( pMatrix ) --> aMatrix
MATRIX_INVERT( pMatrix ) --> Inverse of pMatrix
MATRIX_REFLECT( pMatrix ) --> Transposes the same Square Matrix

MATRIX_CALC( pmatrix1, cOp, double/pmatrix2, [lReverse], [presultmatrix] )
--> pResultMatrix
MATRIX_MMULT( pmatrix1, pmatrix2 ) --> pProductMatrix
MATRIX_DETERMINANT( pMatrix ) --> determinant
MATRIX_SUMOFROWS( matrix, [result] ) --> result

- C functions that can be used in an application program written in C.

double calc( double x, char cOp, double y, HB_BOOL inverse );
PMATRIX matrix_new( int iRows, int iCols );
void matrix_release( MATRIX * matrix );
PMATRIX matrix_check( PMATRIX matrix, int iRows, int iCols );
PMATRIX matrix_clone( MATRIX * matrix );
void matrix_copyfrom( PMATRIX dst, PMATRIX src );
PMATRIX matrix_identity( int iSize );
PMATRIX matrix_random( int iRows, int iCols, double dMin, double dMax,
HB_BOOL bInteger );
PMATRIX matrix_transpose( PMATRIX matrix, PMATRIX result );
PMATRIX matrix_scalar_calc( PMATRIX m1, char cOp, double operand,
HB_BOOL inverse, PMATRIX result );
PMATRIX matrix_sigmoid( PMATRIX matrix, PMATRIX result );
PMATRIX matrix_sigmoid_derivative( PMATRIX matrix, PMATRIX result );
PMATRIX matrix_linear_calc( PMATRIX m1, char cOp, PMATRIX m2, PMATRIX result );
PMATRIX matrix_sumofrows( PMATRIX matrix, PMATRIX result );
PMATRIX matrix_mmult( PMATRIX m1, PMATRIX m2, PMATRIX result );
double array_determinant( double * array, int iSize );
double matrix_determinant( PMATRIX matrix );
PMATRIX matrix_invert( PMATRIX matrix );

In the above functions, if the parameter PMATRIX result is NULL,
a new matrix of the required size is created and returned. This needs
to be released using matrix_release(). If result is a valid matrix pointer,
then this matrix is used to fill the result and returned, after resizing
if necessary. This avoids the overhead of creating a new matrix and
releasing it.

Normally, FW_Matrix class should be enough for most applications.
Where large computations are to be performed in large loops writing the
code in C using these C functions improves the execution speed considerably.
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 2020 (FWH 20.12)

Postby Antonio Linares » Mon Dec 28, 2020 3:18 pm

Septiembre a Diciembre 2020
===========================

* Nuevo: En la clase TCalendar los métodos HandleEvent(), Change(), GetMinReqRect(),
SizeRectToMin( aSize ), SetCurrentView y GetCurrentView han sido añadidos o modificados.
Muchas gracias a AntoninoP.
En los foros: viewtopic.php?f=3&t=39715&start=0

* Mejora: Nuevo método ACCESS/ASSIGN "cPrompt" para la clase TTVItem.

* Nuevo: Nuevo ejemplo de Gestor de Información Personal usando TreeViews, samples\pim.prg.

* Corrección: El ejemplo samples\xmltree tenía un error cargando el fichero XML. Solucionado.

* Nuevo: Método Edit() en la clase TTVItem, permite la edición en línea en un elemento TreeView.

* Nuevo: Método EditItem( oItem ), permite la edición en línea en un elemento TreeView.

* Nuevo: Métodos GoBottom(), GoNext(), GoPrev(), SwapUp() y SwapDown() en la clase TTreeView.
Por favor, revisa el ejemplo samples\pim.prg para un ejemplo de uso.

* Corrección: Las funciones FW_AdoPivotArray() y FW_AdoPivotRS() (source\function\adofuncs.prg)
están generando un error de tiempo de ejecución si el segundo parámetro es un nombre de tabla
pero no una consulta sql.
Corregido. Ahora, el segundo parámetro puede ser un nombre de tabla o una consulta SQL.
viewtopic.php?f=3&p=236838#p236838

* Corrección: Método SayImage() en printer.prg.
Debido a un error en las versiones 20.07 y 20.08, este método genera un error en tiempo de ejecución
cuando se ejecuta. Solucionado.
Para obtener detalles y la solución recomendada para versiones anteriores, consulte:
viewtopic.php?f=3&t=39420&p=236845#p236845

* Clase TRichEdt5
- Modificado / Nuevo método SaveAs()

- Añadido nuevo método RtfBarEdit( nR, nC, nT )
Muestra / Oculta la barra de botones.

- Añadida una barra de botones para controlar la definición del control RichEdt5.
#command @ <nTop>, <nLeft> RICHEDIT5 [ <oRTF> VAR ] <uVar> ;
[ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FONT <oFont> ] ;
[ <pixel: PIXEL> ] ;
[ MESSAGE <cMsg> ] ;
[ <lHScroll: HSCROLL> ] ;
[ <readonly: READONLY, NO MODIFY> ] ;
[ WHEN <uWhen> ] ;
[ VALID <uValid> ] ;
[ ON CHANGE <uChange> ] ;
[ <lDesign: DESIGN> ] ;
[ <lHighlight: HIGHLIGHT> ] ;
[ <file: FILE, FILENAME> <cFileName> ] ;
[ RTFSIZE <nRTFSize> ] ;
[ <lNoURL: NO URL> ] ;
[ <lNoScroll: NO SCROLL> ] ;
[ <lNoBorder: NOBORDER, NO BORDER> ] ;
[ MARGINLEFT <nLeftMargin> ] ;
[ <lBar: BARBUTTON> ] ;

- Añadido nuevo método SetPageRotate( n ) // 0 - 90 - 180 - 270

* Clase TTreeView
- Añadidos TVN_BEGINLABELEDIT y TVN_ENDLABELEDIT, permite editar TVItem.

* MEMOEDIT.PRG
- Cambios para un mejor uso e implementación del control TRichEdt5.

* BITMAPS.C
- Añadido un nuevo fichero de mapa de bits: closebn.

* Soporte para cálculos matriciales:
viewtopic.php?f=3&t=39736

* Nueva clase FW_Matrix (para cálculos matriciales)

CLASS FW_Matrix:

DATAs de sólo lectura y métodos de acceso:

DATA aMatrix READONLY
DATA nRows, nCols READONLY
ACCESS lSquare INLINE ( ::nRows == ::nCols )
ACCESS Determinant INLINE If( ::nRows == ::nCols, m_determinant( ::aMatrix ), 0 )
ACCESS IsIdentity

Métodos CONSTRUCTOR:

METHOD New( aArray ) CONSTRUCTOR
METHOD Identity( nSize ) CONSTRUCTOR // --> Matriz Identity de filas nSize y columnas nSize.
METHOD Random( nRows, nCols, nMin, nMax, lInteger ) CONSTRUCTOR // nMin y nMax por defecto -1 y +1
Devuelve una matriz con tamaño nRows, nCols con cada elemento inicializado con un valor aleatorio
entre nMin y nMax. Si lInteger es .T., todos los valores son números enteros.

Métodos para imprimir o visualizar:

METHOD View( [cTitle] ) // Muestra la matriz en un xBrowse.
METHOD AsText( [lCrlf := .f.] ) // --> Cadena como una caja o línea única.

Métodos para cáculos:

METHOD Calc( bCalc, u ) // o ( u, bCalc )
Devuelve un nuevo objeto de matriz, evaluando bCalc en cada elemento de la matriz usando el
operando "u". "u" puede ser un número escalar de una matriz.
bCalc se evalúa con dos parámetros |x, y| donde x es ::aMatrix [ nRow, nCol ] para cada fila
col e y es el operando si es numérico o se corresponde a u[ nRow, nCol ] si es matriz y nil si u es nil.

METHOD Add( u ) INLINE ::Calc( { |x,y| x + y }, u )
METHOD Subtract( u ) INLINE ::Calc( { |x,y| x - y }, u )
METHOD SubtractFrom( u ) INLINE ::Calc( { |x,y| y - x }, u )
METHOD Negative() INLINE ::Calc( { |x| -x } )
METHOD ScalarInverse() INLINE ::Calc( { |x| 1 / x } )
METHOD Exp() INLINE ::Calc( { |x| Exp( x ) } )
METHOD Sigmoid() INLINE ::Calc( { |x| 1 / ( 1 + Exp( -x ) ) } )
METHOD Sigmoid_derivative() INLINE ::Calc( { |x| x * ( 1 - x ) } )

METHOD DevideBy( u )
METHOD DevideFrom( u )
METHOD Transpose()
METHOD SumOfRows()

METHOD LinearMultiply( u ) INLINE ::Calc( { |x,y| x * y }, u )
MESSAGE MatrixMultiply METHOD mmult
METHOD mmult( u )
METHOD Multiply( u ) // Multiplicacion lineal si u es numérico o de matriz si u es matriz

METHOD Linear( lSet ) INLINE ( ::plLinear := If( lSet == nil, .t., lSet ), Self )
matrix:Linear() // El operador operando siempre realiza un cálculo lineal.


METHOD Invert()
METHOD Inverse() INLINE ::Invert()

OPERATOR "+" ARG u INLINE ::Add( u )
OPERATOR "-" ARG u INLINE ::Subtract( u )
OPERATOR "*" ARG u INLINE ::Multiply( u )
OPERATOR "/" ARG u INLINE ::DevideBy( u )
OPERATOR "==" ARG u INLINE ::IsEqual( u )
OPERATOR "^" ARG u INLINE If( u == -1, ::Inverse(), ::Calc( { |x,y| x ^ y }, u ) )

METHOD ByIndex( i ) OPERATOR "[]"
matrix[ nRow ] --> fila como una matriz unidimensional.
Igual a ::aMatrix[ nRow ]
matrix[ nRow, nCol ] --> valor de ::aMatrix en nRow, nCol

Se recomienda utilizar operadores + - * / ^ y == en lugar de llamar a los
métodos correspondientes.

Operador *:
matrix1 * matrix2 --> matriz resultado de la multiplicación de matriz1 y matriz2.
matrix1 * number --> nueva matriz con todos los elementos de matrix1 multiplicados por number.
matrix1:Linear() * matrix2 --> nueva matriz con todos los elementos de matrix1 multiplicados por
cada elemento correspondiente de matrix2.

* Se proporciona una biblioteca de funciones C para construir programas de nivel C altamente eficientes.
Estas funciones son independientes de la clase FW_Matrix.

En esta biblioteca, la matriz se almacena en la siguiente estructura:
typedef struct _MATRIX
{
int rows;
int cols;
int len;
int xlen;
double * array;
} MATRIX, * PMATRIX;

- Funciones Harbour para acceder a las funciones de nivel C:
MATRIX_CREATE( aArray ) --> Puntero a la estructura de la Matriz usando aArray
MATRIX_IDENTITY( nSize ) --> pIdentityMatrix
MATRIX_RANDOM ( nRows, nCols, nMin = -1.0, nMax = 1.0, lIntegers ) --> pRandomMatrix
MATRIX_RELEASE( pMatrix )

MATRIX_TRANSPOSE( pMatrix ) --> pTransposedMatrix
MATRIX_VAL( pMatrix, nRow, nCol ) --> Value
MATRIX_ROW( pMatrix, nRow ) --> aRow
MATRIX_ARRAY( pMatrix ) --> aMatrix
MATRIX_INVERT( pMatrix ) --> Inverso de pMatrix
MATRIX_REFLECT( pMatrix ) --> Transpone la misma matriz cuadrada

MATRIX_CALC( pmatrix1, cOp, double/pmatrix2, [lReverse], [presultmatrix] ) --> pResultMatrix
MATRIX_MMULT( pmatrix1, pmatrix2 ) --> pProductMatrix
MATRIX_DETERMINANT( pMatrix ) --> determinant
MATRIX_SUMOFROWS( matrix, [result] ) --> result

- Funciones C que pueden ser usadas en un programa de aplicación escrito en C.

double calc( double x, char cOp, double y, HB_BOOL inverse );
PMATRIX matrix_new( int iRows, int iCols );
void matrix_release( MATRIX * matrix );
PMATRIX matrix_check( PMATRIX matrix, int iRows, int iCols );
PMATRIX matrix_clone( MATRIX * matrix );
void matrix_copyfrom( PMATRIX dst, PMATRIX src );
PMATRIX matrix_identity( int iSize );
PMATRIX matrix_random( int iRows, int iCols, double dMin, double dMax,
HB_BOOL bInteger );
PMATRIX matrix_transpose( PMATRIX matrix, PMATRIX result );
PMATRIX matrix_scalar_calc( PMATRIX m1, char cOp, double operand,
HB_BOOL inverse, PMATRIX result );
PMATRIX matrix_sigmoid( PMATRIX matrix, PMATRIX result );
PMATRIX matrix_sigmoid_derivative( PMATRIX matrix, PMATRIX result );
PMATRIX matrix_linear_calc( PMATRIX m1, char cOp, PMATRIX m2, PMATRIX result );
PMATRIX matrix_sumofrows( PMATRIX matrix, PMATRIX result );
PMATRIX matrix_mmult( PMATRIX m1, PMATRIX m2, PMATRIX result );
double array_determinant( double * array, int iSize );
double matrix_determinant( PMATRIX matrix );
PMATRIX matrix_invert( PMATRIX matrix );

En las funciones anteriores, si el resultado del parámetro PMATRIX es NULL,
se crea y devuelve una nueva matriz del tamaño requerido. Esta debe liberarse
usando matrix_release(). Si el resultado es un puntero de matriz válido,
esta matriz se usa para completar el resultado y se devuelve, después de cambiar
el tamaño si es necesario. Esto evita la sobrecarga de crear una nueva matriz y liberarla.

Normalmente, la clase FW_Matrix debería ser suficiente para la mayoría de las aplicaciones.
Cuando se deben realizar grandes cálculos en bucles grandes, la escritura del código en C
utilizando estas funciones C mejora considerablemente la velocidad de ejecución.

* En esta versión en la barra de menús se permiten brushes.
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 2020 (FWH 20.12)

Postby carlos vargas » Mon Jan 04, 2021 6:46 pm

Antonio, el doble click en tcalendar ya no esta funcionando.
puedes probar con testcalr.prg en la carpeta samples.
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: New FTDN December/Diciembre 2020 (FWH 20.12)

Postby Antonio Linares » Mon Jan 04, 2021 7:42 pm

Carlos,

Que debería hacer el doble click ?

Puedes poner un gif animado ?

muchas gracias
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 2020 (FWH 20.12)

Postby carlos vargas » Mon Jan 04, 2021 9:53 pm

USO
Code: Select all  Expand view
STATIC PROCEDURE Pago_SelFecha()
   LOCAL lCambio := FALSE
   LOCAL dFechaAnt := dFecha
   LOCAL cWhere

   dFecha := Seleccionar_Fecha( dFecha )

   IF Empty( dFecha )
      dFecha := dFechaAnt
   ELSE
      IF dFecha > Date()
         dFecha := dFechaAnt
         MsgAlert( "No se permite seleccionar fecha futura!", "Alerta" )
      ELSE
         lCambio := TRUE

         IF DoW( dFecha ) == DOW_DOMINGO
            MsgInfo( "Ha seleccionado un dia domingo!", "Alerta" )
         ELSEIF hb_isArray( aFeriados ) .and. AScan( aFeriados, dFecha ) > 0
            MsgInfo( "Ha seleccionado un dia feriado!", "Alerta" )
         ENDIF

         IF nRutaNum > 0
            cWhere := StrFormat( "a.fecha=%1 and a.num_ruta=%2", Var2Str( dFecha ), Var2Str( nRutaNum ) )
         ELSE
            cWhere := StrFormat( "a.fecha=%1", Var2Str( dFecha ) )
         ENDIF

         WaitOn( "Cambiando parametros de consulta..." )

         TRY
            oQryPago:SetWhere( cWhere, TRUE )
            lCambio := TRUE
         CATCH oError
            ShowError( oError )
         END

         IF !lCambio
            dFecha := dFechaAnt
         ELSE
            //lVer := ( dFecha < Date() )

            oBrw:GoTop()
            oBrw:RefreshTotals()
            oBrw:MakeTotals()

            IF nRutaNum > 0
               oDlg:cTitle := StrFormat( "Abonos del dia: [%1], Ruta: [%2]", DtoC( dFecha ), cRutaNom )
            ELSE
               oDlg:cTitle := StrFormat( "Abonos del dia: [%1], TODAS LAS RUTAS", DtoC( dFecha ) )
            ENDIF

            IF dFecha < Date()
               oBtnEditar:SetText( "&Mostrar" )
               oBtnEditar:cToolTip := "Visualizar datos del registro actual."
            ELSE
               oBtnEditar:SetText( "&Editar" )
               oBtnEditar:cToolTip := "Edita datos del registro actual."
            ENDIF

             oToolBar:aEvalWhen()
         ENDIF

         WaitOff()
      ENDIF
   ENDIF

   oBrw:SetFocus()

RETURN
 

Code: Select all  Expand view

FUNCTION Seleccionar_Fecha( dFecha )
   LOCAL lSelectDay := FALSE
   LOCAL oDlgCal
   LOCAL oCalendario

   DEFAULT dFecha := Date()

   DEFINE DIALOG oDlgCal NAME "DLG_SELE_CAL" OF GetWndDefault() FONT oFontD

   REDEFINE CALENDAR oCalendario VAR dFecha ;
      OF oDlgCal ID 101 ;
      DBLCLICK ( lSelectDay := TRUE, oDlgCal:End() )

   oCalendario:bKeyDown := { |nKey| IIf( nKey == VK_RETURN, ( lSelectDay := TRUE, oDlgCal:End() ), NIL ) }

   REDEFINE BUTTON ;
      ID 201 OF oDlgCal ;
      ACTION ( lSelectDay := TRUE, oDlgCal:End() )

   REDEFINE BUTTON ;
      ID 202 OF oDlgCal ;
      ACTION ( dFecha := Date(), lSelectDay := TRUE, oDlgCal:End() )

   REDEFINE BUTTON ;
      ID 203 OF oDlgCal ;
      ACTION ( lSelectDay := FALSE, oDlgCal:End() )

   ACTIVATE DIALOG oDlgCal

   IF !lSelectDay
      dFecha := CToD( "" )
   ENDIF

RETURN dFecha
 


Image

Con solo darle dobre click al dia que deseo el dialogo se cierra, retornado un true y ejecutando la accion que requiero.
esto funcionaba bien antes.
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: New FTDN December/Diciembre 2020 (FWH 20.12)

Postby Antonio Linares » Tue Jan 05, 2021 8:56 am

Carlos,

En FWH 20.12 hemos añadido esta línea en la clase TCalendar:

METHOD HandleEvent() VIRTUAL

Puedes comprobar, si comentas esa línea, si te vuelve a funcionar el doble click ? gracias
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 2020 (FWH 20.12)

Postby carlos vargas » Tue Jan 05, 2021 8:27 pm

ademas de sto he visto cambios en la definicion de constantes
ANTES
Code: Select all  Expand view


#define MCN_FIRST           (-750)
#define MCN_SELCHANGE       (MCN_FIRST + 1)
#define MCN_GETDAYSTATE     (MCN_FIRST + 3)


AHORA
Code: Select all  Expand view


#define MCN_FIRST           (-746)
#define MCN_SELCHANGE       (MCN_FIRST - 3) // -749
#define MCN_GETDAYSTATE     (MCN_FIRST - 1) // -747
#define MCN_VIEWCHANGE      (-750)
 

Bueno realmente solo cambia MCN_FIRST :-)
Revisando estos valores son los mismo en el SDK de windows
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: New FTDN December/Diciembre 2020 (FWH 20.12)

Postby carlos vargas » Tue Jan 05, 2021 8:28 pm

Vere lo que me indicas... te comento en breve..

Efectivamente antonio, comentado el metodo virtual funciono como antes.
gracias!
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: New FTDN December/Diciembre 2020 (FWH 20.12)

Postby Antonio Linares » Tue Jan 05, 2021 8:32 pm

carlos vargas wrote:ademas de sto he visto cambios en la definicion de constantes
ANTES
Code: Select all  Expand view


#define MCN_FIRST           (-750)
#define MCN_SELCHANGE       (MCN_FIRST + 1)
#define MCN_GETDAYSTATE     (MCN_FIRST + 3)


AHORA
Code: Select all  Expand view


#define MCN_FIRST           (-746)
#define MCN_SELCHANGE       (MCN_FIRST - 3) // -749
#define MCN_GETDAYSTATE     (MCN_FIRST - 1) // -747
#define MCN_VIEWCHANGE      (-750)
 


Carlos,

Si, asi es, lo hemos modificado de la forma en que lo usa Microsoft en sus ficheros .h de cabecera.
Los valores resultantes son los mismos:

-750 + 1 = -746 - 3 = -749

-750 + 3 = -746 - 1 = -747
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 24 guests