#include "FiveWin.ch"
#include "calendar.ch"
FUNCTION main()
LOCAL oDlg
LOCAL fecha := DATE()
SET DATE TO BRITISH
SET EPOCH TO 1980
DEFINE DIALOG oDlg FROM 10,10 TO 200,300 PIXEL
@ 20,20 GET fecha SIZE 100,22 OF oDlg PIXEL ACTION cal( fecha, self ) BITMAP "close.bmp"
ACTIVATE DIALOG oDlg
RETURN NIL
FUNCTION cal( fecha, oGet )
LOCAL oWnd, oCal, aRect
LOCAL dHoy := fecha, lOk := .T.
aRect := getWndRect( oGet:hWnd )
DEFINE DIALOG oWnd FROM 0, 0 TO 150, 174 PIXEL STYLE WS_CHILD | WS_POPUP | WS_VISIBLE
@ 0, 0 CALENDAR oCal VAR dHoy OF oWnd PIXEL DAYSTATE size 87,75 DBLCLICK oWnd:end()
oWnd:bLostFocus := {|| oWnd:end() }
oCal:bLostFocus := {|| oWnd:end() }
oCal:bKeyDown := {|nkey| IF( nKey = 13 .OR. nKey = 32, oWnd:end(), ) }
ACTIVATE DIALOG oWnd ON INIT oWnd:move(aRect[1] + oGet:nHeight ,aRect[2] )
IF lOk
oGet:cText := dHoy
oGet:refresh()
ENDIF
RETURN NIL
#include "FiveWin.ch"
#include "calendar.ch"
FUNCTION main()
LOCAL oDlg
LOCAL fecha := DATE()
SET DATE TO BRITISH
SET EPOCH TO 1980
DEFINE DIALOG oDlg FROM 10,10 TO 200,300 PIXEL
@ 20,20 GET fecha SIZE 100,22 OF oDlg PIXEL ACTION cal( fecha, self ) BITMAP "close.bmp"
ACTIVATE DIALOG oDlg
RETURN NIL
FUNCTION cal( fecha, oGet )
LOCAL oWnd, oCal, aRect
LOCAL dHoy := fecha, lOk := .T., lLostFocus := .F.
aRect := getWndRect( oGet:hWnd )
DEFINE WINDOW oWnd FROM 0, 0 TO 150, 174 PIXEL STYLE WS_CHILD | WS_POPUP | WS_VISIBLE
@ 0, 0 CALENDAR oCal VAR dHoy OF oWnd PIXEL DAYSTATE size 150,174 DBLCLICK oWnd:end() //87,75
oCal:bLostFocus := {|| lLostFocus := .T., oWnd:end() }
oCal:bKeyDown := {|nkey| IF( nKey = 13 .OR. nKey = 32, oWnd:end(), ) }
oWnd:oClient := oCal
ACTIVATE WINDOW oWnd ;
ON INIT oWnd:move(aRect[1] + oGet:nHeight ,aRect[2] ) ;
VALID IF( lOk .AND. ! lLostFocus .AND. ! GetKeyState( VK_ESCAPE ), ( oGet:cText := dHoy, oGet:refresh(), .T. ), .T. )
RETURN NIL
#include "FiveWin.ch"
#include "calendar.ch"
FUNCTION main()
LOCAL oDlg
LOCAL fecha := DATE()
SET DATE TO BRITISH
SET EPOCH TO 1980
DEFINE DIALOG oDlg FROM 10,10 TO 200,300 PIXEL
@ 20,20 GET fecha SIZE 100,22 OF oDlg PIXEL ACTION cal( fecha, self ) BITMAP "close.bmp"
ACTIVATE DIALOG oDlg
RETURN NIL
FUNCTION cal( fecha, oGet )
LOCAL oWnd, oCal, aRect
LOCAL dHoy := fecha, lOk := .T., lLostFocus := .F.
aRect := getWndRect( oGet:hWnd )
DEFINE WINDOW oWnd FROM 0, 0 TO 150, 174 PIXEL STYLE WS_CHILD | WS_POPUP | WS_VISIBLE
@ 0, 0 CALENDAR oCal VAR dHoy OF oWnd PIXEL DAYSTATE size 150,174 DBLCLICK oWnd:end() //87,75
oCal:bLostFocus := {|| lLostFocus := .T., oWnd:end() }
oCal:bKeyDown := {|nkey| IF( nKey = 13 .OR. nKey = 32, oWnd:end(), ) }
oWnd:oClient := oCal
oWnd:bKeyDown := {|nkey| IF( GetKeyState( VK_ESCAPE ), oWnd:end(), ) }
ACTIVATE WINDOW oWnd ;
ON INIT ( oWnd:move(aRect[1] + oGet:nHeight ,aRect[2] ), oCal:setFocus() ) ;
VALID IF( lOk .AND. ! lLostFocus .AND. ! GetKeyState( VK_ESCAPE ), ( oGet:cText := dHoy, oGet:refresh(), .T. ), .T. )
RETURN NIL
FUNCTION calendar( fecha, oGet )
//------------------------------------------------------------------------------
LOCAL oWnd, oCal, aRect, w, h, x, y, cps
LOCAL dHoy := fecha, lOk := .T., lLostFocus := .F.
IF isAppthemed()
w := 224; h := 159
ELSE
w := 174; h := 150
ENDIF
aRect := getWndRect( oGet:hWnd )
y := aRect[1] + oGet:nHeight
x := aRect[2]
DEFINE WINDOW oWnd FROM y, x TO y + h, x + w PIXEL STYLE WS_CHILD | WS_POPUP | WS_VISIBLE
@ 0, 0 CALENDAR oCal VAR dHoy OF oWnd PIXEL size h,w DBLCLICK oWnd:end() //87,75
oCal:bLostFocus := {|| lLostFocus := .T., oWnd:end() }
oCal:bKeyDown := {|nkey| IF( nKey = 13 .OR. nKey = 32, oWnd:end(), ) }
oWnd:oClient := oCal
oWnd:bKeyDown := {|nkey| IF( GetKeyState( VK_ESCAPE ), oWnd:end(), ) }
ACTIVATE WINDOW oWnd ;
ON INIT ( oWnd:move(aRect[1] + oGet:nHeight ,aRect[2] ), oCal:setFocus() ) ;
VALID IF( lOk .AND. ! lLostFocus .AND. ! GetKeyState( VK_ESCAPE ), ( oGet:cText := dHoy, oGet:refresh(), .T. ), .T. )
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 87 guests