diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 31327e3edf..4196ff87b7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to these authors: Viktor Szakats. */ +2009-05-28 18:43 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/gtwvg/wvgcrt.prg + * harbour/contrib/gtwvg/wvgparts.ch + * harbour/contrib/gtwvg/wvgtoolb.prg + * harbour/contrib/gtwvg/wvgwin.c + * harbour/contrib/gtwvg/wvgwnd.prg + * harbour/contrib/hbwin/wapi_commctrl.c + ! Changes to honor NUMERICS to POINTERS. + ! Few artifacts in WvgCRT(). + 2009-05-28 19:25 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * utils/hbmk2/hbmk2.prg ! Fixed -map option for mingw family. Strangely its help diff --git a/harbour/contrib/gtwvg/wvgcrt.prg b/harbour/contrib/gtwvg/wvgcrt.prg index fda74d2d67..8bfffc7657 100644 --- a/harbour/contrib/gtwvg/wvgcrt.prg +++ b/harbour/contrib/gtwvg/wvgcrt.prg @@ -318,16 +318,14 @@ METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgCr ::pGT := hb_gtSelect() endif - if ::lModal + IF ::lModal ::style := WS_POPUP + WS_CAPTION + WS_SYSMENU - #if 0 - if !( ::resizable ) - ::exStyle := WS_EX_DLGMODALFRAME - ::style += WS_DLGFRAME + IF ::resizable + ::style += WS_MINIMIZEBOX + WS_MAXIMIZEBOX + WS_THICKFRAME ENDIF - #endif - endif + ENDIF + hb_gtInfo( HB_GTI_RESIZABLE, ::resizable ) 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 } ) @@ -346,7 +344,6 @@ METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgCr ? " " ::hWnd := hb_gtInfo( HB_GTI_SPEC, HB_GTS_WINDOWHANDLE ) - hb_gtInfo( HB_GTI_RESIZABLE , ::resizable ) Hb_GtInfo( HB_GTI_CLOSABLE , ::closable ) hb_gtInfo( HB_GTI_WINTITLE , ::title ) hb_gtInfo( HB_GTI_RESIZEMODE, if( ::resizeMode == HB_GTI_RESIZEMODE_ROWS, HB_GTI_RESIZEMODE_ROWS, HB_GTI_RESIZEMODE_FONT ) ) diff --git a/harbour/contrib/gtwvg/wvgparts.ch b/harbour/contrib/gtwvg/wvgparts.ch index 91ed5e8ef1..2f12db1086 100644 --- a/harbour/contrib/gtwvg/wvgparts.ch +++ b/harbour/contrib/gtwvg/wvgparts.ch @@ -208,12 +208,14 @@ #define WVGSB_SLIDERTRACK 5 #define WVGSB_ENDTRACK 6 #define WVGSB_ENDSCROLL 7 -#define WVGSB_TOP 11 -#define WVGSB_BOTTOM 12 +#define WVGSB_TOP 11 +#define WVGSB_BOTTOM 12 #define WVGTABPAGE_TAB_BOTTOM 2 #define WVGTABPAGE_TAB_TOP 4 +#define WVGTOOLBAR_BUTTON_SEPARATOR 4 + #endif /* #ifndef _WVG_CH */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/gtwvg/wvgtoolb.prg b/harbour/contrib/gtwvg/wvgtoolb.prg index af221ef8a3..9f6c982bd9 100644 --- a/harbour/contrib/gtwvg/wvgtoolb.prg +++ b/harbour/contrib/gtwvg/wvgtoolb.prg @@ -294,12 +294,13 @@ METHOD configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS Wv /*----------------------------------------------------------------------*/ METHOD sendToolbarMessage( nMsg, p1, p2 ) CLASS WvgToolBar - RETURN Win_SendToolbarMessage( ::hWnd, nMsg, p1, p2 ) + + RETURN Win_SendToolbarMessage( ::pWnd, nMsg, p1, p2 ) /*----------------------------------------------------------------------*/ METHOD addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nStyle, cKey, nMapRGB ) CLASS WvgToolBar - LOCAL oBtn, hBitmap, cType, nBtn + LOCAL oBtn, pBitmap, cType, nBtn HB_SYMBOL_UNUSED( xDisabledImage ) HB_SYMBOL_UNUSED( xHotImage ) @@ -319,32 +320,30 @@ METHOD addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nStyle, cKey, oBtn:command := 100 + oBtn:index cType := valtype( xImage ) - hBitmap := 0 DO CASE CASE cType == "C" IF ( "." $ xImage ) .or. ( "/" $ xImage ) .or. ( "\" $ xImage ) .or. ( ":" $ xImage ) .or. file( xImage ) - hBitmap := Wvg_PrepareBitmapFromFile( xImage, ::imageWidth, ::imageHeight, .t., ::hWnd ) + pBitmap := Wvg_PrepareBitmapFromFile( xImage, ::imageWidth, ::imageHeight, .t., ::hWnd ) ELSE - hBitmap := Wvg_PrepareBitmapFromResourceName( xImage, ::imageWidth, ::imageHeight, .t., ::hWnd ) + pBitmap := Wvg_PrepareBitmapFromResourceName( xImage, ::imageWidth, ::imageHeight, .t., ::hWnd ) ENDIF CASE cType == "N" - hBitmap := Wvg_PrepareBitmapFromResourceID( xImage, ::imageWidth, ::imageHeight, .t., ::hWnd ) + pBitmap := Wvg_PrepareBitmapFromResourceID( xImage, ::imageWidth, ::imageHeight, .t., ::hWnd ) ENDCASE - IF !empty( hBitmap ) - oBtn:image := hBitmap + IF !empty( pBitmap ) + oBtn:image := pBitmap IF !empty( nMapRGB ) - nBtn := WAPI_ImageList_AddMasked( ::hImageList, hBitmap, nMapRGB ) + nBtn := WAPI_ImageList_AddMasked( ::hImageList, pBitmap, nMapRGB ) ELSE - nBtn := WAPI_ImageList_Add( ::hImageList, hBitmap ) + nBtn := WAPI_ImageList_Add( ::hImageList, pBitmap ) ENDIF - - WVG_AddToolbarButton( ::hWnd, nBtn, oBtn:caption, oBtn:command, 1, ::showToolTips ) + WVG_AddToolbarButton( ::pWnd, nBtn, oBtn:caption, oBtn:command, 1, ::showToolTips ) /* Set Button Size */ ::SendToolbarMessage( TB_SETBUTTONSIZE, ::buttonWidth, ::buttonHeight ) @@ -355,7 +354,7 @@ METHOD addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nStyle, cKey, #endif ::sendToolbarMessage( TB_AUTOSIZE ) ELSE - Wvg_AddToolbarButton( ::hWnd, , , oBtn:command, 3, .f. ) + Wvg_AddToolbarButton( ::pWnd, , , oBtn:command, 3, .f. ) ENDIF diff --git a/harbour/contrib/gtwvg/wvgwin.c b/harbour/contrib/gtwvg/wvgwin.c index f5695a41b6..3eacaa979c 100644 --- a/harbour/contrib/gtwvg/wvgwin.c +++ b/harbour/contrib/gtwvg/wvgwin.c @@ -870,11 +870,8 @@ HB_FUNC( WIN_MAKELPARAM ) HB_FUNC( WIN_CREATEWINDOWEX ) { HWND hWnd; - LPTSTR szWinName; - LPTSTR szClassName; - - szClassName = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); - szWinName = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); + LPTSTR szClassName = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); + LPTSTR szWinName = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); hWnd = CreateWindowEx( ( DWORD ) hb_parnint( 1 ), szClassName, @@ -893,29 +890,6 @@ HB_FUNC( WIN_CREATEWINDOWEX ) hb_retnint( ( HB_PTRDIFF ) hWnd ); } /*----------------------------------------------------------------------*/ -#if 0 -HB_FUNC( WIN_CREATETOOLBAREX ) -{ - HWND hWnd; - - hWnd = CreateToolbarEx( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), - ( DWORD ) hb_parnint( 2 ), - hb_parni( 3 ), - hb_parni( 4 ), - ISNIL( 5 ) ? NULL : ( HINSTANCE ) ( HB_PTRDIFF ) hb_parnint( 5 ), - ISNIL( 6 ) ? 0 : hb_parnint( 6 ), - ISNIL( 7 ) ? NULL : ( LPCTBBUTTON ) ( HB_PTRDIFF ) hb_parnint( 7 ), - hb_parni( 8 ), - hb_parni( 9 ), - hb_parni( 10 ), - hb_parni( 11 ), - hb_parni( 12 ), - sizeof( TBBUTTON ) ); - - hb_retnint( ( HB_PTRDIFF ) hWnd ); -} -#endif -/*----------------------------------------------------------------------*/ /* * Bitmap Management Function . Coutesy GTWVW */ @@ -1234,7 +1208,8 @@ HB_FUNC( WVG_PREPAREBITMAPFROMFILE ) hBitmap = hPrepareBitmap( hb_parc( 1 ), 0, hb_parni( 2 ), hb_parni( 3 ), hb_parl( 4 ), ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ), 0 ); - hb_retnint( ( HB_PTRDIFF ) hBitmap ); + //hb_retnint( ( HB_PTRDIFF ) hBitmap ); + hb_retptr( ( void * ) hBitmap ); } /*----------------------------------------------------------------------*/ @@ -1246,7 +1221,8 @@ HB_FUNC( WVG_PREPAREBITMAPFROMRESOURCEID ) hBitmap = hPrepareBitmap( ( char * ) NULL, hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parl( 4 ), ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ), 2 ); - hb_retnint( ( HB_PTRDIFF ) hBitmap ); + //hb_retnint( ( HB_PTRDIFF ) hBitmap ); + hb_retptr( ( void * ) hBitmap ); } /*----------------------------------------------------------------------*/ @@ -1258,7 +1234,8 @@ HB_FUNC( WVG_PREPAREBITMAPFROMRESOURCENAME ) hBitmap = hPrepareBitmap( hb_parc( 1 ), 0, hb_parni( 2 ), hb_parni( 3 ), hb_parl( 4 ), ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ), 1 ); - hb_retnint( ( HB_PTRDIFF ) hBitmap ); + //hb_retnint( ( HB_PTRDIFF ) hBitmap ); + hb_retptr( ( void * ) hBitmap ); } /*----------------------------------------------------------------------*/ @@ -2108,7 +2085,7 @@ HB_FUNC( WVG_ADDTOOLBARBUTTON ) TBBUTTON tbb; TBADDBITMAP tbab; BOOL bSuccess; - HWND hWndTB = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ); + HWND hWndTB = wapi_par_HWND( 1 ); int iCommand = hb_parni( 4 ); TCHAR * szCaption; @@ -2121,9 +2098,9 @@ HB_FUNC( WVG_ADDTOOLBARBUTTON ) /* set bitmap */ tbab.hInst = NULL; #if (_WIN32_IE >= 0x0500) - tbab.nID = ( UINT_PTR ) wapi_par_HBITMAP( 2 ); + tbab.nID = ( UINT_PTR ) ( HBITMAP ) hb_parni( 2 ); #else - tbab.nID = ( UINT ) wapi_par_HBITMAP( 2 ); + tbab.nID = ( UINT ) ( HBITMAP ) hb_parni( 2 ); #endif iNewBitmap = ( int ) SendMessage( hWndTB, TB_ADDBITMAP, ( WPARAM ) 1, ( LPARAM ) &tbab ); @@ -2470,3 +2447,4 @@ HB_FUNC( WVG_RELEASEWINDOWPROCBLOCK ) } /*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/gtwvg/wvgwnd.prg b/harbour/contrib/gtwvg/wvgwnd.prg index cbb4f198d2..b72aecf76e 100644 --- a/harbour/contrib/gtwvg/wvgwnd.prg +++ b/harbour/contrib/gtwvg/wvgwnd.prg @@ -247,6 +247,7 @@ EXPORTED: METHOD sendMessage() DATA hWnd + DATA pWnd DATA aPos INIT { 0,0 } DATA aSize INIT { 0,0 } DATA aPresParams INIT {} @@ -378,12 +379,13 @@ METHOD SetWindowProcCallback() CLASS WvgWindow #endif #ifdef __BYSETPROP__ - ::nOldProc := WVG_SetWindowProcBlock( ::hWnd, {|h,m,w,l| ::ControlWndProc( h,m,w,l ) } ) + ::nOldProc := WVG_SetWindowProcBlock( ::pWnd, {|h,m,w,l| ::ControlWndProc( h,m,w,l ) } ) #endif RETURN Self /*----------------------------------------------------------------------*/ + METHOD captureMouse() CLASS WvgWindow RETURN Self @@ -529,12 +531,7 @@ METHOD setSize( aSize, lPaint ) CLASS WvgWindow SWITCH ::objType - CASE objTypeCrt - hb_gtInfo( HB_GTI_SCREENWIDTH , aSize[ 1 ] ) - hb_gtInfo( HB_GTI_SCREENHEIGHT, aSize[ 2 ] ) - EXIT - - OTHERWISE + CASE objTypeDialog /*Win_MoveWindow( ::hWnd, 0, 0, aSize[ 1 ], aSize[ 2 ], lPaint ) */ Win_SetWindowSize( ::hWnd, aSize[ 1 ], aSize[ 2 ], lPaint ) EXIT @@ -1256,6 +1253,7 @@ METHOD createControl() CLASS WvgWindow IF ( hWnd <> 0 ) ::hWnd := hWnd + ::pWnd := WIN_N2P( hWnd ) ::sendMessage( WM_SETFONT, Win_GetStockObject( DEFAULT_GUI_FONT ), 1 ) ENDIF @@ -1265,7 +1263,7 @@ METHOD createControl() CLASS WvgWindow METHOD ControlWndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgWindow LOCAL nCtrlID, nNotifctn, hWndCtrl, nObj, aMenuItem, oObj, nReturn - #if 0 + #if 1 hb_ToOutDebug( "%s:wndProc( %i %i %i %i )", __ObjGetClsName( self ), hWnd, nMessage, nwParam, nlParam ) #endif @@ -1384,4 +1382,5 @@ METHOD ControlWndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgWindow FUNCTION hb_toOut( ... ) RETURN hb_ToOutDebug( ... ) #endif + /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbwin/wapi_commctrl.c b/harbour/contrib/hbwin/wapi_commctrl.c index efbb40d09f..28c3856d10 100644 --- a/harbour/contrib/hbwin/wapi_commctrl.c +++ b/harbour/contrib/hbwin/wapi_commctrl.c @@ -56,6 +56,12 @@ #include "hbwapi.h" #include +#if defined(__BORLANDC__) && !defined(HB_ARCH_64BIT) + #undef MAKELONG + #define MAKELONG(a,b) ((LONG)(((WORD)((DWORD_PTR)(a) & 0xffff)) | \ + (((DWORD)((WORD)((DWORD_PTR)(b) & 0xffff))) << 16))) +#endif + /*----------------------------------------------------------------------*/ /* BEGIN - ImageList_* - API */ /*----------------------------------------------------------------------*/