From 0f7aa38d7d13af3536088aa8d56dadc933d38427 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sat, 7 Jun 2008 06:36:28 +0000 Subject: [PATCH] 2008-06-06 23:30 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com * harbour/source/rtl/gtwvt/gtwvt.c ! hb_gt_wvt_Info() + GTI_SCREENSIZE Hb_GtInfo( GTI_SCREENSIZE, { nPxlWidth, nPxlHeight } ) Try to adjust the mode to rows and columns best fitting nPxlWidth, nPxlHeight. + GTI_SETTIMER Hb_GtInfo( GTI_SETTIMER, { nTimerId, nMiliSeconds } ) + GTI_KILLTIMER Hb_GtInfo( GTI_KILLTIMER, nTimerId ) --- harbour/ChangeLog | 11 ++++++++++ harbour/source/rtl/gtwvt/gtwvt.c | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f81c05f16d..6312253df6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,17 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-06 23:30 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com + * harbour/source/rtl/gtwvt/gtwvt.c + ! hb_gt_wvt_Info() + + GTI_SCREENSIZE + Hb_GtInfo( GTI_SCREENSIZE, { nPxlWidth, nPxlHeight } ) + Try to adjust the mode to rows and columns best fitting nPxlWidth, nPxlHeight. + + GTI_SETTIMER + Hb_GtInfo( GTI_SETTIMER, { nTimerId, nMiliSeconds } ) + + GTI_KILLTIMER + Hb_GtInfo( GTI_KILLTIMER, nTimerId ) + 2008-06-06 20:45 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/source/rtl/hbgtcore.c * harbour/include/hbgtcore.h diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index 7955e31ca2..e2fec0433c 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -2088,6 +2088,41 @@ static BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) SetCaretBlinkTime( hb_itemGetNI( pInfo->pNewVal ) ); break; + case GTI_SCREENSIZE: + { + int iX, iY; + RECT rc = {0,0,0,0}; + RECT rc1 = {0,0,0,0}; + + GetWindowRect( pWVT->hWnd, &rc ); + + if( !pInfo->pResult ) + { + pInfo->pResult = hb_itemNew( NULL ); + } + hb_arrayNew( pInfo->pResult, 2 ); + hb_itemPutNI( hb_arrayGetItemPtr( pInfo->pResult,2 ), pWVT->PTEXTSIZE.y * pWVT->ROWS ); + hb_itemPutNI( hb_arrayGetItemPtr( pInfo->pResult,1 ), pWVT->PTEXTSIZE.x * pWVT->COLS ); + iY = hb_itemGetNI( hb_arrayGetItemPtr( pInfo->pNewVal,2 ) ); + iX = hb_itemGetNI( hb_arrayGetItemPtr( pInfo->pNewVal,1 ) ); + + if ( iY > 0 ) + { + BOOL bOldCentre = pWVT->CentreWindow; + pWVT->CentreWindow = pWVT->bMaximized ? TRUE : FALSE; + HB_GTSELF_SETMODE( pGT, (USHORT) ( iY / pWVT->PTEXTSIZE.y ), (USHORT) ( iX / pWVT->PTEXTSIZE.x ) ); + pWVT->CentreWindow = bOldCentre; + } + break; + } + case GTI_SETTIMER: + SetTimer( pWVT->hWnd, hb_arrayGetNI( pInfo->pNewVal,1 ), hb_arrayGetNI( pInfo->pNewVal,2 ), NULL ); + break; + + case GTI_KILLTIMER: + KillTimer( pWVT->hWnd, hb_itemGetNI( pInfo->pNewVal ) ); + break; + default: return HB_GTSUPER_INFO( pGT, iType, pInfo ); }