by ShumingWang » Mon Sep 17, 2012 5:10 am
REDEFINE GET DATE1 ID 102 OF odlg;
ACTION cal( DATE1, self )
FUNCTION cal( date1, oGet )
LOCAL odlg, oCal, aRect
LOCAL lOk := .f.
aRect := getWndRect( oGet:hWnd )
DEFINE DIALOG odlg FROM 0,0 TO 145,265 PIXEL STYLE nor( WS_POPUP,WS_VISIBLE,WS_BORDER)
//150, 174
@-10,-10 CALENDAR oCal VAR date1 OF odlg PIXEL DAYSTATE SIZE 150,89 DBLCLICK (lok:=.t.,odlg:end())
// 155,160
//87,75
oCal:bKeyDown := {|nkey| IF( nKey = 13 .OR. nKey = 32, (lok:=.t.,odlg:end()), ) }
odlg:oClient := oCal
ACTIVATE DIALOG odlg ON INIT (ocal:show(),odlg:move(aRect[1] + oGet:nHeight ,aRect[2])) ;
VALID IF( lOk .AND. ! GetKeyState( VK_ESCAPE ), (oGet:cText := date1, oGet:refresh(), .T. ), .t. )
RETURN NIL