#include "FiveWin.ch"
#include "calendar.ch"
FUNCTION Main()
LOCAL oWnd, oCal
LOCAL dHoy := Date()
SET DATE TO BRITISH
SET EPOCH TO 1980
DEFINE DIALOG oWnd FROM 0, 0 TO 170, 170 PIXEL
@ 0, 0 CALENDAR oCal VAR dHoy OF oWnd PIXEL DAYSTATE size 100,100
ACTIVATE DIALOG oWnd ON INIT oCal:move(0,0)
RETURN NIL
El problema (que no es problema) viene del api de window, el api usa unidades logicas para las coordenadas de los dialogos, luego son transformadas a pixels despues de su creacion, usando algoritmos de conversion dependiendo del "font", el tema no es tan simple, pero es loq ue nos ofrece el api
#include "FiveWin.ch"
#include "calendar.ch"
FUNCTION Main()
LOCAL oWnd, oCal
LOCAL dHoy := Date()
SET DATE TO BRITISH
SET EPOCH TO 1980
DEFINE DIALOG oWnd FROM 0, 0 TO 150, 170 PIXEL
@ 0, 0 CALENDAR oCal VAR dHoy OF oWnd PIXEL DAYSTATE size 85,75
ACTIVATE DIALOG oWnd ON INIT oCal:move(0,0)
RETURN NIL
FUNCTION SHW_CAL()
LOCAL oWnd, oCal
LOCAL dHoy := Date()
Local nBottom := 13
Local nRight := 25.4
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
Local oFontCal :=TFont():New( GetDefaultFontName(), 0, GetDefaultFontHeight(),, )
SET DATE TO BRITISH
SET EPOCH TO 1980
DEFINE DIALOG oWnd SIZE nWidth, nHeight PIXEL ;
STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION, 4 );
TITLE "Seleziona una data" FONT oFontCal
@ 0, 0 CALENDAR oCal VAR dHoy OF oWnd PIXEL DAYSTATE size 100,100