From f7b1452f168f416497f2cfaaa5535807be811dc9 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sat, 15 Nov 2008 21:19:55 +0000 Subject: [PATCH] 2008-11-15 13:12 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtwvg/gtwvg.c * harbour/contrib/gtwvg/gtwvg.h - pWVT->bResizing - pWVT->bAlreadySizing ; Optimized resizing behavior. Now Window must not flicker until resizing is finished. Please test. If this effects the desired behavior, let me port it to GTWVT also. * harbour/contrib/gtwvg/tests/demowvg.prg ! Adjusted few parameters. Just play with . ; TOFIX: INKEY() vs FireEvent() - Not sure what it behave like. * harbour/contrib/gtwvg/wvgcrt.prg ! Fixes to some events behaviors. Copy and Paste syndrome :-( --- harbour/ChangeLog | 17 +++ harbour/contrib/gtwvg/gtwvg.c | 139 +++++++++------------ harbour/contrib/gtwvg/gtwvg.h | 4 +- harbour/contrib/gtwvg/tests/demowvg.prg | 157 +++++++----------------- harbour/contrib/gtwvg/wvgcrt.prg | 9 +- 5 files changed, 127 insertions(+), 199 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 07a2c2dcdd..30c0f48736 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,23 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-11-15 13:12 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/gtwvg/gtwvg.c + * harbour/contrib/gtwvg/gtwvg.h + - pWVT->bResizing + - pWVT->bAlreadySizing + ; Optimized resizing behavior. Now Window must not flicker until + resizing is finished. Please test. If this effects the desired + behavior, let me port it to GTWVT also. + + * harbour/contrib/gtwvg/tests/demowvg.prg + ! Adjusted few parameters. Just play with . + ; TOFIX: INKEY() vs FireEvent() - Not sure what it behave like. + + * harbour/contrib/gtwvg/wvgcrt.prg + ! Fixes to some events behaviors. Copy and Paste syndrome :-( + + 2008-11-15 08:17 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtwvg/gtwvg.c * harbour/contrib/gtwvg/gtwvg.h diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index e3d19fda63..43685e5edf 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -331,8 +331,6 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) pWVT->ResizeMode = HB_GTI_RESIZEMODE_FONT; - pWVT->bAlreadySizing = FALSE; - pWVT->pPP = ( HB_GT_PARAMS * ) hb_xgrab( sizeof( HB_GT_PARAMS ) ); pWVT->pPP->style = WS_THICKFRAME|WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX; pWVT->pPP->exStyle = 0; @@ -605,7 +603,7 @@ static int hb_gt_wvt_key_ansi_to_oem( int c ) return * pszOem; } -static void hb_gt_wvt_FitRows( PHB_GTWVT pWVT ) +static BOOL hb_gt_wvt_FitRows( PHB_GTWVT pWVT ) { RECT wi; RECT ci; @@ -615,6 +613,12 @@ static void hb_gt_wvt_FitRows( PHB_GTWVT pWVT ) int borderHeight; GetClientRect( pWVT->hWnd, &ci ); + if( !pWVT->bMaximized && ( ci.right - ci.left ) == ( pWVT->PTEXTSIZE.x * pWVT->COLS ) + && + ( ci.bottom - ci.top ) == ( pWVT->PTEXTSIZE.y * pWVT->ROWS ) ) + { + return( FALSE ); + } GetWindowRect( pWVT->hWnd, &wi ); borderWidth = ( wi.right - wi.left - ( ci.right - ci.left ) ); @@ -639,10 +643,12 @@ static void hb_gt_wvt_FitRows( PHB_GTWVT pWVT ) pWVT->CentreWindow = pWVT->bMaximized ? TRUE : FALSE; HB_GTSELF_SETMODE( pWVT->pGT, ( USHORT ) ( maxHeight / pWVT->PTEXTSIZE.y ), ( USHORT ) ( maxWidth / pWVT->PTEXTSIZE.x ) ); pWVT->CentreWindow = bOldCentre; + return( TRUE ); } + return( FALSE ); } -static void hb_gt_wvt_FitSize( PHB_GTWVT pWVT ) +static BOOL hb_gt_wvt_FitSize( PHB_GTWVT pWVT ) { RECT wi; RECT ci; @@ -654,6 +660,12 @@ static void hb_gt_wvt_FitSize( PHB_GTWVT pWVT ) int top; GetClientRect( pWVT->hWnd, &ci ); + if( !pWVT->bMaximized && ( ci.right - ci.left ) == ( pWVT->PTEXTSIZE.x * pWVT->COLS ) + && + ( ci.bottom - ci.top ) == ( pWVT->PTEXTSIZE.y * pWVT->ROWS ) ) + { + return( FALSE ); + } GetWindowRect( pWVT->hWnd, &wi ); borderWidth = ( wi.right - wi.left - ( ci.right - ci.left ) ); @@ -678,7 +690,7 @@ static void hb_gt_wvt_FitSize( PHB_GTWVT pWVT ) top = wi.top; } - { + { /* Just a block */ HFONT hOldFont; HFONT hFont; int fontHeight; @@ -759,6 +771,30 @@ static void hb_gt_wvt_FitSize( PHB_GTWVT pWVT ) HB_GTSELF_EXPOSEAREA( pWVT->pGT, 0, 0, pWVT->ROWS, pWVT->COLS ); } } + return( TRUE ); +} + +static BOOL hb_gt_wvt_IsSizeChanged( PHB_GTWVT pWVT ) +{ + BOOL bSizeChanged = FALSE; + + if( pWVT->bResizable ) + { + if( pWVT->ResizeMode == HB_GTI_RESIZEMODE_FONT ) + bSizeChanged = hb_gt_wvt_FitSize( pWVT ); + else + bSizeChanged = hb_gt_wvt_FitRows( pWVT ); + + if( bSizeChanged ) + { + PHB_ITEM pEvParams = hb_itemNew( NULL ); + + hb_gt_wvt_AddCharToInputQueue( pWVT, HB_K_RESIZE ); + hb_gt_wvt_FireEvent( pWVT, HB_GTE_RESIZED, pEvParams ); + hb_itemRelease( pEvParams ); + } + } + return( bSizeChanged ); } static void hb_gt_wvt_ResetWindowSize( PHB_GTWVT pWVT ) @@ -836,12 +872,9 @@ static void hb_gt_wvt_ResetWindowSize( PHB_GTWVT pWVT ) if( wi.left < 0 || wi.top < 0 ) { - if( pWVT->ResizeMode == HB_GTI_RESIZEMODE_FONT ) - hb_gt_wvt_FitSize( pWVT ); - else + if( hb_gt_wvt_IsSizeChanged( pWVT ) ) { - hb_gt_wvt_FitRows( pWVT ); - hb_gt_wvt_AddCharToInputQueue( pWVT, HB_K_RESIZE ); + //hb_gt_wvt_AddCharToInputQueue( pWVT, HB_K_RESIZE ); } /* resize the window to get the specified number of rows and columns */ @@ -1154,6 +1187,15 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L default: keyCode = K_MOUSEMOVE; } + if( !pWVT->bTracking ) + { + TRACKMOUSEEVENT tmi; + tmi.cbSize = sizeof( TRACKMOUSEEVENT ); + tmi.dwFlags = TME_LEAVE | TME_HOVER ; + tmi.hwndTrack = pWVT->hWnd; + tmi.dwHoverTime = 1; + pWVT->bTracking = _TrackMouseEvent( &tmi ); + } break; } } @@ -1795,34 +1837,11 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara ShowWindow( pWVT->hWnd, SW_HIDE ); ShowWindow( pWVT->hWnd, SW_NORMAL ); } - pWVT->bResizing = TRUE; return 0; case WM_EXITSIZEMOVE: - { - PHB_ITEM pEvParams = hb_itemNew( NULL ); - - pWVT->bResizing = FALSE; - hb_wvt_gtSaveGuiState( pWVT ); - hb_gt_wvt_AddCharToInputQueue( pWVT, HB_K_RESIZE ); - hb_gt_wvt_FireEvent( pWVT, HB_GTE_RESIZED, pEvParams ); - hb_itemRelease( pEvParams ); - return 0; - } - case WM_SIZE: - if( pWVT->bResizing ) - { - if( !pWVT->bAlreadySizing ) - { - pWVT->bAlreadySizing = TRUE; - - if ( pWVT->ResizeMode == HB_GTI_RESIZEMODE_FONT ) - hb_gt_wvt_FitSize( pWVT ); - else - hb_gt_wvt_FitRows( pWVT ); - } - pWVT->bAlreadySizing = FALSE; - } + if( hb_gt_wvt_IsSizeChanged( pWVT ) ) + hb_wvt_gtSaveGuiState( pWVT ); return 0; case WM_SYSCOMMAND: @@ -1830,17 +1849,10 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara { case SC_MAXIMIZE: { - PHB_ITEM pEvParams = hb_itemNew( NULL ); - pWVT->bMaximized = TRUE; - if( pWVT->ResizeMode == HB_GTI_RESIZEMODE_FONT ) - hb_gt_wvt_FitSize( pWVT ); - else - { - hb_gt_wvt_FitRows( pWVT ); - } - hb_wvt_gtSaveGuiState( pWVT ); + if( hb_gt_wvt_IsSizeChanged( pWVT ) ) + hb_wvt_gtSaveGuiState( pWVT ); /* Disable "maximize" button */ #if (defined(_MSC_VER) && (_MSC_VER <= 1200 || defined(HB_WINCE)) || defined(__DMC__)) && !defined(HB_ARCH_64BIT) @@ -1852,14 +1864,8 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_DEFERERASE ); ShowWindow( pWVT->hWnd, SW_HIDE ); ShowWindow( pWVT->hWnd, SW_NORMAL ); - - hb_gt_wvt_AddCharToInputQueue( pWVT, HB_K_RESIZE ); - hb_gt_wvt_FireEvent( pWVT, HB_GTE_RESIZED, pEvParams ); - hb_itemRelease( pEvParams ); - return 0; } - case SYS_EV_MARK: { pWVT->bBeginMarked = TRUE; @@ -1913,15 +1919,6 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara hb_gt_wvt_FireEvent( pWVT, HB_GTE_MOUSE, pEvParams ); hb_itemRelease( pEvParams ); - - { - TRACKMOUSEEVENT tmi; - tmi.cbSize = sizeof( TRACKMOUSEEVENT ); - tmi.dwFlags = TME_LEAVE; - tmi.hwndTrack = pWVT->hWnd; - tmi.dwHoverTime = HOVER_DEFAULT; - TrackMouseEvent( &tmi ); - } return 0; } case WM_MOUSELEAVE: @@ -1935,16 +1932,8 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara hb_gt_wvt_FireEvent( pWVT, HB_GTE_MOUSE, pEvParams ); hb_itemRelease( pEvParams ); - - { - TRACKMOUSEEVENT tmi; - tmi.cbSize = sizeof( TRACKMOUSEEVENT ); - tmi.dwFlags = TME_HOVER; - tmi.hwndTrack = pWVT->hWnd; - tmi.dwHoverTime = HOVER_DEFAULT; - TrackMouseEvent( &tmi ); - } - return 0; + pWVT->bTracking = FALSE; + return DefWindowProc( hWnd, message, wParam, lParam );; } } @@ -2169,16 +2158,6 @@ static BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT ) if( b_MouseEnable ) hb_wvt_gtCreateToolTipWindow( pWVT ); } - - /* Make sure that first tracking event is generated */ - { - TRACKMOUSEEVENT tmi; - tmi.cbSize = sizeof( TRACKMOUSEEVENT ); - tmi.dwFlags = TME_LEAVE | TME_HOVER ; - tmi.hwndTrack = pWVT->hWnd; - tmi.dwHoverTime = HOVER_DEFAULT; - TrackMouseEvent( &tmi ); - } } return TRUE; @@ -3747,8 +3726,8 @@ static void hb_wvt_gtCreateObjects( PHB_GTWVT pWVT ) HINSTANCE h; int iIndex; - pWVT->bResizing = FALSE; pWVT->bDeferPaint = FALSE; + pWVT->bTracking = FALSE; pWVT->penWhite = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 255,255,255 ) ); pWVT->penBlack = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 0, 0, 0 ) ); diff --git a/harbour/contrib/gtwvg/gtwvg.h b/harbour/contrib/gtwvg/gtwvg.h index 3cc737454c..9515412bad 100644 --- a/harbour/contrib/gtwvg/gtwvg.h +++ b/harbour/contrib/gtwvg/gtwvg.h @@ -345,9 +345,6 @@ typedef struct RECT sRectNew; RECT sRectOld; - BOOL bResizing; - BOOL bAlreadySizing; - // To Be Split in 2 Structures <1 GUI dynamic> <2 GUI fixed> // int rowStart; // Holds nTop of last WM_PAINT rectangle returned by Wvt_GetPaintRect() @@ -422,6 +419,7 @@ typedef struct PHB_GT_PARAMS pPP; // Presentation Parameters BOOL bDeferPaint; // To create pure Windows dialogs + BOOL bTracking; // To track if mouse has eneter or left the window area } HB_GTWVT, * PHB_GTWVT; diff --git a/harbour/contrib/gtwvg/tests/demowvg.prg b/harbour/contrib/gtwvg/tests/demowvg.prg index 01b424cbf9..1a463972e8 100644 --- a/harbour/contrib/gtwvg/tests/demowvg.prg +++ b/harbour/contrib/gtwvg/tests/demowvg.prg @@ -753,7 +753,7 @@ FUNCTION WvtMyBrowse_X() DispBox( 0, 0, maxrow(), maxcol(), " ", "N/W" ) DispOutAt( oBrowse:nTop-2, oBrowse:nleft, padc( CurDrive()+":\"+CurDir()+"\"+"test.dbf", oBrowse:nRight-oBrowse:nLeft+1 ), "W+/W" ) - DispOutAt( maxrow(), 0, padc( ' ',maxcol()+1), 'B/W' ) + DispOutAt( maxrow(), 0, padc( ' ',maxcol()+1), 'B/W' ) While !lEnd oBrowse:ForceStable() @@ -777,7 +777,7 @@ FUNCTION WvtMyBrowse_X() DispBox( 0, 0, maxrow(), maxcol(), " ", "N/W" ) DispOutAt( oBrowse:nTop-2, oBrowse:nleft, padc( CurDrive()+":\"+CurDir()+"\"+"test.dbf", oBrowse:nRight - oBrowse:nLeft + 1 ), "W+/W" ) - DispOutAt( maxrow(), 0, padc( ' ',maxcol()+1), 'B/W' ) + DispOutAt( maxrow(), 0, padc( ' ',maxcol()+1), 'B/W' ) oBrowse:configure() case nKey == K_F2 @@ -791,37 +791,12 @@ FUNCTION WvtMyBrowse_X() case nKey == K_F3 aLastPaint1 := WvtSetBlocks( {} ) - - DoModalWindowByClass() - #if 0 - pGT1 := hb_gtCreate( 'WVG' ) - pGT := hb_gtSelect( pGT1 ) - - /* If coordinates are in row/cols */ - /* Extended Style, Standard Style, Top, Left, Rows, Columns, ParentGT, Visible, RowCols */ - /* If coordinates are in pixels */ - /* Extended Style, Standard Style, x, y, width, height, ParentGT, Visible, RowCols */ - nExStyle := WS_EX_DLGMODALFRAME - nStStyle := WS_POPUP + WS_CAPTION + WS_MINIMIZEBOX - hb_gtInfo( HB_GTI_PRESPARAMS, { nExStyle, nStStyle, 4, 8, 13, 50, pGT, .F., .T. } ) - - SetColor( 'W+/W' ) - CLS - hb_gtInfo( HB_GTI_RESIZABLE , .F. ) - Hb_GtInfo( HB_GTI_CLOSABLE , .F. ) - hb_gtInfo( HB_GTI_WINTITLE , 'Information! [R:4 C:8]' ) - hb_gtInfo( HB_GTI_DISABLE , pGT ) - - Hb_GtInfo( HB_GTI_SPEC , HB_GTS_SHOWWINDOW, SW_NORMAL ) - - alert( 'I am in modal window !' ) - - pGT1 := NIL - hb_gtSelect( pGT ) - hb_gtInfo( HB_GTI_ENABLE, pGT ) - hb_gtInfo( HB_GTI_SETFOCUS, pGT ) - #endif + DoModalWindow() WvtSetBlocks( aLastPaint1 ) + + case nKey == K_F4 + hb_gtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_MAXIMIZED ) + endcase end @@ -2228,6 +2203,8 @@ FUNCTION DrawSlide( hDlg, nSlide ) Return nil //----------------------------------------------------------------------// +// The function has to be called via hb_threadStart( {|| ExecuteActiveX( nActiveX ) } ) +// Function ExecuteActiveX( nActiveX ) Local oCrt @@ -2235,80 +2212,78 @@ Function ExecuteActiveX( nActiveX ) oCrt:closable := .f. oCrt:create() - //hb_gtReload( 'WVG' ) SetCursor( 0 ) SetColor( 'N/W' ) CLS - //SetMode( 30,60 ) - //Wvt_ShowWindow( 1 ) + oCrt:show() - //hb_gtInfo( HB_GTI_CLOSABLE, .F. ) + ExeActiveX( oCrt, nActiveX ) + oCrt:Destroy() Return nil //----------------------------------------------------------------------// -#define ie_evBeforeNavigate 100 - -#define evClick 1 -#define evDblClk 2 -#define evBtnDown 3 -#define evMouseMove 4 -#define evBtnUp 5 - Static Function ExeActiveX( oCrt, nActiveX ) - Local oCOM, nKey, cDhtml + Local oCom, nKey, cDhtml Local cServer Local cNavigate Local lEnd := .f. hb_gtInfo( HB_GTI_DEFERPAINT, .T. ) -//hb_toOutDebug( 'oCrt:hwnd=%i', Wvt_GetWindowHandle() ) + DEFAULT nActiveX TO 2 - oCOM := WvgActiveXControl():New( oCrt, , { 0,0 }, { 200,200 }, , .t. ) + oCom := WvgActiveXControl():New( oCrt, , { 0,0 }, { 200,200 }, , .t. ) do case case nActiveX == 1 hb_gtInfo( HB_GTI_WINTITLE, 'Shell.Explorer.2'+' [ '+'http://www.harbour.vouch.info'+' ]' ) - oCOM:CLSID := 'Shell.Explorer.2' - oCOM:mapEvent( 269, { {|| QOut( ' E X P L O R E R - 2 6 9' ) } } ) + oCom:CLSID := 'Shell.Explorer.2' + oCom:mapEvent( 269, { {|| QOut( ' E X P L O R E R - 2 6 9' ) } } ) case nActiveX == 11 hb_gtInfo( HB_GTI_WINTITLE, 'Shell.Explorer.2'+' [ '+'MSHTML Demo'+' ]' ) oCom:CLSID := "MSHTML:" + "

Stream Test

This HTML content is being loaded from a stream." case nActiveX == 2 - hb_gtInfo( HB_GTI_WINTITLE, 'AnalogClockControl.AnalogClock' ) - oCOM:CLSID := 'AnalogClockControl.AnalogClock' - oCOM:Id := 5 - oCOM:mapEvent( evDblClk, {|| DoModalWindow() ,; - oCOM:Value := .75632 ,; - oCOM:BackColor := RGB( 0,140,210 ),; - oCOM:Refresh() ,; - oCOM:ShowSecondsHand := .t. ,; - oCOM:Hands3D := .t. ,; - oCOM:Refresh() } ) + #define evClick 1 + #define evDblClk 2 + #define evBtnDown 3 + #define evMouseMove 4 + #define evBtnUp 5 - oCOM:mapEvent( evBtnUp, {|nBtn,nShift,nX,nY| if( nBtn == 2, lEnd := .t., NIL ) } ) + hb_gtInfo( HB_GTI_WINTITLE, 'AnalogClockControl.AnalogClock' ) + oCom:CLSID := 'AnalogClockControl.AnalogClock' + oCom:Id := 5 + oCom:mapEvent( evDblClk, {|| DoModalWindow() ,; + oCom:Value := .75632 ,; + oCom:BackColor := RGB( 0,140,210 ),; + oCom:Refresh() ,; + oCom:ShowSecondsHand := .t. ,; + oCom:Hands3D := .t. ,; + oCom:Refresh() } ) + + oCom:mapEvent( evBtnUp, {|nBtn,nShift,nX,nY| if( nBtn == 2, lEnd := .t., NIL ) } ) case nActiveX == 3 hb_gtInfo( HB_GTI_WINTITLE, 'file://C:\harbour\contrib\gtwvg\tests\myharu.pdf' ) - oCOM:CLSID := 'file://C:\harbour\contrib\gtwvg\tests\myharu.pdf' + oCom:CLSID := 'file://C:\harbour\contrib\gtwvg\tests\myharu.pdf' case nActiveX == 4 hb_gtInfo( HB_GTI_WINTITLE, 'Frontpage.Application' ) //oCom:CLSID := 'Frontpage.Application' oCom:CLSID := 'Excel.Application' oCom:visible := .t. + endcase - oCOM:create() + oCom:create() // After :CREATE() Messages // if nActiveX == 1 - oCOM:AddressBar := .t. - oCOM:Navigate( 'http://www.harbour.vouch.info' ) + oCom:AddressBar := .t. + oCom:Navigate( 'http://www.harbour.vouch.info' ) elseif nActiveX == 4 oCom:visible := .t. oCom:Display() @@ -2318,7 +2293,7 @@ Static Function ExeActiveX( oCrt, nActiveX ) nKey := inkey() if nKey == HB_K_RESIZE - Win_MoveWindow( oCOM:hWnd, 0, 0, hb_gtInfo( HB_GTI_SCREENWIDTH ), hb_gtInfo( HB_GTI_SCREENHEIGHT ), .F. ) + Win_MoveWindow( oCom:hWnd, 0, 0, hb_gtInfo( HB_GTI_SCREENWIDTH ), hb_gtInfo( HB_GTI_SCREENHEIGHT ), .F. ) elseif nKey == K_LBUTTONDOWN //hb_ToOutDebug( "Key is passed to the window procedure also!" ) @@ -2333,44 +2308,11 @@ Static Function ExeActiveX( oCrt, nActiveX ) endif enddo - oCOM:Destroy() + oCom:Destroy() Return nil //----------------------------------------------------------------------// Static Function DoModalWindow() - - DoModalWindowByClass() - - #if 0 - Local pGT1, pGT, nExStyle, nStStyle - - pGT1 := hb_gtCreate( 'WVG' ) - pGT := hb_gtSelect( pGT1 ) - - nExStyle := WS_EX_DLGMODALFRAME - nStStyle := WS_POPUP + WS_CAPTION + WS_MINIMIZEBOX - hb_gtInfo( HB_GTI_PRESPARAMS, { nExStyle, nStStyle, 4, 8, 13, 50, pGT, .F., .T. } ) - - SetColor( 'W+/W' ) - CLS - hb_gtInfo( HB_GTI_RESIZABLE , .F. ) - Hb_GtInfo( HB_GTI_CLOSABLE , .F. ) - hb_gtInfo( HB_GTI_WINTITLE , 'Information! [R:4 C:8]' ) - hb_gtInfo( HB_GTI_DISABLE , pGT ) - - Hb_GtInfo( HB_GTI_SPEC , HB_GTS_SHOWWINDOW, SW_NORMAL ) - - alert( 'I am in modal window !' ) - - pGT1 := NIL - hb_gtSelect( pGT ) - hb_gtInfo( HB_GTI_ENABLE, pGT ) - hb_gtInfo( HB_GTI_SETFOCUS, pGT ) - #endif - - Return nil -//----------------------------------------------------------------------// -Static Function DoModalWindowByClass() Local oCrt, nSel /* This part can be clubbed in a separate prg for different dialogs @@ -2384,9 +2326,10 @@ Static Function DoModalWindowByClass() oCrt:closable := .f. oCrt:title := 'Information! [R:4 C:8]' - oCrt:lbDblClick := {|aPos,uNIL,obj| MyCallback( aPos, uNIL, obj ) } - oCrt:leave := {|| QOut( 'Left the window client area' ) } - oCrt:enter := {|| QOut( 'Entered the window client area' ) } + oCrt:rbUp := {|aPos,uNIL,obj| DispOutAt( maxrow(), 0, padc( 'rbUp', maxcol()+1 ),'W+/R*' ) } + oCrt:lbUp := {|aPos,uNIL,obj| DispOutAt( maxrow(), 0, padc( 'lbUp', maxcol()+1 ),'W+/B*' ) } + oCrt:leave := {|| DispOutAt( maxrow(), 0, padc( 'Leaving', maxcol()+1 ), 'W+/RB' ) } + oCrt:enter := {|| DispOutAt( maxrow(), 0, padc( 'Entering', maxcol()+1 ), 'W+/B' ) } oCrt:Create() oCrt:show() @@ -2404,7 +2347,7 @@ Static Function DoModalWindowByClass() SetColor( 'N/W' ) CLS do while .t. - nSel := alert( 'I am in modal window !;Change parent position?',{'Yes','No','Exit'} ) + nSel := alert( 'I am in modal window !;< Try: MMove LBUp RBUp >;Click Parent Window', { 'OK' } ) if nSel == 0 .or. nSel == 3 exit @@ -2425,11 +2368,3 @@ Static Function DoModalWindowByClass() Return nil //----------------------------------------------------------------------// -Static Function MyCallBack( aPos, uNIL, oObj ) - Local scr := SaveScreen( 0,0,maxrow(),maxcol() ) - - Alert( 'Hi '+str( aPos[ 1 ] ) +':'+ str( aPos[ 2 ] ) ) - - RestScreen( 0,0,maxrow(),maxcol(),scr ) - Return nil -//----------------------------------------------------------------------// diff --git a/harbour/contrib/gtwvg/wvgcrt.prg b/harbour/contrib/gtwvg/wvgcrt.prg index b69a9a85b7..d357904627 100644 --- a/harbour/contrib/gtwvg/wvgcrt.prg +++ b/harbour/contrib/gtwvg/wvgcrt.prg @@ -1108,7 +1108,6 @@ METHOD dragDrop( xParam, xParam1 ) CLASS WvgCrt METHOD notifier( nEvent, xParams ) CLASS WvgCrt Local aPos, nReturn := 0 -//hb_ToOutDebug( "............ %i %i %i %i", nEvent, WM_MOUSEHOVER, WM_MOUSELEAVE, if( hb_isArray(xParams), xParams[ 1 ], 0 ) ) DO CASE CASE nEvent == HB_GTE_MOUSE @@ -1143,13 +1142,13 @@ METHOD notifier( nEvent, xParams ) CLASS WvgCrt endif EXIT case WM_RBUTTONUP //// - if hb_isBlock( ::sl_rbClick ) - eval( ::sl_rbClick, aPos, NIL, self ) + if hb_isBlock( ::sl_rbUp ) + eval( ::sl_rbUp, aPos, NIL, self ) endif EXIT case WM_LBUTTONUP //// - if hb_isBlock( ::sl_lbClick ) - eval( ::sl_lbClick, aPos, NIL, self ) + if hb_isBlock( ::sl_lbUp ) + eval( ::sl_lbUp, aPos, NIL, self ) endif EXIT case WM_RBUTTONDBLCLK