From fa6220892b5daff0a79020d88a220a4e54b5918a Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 26 Feb 2009 03:01:10 +0000 Subject: [PATCH] 2009-02-25 18:57 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtwvg/gtwvg.c * harbour/contrib/gtwvg/wvgcrt.prg * harbour/contrib/gtwvg/wvgwnd.prg ! More types of consoles. Mainly modal windows implementation. --- harbour/ChangeLog | 6 +++++ harbour/contrib/gtwvg/gtwvg.c | 43 +++++++------------------------- harbour/contrib/gtwvg/wvgcrt.prg | 12 +++++++-- harbour/contrib/gtwvg/wvgwnd.prg | 3 ++- 4 files changed, 27 insertions(+), 37 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a1a626d3e9..d9ee1fa608 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-25 18:57 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/gtwvg/gtwvg.c + * harbour/contrib/gtwvg/wvgcrt.prg + * harbour/contrib/gtwvg/wvgwnd.prg + ! More types of consoles. Mainly modal windows implementation. + 2009-02-25 15:35 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbwin/wapi_winuser.c ! Commented out WAPI_GETSCROLLBARINFO(). diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index 8feaac093e..81c42abd5c 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -1791,7 +1791,6 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara if( pWVT ) switch( message ) { - #if 1 case WM_HSCROLL: { PHB_ITEM pEvParams = hb_itemNew( NULL ); @@ -1818,7 +1817,6 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara hb_gt_wvt_FireEvent( pWVT, HB_GTE_VSCROLL, pEvParams ); return( 0 ); } - #endif case WM_CREATE: { if( pWVT->pPP->iWndType == HB_WNDTYPE_CRT ) @@ -2173,34 +2171,6 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara return( iResult ); } } - #if 0 - case WM_HSCROLL: - { - PHB_ITEM pEvParams = hb_itemNew( NULL ); - - hb_arrayNew( pEvParams, 3 ); - - hb_arraySetNL( pEvParams, 1, ( HB_LONG ) LOWORD( wParam ) ); - hb_arraySetNL( pEvParams, 2, ( HB_LONG ) HIWORD( wParam ) ); - hb_arraySetNInt( pEvParams, 3, ( HB_LONG ) ( HB_PTRDIFF ) lParam ); - - hb_gt_wvt_FireEvent( pWVT, HB_GTE_HSCROLL, pEvParams ); - return( 0 ); - } - case WM_VSCROLL: - { - PHB_ITEM pEvParams = hb_itemNew( NULL ); - - hb_arrayNew( pEvParams, 3 ); - - hb_arraySetNL( pEvParams, 1, ( HB_LONG ) LOWORD( wParam ) ); - hb_arraySetNL( pEvParams, 2, ( HB_LONG ) HIWORD( wParam ) ); - hb_arraySetNInt( pEvParams, 3, ( HB_LONG ) ( HB_PTRDIFF ) lParam ); - - hb_gt_wvt_FireEvent( pWVT, HB_GTE_VSCROLL, pEvParams ); - return( 0 ); - } - #endif } return DefWindowProc( hWnd, message, wParam, lParam ); @@ -2314,6 +2284,9 @@ static HWND hb_gt_wvt_CreateWindow( PHB_GTWVT pWVT ) pWVT->pPP->y = pt.y; bByConf = TRUE; + + //WS_THICKFRAME|WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX; + pWVT->pPP->style = WS_POPUP|WS_CAPTION|WS_DLGFRAME; } } } @@ -3023,14 +2996,16 @@ static BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) if( pWVT->hWnd ) { #if (defined(_MSC_VER) && (_MSC_VER <= 1200 || defined(HB_OS_WIN_CE)) || defined(__DMC__)) && !defined(HB_ARCH_64BIT) - LONG style; + LONG style = GetWindowLong( pWVT->hWnd, GWL_STYLE ); #else - LONG_PTR style; + LONG_PTR style = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE ); #endif if( pWVT->bResizable ) - style = WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_THICKFRAME; + //style = WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_THICKFRAME; + style = style | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME; else - style = WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_BORDER; + //style = WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_BORDER; + style = ( style & ~( WS_MAXIMIZEBOX | WS_THICKFRAME ) ); #if (defined(_MSC_VER) && (_MSC_VER <= 1200 || defined(HB_OS_WIN_CE)) || defined(__DMC__)) && !defined(HB_ARCH_64BIT) SetWindowLong( pWVT->hWnd, GWL_STYLE, style ); diff --git a/harbour/contrib/gtwvg/wvgcrt.prg b/harbour/contrib/gtwvg/wvgcrt.prg index 164faba97c..7393b376c4 100644 --- a/harbour/contrib/gtwvg/wvgcrt.prg +++ b/harbour/contrib/gtwvg/wvgcrt.prg @@ -241,7 +241,7 @@ EXPORTED: // HARBOUR implementation DATA resizable INIT .t. DATA resizeMode INIT HB_GTI_RESIZEMODE_FONT - DATA style INIT WS_OVERLAPPEDWINDOW + DATA style INIT (WS_OVERLAPPED + WS_CAPTION + WS_SYSMENU + WS_SIZEBOX + WS_MINIMIZEBOX + WS_MAXIMIZEBOX) DATA exStyle INIT 0 DATA lModal INIT .f. DATA pGTp @@ -321,6 +321,14 @@ METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgCr ::pGT := hb_gtSelect() endif + if ::lModal + ::style := WS_POPUP + WS_CAPTION + if !( ::resizable ) + //::exStyle := WS_EX_DLGMODALFRAME + //::style += WS_DLGFRAME + endif + endif + hb_gtInfo( HB_GTI_PRESPARAMS, { ::exStyle, ::style, ::aPos[ 1 ], ::aPos[ 2 ], ; ::maxRow+1, ::maxCol+1, ::pGTp, .F., lRowCol, HB_WNDTYPE_CRT } ) hb_gtInfo( HB_GTI_SETFONT, { ::fontName, ::fontHeight, ::fontWidth } ) @@ -345,7 +353,7 @@ METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgCr endif if ::lModal - //hb_gtInfo( HB_GTI_DISABLE, ::pGTp ) + hb_gtInfo( HB_GTI_DISABLE, ::pGTp ) endif if ::visible diff --git a/harbour/contrib/gtwvg/wvgwnd.prg b/harbour/contrib/gtwvg/wvgwnd.prg index 39b3e0b4a5..9e53d24c12 100644 --- a/harbour/contrib/gtwvg/wvgwnd.prg +++ b/harbour/contrib/gtwvg/wvgwnd.prg @@ -1328,7 +1328,7 @@ METHOD ControlWndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgWindow CASE WM_CAPTURECHANGED EXIT - +#if 0 CASE WM_MOUSEMOVE IF ::objType == objTypeScrollBar IF !( ::lTracking ) @@ -1354,6 +1354,7 @@ METHOD ControlWndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgWindow ENDIF ENDIF EXIT +#endif END RETURN Win_CallWindowProc( ::nOldProc, hWnd, nMessage, nwParam, nlParam )