As subject.
EMG
As subject.
EMG
Sorry, it is not enough. Latest xHarbour from CVS isn't currently usable.
EMG
Enrico,
We have not tested it yet.
The latest xharbour build that we provided with FWH 8.10 works very well and we are also quite busy working on the Visual IDE ![]()
Stefan,
fwh\samples\DateTime.prg works fine with Harbour (you can check on and off the controls), but GPFs with xHarbour when the checkbox is turned off. So it looks as a xHarbour issue.
Anyhow we are going to review it,
Stefan,
It looks as the problem comes from hb_retds()
If we change this line in Class TDatePick:
METHOD GetDate() INLINE Date() // GetDatePick( ::hWnd )
Then fwh\samples\DateTime.prg works fine with xHarbour.
Lets compare Harbour and xHarbour hb_retds()...
st.wYear = 0; st.wMonth = 0; st.wDay = 0;
SendMessage( ( HWND ) _parnl( 1 ), DTM_GETSYSTEMTIME, 0, ( LPARAM ) &st );
...METHOD Notify( nIdCtrl, nPtrNMHDR ) CLASS TDatePick
local nCode := GetNMHDRCode( nPtrNMHDR )
if nCode == -759 // Date-time picker changed
SysRefresh() // here !!!
Eval( ::bSetGet, ::GetDate() )
::Change()
endif
return nilAntonio,
many thanks for your help, but your solution does not work here. The sample is still crashing using an empty date or unselecting the checkbox
It seems, the sample stops working in the function sendmessage (...)
Stefan,
Please test our EXE built using FWH 8.10 (with the commented changes) and xHarbour:
// Date picker and Time picker samples
#include "FiveWin.ch"
#include "dtpicker.ch"
//----------------------------------------------------------------------------//
function Main()
local oDlg, aGet[5], aVAR[5], aSAY[5]
Set Date British
DEFINE DIALOG oDlg RESOURCE "Main"
aVAR[1] := Date()
REDEFINE DTPicker aGet[1] VAR aVAR[1] ID 120 UPDATE OF oDlg
REDEFINE SAY aSAY[1] ID 130 UPDATE OF oDlg
aVAR[2] := Date()
REDEFINE DTPicker aGet[2] VAR aVAR[2] ID 121 UPDATE OF oDlg
REDEFINE SAY aSAY[2] ID 131 UPDATE OF oDlg
aVAR[3] := ctod('')
REDEFINE DTPicker aGet[3] VAR aVAR[3] ID 122 UPDATE OF oDlg
REDEFINE SAY aSAY[3] ID 132 UPDATE OF oDlg
aVAR[4] := Hora()
REDEFINE TMPicker aGet[4] VAR aVAR[4] ID 123 UPDATE OF oDlg
REDEFINE SAY aSAY[4] ID 133 UPDATE OF oDlg
aVAR[5] := ''
REDEFINE TMPicker aGet[5] VAR aVAR[5] ID 124 UPDATE OF oDlg
REDEFINE SAY aSAY[5] ID 134 UPDATE OF oDlg
REDEFINE BUTTON ID IDOK OF oDlg ACTION ps_Show(aGet, aSAY)
REDEFINE BUTTON ID 4 OF oDlg ACTION ps_Clean(aSAY)
REDEFINE BUTTON ID IDCANCEL OF oDlg ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED
return nil
static proc ps_Show(aGet, aSAY)
local i, xValor
for i:= 1 to len(aGet)
xValor := Eval(aGet[i]:bSetGet)
xValor := if( Empty(xValor), 'EMPTY', xValor )
xValor := if( Valtype(xValor)='D', dtoc(xValor), xValor )
aSAY[i]:SetText( xValor )
next
return
static proc ps_Clean(aSAY)
local i, xValor
for i:= 1 to len(aSAY)
aSAY[i]:SetText( '' )
next
return
FUNCTION Hora()
local nAux, nMin, nHor, nSec, cMin, cHor, cSec
nSec := Seconds()
nAux := Int(nSec) / 3600
nHor := Int(nAux)
nAux := (nAux - nHor) * 60
nMin := Int(nAux)
nSec := Int( (nAux - nMin) * 60 )
cHor := Padl( alltrim(str(nHor)), 2, '0')
cMin := Padl( alltrim(str(nMin)), 2, '0')
cSec := Padl( alltrim(str(nSec)), 2, '0')
return cHor + cMin + cSecAntonio,
same as mine.
It fails at aVAR[3] := ctod('') .
It shows the actual date and crashes unselecting the checkbox.
The timepicker is working fine.
Stefan,
What FWH and xHarbour versions are you using ?
#ifdef __HARBOUR__
HB_FUNC (GETDATEPICK) //( PARAMS ) // ( hWnd ) --> dDate
#else
CLIPPER GETDATEPIC( PARAMS )
#endifMETHOD SetDate( dDate, lEmpty ) INLINE IIF (Empty(dDate),(lEmpty :=.t., dDate:=Date()), ),;
SetDatePick( ::hWnd, Year( dDate ),;
Month( dDate ), Day( dDate ),;
If( lEmpty != nil .and. lEmpty, 1, 0 ) )