From 11890100e446c1b374c267a42e25e8c5cbd41f2b Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 10 Jun 2008 22:41:35 +0000 Subject: [PATCH] 2008-06-10 15:35 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com * harbour/source/rtl/gtwvt/gtwvt.c ! Fixed maximized state. Borders were missing. + Added functionality to force Windows not to show Windows contents while resizing. This can be set manually via ; To review: If this behavior be controlled via HB_GTI_SHOWRESIZING or like. * harbour/tests/wvtext.prg * Minor changes. --- harbour/ChangeLog | 11 +++++++ harbour/source/rtl/gtwvt/gtwvt.c | 52 +++++++++++++++++--------------- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b7e815cc4d..afa679c8b7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,17 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-10 15:35 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com + * harbour/source/rtl/gtwvt/gtwvt.c + ! Fixed maximized state. Borders were missing. + + Added functionality to force Windows not to show Windows contents while + resizing. This can be set manually via + + ; To review: If this behavior be controlled via HB_GTI_SHOWRESIZING or like. + + * harbour/tests/wvtext.prg + * Minor changes. + 2008-06-10 22:48 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/hbw32/dllcall.c * Casts and cleanups. diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index 5b1111a240..dfdc3fb43e 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -240,9 +240,9 @@ static int hb_gt_wvt_FireEvent( PHB_GTWVT pWVT, int nEvent ) if( hb_vmRequestReenter() ) { PHB_ITEM pEvent = hb_itemPutNI( NULL, nEvent ); - + nResult = hb_itemGetNI( hb_vmEvalBlockV( ( PHB_ITEM ) pWVT->pGT->pNotifierBlock, 1, pEvent ) ); - + hb_itemRelease( pEvent ); hb_vmRequestRestore(); @@ -489,8 +489,8 @@ static void hb_gt_wvt_FitSize( PHB_GTWVT pWVT, USHORT mode ) { SystemParametersInfo( SPI_GETWORKAREA, 0, &wi, 0 ); - maxHeight = wi.bottom - wi.top - borderwidth; - maxWidth = wi.right - wi.left - borderheight; + maxHeight = wi.bottom;// - wi.top - borderwidth; + maxWidth = wi.right;// - wi.left - borderheight; left = 0; top = 0; @@ -550,7 +550,7 @@ static void hb_gt_wvt_FitSize( PHB_GTWVT pWVT, USHORT mode ) for( n = 0; n < pWVT->COLS; n++ ) pWVT->FixedSize[ n ] = pWVT->PTEXTSIZE.x; - width = ( ( USHORT ) ( pWVT->PTEXTSIZE.x * pWVT->COLS ) ) + borderwidth; + width = ( ( USHORT ) ( pWVT->PTEXTSIZE.x * pWVT->COLS ) ) + ( pWVT->bMaximized ? 0 : borderwidth ); height = ( ( USHORT ) ( pWVT->PTEXTSIZE.y * pWVT->ROWS ) ) + borderheight; hb_gt_wvt_KillCaret( pWVT ); @@ -876,9 +876,9 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L HDC hdc = GetDC( pWVT->hWnd ); RECT rectUpd; - if( s_rectOld.left == 0 && - s_rectOld.right == 0 && - s_rectOld.top == 0 && + if( s_rectOld.left == 0 && + s_rectOld.right == 0 && + s_rectOld.top == 0 && s_rectOld.bottom == 0 ) { /* New selection */ @@ -887,10 +887,10 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L rect.top = a0.y; rect.right = a1.x; rect.bottom = a1.y; - + InvertRect( hdc, &rect ); } - else + else { int nS = 0; int nG = 0; @@ -898,12 +898,12 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L if( abs( rect.left - rect.right ) < abs( s_rectOld.left - s_rectOld.right ) ) { /* Selection shrunk horizontally */ - + rectUpd.left = rect.right; rectUpd.top = rect.top; rectUpd.right = s_rectOld.right; rectUpd.bottom = s_rectOld.bottom; - + RedrawWindow( pWVT->hWnd, &rectUpd, NULL, RDW_INVALIDATE | RDW_UPDATENOW ); ++nS; @@ -912,12 +912,12 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L if( abs( rect.top - rect.bottom ) < abs( s_rectOld.top - s_rectOld.bottom ) ) { /* Selection shrunk vertically */ - + rectUpd.left = rect.left; rectUpd.top = rect.bottom; rectUpd.right = s_rectOld.right; rectUpd.bottom = s_rectOld.bottom; - + RedrawWindow( pWVT->hWnd, &rectUpd, NULL, RDW_INVALIDATE | RDW_UPDATENOW ); ++nS; @@ -926,24 +926,24 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L if( nS == 2 ) { /* Selection shrunk horizontally + vertically */ - + rectUpd.left = rect.right; rectUpd.top = rect.bottom; rectUpd.right = s_rectOld.right; rectUpd.bottom = s_rectOld.bottom; - + RedrawWindow( pWVT->hWnd, &rectUpd, NULL, RDW_INVALIDATE | RDW_UPDATENOW ); } if( abs( rect.left - rect.right ) > abs( s_rectOld.left - s_rectOld.right ) ) { /* Selection grown horizontally */ - + rectUpd.left = s_rectOld.right; rectUpd.top = s_rectOld.top; rectUpd.right = rect.right; rectUpd.bottom = nS ? rect.bottom : s_rectOld.bottom; - + InvertRect( hdc, &rectUpd ); ++nG; @@ -952,12 +952,12 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L if( abs( rect.top - rect.bottom ) > abs( s_rectOld.top - s_rectOld.bottom ) ) { /* Selection grown vertically */ - + rectUpd.left = s_rectOld.left; rectUpd.top = s_rectOld.bottom; rectUpd.right = nS ? rect.right : s_rectOld.right; rectUpd.bottom = rect.bottom; - + InvertRect( hdc, &rectUpd ); ++nG; @@ -966,12 +966,12 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L if( nG == 2 ) { /* Selection grown horizontally + vertically */ - - rectUpd.left = s_rectOld.right; + + rectUpd.left = s_rectOld.right; rectUpd.top = s_rectOld.bottom; - rectUpd.right = rect.right; + rectUpd.right = rect.right; rectUpd.bottom = rect.bottom; - + InvertRect( hdc, &rectUpd ); } } @@ -1721,6 +1721,10 @@ static void hb_gt_wvt_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd AppendMenu( hSysMenu, MF_STRING, SYS_EV_MARK, "Mark and Copy" ); } + /* Force Windows not to show dragged windows contents */ + /* If desired it can be controlled via HB_GTI_SETDRAGFULLWINDOW or something like */ + SystemParametersInfo( SPI_SETDRAGFULLWINDOWS, 0, NULL, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE ); + /* SUPER GT initialization */ HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); HB_GTSELF_RESIZE( pGT, pWVT->ROWS, pWVT->COLS );