From ac66a90bfaa99f336d2bc6fb974181c5c283333d Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Wed, 2 Jun 2010 07:47:23 +0000 Subject: [PATCH] 2010-06-02 00:41 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/gtwvg/tests/demowvg.prg * contrib/gtwvg/tests/wvgcuigdialog.prg * contrib/gtwvg/tests/wvgtbrowser.prg * contrib/gtwvg/tests/wvgutilities.prg * contrib/gtwvg/tests/wvgwvtclasses.prg * contrib/gtwvg/tests/wvgxbp.prg ! Suffixed remaining resources with hb_dirBase(). * contrib/hbide/hbide.prg * contrib/hbide/ideenviron.prg * contrib/hbide/ideprojmanager.prg ! Changed the way hbide.env file is located if not directed to use one. Before no attempt was made to locate it and user had to assign through "Compiler Environments" dialog. Now hbIDE looks it alongside hbide.ini, if one is not assigned, and loads at startup. --- harbour/ChangeLog | 17 ++++++++ harbour/contrib/gtwvg/tests/demowvg.prg | 40 +++++++++---------- harbour/contrib/gtwvg/tests/wvgcuigdialog.prg | 4 +- harbour/contrib/gtwvg/tests/wvgtbrowser.prg | 2 +- harbour/contrib/gtwvg/tests/wvgutilities.prg | 8 +++- harbour/contrib/gtwvg/tests/wvgwvtclasses.prg | 18 ++++----- harbour/contrib/gtwvg/tests/wvgxbp.prg | 4 +- harbour/contrib/hbide/hbide.prg | 15 ++++++- harbour/contrib/hbide/ideenviron.prg | 19 ++++++++- harbour/contrib/hbide/ideprojmanager.prg | 2 +- 10 files changed, 90 insertions(+), 39 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 78b788fdbc..2c129c0d46 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,23 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-06-02 00:41 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/gtwvg/tests/demowvg.prg + * contrib/gtwvg/tests/wvgcuigdialog.prg + * contrib/gtwvg/tests/wvgtbrowser.prg + * contrib/gtwvg/tests/wvgutilities.prg + * contrib/gtwvg/tests/wvgwvtclasses.prg + * contrib/gtwvg/tests/wvgxbp.prg + ! Suffixed remaining resources with hb_dirBase(). + + * contrib/hbide/hbide.prg + * contrib/hbide/ideenviron.prg + * contrib/hbide/ideprojmanager.prg + ! Changed the way hbide.env file is located if not directed to use one. + Before no attempt was made to locate it and user had to assign through + "Compiler Environments" dialog. Now hbIDE looks it alongside hbide.ini, + if one is not assigned, and loads at startup. + 2010-06-01 18:38 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qth/QListWidget.qth * contrib/hbqt/qth/QTableWidget.qth diff --git a/harbour/contrib/gtwvg/tests/demowvg.prg b/harbour/contrib/gtwvg/tests/demowvg.prg index 971357b561..1f6a51bbd0 100644 --- a/harbour/contrib/gtwvg/tests/demowvg.prg +++ b/harbour/contrib/gtwvg/tests/demowvg.prg @@ -39,12 +39,12 @@ REQUEST DbfNtx //-------------------------------------------------------------------// -#define IMAGE_VOUCH "vouch1.bmp" -#define IMAGE_BROWSE "v_browse.ico" -#define IMAGE_VR "vr_1.ico" -#define IMAGE_NOTES "v_notes.ico" -#define IMAGE_TOOLS "v_tools.ico" -#define IMAGE_HELP "v_notes.ico" +#define IMAGE_VOUCH hb_dirBase() + "vouch1.bmp" +#define IMAGE_BROWSE hb_dirBase() + "v_browse.ico" +#define IMAGE_VR hb_dirBase() + "vr_1.ico" +#define IMAGE_NOTES hb_dirBase() + "v_notes.ico" +#define IMAGE_TOOLS hb_dirBase() + "v_tools.ico" +#define IMAGE_HELP hb_dirBase() + "v_notes.ico" #define OBJ_TYPE_BUTTON 1 @@ -91,7 +91,7 @@ PROCEDURE Main() LOCAL cName := Pad( "Pritpal Bedi", 35 ) LOCAL cAdd1 := Pad( "60, New Professor Colony", 35 ) LOCAL cAdd2 := Pad( "Ludhiana, INDIA", 35 ) - LOCAL cAdd3 := Pad( "http://www.vouchcac.com", 35 ) + LOCAL cAdd3 := Pad( "http://hbide.vouch.info", 35 ) LOCAL nSlry := 20000 LOCAL aBlocks := {} LOCAL nColGet := 8 @@ -131,7 +131,7 @@ PROCEDURE Main() // Wvt_SetMousePos( 2,40 ) - aAdd( aBlocks, {|| Wvt_SetIcon( "vr_1.ico" ) } ) + aAdd( aBlocks, {|| Wvt_SetIcon( GetResource( "vr_1.ico" ) ) } ) aAdd( aBlocks, {|| Wvt_SetTitle( "Vouch" ) } ) aAdd( aBlocks, {|| Wvt_DrawLabel( 1,40, cLabel,6,, rgb(255,255,255), rgb(198,198,198), "Arial", 26, , , , , .t., .t. ) } ) aAdd( aBlocks, {|| Wvt_DrawBoxRaised( nTop, nLft, nBtm, nRgt ) } ) @@ -354,20 +354,20 @@ PROCEDURE WvtNextGets_X() Wvt_SetPalette( aNewPalette ) aAdd( aBlocks, {|| Wvt_SetTitle( "Wvt Gets 2nd Window with Different Palette" ) } ) - aAdd( aBlocks, {|| Wvt_DrawLine( maxrow()-1,0,maxrow()-1,maxcol() ) }) - aAdd( aBlocks, {|| Wvt_SetBrush( 0, rgb( 32,255,100 ) ) } ) - aAdd( aBlocks, {|| Wvt_DrawEllipse( 6,50,10,58 ) } ) + aAdd( aBlocks, {|| Wvt_DrawLine( maxrow()-1,0,maxrow()-1,maxcol() ) } ) + aAdd( aBlocks, {|| Wvt_SetBrush( 0, rgb( 32,255,100 ) ) } ) + aAdd( aBlocks, {|| Wvt_DrawEllipse( 6,50,10,58 ) } ) aAdd( aBlocks, {|| Wvt_SetBrush( 2, rgb( 255,255,100 ),1 ) } ) - aAdd( aBlocks, {|| Wvt_DrawRectangle( 11, 50, 13, 58 ) } ) - aAdd( aBlocks, {|| Wvt_DrawBoxGroupRaised( 5, 6, 19, 72 ) } ) + aAdd( aBlocks, {|| Wvt_DrawRectangle( 11, 50, 13, 58 ) } ) + aAdd( aBlocks, {|| Wvt_DrawBoxGroupRaised( 5, 6, 19, 72 ) } ) aAdd( aBlocks, {|| aEval( GetList, {|oGet| Wvt_DrawBoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } ) - aAdd( aBlocks, {|| Wvt_DrawButton( 21, 6,22, 9,"New" ,"vouch1.bmp" ) } ) - aAdd( aBlocks, {|| Wvt_DrawButton( 21,11,22,14,"Browse","vouch1.bmp", 1, rgb( 255,255,255 ) ) } ) - aAdd( aBlocks, {|| Wvt_DrawButton( 21,16,22,19, ,"vouch1.bmp" ) } ) + aAdd( aBlocks, {|| Wvt_DrawButton( 21, 6,22, 9,"New" ,"vouch1.bmp" ) } ) + aAdd( aBlocks, {|| Wvt_DrawButton( 21,11,22,14,"Browse","vouch1.bmp", 1, rgb( 255,255,255 ) ) } ) + aAdd( aBlocks, {|| Wvt_DrawButton( 21,16,22,19, ,"vouch1.bmp" ) } ) aAdd( aBlocks, {|| Wvt_DrawButton( 21,21,22,24,"Data",, 0, rgb( 100,22,241 ), rgb( 198,198,198 ) ) } ) - aAdd( aBlocks, {|| Wvt_DrawButton( 21,26,22,29,"Flat",IMAGE_VR,2 ) } ) - aAdd( aBlocks, {|| Wvt_DrawButton( 21,31,22,34,"Outline",IMAGE_VR,3 ) } ) + aAdd( aBlocks, {|| Wvt_DrawButton( 21,26,22,29,"Flat",IMAGE_VR,2 ) } ) + aAdd( aBlocks, {|| Wvt_DrawButton( 21,31,22,34,"Outline",IMAGE_VR,3 ) } ) aAdd( aBlocks, {|| Wvt_DrawButton( 22,36,22,41,"Data",, 0, rgb( 100,22,241 ), rgb( 198,198,198 ) ) } ) aLastPaint := WvtSetBlocks( aBlocks ) @@ -461,7 +461,7 @@ function WvtLines() CLS aAdd( aBlocks, {|| Wvt_DrawLine( 0, 0, 0, nCols, WVT_LINE_HORZ, WVT_LINE_RAISED , WVT_LINE_CENTER ) } ) - aAdd( aBlocks, {|| Wvt_DrawLine( 1, 0, 1, nCols, WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_TOP ) } ) + aAdd( aBlocks, {|| Wvt_DrawLine( 1, 0, 1, nCols, WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_TOP ) } ) aAdd( aBlocks, {|| Wvt_DrawLine( 2, 0, 2, nCols, WVT_LINE_HORZ, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_SOLID, 4, Rgb( 255,255,255 ) ) } ) aAdd( aBlocks, {|| Wvt_DrawLine( 3, 0, 3, nCols, WVT_LINE_HORZ, WVT_LINE_RAISED , WVT_LINE_CENTER, WVT_LINE_DASH , 0, Rgb( 255,0,0 ) ) } ) aAdd( aBlocks, {|| Wvt_DrawLine( 4, 0, 4, nCols, WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_BOTTOM ) } ) @@ -515,7 +515,7 @@ FUNCTION CreateMainMenu() oMenu := WvtMenu():new():create() oMenu:Caption:= "Wvt*Classes" - oMenu:AddItem( "Dialog One . New Window . Threaded", {|| DialogWvgClassesOne( 1 ) } ) + oMenu:AddItem( "Dialog One . New Window . Threaded" , {|| DialogWvgClassesOne( 1 ) } ) oMenu:AddItem( "Dialog One . Main Window . Primary Thread", {|| DialogWvgClassesOne( 2 ) } ) oMenu:AddItem( "-" ) oMenu:AddItem( "Dialog Two" , {|| DialogWvgClassesTwo() } ) diff --git a/harbour/contrib/gtwvg/tests/wvgcuigdialog.prg b/harbour/contrib/gtwvg/tests/wvgcuigdialog.prg index 4777764f87..464099a2ac 100644 --- a/harbour/contrib/gtwvg/tests/wvgcuigdialog.prg +++ b/harbour/contrib/gtwvg/tests/wvgcuigdialog.prg @@ -25,7 +25,7 @@ PROCEDURE ExecGCUI() IF hb_mtvm() Hb_ThreadStart( {|oCrt| oCrt := WvgCrt():New( , , { 2,4 }, { 20,81 }, , .t. ) , ; - oCrt:icon := "dia_excl.ico",; + oCrt:icon := GetResource( "dia_excl.ico" ),; oCrt:create(), ; GCUIConsole( oCrt ) , ; oCrt:destroy() } ) @@ -94,7 +94,7 @@ PROCEDURE GCUIConsole( oCrt ) // hTxt := Wvg_TextBox( 3,57,16,75, {10,10,-10,-10}, 'This is first TextBox Line!', 2, 2 ) // - Wvg_Image( 15,36,16,42, {-3,-3,3,3}, GOBJ_IMAGESOURCE_FILE, 'Vouch1.bmp' ) + Wvg_Image( 15,36,16,42, {-3,-3,3,3}, GOBJ_IMAGESOURCE_FILE, GetResource( 'Vouch1.bmp' ) ) Wvg_BoxRaised( 15,36,16,42,{-2,-2,2,2} ) // Wvg_ShadedRect( 1,54,18,79, { -5,-5,5,5 }, 0, {65000,21000,7000,56000}, {255,32255,16000,32500} ) diff --git a/harbour/contrib/gtwvg/tests/wvgtbrowser.prg b/harbour/contrib/gtwvg/tests/wvgtbrowser.prg index 7d735d7b36..b3a3599006 100644 --- a/harbour/contrib/gtwvg/tests/wvgtbrowser.prg +++ b/harbour/contrib/gtwvg/tests/wvgtbrowser.prg @@ -42,7 +42,7 @@ FUNCTION WvtMyBrowse() IF hb_mtvm() Hb_ThreadStart( {|oCrt| oCrt := WvgCrt():New( , , { -1,-2 }, { 34,69 }, , .T. ), ; oCrt:resizeMode := HB_GTI_RESIZEMODE_ROWS,; - oCrt:icon := "dia_excl.ico",; + oCrt:icon := GetResource( "dia_excl.ico" ),; oCrt:create(),; Wvt_SetGui( .t. ),; ExecBrowser( oCrt ),; diff --git a/harbour/contrib/gtwvg/tests/wvgutilities.prg b/harbour/contrib/gtwvg/tests/wvgutilities.prg index 30766de12f..36888e5448 100644 --- a/harbour/contrib/gtwvg/tests/wvgutilities.prg +++ b/harbour/contrib/gtwvg/tests/wvgutilities.prg @@ -500,4 +500,10 @@ FUNCTION WvtExePicture( nTop, nLeft, nBottom, nRight, nSlot, aOffset ) RETURN NIL -//-------------------------------------------------------------------// +/*----------------------------------------------------------------------*/ + +FUNCTION GetResource( cName ) + RETURN hb_dirBase() + cName + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/gtwvg/tests/wvgwvtclasses.prg b/harbour/contrib/gtwvg/tests/wvgwvtclasses.prg index 131aa5f529..d7c0860de9 100644 --- a/harbour/contrib/gtwvg/tests/wvgwvtclasses.prg +++ b/harbour/contrib/gtwvg/tests/wvgwvtclasses.prg @@ -79,13 +79,13 @@ STATIC FUNCTION MyDialogOne( oCrt ) cTxt := cTxt + "Enjoy - Pritpal Bedi, INDIA" aImg_:={} - aadd( aImg_, hb_DirBase() + "v_lock.bmp" ) - aadd( aImg_, hb_DirBase() + "v_new.bmp" ) - aadd( aImg_, hb_DirBase() + "v_clclt.bmp" ) - aadd( aImg_, hb_DirBase() + "v_calend.bmp" ) - aadd( aImg_, hb_DirBase() + "v_index.bmp" ) - aadd( aImg_, hb_DirBase() + "v_notes1.bmp" ) - aadd( aImg_, hb_DirBase() + "v_selct1.bmp" ) + aadd( aImg_, GetResource( "v_lock.bmp" ) ) + aadd( aImg_, GetResource( "v_new.bmp" ) ) + aadd( aImg_, GetResource( "v_clclt.bmp" ) ) + aadd( aImg_, GetResource( "v_calend.bmp" ) ) + aadd( aImg_, GetResource( "v_index.bmp" ) ) + aadd( aImg_, GetResource( "v_notes1.bmp" ) ) + aadd( aImg_, GetResource( "v_selct1.bmp" ) ) ? '.' Wvt_ShowWindow( 1 ) nWinRows := 55 @@ -170,7 +170,7 @@ STATIC FUNCTION MyDialogOne( oCrt ) oPBar2:cBackColor := "W/N*" oPBar2:lVertical := .t. oPBar2:nDirection := 0 - oPBar2:cImage := "vouch1.bmp" + oPBar2:cImage := GetResource( "vouch1.bmp" ) oDlg:AddObject( oPBar2 ) oPBar3 := WvtProgressBar():New( oDlg, , 26, 129, 36, 137 ) @@ -178,7 +178,7 @@ STATIC FUNCTION MyDialogOne( oCrt ) oPBar3:cBackColor := "W/N*" oPBar3:lVertical := .t. oPBar3:nDirection := 1 - oPBar3:cImage := "vouch1.bmp" + oPBar3:cImage := GetResource( "vouch1.bmp" ) oDlg:AddObject( oPBar3 ) oBBox2 := WvtStatic():New( oDlg, , 9, oDlg:MaxCol()-40, 18, oDlg:Maxcol()-2 ) diff --git a/harbour/contrib/gtwvg/tests/wvgxbp.prg b/harbour/contrib/gtwvg/tests/wvgxbp.prg index 9d18334c62..9a4db4fa74 100644 --- a/harbour/contrib/gtwvg/tests/wvgxbp.prg +++ b/harbour/contrib/gtwvg/tests/wvgxbp.prg @@ -36,7 +36,7 @@ FUNCTION demoxbp() //--------------------------- Dialog -------------------------------\\ oCrt := WvgDialog():new( , , { 30,30 }, { 900,600 }, , .t. ) oCrt:closable := .t. - oCrt:icon := "vr_1.ico" + oCrt:icon := GetResource( "vr_1.ico" ) oCrt:create() oCrt:setFontCompoundName( '12.Courier italic' ) @@ -232,7 +232,7 @@ FUNCTION demoxbp() oXbp:killInputFocus := { |x,y,oSLE| x:=x,y:=y, oSLE:getData(), oPanel:caption := "cVarB =" + cVarB } // Read file into LOCAL variable - cText := MemoRead( 'gtwvg.hbc' ) + cText := MemoRead( GetResource( 'gtwvg.hbc' ) ) // Create MLE, specify position using :create() and // assign data code block accessing LOCAL variable oMLE := WvgMLE():new() diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 4cbf7214bb..eb57fa1dac 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -93,6 +93,19 @@ STATIC s_pathSep PROCEDURE Main( ... ) LOCAL oIde + #ifdef HB_IDE_DISTRO + LOCAL cSep := hb_osPathSeparator() + LOCAL cBse := hb_dirBase() + ".." + + /* Set the path env variable to Qt's run-time which is used to compile Harbour binaries */ + hb_setEnv( "PATH", cBse + cSep + "Qt" + cSep + "4.6.2" + cSep + "lib" + ; + hb_osPathListSeparator() + hb_getEnv( "PATH" ) ) + + /* Variable is used in hbide.env */ + hb_setEnv( "HB_IDE_INSTALL", cBse ) + #endif + + SET CENTURY ON SET EPOCH TO 1970 @@ -433,7 +446,7 @@ METHOD HbIde:create( aParams ) ::oEM := IdeEditsManager():new( Self ):create() /* Load Environments */ - ::oEV := IdeEnvironments():new( Self, hbide_pathToOSPath( ::aINI[ INI_HBIDE, PathEnv ] + ::pathSep + "hbide.env" ) ):create() + ::oEV := IdeEnvironments():new( Self ):create() /* Home Implementation */ ::oHM := IdeHome():new():create( Self ) diff --git a/harbour/contrib/hbide/ideenviron.prg b/harbour/contrib/hbide/ideenviron.prg index 482b48c273..0f0dce7d2b 100644 --- a/harbour/contrib/hbide/ideenviron.prg +++ b/harbour/contrib/hbide/ideenviron.prg @@ -102,7 +102,7 @@ CLASS IdeEnvironments INHERIT IdeObject METHOD IdeEnvironments:new( oIDE, cEnvFile ) - ::oIDE := oIDE + ::oIDE := oIDE ::cEnvFile := cEnvFile RETURN Self @@ -110,6 +110,7 @@ METHOD IdeEnvironments:new( oIDE, cEnvFile ) /*----------------------------------------------------------------------*/ METHOD IdeEnvironments:create( oIDE, cEnvFile ) + LOCAL cPath, cFile DEFAULT oIDE TO ::oIDE DEFAULT cEnvFile TO ::cEnvFile @@ -117,6 +118,20 @@ METHOD IdeEnvironments:create( oIDE, cEnvFile ) ::oIDE := oIDE ::cEnvFile := cEnvFile + IF empty( ::cEnvFile ) + cFile := ::oIde:aINI[ INI_HBIDE, PathEnv ] + cFile := iif( empty( cFile ), cFile, hbide_pathAppendLastSlash( cFile ) ) + IF empty( cFile ) + cFile := oIde:cProjIni + ENDIF + hb_fNameSplit( cFile, @cPath ) + ::cEnvFile := cPath + "hbide.env" + ENDIF + + hb_fNameSplit( ::cEnvFile, @cPath ) + ::oIDE:cWrkPathEnv := hbide_pathNormalized( cPath, .f. ) + ::oIde:aINI[ INI_HBIDE, PathEnv ] := ::oIDE:cWrkPathEnv + IF !empty( ::cEnvFile ) .AND. hb_fileExists( ::cEnvFile ) ::parse( ::cEnvFile ) ENDIF @@ -271,7 +286,7 @@ METHOD IdeEnvironments:execEnv( nMode, p ) IF !empty( cPath ) hb_fNameSplit( cPath, @cP ) ::oIDE:cWrkPathEnv := cP - ::oUI:q_editPathEnv:setText( hbide_pathStripLastSlash( cP ) ) + ::oUI:q_editPathEnv:setText( cP ) // hbide_pathStripLastSlash( cP ) ) ::oUI:q_editCompilers:setPlainText( ; hb_memoread( hbide_pathFile( ::oUI:q_editPathEnv:text(), "hbide.env" ) ) ) diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index 72f049aafb..78c277b7e6 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -1307,7 +1307,7 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) ::oOutputResult:oWidget:append( cTmp ) ::oOutputResult:oWidget:append( hbide_outputLine() ) - ::oIDE:oEV := IdeEnvironments():new():create( ::oIDE, hbide_pathFile( ::aINI[ INI_HBIDE, PathEnv ], "hbide.env" ) ) + ::oIDE:oEV := IdeEnvironments():new():create( ::oIDE ) ::cBatch := ::oEV:prepareBatch( ::cWrkEnvironment ) aeval( ::oEV:getHbmk2Commands( ::cWrkEnvironment ), {|e| aadd( aHbp, e ) } )