2011-05-20 17:26 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/gtwvg/gtwvg.c
    ! Applied: GTWVT fix by Przemek regarding HB_GTI_FONTSIZE.
This commit is contained in:
Pritpal Bedi
2011-05-21 00:28:34 +00:00
parent 6c9f24b811
commit 3f2e77f1d3
2 changed files with 32 additions and 20 deletions

View File

@@ -16,6 +16,10 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-05-20 17:26 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/gtwvg/gtwvg.c
! Applied: GTWVT fix by Przemek regarding HB_GTI_FONTSIZE.
2011-05-20 17:11 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rtl/gtwvt/gtwvt.c
! update font metrics after HB_GTI_FONTSIZE also when window is not

View File

@@ -2827,29 +2827,21 @@ static HB_BOOL hb_gt_wvt_SetMode( PHB_GT pGT, int iRow, int iCol )
{
if( pWVT->hWnd ) /* Is the window already open */
{
if( pWVT->bResizable && ! pWVT->bFullScreen )
{
fResult = hb_gt_wvt_InitWindow( pWVT, iRow, iCol );
HB_GTSELF_REFRESH( pGT );
}
else
{
HFONT hFont = hb_gt_wvt_GetFont( pWVT->fontFace, pWVT->fontHeight, pWVT->fontWidth,
pWVT->fontWeight, pWVT->fontQuality, pWVT->CodePage );
HFONT hFont = hb_gt_wvt_GetFont( pWVT->fontFace, pWVT->fontHeight, pWVT->fontWidth,
pWVT->fontWeight, pWVT->fontQuality, pWVT->CodePage );
if( hFont )
if( hFont )
{
/*
* make sure that the mode selected along with the current
* font settings will fit in the window
*/
if( hb_gt_wvt_ValidWindowSize( pWVT->hWnd, iRow, iCol, hFont, pWVT->fontWidth ) )
{
/*
* make sure that the mode selected along with the current
* font settings will fit in the window
*/
if( hb_gt_wvt_ValidWindowSize( pWVT->hWnd, iRow, iCol, hFont, pWVT->fontWidth ) )
{
fResult = hb_gt_wvt_InitWindow( pWVT, iRow, iCol );
}
DeleteObject( hFont );
HB_GTSELF_REFRESH( pGT );
fResult = hb_gt_wvt_InitWindow( pWVT, iRow, iCol );
}
DeleteObject( hFont );
HB_GTSELF_REFRESH( pGT );
}
}
else
@@ -3083,6 +3075,22 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
hb_gt_wvt_ResetWindowSize( pWVT );
HB_GTSELF_REFRESH( pGT );
}
else
{
TEXTMETRIC tm;
HWND hDesk = GetDesktopWindow();
HDC hdc = GetDC( hDesk );
HFONT hOldFont = ( HFONT ) SelectObject( hdc, hFont );
SetTextCharacterExtra( hdc, 0 );
GetTextMetrics( hdc, &tm );
SelectObject( hdc, hOldFont );
ReleaseDC( hDesk, hdc );
pWVT->PTEXTSIZE.x = tm.tmAveCharWidth;
pWVT->PTEXTSIZE.y = tm.tmHeight;
}
DeleteObject( hFont );
}
}