Interface visual para Harbour hbmk2.exe
Posted: Sun Mar 17, 2013 10:35 pm
Harbour proporciona una potente utilidad make hbmk2.exe pero esta diseñada para ser usado desde una ventana de consola, por lo que pensé en proporcionarle un interface visual para que su uso sea aún mas sencillo
Este es un primer prototipo, muy incompleto, pero tal vez quieras probarlo, dar ideas, etc. gracias
vhb.prg
Este es un primer prototipo, muy incompleto, pero tal vez quieras probarlo, dar ideas, etc. gracias
vhb.prg
Code: Select all
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function BuildWindow()
local oDlg, oGet1, cPrgName := Space( 20 ), oSay3, oFld1, oSay2, oBtn1, oBtn2
local cResult, oResult, cPath, nRetCode
SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )
DEFINE DIALOG oDlg TITLE "Visual make for Harbour" ;
SIZE 600, 500
@ 16, 16 SAY oSay2 PROMPT "Main PRG" SIZE 30, 9 PIXEL OF oDlg
@ 25, 16 GET oGet1 VAR cPrgName SIZE 120, 12 PIXEL OF oDlg ;
ACTION oGet1:VarPut( cGetFile( "*.prg" ) )
@ 50, 16 SAY oSay3 PROMPT "Additional" SIZE 30, 9 PIXEL OF oDlg
@ 60, 16 FOLDER oFld1 PROMPTS "PRGs", "OBJs", "LIBs" ;
SIZE 200, 100 PIXEL OF oDlg
@ 22, 230 BUTTON oBtn1 PROMPT "&Build" ;
SIZE 60, 20 PIXEL OF oDlg ;
ACTION ( MemoWrit( "go.bat", "set path=c:\bcc582\bin" + CRLF + ;
"c:\harbour\bin\hbmk2 " + ;
"-comp=bcc " + ;
"-ic:\fwteam\include " + ;
"-lfiveh.lib " + ;
"-lfivehc.lib " + ;
"-Lc:\fwteam\lib " + ;
"-lc:\bcc582\lib\psdk\psapi.lib " + ;
"xhb.hbc " + ;
"-gtgui " + ;
AllTrim( cPrgName ) ),;
nRetCode := WaitRun( "go.bat > out.log", 0 ),;
oResult:SetText( GetError( nRetCode ) + CRLF + MemoRead( "out.log" ) ),;
WaitRun( cFileNoExt( cPrgName ) ),;
hb_SetEnv( "path", cPath ) )
@ 48, 230 BUTTON oBtn2 PROMPT "&Cancel" ;
SIZE 60, 20 PIXEL OF oDlg ;
ACTION oDlg:End()
@ 170, 16 SAY oSay3 PROMPT "Result" SIZE 30, 9 PIXEL OF oDlg
@ 180, 16 GET oResult VAR cResult MEMO ;
SIZE 200, 60 PIXEL OF oDlg
ACTIVATE DIALOG oDlg CENTERED
return oDlg
//----------------------------------------------------------------------------//
function GetError( nError )
do case
case nError == 0
return "Ok"
case nError == 2
return "unknown compiler"
case nError == 6
return "failed in compilation (Harbour, C compiler, Resource compiler)"
case nError == 7
return "failed in final assembly (linker or library manager)"
endcase
return Str( nError )
//----------------------------------------------------------------------------//