FUNCTION MAKE_Exe()
c_path := CURDRIVE() + ":\" + GETCURDIR()
IF FILE ( c_path + "\PROJECT.PRG" )
// If File exists open with Editor
WAITRUN( "Angelwriter.exe PROJECT.PRG" ) // Open PRG with Editor
// Close Editor and create EXE-File
IF MsgYesNo( "Do you want to Create / Run : " + CRLF + ;
c_path + "\PROJECT.PRG" + " ?","PROJECT")
WAITRUN( "GO1.BAT" )
IF FILE ( c_path + "\PROJECT.EXE" )
WINEXEC( "&c_path\PROJECT.EXE" )
ELSE
MsgAlert( "The EXE-File : " + CRLF + ;
"is not created !","Error" )
ENDIF
ENDIF
ELSE
MsgAlert( "The File : " + CRLF + ;
"&c_Path\PROJECT.PRG" + CRLF + ;
"is not created !", "Error" )
ENDIF
RETURN( NIL )
IF not exist obj md obj
c:\bcc55\bin\make -f Project.rmk
FUNCTION MAKE_PRG(nOption1,nOption2)
IF FILE ( c_path + "\PROJECT.PRG" )
DELETE FILE "&c_path\PROJECT.PRG"
ENDIF
oText := TTxtFile():New( c_path + "\PROJECT.PRG" )
IF oText:Open()
oText:Add('#include "fivewin.ch"' )
oText:Add('')
oText:Add('STATIC hDC, oWndMain, oFont1' )
oText:Add('STATIC c_path' )
oText:Add('')
oText:Add('FUNCTION MAIN()')
oText:Add('LOCAL oBar, aColors1,aColors2,aColors3' )
oText:Add('LOCAL oBtn1, oBtn2, oBtn3, oBtn4' )
oText:Add('LOCAL oTmp, oBrush1, oBrush2, oBrush3, oBrush4' )
oText:Add('LOCAL aRect3 := GetSysmetrics( 1 ) // Screen-Height' )
oText:Add('LOCAL aRect4 := GetSysmetrics( 0 ) // Screen-Width' )
oText:Add('')
oText:Add('c_path := CURDRIVE() + ":\" + GETCURDIR()' )
oText:Add('oFont1 := TFont():New( "' + AF + '",' + A1 + ',' + A2 + ',.F.,' + A3 + ',' + A4 + ',0,0,' + A5 + ',' + A6 + ')' )
oText:Add('')
IF nOption1 = 1 // Window with Color selected
oText:Add('DEFINE BRUSH oBrush1 COLOR ' + ALLTRIM(STR(nColor1a)) )
oText:Add('DEFINE WINDOW oWndMain FROM 0, 0 TO aRect3, aRect4 TITLE "Window- and Dialog-test" BRUSH oBrush1 PIXEL' )
ENDIF
IF nOption1 = 2 // Windows with Gradient selected
oText:Add('DEFINE WINDOW oWndMain FROM 0, 0 TO aRect3, aRect4;' )
oText:Add('TITLE "Window- and Dialog-test" PIXEL' )
oText:Add('aColors1 := { { ' + ALLTRIM(STR(nMove1)) + ', ' + ALLTRIM(STR(nColor1a)) + ', ' + ALLTRIM(STR(nColor1b)) + ' }, { ' + + ALLTRIM(STR(nMove1)) + ', ' + ALLTRIM(STR(nColor1b)) + ', ' + ALLTRIM(STR(nColor1a)) + ' } }' )
oText:Add('hDC = CreateCompatibleDC( oWndMain:GetDC() )' )
oText:Add('hBmp = CreateCompatibleBitMap( oWndMain:hDC, oWndMain:nWidth(), oWndMain:nHeight() )' )
oText:Add('hBmpOld = SelectObject( hDC, hBmp )' )
oText:Add('GradientFill( hDC, -50, 0, oWndMain:nHeight(), oWndMain:nWidth(), aColors1, lDirect1 )' )
oText:Add('DeleteObject( oWndMain:oBrush:hBrush )' )
oText:Add('oWndMain:oBrush:hBitmap = hBmp' )
oText:Add('oWndMain:oBrush:hBrush = CreatePatternBrush( hBmp )' )
oText:Add('SelectObject( hDC, hBmpOld )' )
oText:Add('oWndMain:ReleaseDC()' )
ENDIF
IF nOption1 = 3 // Windows with Brush selected
oText:Add('DEFINE BRUSH oBrush1 FILENAME c_Path + "\bitmaps' + cBrush1 + '"' )
oText:Add('DEFINE WINDOW oWndMain FROM 0, 0 TO aRect3, aRect4;' )
oText:Add('TITLE "Window- and Dialog-test" BRUSH oBrush1 PIXEL' )
ENDIF
IF nOption1 = 4 // Windows with Image selected
oText:Add('DEFINE IMAGE oTmp FILENAME c_Path + "\bitmaps\' + cImage1 + '"' )
oText:Add('oBrush1 := TBrush():new( ,,,, ResizeBmp( oTmp:hBitmap, aRect4, aRect3, .T. ) )' )
oText:Add('DEFINE WINDOW oWndMain FROM 0, 0 TO aRect3, aRect4 ;' )
oText:Add('TITLE "Window- and Dialog-test" BRUSH oBrush1 PIXEL' )
oText:Add('oTmp:End()' )
ENDIF
IF nPreview > 1
oText:Add('ACTIVATE WINDOW oWndMain MAXIMIZED ;' )
oText:Add('ON INIT MDI_DIALOG() ;' )
oText:Add('ON PAINT ABPaint( hDC, 30, 380, oAlpha:hBitmap, 255 ) // Horiz / Vertical' )
ELSE
oText:Add('ACTIVATE WINDOW oWndMain MAXIMIZED ;' )
oText:Add('ON PAINT ABPaint( hDC, 30, 380, oAlpha:hBitmap, 255 ) // Horiz / Vertical' )
ENDIF
oText:Add('')
oText:Add('SET MESSAGE OF oWndMain TO FWVERSION + " TechData Software " ;' )
oText:Add('CENTERED 2007' )
oText:Add('')
oText:Add('oFont1:End()' )
IF nOption1 <> 2
oText:Add('oBrush1:End()' )
ENDIF
IF nOption2 <> 2
oText:Add('oBrush2:End()' )
ENDIF
oText:Add('')
oText:Add('RETURN NIL' )
oText:Add('')
oText:Close()
ENDIF
IF FILE ( c_path + "\PROJECT.PRG" )
// File exists open with Editor
WAITRUN( "Angelwriter.exe PROJECT.PRG" ) // copy from .PRG
// Close Editor and create EXE-File
IF MsgYesNo( "Do you want to Create / Run : " + CRLF + ;
c_path + "\PROJECT.PRG" + " ?","PROJECT")
WAITRUN( "GO1.BAT" )
IF FILE ( c_path + "\PROJECT.EXE" )
WINEXEC( "&c_path\PROJECT.EXE" )
ELSE
MsgAlert( "The EXE-File : " + CRLF + ;
"is not created !","Error" )
ENDIF
ENDIF
ELSE
MsgAlert( "The File : " + CRLF + ;
"&c_Path\PROJECT.PRG" + CRLF + ;
"is not created !", "Error" )
ENDIF
RETURN( NIL )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 78 guests