@ nRow, 70 GET aGet[1] VAR ddatacambio SIZE 100,24 PIXEL OF oDlgSub;
BITMAP "date.bmp" ACTION ( Selecdata(@ddatacambio, aGet[1]),aGet[1]:refresh())
the calendar run but when I double click it not run
i.e. it doesn't close the dialog and it doesn't refresh the date in the get
- Code: Select all Expand view RUN
#include "FiveWin.ch"
#include "calendar.ch"
Function SelecData(dFechaPres, oGet)
local oDlg, oButton1, oButton2, oSayFecha, oCalendar
local lOk := .f.
local dFecha
local aPoint := AdjustWnd(oGet, 97*2, 88*2)
local nWd := GetSysMetrics(0) * .20
local nHt := (GetSysMetrics(1) / 5 )
IF Empty(dFechaPres)
dFecha := Date()
ELSE
dFecha := dFechaPres
ENDIF
DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL ;
COLOR CLR_BLACK, RGB( 245,245,235) ;
TITLE "Selezione data"
oDlg:lHelpIcon = .f.
*oDlg:SetFont(oApp():oFont)
@ 0,1 CALENDAR oCalendar VAR dFecha ;
SIZE 200, 170 OF oDlg ;
DBLCLICK ( lOk := .t., oDlg:End())
* oCalendar:SetFont(oApp():oFont)
oCalendar:oCursor := TCursor():New(,'HAND')
ACTIVATE DIALOG oDlg ;
ON PAINT ( oDlg:Move(aPoint[1], aPoint[2],,,.t.), ;
oCalendar:SetFocus(.t.) )
if lOK
oGet:cText( oCalendar:dDate )
sysrefresh()
endif
return NIL
function AdjustWnd( oBtn, nWidth, nHeight )
local nMaxWidth, nMaxHeight
local aPoint
aPoint := { oBtn:nTop + oBtn:nHeight(), oBtn:nLeft }
clientToScreen( oBtn:oWnd:hWnd, @aPoint )
nMaxWidth := GetSysMetrics(0)
nMaxHeight := GetSysMetrics(1)
if aPoint[2] + nWidth > nMaxWidth
aPoint[2] := nMaxWidth - nWidth
endif
if aPoint[1] + nHeight > nMaxHeight
aPoint[1] := nMaxHeight - nHeight
endif
return aPoint