From 94fec837cd71f0eb07b203341f2a4a2591e35231 Mon Sep 17 00:00:00 2001 From: Andi Jahja Date: Sun, 11 Nov 2001 08:38:17 +0000 Subject: [PATCH] andijahja@cbn.net.id --- harbour/contrib/hgf/win32/makefile.vc | 69 +++++++++++++++++++++++++++ harbour/contrib/hgf/win32/makevc.bat | 14 ++++++ harbour/contrib/hgf/win32/win32.c | 20 ++++---- 3 files changed, 93 insertions(+), 10 deletions(-) create mode 100644 harbour/contrib/hgf/win32/makefile.vc create mode 100644 harbour/contrib/hgf/win32/makevc.bat diff --git a/harbour/contrib/hgf/win32/makefile.vc b/harbour/contrib/hgf/win32/makefile.vc new file mode 100644 index 0000000000..75919d2a15 --- /dev/null +++ b/harbour/contrib/hgf/win32/makefile.vc @@ -0,0 +1,69 @@ +# makefile for Microsoft Visual C++ 32 bits +# Building of hgfwin32.lib - Harbour GUI framework for Win32 + +INCLUDE_DIR = ..\..\..\include +HARBOUR_EXE = ..\..\..\bin\vc\HARBOUR.EXE +CC = CL +CFLAGS = -TP -W3 -nologo -I$(INCLUDE_DIR) -DWIN32 +CLIBFLAGS = $(CFLAGS) -c +CLIBFLAGSDEBUG = $(CLIBFLAGS) -Zi + +BIN_DIR = ..\..\..\bin\vc +OBJ_DIR = ..\..\..\obj\vc +LIB_DIR = ..\..\..\lib\vc + +HGFWIN_LIB = $(LIB_DIR)\hgfwin32.lib +HGFWIN_LIB_OBJS = \ + $(OBJ_DIR)\button.obj \ + $(OBJ_DIR)\edit.obj \ + $(OBJ_DIR)\form.obj \ + $(OBJ_DIR)\menu.obj \ + $(OBJ_DIR)\menuitem.obj \ + $(OBJ_DIR)\winctrl.obj \ + $(OBJ_DIR)\win32.obj + +$(HGFWIN_LIB) : $(HGFWIN_LIB_OBJS) + lib /OUT:$(HGFWIN_LIB) $(HGFWIN_LIB_OBJS) + +# +# ADS dependencies +# + +$(OBJ_DIR)\button.c : button.prg + $(HARBOUR_EXE) $** $(HARBOURFLAGS) -o$*.c + +$(OBJ_DIR)\button.obj : $(OBJ_DIR)\button.c + $(CC) $(CLIBFLAGS) -Fo$@ $** + +$(OBJ_DIR)\edit.c : edit.prg + $(HARBOUR_EXE) $** $(HARBOURFLAGS) -o$*.c + +$(OBJ_DIR)\edit.obj : $(OBJ_DIR)\edit.c + $(CC) $(CLIBFLAGS) -Fo$@ $** + +$(OBJ_DIR)\form.c : form.prg + $(HARBOUR_EXE) $** $(HARBOURFLAGS) -o$*.c + +$(OBJ_DIR)\form.obj : $(OBJ_DIR)\form.c + $(CC) $(CLIBFLAGS) -Fo$@ $** + +$(OBJ_DIR)\menu.c : menu.prg + $(HARBOUR_EXE) $** $(HARBOURFLAGS) -o$*.c + +$(OBJ_DIR)\menu.obj : $(OBJ_DIR)\menu.c + $(CC) $(CLIBFLAGS) -Fo$@ $** + +$(OBJ_DIR)\menuitem.c : menuitem.prg + $(HARBOUR_EXE) $** $(HARBOURFLAGS) -o$*.c + +$(OBJ_DIR)\menuitem.obj : $(OBJ_DIR)\menuitem.c + $(CC) $(CLIBFLAGS) -Fo$@ $** + +$(OBJ_DIR)\winctrl.c : winctrl.prg + $(HARBOUR_EXE) $** $(HARBOURFLAGS) -o$*.c + +$(OBJ_DIR)\winctrl.obj : $(OBJ_DIR)\winctrl.c + $(CC) $(CLIBFLAGS) -Fo$@ $** + +$(OBJ_DIR)\win32.obj : win32.c + $(CC) $(CLIBFLAGS) -Fo$@ $** diff --git a/harbour/contrib/hgf/win32/makevc.bat b/harbour/contrib/hgf/win32/makevc.bat new file mode 100644 index 0000000000..ad8865dd10 --- /dev/null +++ b/harbour/contrib/hgf/win32/makevc.bat @@ -0,0 +1,14 @@ +@echo off +SET _LIB=%LIB% +SET _PATH=%PATH% +SET _INCLUDE=%INCLUDE% +SET LIB=C:\COMPILER\VC\LIB;%PATH% +SET PATH=C:\COMPILER\VC\BIN;%PATH% +SET INCLUDE=..\..\..\INCLUDE;C:\COMPILER\VC\INCLUDE;%_INCLUDE% +nmake /f makefile.vc %1 %2 %3 +SET LIB=%_LIB% +SET PATH=%_PATH% +SET INCLUDE=%_INCLUDE% +SET _LIB= +SET _PATH= +SET _INCLUDE= diff --git a/harbour/contrib/hgf/win32/win32.c b/harbour/contrib/hgf/win32/win32.c index 7f7fb37a15..6e41d2fccf 100644 --- a/harbour/contrib/hgf/win32/win32.c +++ b/harbour/contrib/hgf/win32/win32.c @@ -124,8 +124,8 @@ HB_FUNC( WINGETTEXT ) { BYTE bBuffer[ 255 ]; - GetWindowText( ( HWND ) hb_parnl( 1 ), bBuffer, 254 ); - hb_retc( bBuffer ); + GetWindowText( ( HWND ) hb_parnl( 1 ), (char*) bBuffer, 254 ); + hb_retc( (char*) bBuffer ); } @@ -221,7 +221,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) hb_vmDo( 4 ); if( hb_arrayGetType( &hb_stack.Return, 1 ) == HB_IT_NIL ) - return DefWindowProc( ( HANDLE ) hWnd, message, wParam, lParam ); + return DefWindowProc( ( HWND ) hWnd, message, wParam, lParam ); else return hb_parnl( -1, 1 ); } @@ -259,7 +259,7 @@ HB_FUNC( WINSETWIDTH ) WORD wHeight; GetWindowRect( hWnd, &rct ); - wHeight = rct.bottom - rct.top; + wHeight = (WORD) ( rct.bottom - rct.top ); if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD ) { @@ -291,7 +291,7 @@ HB_FUNC( WINSETHEIGHT ) WORD wWidth; GetWindowRect( hWnd, &rct ); - wWidth = rct.right - rct.left; + wWidth = (WORD) ( rct.right - rct.left ); if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD ) { @@ -333,8 +333,8 @@ HB_FUNC( WINSETTOP ) WORD wHeight, wWidth; GetWindowRect( hWnd, &rct ); - wHeight = rct.bottom - rct.top; - wWidth = rct.right - rct.left; + wHeight = (WORD) ( rct.bottom - rct.top ); + wWidth = (WORD) ( rct.right - rct.left ); if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD ) { @@ -376,8 +376,8 @@ HB_FUNC( WINSETLEFT ) WORD wHeight, wWidth; GetWindowRect( hWnd, &rct ); - wHeight = rct.bottom - rct.top; - wWidth = rct.right - rct.left; + wHeight = (WORD) ( rct.bottom - rct.top ); + wWidth = (WORD) ( rct.right - rct.left ); if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD ) { @@ -394,4 +394,4 @@ HB_FUNC( WINSETLEFT ) HB_FUNC( SHOWWINDOW ) { hb_retl( ShowWindow( ( HWND ) hb_parnl( 1 ), hb_parl( 2 ) ) ); -} \ No newline at end of file +}