2010-01-05 19:01 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbxbp/tests/demoxbp.prg
! Changed to HBQT_SET_RELEASE_METHOD( HBQT_RELEASE_WITH_DELETE )
* contrib/hbide/hbide.prg
* contrib/hbide/ideactions.prg
* contrib/hbide/idedocks.prg
* contrib/hbide/ideeditor.prg
* contrib/hbide/idemisc.prg
* contrib/hbide/ideprojmanager.prg
! Another round of reforms.
Vailton, I had to delete some of your code causing the recursions.
Please note that never ever you should call the methods like
a->b->a. Please check the code and its usability as per
your line-of-thinking. More refinements are under-way.
This commit is contained in:
@@ -17,6 +17,22 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2010-01-05 19:01 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
|
||||
* contrib/hbxbp/tests/demoxbp.prg
|
||||
! Changed to HBQT_SET_RELEASE_METHOD( HBQT_RELEASE_WITH_DELETE )
|
||||
|
||||
* contrib/hbide/hbide.prg
|
||||
* contrib/hbide/ideactions.prg
|
||||
* contrib/hbide/idedocks.prg
|
||||
* contrib/hbide/ideeditor.prg
|
||||
* contrib/hbide/idemisc.prg
|
||||
* contrib/hbide/ideprojmanager.prg
|
||||
! Another round of reforms.
|
||||
Vailton, I had to delete some of your code causing the recursions.
|
||||
Please note that never ever you should call the methods like
|
||||
a->b->a. Please check the code and its usability as per
|
||||
your line-of-thinking. More refinements are under-way.
|
||||
|
||||
2010-01-06 01:29 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* INSTALL
|
||||
* Minor update to prev.
|
||||
|
||||
@@ -224,7 +224,6 @@ CLASS HbIde
|
||||
METHOD closeAllSources()
|
||||
METHOD closeAllOthers()
|
||||
METHOD saveSource()
|
||||
METHOD saveSourceAs()
|
||||
METHOD saveAllSources()
|
||||
METHOD saveAndExit()
|
||||
METHOD revertSource()
|
||||
@@ -247,8 +246,6 @@ CLASS HbIde
|
||||
|
||||
METHOD setCodec()
|
||||
|
||||
METHOD findEditByFileName()
|
||||
METHOD findEditByID()
|
||||
METHOD updateTitleBar()
|
||||
|
||||
ENDCLASS
|
||||
@@ -400,6 +397,7 @@ METHOD HbIde:create( cProjIni )
|
||||
hbide_dbg( " " )
|
||||
|
||||
::oDlg:destroy()
|
||||
::oAC:destroy()
|
||||
|
||||
hbide_dbg( " " )
|
||||
hbide_dbg( "After ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() )
|
||||
@@ -420,28 +418,25 @@ METHOD HbIde:execAction( cKey )
|
||||
DO CASE
|
||||
CASE cKey == "Exit"
|
||||
PostAppEvent( xbeP_Close, NIL, NIL, ::oDlg )
|
||||
|
||||
CASE cKey == "NewProject"
|
||||
::oPM:loadProperties( , .t., .t., .t. )
|
||||
CASE cKey == "LoadProject"
|
||||
::oPM:loadProperties( , .f., .f., .t. )
|
||||
CASE cKey == "LaunchProject"
|
||||
::oPM:launchProject()
|
||||
|
||||
CASE cKey == "Build"
|
||||
::oPM:buildProject( '', .F., .F. )
|
||||
CASE cKey == "BuildLaunch"
|
||||
::oPM:buildProject( '', .T., .F. )
|
||||
|
||||
CASE cKey == "Rebuild"
|
||||
::oPM:buildProject( '', .F., .T. )
|
||||
CASE cKey == "RebuildLaunch"
|
||||
::oPM:buildProject( '', .T., .T. )
|
||||
|
||||
CASE cKey == "Compile"
|
||||
//
|
||||
CASE cKey == "CompilePPO"
|
||||
::oPM:buildProject( '', .F., .F., .T. )
|
||||
|
||||
CASE cKey == "Properties"
|
||||
IF Empty( ::cWrkProject )
|
||||
MsgBox( 'No active project detected!' )
|
||||
@@ -456,11 +451,11 @@ METHOD HbIde:execAction( cKey )
|
||||
ELSE
|
||||
MsgBox( 'Invalid project: ' + cTmp )
|
||||
ENDIF
|
||||
|
||||
CASE cKey == "SelectProject"
|
||||
::oPM:selectCurrentProject()
|
||||
CASE cKey == "CloseProject"
|
||||
::oPM:closeProject()
|
||||
|
||||
CASE cKey == "New"
|
||||
::editSource( '' )
|
||||
CASE cKey == "Open"
|
||||
@@ -468,9 +463,9 @@ METHOD HbIde:execAction( cKey )
|
||||
aEval( aSrc, {|e| ::editSource( e ) } )
|
||||
ENDIF
|
||||
CASE cKey == "Save"
|
||||
::saveSource( ::getCurrentTab() )
|
||||
::saveSource( ::getCurrentTab(), , .f. )
|
||||
CASE cKey == "SaveAs"
|
||||
::saveSourceAs( ::getCurrentTab() )
|
||||
::saveSourceAs( ::getCurrentTab(), , .t. )
|
||||
CASE cKey == "SaveAll"
|
||||
::saveAllSources()
|
||||
CASE cKey == "SaveExit"
|
||||
@@ -594,103 +589,161 @@ METHOD HbIde:getCurCursor()
|
||||
// Source Editor
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD HbIde:editSource( cSourceFile, nPos, nHPos, nVPos, cTheme )
|
||||
LOCAL n
|
||||
|
||||
IF !Empty( cSourceFile ) .AND. !( hbide_isValidText( cSourceFile ) )
|
||||
MsgBox( 'File type unknown or unsupported: ' + cSourceFile )
|
||||
RETURN Self
|
||||
ENDIF
|
||||
|
||||
IF !Empty( cSourceFile ) .AND. !hb_FileExists( cSourceFile )
|
||||
MsgBox( 'File not found: ' + cSourceFile )
|
||||
RETURN Self
|
||||
ENDIF
|
||||
|
||||
DEFAULT cSourceFile TO ::cProjIni
|
||||
DEFAULT nPos TO 0
|
||||
DEFAULT nHPos TO 0
|
||||
DEFAULT nVPos TO 0
|
||||
|
||||
* An empty filename is a request to create a new empty file...
|
||||
IF Empty( cSourceFile )
|
||||
n := 0
|
||||
ELSE
|
||||
n := aScan( ::aTabs, {|a_| hbide_pathNormalized( a_[ TAB_SOURCEFILE ] ) == hbide_pathNormalized( cSourceFile ) } )
|
||||
End
|
||||
|
||||
IF n > 0
|
||||
::qTabWidget:setCurrentIndex( ::qTabWidget:indexOf( ::aTabs[ n, TAB_OTAB ]:oWidget ) )
|
||||
RETURN Self
|
||||
END
|
||||
|
||||
aadd( ::aEdits, IdeEditor():new():create( Self, cSourceFile, nPos, nHPos, nVPos, cTheme ) )
|
||||
|
||||
IF !Empty( cSourceFile )
|
||||
hbide_mnuAddFileToMRU( Self, cSourceFile, INI_RECENTFILES )
|
||||
ENDIF
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD HbIde:loadSources()
|
||||
LOCAL i
|
||||
LOCAL a_
|
||||
|
||||
IF !empty( ::aIni[ INI_FILES ] )
|
||||
FOR i := 1 TO len( ::aIni[ INI_FILES ] )
|
||||
::editSource( ::aIni[ INI_FILES, i, 1 ], ::aIni[ INI_FILES, i, 2 ], ;
|
||||
::aIni[ INI_FILES, i, 3 ], ::aIni[ INI_FILES, i, 4 ], ::aIni[ INI_FILES, i, 5 ] )
|
||||
FOR EACH a_ IN ::aIni[ INI_FILES ]
|
||||
::editSource( a_[ 1 ], a_[ 2 ], a_[ 3 ], a_[ 4 ], a_[ 5 ] )
|
||||
NEXT
|
||||
::qTabWidget:setCurrentIndex( val( ::aIni[ INI_HBIDE, RecentTabIndex ] ) )
|
||||
::oED:setSourceVisibleByIndex( val( ::aIni[ INI_HBIDE, RecentTabIndex ] ) )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* Close the selected tab. If the user changed the file and has not saved him
|
||||
* ask to User if he want to save the contents.
|
||||
* Save selected Tab on harddisk and return .T. if successfull!
|
||||
*/
|
||||
METHOD HbIde:saveSource( nTab, lCancel, lAs )
|
||||
LOCAL oEdit, lNew, cBuffer, qDocument, nIndex, cSource, cFile, cExt, cNewFile
|
||||
LOCAL cFileToSave
|
||||
|
||||
DEFAULT nTab TO ::getCurrentTab()
|
||||
DEFAULT lAs TO .F.
|
||||
|
||||
lCancel := .F.
|
||||
|
||||
IF !empty( oEdit := ::oED:getEditorByTabPosition( nTab ) )
|
||||
cSource := oEdit:sourceFile
|
||||
lNew := Empty( cSource ) .OR. lAs
|
||||
IF lNew
|
||||
cNewFile := ::selectSource( 'save', ;
|
||||
iif( !Empty( cSource ), cSource, hb_dirBase() + "projects\" ),;
|
||||
"Save " + oEdit:oTab:caption + " as..." )
|
||||
IF empty( cNewFile )
|
||||
// will check later what decision to take
|
||||
RETURN .f.
|
||||
ENDIF
|
||||
IF hbide_pathNormalized( cNewFile ) == hbide_pathNormalized( cSource )
|
||||
lNew := .f.
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
cFileToSave := iif( lNew, cNewFile, cSource )
|
||||
qDocument := oEdit:qDocument
|
||||
|
||||
cBuffer := oEdit:qEdit:toPlainText()
|
||||
/*
|
||||
* If the burn process fails, we should change the name of the previous file.
|
||||
* 01/01/2010 - 21:24:41 - vailtom
|
||||
*/
|
||||
IF !hb_memowrit( cFileToSave, cBuffer )
|
||||
MsgBox( "Error saving the file " + oEdit:sourceFile + ".",, 'Error saving file!' )
|
||||
lCancel := .T.
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
IF lNew
|
||||
hb_fNameSplit( cFileToSave, , @cFile, @cExt )
|
||||
|
||||
::aTabs[ nTab, TAB_SOURCEFILE ] := cFileToSave
|
||||
oEdit:sourceFile := cFileToSave
|
||||
|
||||
oEdit:oTab:Caption := cFile + cExt
|
||||
::qTabWidget:setTabText( nIndex, cFile + cExt )
|
||||
::qTabWidget:setTabTooltip( nIndex, cSource )
|
||||
ENDIF
|
||||
|
||||
IF empty( cSource )
|
||||
/* The file is not populated in editors tree. Inject */
|
||||
::addSourceInTree( oEdit:sourceFile )
|
||||
ELSEIF lNew
|
||||
/* Rename the existing nodes in tree */
|
||||
ENDIF
|
||||
|
||||
qDocument:setModified( .f. )
|
||||
::aSources := { oEdit:sourceFile }
|
||||
::createTags()
|
||||
::updateFuncList()
|
||||
nIndex := ::qTabWidget:indexOf( oEdit:oTab:oWidget )
|
||||
::qTabWidget:setTabIcon( nIndex, ::resPath + "tabunmodified.png" )
|
||||
::oSBar:getItem( SB_PNL_MODIFIED ):caption := " "
|
||||
ENDIF
|
||||
|
||||
RETURN .T.
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD HbIde:editSource( cSourceFile, nPos, nHPos, nVPos, cTheme )
|
||||
|
||||
IF !Empty( cSourceFile )
|
||||
IF !( hbide_isValidText( cSourceFile ) )
|
||||
MsgBox( 'File type unknown or unsupported: ' + cSourceFile )
|
||||
RETURN Self
|
||||
ELSEIF !hb_FileExists( cSourceFile )
|
||||
MsgBox( 'File not found: ' + cSourceFile )
|
||||
RETURN Self
|
||||
ENDIF
|
||||
IF ::oED:isOpen( cSourceFile )
|
||||
IF hbide_getYesNo( cSourceFile + " is already open.", ;
|
||||
"Want to re-load it again ?", "File Open Info!" )
|
||||
::oED:reLoad( cSourceFile )
|
||||
ENDIF
|
||||
::oED:setSourceVisible( cSourceFile )
|
||||
RETURN Self
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
DEFAULT nPos TO 0
|
||||
DEFAULT nHPos TO 0
|
||||
DEFAULT nVPos TO 0
|
||||
|
||||
::oED:buildEditor( cSourceFile, nPos, nHPos, nVPos, cTheme )
|
||||
|
||||
IF !Empty( cSourceFile )
|
||||
hbide_mnuAddFileToMRU( Self, cSourceFile, INI_RECENTFILES )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD HbIde:closeSource( nTab, lCanCancel, lCanceled )
|
||||
LOCAL lSave := .T.
|
||||
LOCAL n
|
||||
LOCAL lSave, n, oEdit
|
||||
|
||||
DEFAULT nTab TO ::getCurrentTab()
|
||||
DEFAULT lCanCancel TO .F.
|
||||
DEFAULT nTab TO ::getCurrentTab()
|
||||
|
||||
lCanceled := .F.
|
||||
IF !empty( oEdit := ::oED:getEditorByTabPosition( nTab ) )
|
||||
|
||||
IF !( nTab > 0 .AND. nTab <= LEN( ::aTabs ) )
|
||||
RETURN .T.
|
||||
ENDIF
|
||||
DEFAULT lCanCancel TO .F.
|
||||
lCanceled := .F.
|
||||
|
||||
IF !::aTabs[ nTab, TAB_QDOCUMENT ]:isModified()
|
||||
* File has not changed, ignore the question to User
|
||||
lSave := .F.
|
||||
ELSEIF lCanCancel
|
||||
n := hbide_getYesNoCancel( ::aTabs[ nTab, TAB_OTAB ]:Caption, ;
|
||||
"Has been modified, save this source?", 'Save?' )
|
||||
|
||||
lCanceled := ( n == QMessageBox_Cancel )
|
||||
lSave := ( n == QMessageBox_Yes )
|
||||
|
||||
IF lCanceled
|
||||
RETURN .F.
|
||||
End
|
||||
ELSE
|
||||
IF !hbide_getYesNo( ::aTabs[ nTab, TAB_OTAB ]:Caption, ;
|
||||
"Has been modified, save this source?", 'Save?' )
|
||||
IF !( oEdit:qDocument:isModified() )
|
||||
* File has not changed, ignore the question to User
|
||||
lSave := .F.
|
||||
|
||||
ELSEIF lCanCancel
|
||||
n := hbide_getYesNoCancel( oEdit:oTab:Caption, "Has been modified, save this source?", 'Save?' )
|
||||
IF ( lCanceled := ( n == QMessageBox_Cancel ) )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
lSave := ( n == QMessageBox_Yes )
|
||||
|
||||
ELSE
|
||||
lSave := hbide_getYesNo( oEdit:oTab:Caption, "Has been modified, save this source?", 'Save?' )
|
||||
|
||||
ENDIF
|
||||
|
||||
IF lSave .AND. !( ::saveSource( nTab, @lCanceled ) )
|
||||
IF lCanCancel
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
oEdit:removeTabPage()
|
||||
ENDIF
|
||||
|
||||
IF lSave .AND. !::saveSource( nTab, @lCanceled )
|
||||
IF lCanCancel
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
::aTabs[ nTab, TAB_OEDITOR ]:removeTabPage()
|
||||
RETURN .T.
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -702,7 +755,6 @@ METHOD HbIde:closeAllSources()
|
||||
LOCAL lCanceled
|
||||
LOCAL i := 0
|
||||
|
||||
* Finally now we will close all tabs.
|
||||
DO WHILE ( ++i <= Len( ::aTabs ) )
|
||||
|
||||
IF ::closeSource( i, .T., @lCanceled )
|
||||
@@ -723,34 +775,16 @@ METHOD HbIde:closeAllSources()
|
||||
* 02/01/2010 - 15:47:19
|
||||
*/
|
||||
METHOD HbIde:closeAllOthers( nTab )
|
||||
LOCAL lCanceled
|
||||
LOCAL nID
|
||||
LOCAL lCanceled, a_
|
||||
|
||||
DEFAULT nTab TO ::getCurrentTab()
|
||||
|
||||
IF !( nTab > 0 .AND. nTab <= LEN( ::aTabs ) )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
nID := ::aTabs[ nTab, TAB_OEDITOR ]:nID
|
||||
nTab:= 0
|
||||
|
||||
* Finally now we will close all tabs.
|
||||
DO WHILE ( ++nTab <= Len( ::aTabs ) )
|
||||
|
||||
IF ::aTabs[ nTab, TAB_OEDITOR ]:nID == nID
|
||||
Loop
|
||||
End
|
||||
|
||||
IF ::closeSource( nTab, .T., @lCanceled )
|
||||
nTab --
|
||||
Loop
|
||||
ENDIF
|
||||
|
||||
IF lCanceled
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
ENDDO
|
||||
FOR EACH a_ IN ::aTabs
|
||||
IF a_:__enumIndex() != nTab
|
||||
::closeSource( a_:__enumIndex(), .T., @lCanceled )
|
||||
IF lCanceled
|
||||
RETURN .f.
|
||||
ENDIF
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
RETURN .T.
|
||||
|
||||
@@ -763,7 +797,7 @@ METHOD HbIde:saveAllSources()
|
||||
LOCAL n
|
||||
|
||||
FOR n := 1 TO Len( ::aTabs )
|
||||
::saveSource( n )
|
||||
::saveSource( n )
|
||||
NEXT
|
||||
|
||||
RETURN Self
|
||||
@@ -810,115 +844,6 @@ METHOD HbIde:revertSource( nTab )
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* Save selected tab with a new filename...
|
||||
* 01/01/2010 - 20:55:24 - vailtom
|
||||
*/
|
||||
METHOD HbIde:saveSourceAs( nTab, lCancel )
|
||||
LOCAL cSource
|
||||
|
||||
DEFAULT nTab TO ::getCurrentTab()
|
||||
|
||||
lCancel := .F.
|
||||
|
||||
IF nTab < 1
|
||||
RETURN .F.
|
||||
End
|
||||
|
||||
cSource := ::aTabs[ nTab, TAB_SOURCEFILE ]
|
||||
cSource := ::selectSource( 'save', ;
|
||||
IIF( !Empty( cSource ), cSource, hb_dirBase() + "projects\" ),;
|
||||
"Save " + ::aTabs[ nTab, TAB_OTAB ]:Caption + " as..." ;
|
||||
)
|
||||
|
||||
IF Empty( cSource )
|
||||
lCancel := .T.
|
||||
RETURN .F.
|
||||
End
|
||||
|
||||
IF ::saveSource( nTab, cSource, @lCancel )
|
||||
hbide_mnuAddFileToMRU( Self, cSource, INI_RECENTFILES )
|
||||
RETURN .T.
|
||||
ENDIF
|
||||
|
||||
RETURN .F.
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* Save selected Tab on harddisk and return .T. if successfull!
|
||||
*/
|
||||
METHOD HbIde:saveSource( nTab, cNewFileName, lCancel )
|
||||
LOCAL cBuffer, qDocument, nIndex
|
||||
LOCAL cSource, cFile, cExt
|
||||
|
||||
DEFAULT nTab TO ::getCurrentTab()
|
||||
|
||||
lCancel := .F.
|
||||
|
||||
IF nTab < 1
|
||||
RETURN .F.
|
||||
End
|
||||
|
||||
qDocument := ::aTabs[ nTab, TAB_QDOCUMENT ]
|
||||
|
||||
// IF !qDocument:isModified()
|
||||
// RETURN .T.
|
||||
// End
|
||||
|
||||
cSource := ::aTabs[ nTab, TAB_SOURCEFILE ]
|
||||
|
||||
/* Dont have a valid filename? Call ::SaveAs() to obtain one... */
|
||||
IF Empty( cSource ) .AND. Empty( cNewFileName )
|
||||
RETURN ::saveSourceAs( nTab, @lCancel )
|
||||
ENDIF
|
||||
|
||||
IF !Empty( cNewFileName )
|
||||
cSource := cNewFileName
|
||||
ENDIF
|
||||
|
||||
cBuffer := ::aTabs[ nTab, TAB_QEDIT ]:toPlainText()
|
||||
nIndex := ::qTabWidget:indexOf( ::aTabs[ nTab, TAB_OTAB ]:oWidget )
|
||||
|
||||
/*
|
||||
* If the burn process fails, we should change the name of the previous file.
|
||||
* 01/01/2010 - 21:24:41 - vailtom
|
||||
*/
|
||||
IF !hb_memowrit( cSource, cBuffer )
|
||||
MsgBox( "Error saving the file " + cSource + ".",, 'Error saving file!' )
|
||||
lCancel := .T.
|
||||
RETURN .F.
|
||||
// ELSE
|
||||
// MsgBox( "File " + cSource + " save successfuly!",, 'Saving file!' )
|
||||
ENDIF
|
||||
|
||||
hb_fNameSplit( cSource, , @cFile, @cExt )
|
||||
|
||||
IF !Empty( cNewFileName )
|
||||
/*
|
||||
* TOFIX: Remove old filename from treeview...
|
||||
*/
|
||||
* ::delSourceInTree( ::aTabs[ nTab, TAB_SOURCEFILE ] )
|
||||
|
||||
::aTabs[ nTab, TAB_OTAB ]:Caption := cFile + cExt
|
||||
::aTabs[ nTab, TAB_SOURCEFILE ] := cNewFileName
|
||||
End
|
||||
|
||||
::qTabWidget:setTabText( nIndex, cFile + cExt )
|
||||
::qTabWidget:setTabTooltip( nIndex, cSource )
|
||||
|
||||
::addSourceInTree( cSource )
|
||||
::aSources := { cSource }
|
||||
|
||||
qDocument:setModified( .f. )
|
||||
::createTags()
|
||||
::updateFuncList()
|
||||
|
||||
::qTabWidget:setTabIcon( nIndex, s_resPath + "tabunmodified.png" )
|
||||
::oSBar:getItem( SB_PNL_MODIFIED ):caption := " "
|
||||
|
||||
RETURN .T.
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD HbIde:selectSource( cMode, cFile, cTitle )
|
||||
@@ -931,6 +856,7 @@ METHOD HbIde:selectSource( cMode, cFile, cTitle )
|
||||
oDlg:fileFilters := { { "All Files" , "*.*" }, { "PRG Sources", "*.prg" }, { "C Sources" , "*.c" },;
|
||||
{ "CPP Sources", "*.cpp" }, { "H Headers" , "*.h" }, { "CH Headers", "*.ch" } }
|
||||
cFile := oDlg:open( , , .f. )
|
||||
|
||||
ELSEIF cMode == "openmany"
|
||||
oDlg:title := "Select Sources"
|
||||
oDlg:center := .t.
|
||||
@@ -938,6 +864,7 @@ METHOD HbIde:selectSource( cMode, cFile, cTitle )
|
||||
oDlg:fileFilters := { { "All Files" , "*.*" }, { "PRG Sources", "*.prg" }, { "C Sources" , "*.c" },;
|
||||
{ "CPP Sources", "*.cpp" }, { "H Headers" , "*.h" }, { "CH Headers", "*.ch" } }
|
||||
cFile := oDlg:open( , , .t. )
|
||||
|
||||
ELSEIF cMode == "save"
|
||||
oDlg:title := iif( !hb_isChar(cTitle), "Save as...", cTitle )
|
||||
oDlg:center := .t.
|
||||
@@ -954,14 +881,16 @@ METHOD HbIde:selectSource( cMode, cFile, cTitle )
|
||||
oDlg:fileFilters := { { "PRG Sources", "*.prg" }, { "C Sources", "*.c" }, { "CPP Sources", "*.cpp" }, ;
|
||||
{ "H Headers", "*.h" }, { "CH Headers", "*.ch" } }
|
||||
cFile := oDlg:saveAs( cPath )
|
||||
|
||||
ELSE
|
||||
oDlg:title := "Save this Database"
|
||||
oDlg:fileFilters := { { "Database Files", "*.dbf" } }
|
||||
oDlg:quit := {|| MsgBox( "Quitting the Dialog" ), 1 }
|
||||
cFile := oDlg:saveAs( "myfile.dbf" )
|
||||
IF !empty( cFile )
|
||||
HBXBP_DEBUG( cFile )
|
||||
hbide_dbg( cFile )
|
||||
ENDIF
|
||||
|
||||
ENDIF
|
||||
|
||||
RETURN cFile
|
||||
@@ -1169,12 +1098,16 @@ METHOD HbIde:manageItemSelected( oXbpTreeItem )
|
||||
::oPM:loadProperties( cHbi, .f., .t., .f. )
|
||||
|
||||
CASE ::aProjData[ n, TRE_TYPE ] == "Source File"
|
||||
cSource := ::aProjData[ n, TRE_ORIGINAL ]
|
||||
::editSource( cSource )
|
||||
#if 0
|
||||
cSource := ::aProjData[ n, TRE_ORIGINAL ]
|
||||
IF ( n := ascan( ::aTabs, {|e_| hbide_pathNormalized( e_[ TAB_SOURCEFILE ] ) == hbide_pathNormalized( cSource ) } ) ) == 0
|
||||
::editSource( cSource )
|
||||
ELSE
|
||||
::qTabWidget:setCurrentIndex( ::qTabWidget:indexOf( ::aTabs[ n, TAB_OTAB ]:oWidget ) )
|
||||
ENDIF
|
||||
#endif
|
||||
|
||||
CASE ::aProjData[ n, TRE_TYPE ] == "Opened Source"
|
||||
cSource := ::aProjData[ n, TRE_DATA ]
|
||||
@@ -1211,9 +1144,9 @@ METHOD HbIde:manageProjectContext( mp1, mp2, oXbpTreeItem )
|
||||
CASE n == 0 // Source File - nothing to do
|
||||
CASE n == -2 // "Files"
|
||||
CASE n == -1 // Project Root
|
||||
aadd( aPops, { "New Project" , {|| ::oPM:loadProperties( , .t., .t., .t. ) } } )
|
||||
aadd( aPops, { "New Project" , {|| ::oPM:loadProperties( , .t., .t., .t. ) } } )
|
||||
aadd( aPops, { "" } )
|
||||
aadd( aPops, { "Load Project" , {|| ::oPM:loadProperties( , .f., .f., .t. ) } } )
|
||||
aadd( aPops, { "Load Project" , {|| ::oPM:loadProperties( , .f., .f., .t. ) } } )
|
||||
hbide_ExecPopup( aPops, mp1, ::oProjTree:oWidget )
|
||||
|
||||
CASE ::aProjData[ n, 2 ] == "Project Name"
|
||||
@@ -1222,20 +1155,18 @@ METHOD HbIde:manageProjectContext( mp1, mp2, oXbpTreeItem )
|
||||
aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_OUTPUT ] + ".hbi"
|
||||
//
|
||||
IF Alltrim( Upper( ::cWrkProject ) ) != Alltrim( Upper( oXbpTreeItem:caption ) )
|
||||
aadd( aPops, { "Set as Current" , {|| ::oPM:setCurrentProject( oXbpTreeItem:caption ) } } )
|
||||
aadd( aPops, { "Set as Current" , {|| ::oPM:setCurrentProject( oXbpTreeItem:caption ) } } )
|
||||
End
|
||||
aadd( aPops, { ::oAC:getAction( "Properties" ), {|| ::oPM:loadProperties( cHbi, .f., .t., .t. ) } } )
|
||||
aadd( aPops, { "Properties" , {|| ::oPM:loadProperties( cHbi, .f., .t., .t. ) } } )
|
||||
aadd( aPops, { "" } )
|
||||
// aadd( aPops, { "Save and Build ( Qt )" , {|| ::oPM:buildProjectViaQt( oXbpTreeItem:caption ) } } )
|
||||
// aadd( aPops, { "" } )
|
||||
aadd( aPops, { ::oAC:getAction( "Build" ), {|| ::oPM:buildProject( oXbpTreeItem:caption, .F., , , .T. ) } } )
|
||||
aadd( aPops, { ::oAC:getAction( "BuildLaunch" ), {|| ::oPM:buildProject( oXbpTreeItem:caption, .T., , , .T. ) } } )
|
||||
aadd( aPops, { ::oAC:getAction( "ReBuild" ), {|| ::oPM:buildProject( oXbpTreeItem:caption, .F., .T., , .T. ) } } )
|
||||
aadd( aPops, { ::oAC:getAction( "ReBuildLaunch" ), {|| ::oPM:buildProject( oXbpTreeItem:caption, .T., .T., , .T. ) } } )
|
||||
aadd( aPops, { ::oAC:getAction( "BuildQt" ), {|| ::oPM:buildProject( oXbpTreeItem:caption, .F., , , .T. ) } } )
|
||||
aadd( aPops, { ::oAC:getAction( "BuildLaunchQt" ), {|| ::oPM:buildProject( oXbpTreeItem:caption, .T., , , .T. ) } } )
|
||||
aadd( aPops, { ::oAC:getAction( "ReBuildQt" ), {|| ::oPM:buildProject( oXbpTreeItem:caption, .F., .T., , .T. ) } } )
|
||||
aadd( aPops, { ::oAC:getAction( "ReBuildLaunchQt" ), {|| ::oPM:buildProject( oXbpTreeItem:caption, .T., .T., , .T. ) } } )
|
||||
aadd( aPops, { "" } )
|
||||
aadd( aPops, { "Launch" , {|| ::oPM:launchProject( oXbpTreeItem:caption ) } } )
|
||||
aadd( aPops, { "Launch" , {|| ::oPM:launchProject( oXbpTreeItem:caption ) } } )
|
||||
aadd( aPops, { "" } )
|
||||
aadd( aPops, { "Close This Project" , {|| ::oPM:closeProject( oXbpTreeItem:caption ) } } )
|
||||
aadd( aPops, { "Close This Project" , {|| ::oPM:closeProject( oXbpTreeItem:caption ) } } )
|
||||
//
|
||||
hbide_ExecPopup( aPops, mp1, ::oProjTree:oWidget )
|
||||
|
||||
@@ -1246,11 +1177,11 @@ METHOD HbIde:manageProjectContext( mp1, mp2, oXbpTreeItem )
|
||||
cSource := ::aProjData[ n, 5 ]
|
||||
n := ascan( ::aTabs, {|e_| hbide_pathNormalized( e_[ 5 ] ) == cSource } )
|
||||
//
|
||||
aadd( aPops, { "Save" , {|| ::saveSource( n ) } } )
|
||||
aadd( aPops, { "Save As" , {|| ::saveSourceAs( n ) } } )
|
||||
aadd( aPops, { "Save" , {|| ::saveSource( n ) } } )
|
||||
aadd( aPops, { "Save As" , {|| ::saveSource( n, , .t. ) } } )
|
||||
aadd( aPops, { "" } )
|
||||
aadd( aPops, { "Close" , {|| ::closeSource( n ) } } )
|
||||
aadd( aPops, { "Close Others" , {|| ::closeAllOthers( n ) } } )
|
||||
aadd( aPops, { "Close" , {|| ::closeSource( n ) } } )
|
||||
aadd( aPops, { "Close Others" , {|| ::closeAllOthers( n ) } } )
|
||||
aadd( aPops, { "" } )
|
||||
aadd( aPops, { "Apply Theme", {|| ::aTabs[ n, TAB_OEDITOR ]:applyTheme() } } )
|
||||
//
|
||||
@@ -1423,41 +1354,4 @@ METHOD HbIde:setCodec( cCodec )
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* Find an item in aEdits[] based on the file name passed as argument.
|
||||
* 02/01/2010 - 10:02:51 - vailtom
|
||||
*/
|
||||
METHOD HbIde:findEditByFileName( cSource )
|
||||
LOCAL myEdit
|
||||
|
||||
cSource := hbide_pathNormalized( cSource, .F. )
|
||||
|
||||
FOR EACH myEdit IN ::aEdits
|
||||
|
||||
IF myEdit:SourceFile == cSource
|
||||
RETURN myEdit
|
||||
ENDIF
|
||||
|
||||
NEXT
|
||||
|
||||
RETURN nil
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* Find an item in aEdits[] based on the nID passed as argument.
|
||||
* 02/01/2010 - 12:04:01 - vailtom
|
||||
*/
|
||||
METHOD HbIde:findEditByID( nID )
|
||||
LOCAL myEdit
|
||||
|
||||
FOR EACH myEdit IN ::aEdits
|
||||
|
||||
IF myEdit:nID == nID
|
||||
RETURN myEdit
|
||||
ENDIF
|
||||
|
||||
NEXT
|
||||
|
||||
RETURN nil
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -82,6 +82,7 @@ CLASS IdeActions INHERIT IdeObject
|
||||
|
||||
METHOD new()
|
||||
METHOD create()
|
||||
METHOD destroy()
|
||||
|
||||
METHOD buildMainMenu()
|
||||
METHOD buildToolBar()
|
||||
@@ -113,6 +114,16 @@ METHOD IdeActions:create( oIde )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeActions:destroy()
|
||||
LOCAL qAction
|
||||
|
||||
FOR EACH qAction IN ::hActions
|
||||
qAction:pPtr := 0
|
||||
NEXT
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeActions:getAction( cKey )
|
||||
|
||||
IF hb_hHasKey( ::hActions, cKey )
|
||||
@@ -221,7 +232,7 @@ METHOD IdeActions:loadActions()
|
||||
aadd( aAct, { "CommandPrompt" , "Command Prompt...*" , "" , "" , "No", "Yes" } )
|
||||
#else
|
||||
aadd( aAct, { "Terminal" , "Terminal" , "" , "" , "No", "Yes" } )
|
||||
#endif
|
||||
#endif
|
||||
|
||||
aadd( aAct, { "ManageThemes" , "Manage Themes" , "" , "" , "No", "Yes" } )
|
||||
aadd( aAct, { "DefaultTheme" , "Set Default Theme" , "" , "" , "No", "Yes" } )
|
||||
@@ -230,6 +241,11 @@ METHOD IdeActions:loadActions()
|
||||
aadd( aAct, { "HarbourUsersList" , "Harbour Users (Mailing Lists)", "list-users" , "" , "No", "Yes" } )
|
||||
aadd( aAct, { "HarbourDevList" , "Harbour Developers (Mailing Lists)", "list-developers", "", "No", "Yes" } )
|
||||
|
||||
aadd( aAct, { "BuildQt" , "Build Project" , "build" , "" , "No", "Yes" } )
|
||||
aadd( aAct, { "BuildLaunchQt" , "Build and Launch" , "buildlaunch" , "" , "No", "Yes" } )
|
||||
aadd( aAct, { "RebuildQt" , "Rebuild Project" , "rebuild" , "" , "No", "Yes" } )
|
||||
aadd( aAct, { "RebuildLaunchQt" , "Rebuild and Launch" , "rebuildlaunch" , "" , "No", "Yes" } )
|
||||
|
||||
RETURN aAct
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -473,197 +489,6 @@ METHOD IdeActions:buildMainMenu()
|
||||
|
||||
RETURN Self
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
//
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
FUNCTION buildMainMenu( oWnd, oIde )
|
||||
LOCAL oMenuBar, oSubMenu, oSubMenu2, n, f, lEmpty
|
||||
|
||||
oMenuBar := oWnd:MenuBar()
|
||||
|
||||
oMenuBar:setStyleSheet( GetStyleSheet( "QMenuBar" ) )
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* File */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
oSubMenu := XbpMenu():new( oMenuBar ):create()
|
||||
oSubMenu:title := "~File"
|
||||
|
||||
oSubMenu2 := XbpMenu():new( oSubMenu ):create()
|
||||
|
||||
oSubMenu2:addItem( { _T( "~Source, ^N | new.png" ) , {|| oIde:execAction( "New" ) } } )
|
||||
oSubMenu2:addItem( { _T( "~Project | project.png" ) , {|| oIde:execAction( "NewProject" ) } } )
|
||||
oMenuBar:addItem( { oSubMenu2, _T( "~New" ) } )
|
||||
oMenuBar:aMenuItems[ oMenuBar:numItems(), 2 ]:setIcon( oIde:resPath + 'new.png' )
|
||||
|
||||
// oSubMenu:addItem( { _T( "~New File, ^N | new.png" ) , {|| oIde:execAction( "New" ) } } )
|
||||
// oSubMenu:addItem( { _T( "New Pro~ject, Sh+^N | project.png" ) , {|| oIde:execAction( "NewProject" ) } } )
|
||||
oSubMenu:addItem( { _T( "~Open, ^O | open.png" ) , {|| oIde:execAction( "Open" ) } } )
|
||||
oSubMenu:addItem( { _T( "Open Projec~t" ) , {|| oIde:execAction( "LoadProject" ) } } )
|
||||
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
|
||||
oSubMenu2 := XbpMenu():new( oSubMenu ):create()
|
||||
oSubMenu2:itemSelected := {| nIndex, cFile | cFile := oIde:aIni[ INI_RECENTFILES, nIndex ], ;
|
||||
oIde:editSource( cFile ) }
|
||||
lEmpty := .T.
|
||||
FOR n := 1 TO Len( oIde:aIni[ INI_RECENTFILES ] )
|
||||
f := hbide_pathNormalized( oIde:aIni[ INI_RECENTFILES, n ], .F. )
|
||||
lEmpty := .F.
|
||||
oSubMenu2:addItem( { _T( '~' + hb_NumToHex(n) + '. ' + f ), nil } )
|
||||
IF !hb_FileExists(f)
|
||||
oSubMenu2:disableItem( n )
|
||||
ENDIF
|
||||
NEXT
|
||||
IF lEmpty
|
||||
oSubMenu2:addItem( { _T( "** No recent files found **" ) , nil } )
|
||||
oSubMenu2:disableItem( 1 )
|
||||
ENDIF
|
||||
oMenuBar:addItem( { oSubMenu2, _T( "Recent Files" ) } )
|
||||
|
||||
oSubMenu2 := XbpMenu():new( oSubMenu ):create()
|
||||
oSubMenu2:itemSelected := {| nIndex, cFile | cFile := oIde:aIni[ INI_RECENTPROJECTS, nIndex ], ;
|
||||
oIde:loadProjectProperties( cFile, .F., .F., .T. ) }
|
||||
|
||||
lEmpty := .T.
|
||||
FOR n := 1 TO Len( oIde:aIni[ INI_RECENTPROJECTS ] )
|
||||
f := hbide_pathNormalized( oIde:aIni[ INI_RECENTPROJECTS, n ], .F. )
|
||||
lEmpty := .F.
|
||||
oSubMenu2:addItem( { _T( '~' + hb_NumToHex(n) + '. ' + f ) , nil } )
|
||||
IF !hb_FileExists(f)
|
||||
oSubMenu2:disableItem( n )
|
||||
ENDIF
|
||||
NEXT
|
||||
IF lEmpty
|
||||
oSubMenu2:addItem( { _T( "** No recent projects found **" ) , nil } )
|
||||
oSubMenu2:disableItem( 1 )
|
||||
ENDIF
|
||||
oMenuBar:addItem( { oSubMenu2, _T( "Recent Projects" ) } )
|
||||
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
|
||||
oSubMenu:addItem( { _T( "~Save, ^S | save.png" ) , {|| oIde:execAction( "Save" ) } } )
|
||||
oSubMenu:addItem( { _T( "Save ~As | saveas.png" ) , {|| oIde:execAction( "SaveAs" ) } } )
|
||||
oSubMenu:addItem( { _T( "Save A~ll, Sh+^S | saveall.png") , {|| oIde:execAction( "SaveAll" ) } } )
|
||||
oSubMenu:addItem( { _T( "~Close, ^W | close.png" ) , {|| oIde:execAction( "Close" ) } } )
|
||||
oSubMenu:addItem( { _T( "Clos~e All | closeall.png" ) , {|| oIde:execAction( "CloseAll" ) } } )
|
||||
oSubMenu:addItem( { _T( "Close ~Others| closeexcept.png" ) , {|| oIde:execAction( "CloseOther" ) } } )
|
||||
oSubMenu:addItem( { _T( "~Revert to Saved, Sh+^R" ) , {|| oIde:execAction( "Revert" ) } } )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
|
||||
* oSubMenu:addItem( { _T( "~Export as HTML* | exporthtml.png" ), {|| oIde:execAction( "" ) } } )
|
||||
oSubMenu:addItem( { _T( "~Print, ^P | print.png" ) , {|| oIde:execAction( "Print" ) } } )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
oSubMenu:addItem( { _T( "Sa~ve and Exit, Sh+^W" ) , {|| oIde:execAction( "SaveExit" ) } } )
|
||||
oSubMenu:addItem( { _T( "E~xit | exit.png" ) , {|| oIde:execAction( "Exit" ) } } )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Edit */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
oSubMenu := XbpMenu():new( oMenuBar ):create()
|
||||
oSubMenu:title := "~Edit"
|
||||
oSubMenu:addItem( { _T( "~Undo | undo.png" ) , {|| oIde:execAction( "Undo" ) } } )
|
||||
oSubMenu:addItem( { _T( "~Redo | redo.png" ) , {|| oIde:execAction( "Redo" ) } } )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
oSubMenu:addItem( { _T( "C~ut | cut.png" ) , {|| oIde:execAction( "Cut" ) } } )
|
||||
oSubMenu:addItem( { _T( "~Copy | copy.png" ) , {|| oIde:execAction( "Copy" ) } } )
|
||||
oSubMenu:addItem( { _T( "~Paste| paste.png" ) , {|| oIde:execAction( "Paste" ) } } )
|
||||
oSubMenu:addItem( { _T( "Select ~All | selectall.png" ) , {|| oIde:execAction( "SelectAll" ) } } )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
oSubMenu:addItem( { _T( "~Find/Replace, ^F | find.png" ) , {|| oIde:execAction( "Find" ) } } )
|
||||
oSubMenu:addItem( { _T( "~Go To Line..., ^G| gotoline.png" ) , {|| oIde:execAction( "Goto" ) } } )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
|
||||
oSubMenu2 := XbpMenu():new( oSubMenu ):create()
|
||||
oSubMenu2:addItem( { _T( "~Date && Time, Sh+F7| insert-datetime.png" ) , {|| oIde:execAction( "InsertDateTime" ) } } )
|
||||
oSubMenu2:addItem( { _T( "~Random Function Name, Sh+^F8| insert-procname.png" ) , {|| oIde:execAction( "InsertRandomName" ) } } )
|
||||
oSubMenu2:addItem( { _T( "~External File at cursor| insert-external-file.png" ) , {|| oIde:execAction( "InsertExternalFile" ) } } )
|
||||
oMenuBar:addItem( { oSubMenu2, _T( "~Insert" ) } )
|
||||
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
oSubMenu:addItem( { _T( "Switch Read~Only Mode | readonly.png" ) , {|| oIde:execAction( "switchReadOnly" ) } } )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Project */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
oSubMenu := XbpMenu():new( oMenuBar ):create()
|
||||
oSubMenu:title := "~Project"
|
||||
oSubMenu:addItem( { _T( "Properties" ) , {|| oIde:execAction( "Properties" ) } } )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
oSubMenu:addItem( { _T( "Add File* | projectadd.png" ) , {|| oIde:execAction( "" ) } } )
|
||||
oSubMenu:addItem( { _T( "Remove File* | projectdel.png" ) , {|| oIde:execAction( "" ) } } )
|
||||
oSubMenu:addItem( { _T( "Select Main Module | setmain.png" ) , {|| oIde:execAction( "" ) } } )
|
||||
oSubMenu:disableItem( oSubMenu:numItems )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
oSubMenu:addItem( { _T( "Change Current Project" ) , {|| oIde:execAction( "SelectProject" ) } } )
|
||||
oSubMenu:addItem( { _T( "Close Current Project" ) , {|| oIde:execAction( "CloseProject" ) } } )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Build */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
oSubMenu := XbpMenu():new( oMenuBar ):create()
|
||||
oSubMenu:title := "~Build"
|
||||
oSubMenu:addItem( { _T( "Build, ^F9 | build.png" ) , {|| oIde:execAction( "Build" ) } } )
|
||||
oSubMenu:addItem( { _T( "Build and Launch, F9 | buildlaunch.png" ) , {|| oIde:execAction( "BuildLaunch" ) } } )
|
||||
oSubMenu:addItem( { _T( "Re-build | rebuild.png" ) , {|| oIde:execAction( "Rebuild" ) } } )
|
||||
oSubMenu:addItem( { _T( "Re-build and Launch, Sh+^F9 | rebuildlaunch.png" ), {|| oIde:execAction( "RebuildLaunch" ) } } )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
oSubMenu:addItem( { _T( "Save and Compile Current File | compile.png") , {|| oIde:execAction( "SaveCompileCurrent" ) } } )
|
||||
oSubMenu:addItem( { _T( "Save and Compile to PPO | ppo.png" ) , {|| oIde:execAction( "CompilePPO" ) } } )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
oSubMenu:addItem( { _T( "Launch, ^F10" ) , {|| oIde:execAction( "LaunchProject" ) } } )
|
||||
* oSubMenu:addItem( { _T( "Run without Debug*, Sh+^F10 | runnodebug.png" ), {|| oIde:execAction( "" ) } } )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Tools */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
oSubMenu := XbpMenu():new( oMenuBar ):create()
|
||||
oSubMenu:title := "~Tools"
|
||||
oSubMenu:addItem( { _T( "Configure Tools...*" ) , {|| oIde:execAction( "" ) } } )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
// TODO: Load custom TOOLS LINK from .INI file
|
||||
#ifdef __PLATFORM__WINDOWS
|
||||
oSubMenu:addItem( { _T( "Command Prompt...*" ) , {|| oIde:execAction( "" ) } } )
|
||||
#else
|
||||
oSubMenu:addItem( { _T( "Terminal" ) , {|| oIde:execAction( "" ) } } )
|
||||
#endif
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Options */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
oSubMenu := XbpMenu():new( oMenuBar ):create()
|
||||
oSubMenu:title := "~Options"
|
||||
oSubMenu:addItem( { _T( "Manage Themes" ) , {|| oIde:oThemes:fetch() } } )
|
||||
oSubMenu:addItem( { _T( "Default Theme" ) , {|| oIde:oThemes:setWrkTheme() } } )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Codec */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
oSubMenu := hbide_buildCodecMenu( oIde, oMenuBar )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Help */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
oSubMenu := XbpMenu():new( oMenuBar ):create()
|
||||
oSubMenu:title := "~Help"
|
||||
oSubMenu:addItem( { _T( "About hbIDE | vr-16x16.png" ) , {|| hbide_help( 1 ) } } )
|
||||
oSubMenu:addItem( { _T( "About Harbour | hb-16x16.png" ) , {|| hbide_help( 4 ) } } )
|
||||
hbide_menuAddSep( oSubMenu )
|
||||
oSubMenu:addItem( { _T( "Harbour Users (Mailing Lists) | list-users.png" ) , {|| hbide_help( 3 ) } } )
|
||||
oSubMenu:addItem( { _T( "Harbour Developers (Mailing Lists) | list-developers.png" ), {|| hbide_help( 2 ) } } )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
|
||||
Return Nil
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
STATIC FUNCTION hbide_buildCodecMenu( oIde, oMenuBar )
|
||||
@@ -760,9 +585,7 @@ STATIC FUNCTION hbide_buildCodecMenu( oIde, oMenuBar )
|
||||
* 27/12/2009 - 16:05:32 - vailtom
|
||||
*/
|
||||
STATIC FUNCTION mnuNormalizeItem( cCaption )
|
||||
LOCAL cKey
|
||||
LOCAL cIco
|
||||
LOCAL p
|
||||
LOCAL cKey, cIco, p
|
||||
|
||||
/* Retrieve and update the ICON name for this menu item */
|
||||
IF ( ( p := Rat( '|', cCaption ) ) != 00 )
|
||||
@@ -789,7 +612,7 @@ STATIC FUNCTION mnuNormalizeItem( cCaption )
|
||||
|
||||
/* Update the key shortcut for this menu item */
|
||||
IF ( ( p := Rat( ',', cCaption ) ) != 00 )
|
||||
cKey := Substr( cCaption, p + 1 )
|
||||
cKey := Substr( cCaption, p + 1 )
|
||||
cCaption := Substr( cCaption, 1, p - 1 )
|
||||
cCaption := alltrim( cCaption )
|
||||
|
||||
@@ -912,9 +735,7 @@ FUNCTION hbide_mnuAddFileToMRU( oIde, cFileName, nType )
|
||||
* 03/01/2010 - 13:12:42
|
||||
*/
|
||||
FUNCTION hbide_mnuFindItem( oIde, cCaption )
|
||||
LOCAL oMenuBar
|
||||
LOCAL oItem
|
||||
LOCAL n, c
|
||||
LOCAL oMenuBar, oItem, n, c
|
||||
|
||||
IF Empty( oIde:oDlg )
|
||||
RETURN nil
|
||||
@@ -938,14 +759,3 @@ FUNCTION hbide_mnuFindItem( oIde, cCaption )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
FUNCTION hbide_getAction( oIde )
|
||||
LOCAL oAction
|
||||
|
||||
oAction := QAction():new( oIde:oDlg:oWidget )
|
||||
oAction:setText( "Nnnnnew" )
|
||||
oAction:setIcon( hb_DirBase() + "resources" + hb_OsPathSeparator() + "new.png" )
|
||||
oAction:setShortcut( QKeySequence():new( "Ctrl+N" ) )
|
||||
|
||||
RETURN oAction
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -81,8 +81,6 @@ CLASS IdeDockS INHERIT IdeObject
|
||||
METHOD destroy()
|
||||
|
||||
METHOD buildDialog()
|
||||
|
||||
METHOD buildMainMenu()
|
||||
METHOD buildStatusBar()
|
||||
|
||||
METHOD buildDockWidgets()
|
||||
@@ -164,14 +162,6 @@ METHOD IdeDocks:buildDialog()
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeDocks:buildMainMenu()
|
||||
|
||||
buildMainMenu( ::oDlg, ::oIde )
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeDocks:buildDockWidgets()
|
||||
|
||||
::buildProjectTree()
|
||||
|
||||
@@ -98,10 +98,109 @@ CLASS IdeEditsManager INHERIT IdeObject
|
||||
|
||||
METHOD zoom()
|
||||
|
||||
METHOD isOpen()
|
||||
METHOD reLoad()
|
||||
METHOD buildEditor()
|
||||
|
||||
METHOD setSourceVisible()
|
||||
METHOD setSourceVisibleByIndex()
|
||||
|
||||
METHOD getEditorBySource()
|
||||
METHOD getEditorByTabPosition()
|
||||
METHOD getEditorByIndex()
|
||||
|
||||
ENDCLASS
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:buildEditor( cSourceFile, nPos, nHPos, nVPos, cTheme )
|
||||
|
||||
aadd( ::aEdits, IdeEditor():new():create( ::oIde, cSourceFile, nPos, nHPos, nVPos, cTheme ) )
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:getEditorByIndex( nIndex ) /* Index is 0 based */
|
||||
LOCAL pTab, a_
|
||||
|
||||
IF hb_isNumeric( nIndex ) .AND. nIndex > 0 .AND. nIndex < ::qTabWidget:count()
|
||||
pTab := ::qTabWidget:widget( nIndex )
|
||||
FOR EACH a_ IN ::aTabs
|
||||
IF !empty( a_[ TAB_OTAB ] ) .AND. hbqt_IsEqualGcQtPointer( a_[ TAB_OTAB ]:oWidget:pPtr, pTab )
|
||||
RETURN ::aTabs[ a_:__enumIndex(), TAB_OEDITOR ]
|
||||
ENDIF
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
RETURN Nil
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:getEditorByTabPosition( nPos )
|
||||
|
||||
IF hb_isNumeric( nPos ) .AND. nPos > 0 .AND. nPos <= len( ::aTabs )
|
||||
IF !empty( ::aTabs[ nPos, TAB_OEDITOR ] )
|
||||
RETURN ::aTabs[ nPos, TAB_OEDITOR ]
|
||||
ENDIF
|
||||
ENDIF
|
||||
RETURN Nil
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:getEditorBySource( cSource )
|
||||
LOCAL n
|
||||
|
||||
cSource := hbide_pathNormalized( cSource, .t. )
|
||||
IF ( n := ascan( ::aTabs, {|e_| e_[ TAB_OEDITOR ]:pathNormalized == cSource } ) ) > 0
|
||||
RETURN ::aTabs[ n, TAB_OEDITOR ]
|
||||
ENDIF
|
||||
|
||||
RETURN Nil
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:reLoad( cSource )
|
||||
LOCAL oEdit
|
||||
|
||||
IF hb_fileExists( cSource ) .AND. hbide_isValidText( cSource )
|
||||
IF !empty( oEdit := ::getEditorBySource( cSource ) )
|
||||
oEdit:qEdit:clear()
|
||||
oEdit:qEdit:setPlainText( hb_memoread( hbide_pathToOSPath( cSource ) ) )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:isOpen( cSource )
|
||||
RETURN !empty( ::getEditorBySource( cSource ) )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:setSourceVisible( cSource )
|
||||
LOCAL oEdit
|
||||
|
||||
IF !empty( oEdit := ::getEditorBySource( cSource ) )
|
||||
::qTabWidget:setCurrentIndex( ::qTabWidget:indexOf( oEdit:oTab:oWidget ) )
|
||||
RETURN .t.
|
||||
ENDIF
|
||||
|
||||
RETURN .f.
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:setSourceVisibleByIndex( nIndex )
|
||||
|
||||
IF ::qTabWidget:count() > 0 .AND. ::qTabWidget:count() > nIndex /* nIndex is 0 based */
|
||||
::qTabWidget:setCurrentIndex( nIndex )
|
||||
ENDIF
|
||||
|
||||
RETURN .f.
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:new( oIde )
|
||||
|
||||
::oIde := oIde
|
||||
@@ -277,18 +376,6 @@ METHOD IdeEditsManager:zoom( cKey )
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
#if 0
|
||||
METHOD IdeEditsManager:()
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:()
|
||||
|
||||
RETURN Self
|
||||
#endif
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:printPreview()
|
||||
LOCAL qDlg
|
||||
@@ -409,8 +496,10 @@ CLASS IdeEditor INHERIT IdeObject
|
||||
DATA qDocument
|
||||
DATA qHiliter
|
||||
DATA sourceFile
|
||||
DATA pathNormalized
|
||||
DATA qLayout
|
||||
|
||||
|
||||
DATA nBlock INIT -1
|
||||
DATA nColumn INIT -1
|
||||
DATA nBlocks INIT 0
|
||||
@@ -448,6 +537,7 @@ METHOD IdeEditor:new( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme )
|
||||
::nVPos := nVPos
|
||||
::cTheme := cTheme
|
||||
::nID := hbide_getNextUniqueID()
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -461,12 +551,13 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme )
|
||||
DEFAULT nVPos TO ::nVPos
|
||||
DEFAULT cTheme TO ::cTheme
|
||||
|
||||
::oIde := oIde
|
||||
::SourceFile := hbide_pathNormalized( cSourceFile, .F. )
|
||||
::nPos := nPos
|
||||
::nHPos := nHPos
|
||||
::nVPos := nVPos
|
||||
::cTheme := cTheme
|
||||
::oIde := oIde
|
||||
::SourceFile := hbide_pathNormalized( cSourceFile, .F. )
|
||||
::nPos := nPos
|
||||
::nHPos := nHPos
|
||||
::nVPos := nVPos
|
||||
::cTheme := cTheme
|
||||
::pathNormalized := hbide_pathNormalized( cSourceFile, .t. )
|
||||
|
||||
hb_fNameSplit( cSourceFile, @::cPath, @::cFile, @::cExt )
|
||||
|
||||
|
||||
@@ -114,11 +114,12 @@ FUNCTION hbide_execPopup( aPops, aPos, qParent )
|
||||
ENDIF
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
hbide_dbg( 1001 )
|
||||
qPoint := QPoint():new( aPos[ 1 ], aPos[ 2 ] )
|
||||
pAct := qPop:exec_1( qPoint )
|
||||
hbide_dbg( 1002 )
|
||||
qAct := QAction():configure( pAct )
|
||||
|
||||
hbide_dbg( 1003 )
|
||||
IF !empty( qAct:pPtr ) .and. !empty( cAct := qAct:text() )
|
||||
FOR EACH a_ IN aPops
|
||||
IF hb_isObject( a_[ 1 ] )
|
||||
@@ -133,19 +134,8 @@ FUNCTION hbide_execPopup( aPops, aPos, qParent )
|
||||
ENDIF
|
||||
ENDIF
|
||||
NEXT
|
||||
#if 0
|
||||
IF hb_isObject( aPops[ i, 1 ] )
|
||||
IF ( nAct := ascan( aPops, {|e_| e_[ 1 ]:text() == cAct } ) ) > 0
|
||||
xRet := eval( aPops[ nAct,2 ] )
|
||||
ENDIF
|
||||
ELSE
|
||||
IF ( nAct := ascan( aPops, {|e_| e_[ 1 ] == cAct } ) ) > 0
|
||||
xRet := eval( aPops[ nAct,2 ] )
|
||||
ENDIF
|
||||
ENDIF
|
||||
#endif
|
||||
ENDIF
|
||||
|
||||
hbide_dbg( 1004 )
|
||||
qPop:pPtr := 0
|
||||
|
||||
RETURN xRet
|
||||
|
||||
@@ -722,8 +722,10 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
|
||||
::qProcess := QProcess():new()
|
||||
|
||||
::cFileOut := hbide_pathToOSPath( cTargetFN + '.' + hb_md5( alltrim( str( seconds() ) ) ) + ".out" )
|
||||
::cFileErr := hbide_pathToOSPath( cTargetFN + '.' + hb_md5( alltrim( str( seconds() ) ) ) + ".err" )
|
||||
//::cFileOut := hbide_pathToOSPath( cTargetFN + '.' + hb_md5( alltrim( str( seconds() ) ) ) + ".out" )
|
||||
::cFileOut := "xxx"
|
||||
//::cFileErr := hbide_pathToOSPath( cTargetFN + '.' + hb_md5( alltrim( str( seconds() ) ) ) + ".err" )
|
||||
::cFileErr := "yyy"
|
||||
|
||||
::qProcess:setStandardOutputFile( ::cFileOut )
|
||||
::qProcess:setStandardErrorFile( ::cFileErr )
|
||||
|
||||
@@ -94,8 +94,8 @@ STATIC oMLE
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
HBQT_SET_RELEASE_METHOD( HBQT_RELEASE_WITH_DESTRUTOR ) // Exits cleanly
|
||||
//HBQT_SET_RELEASE_METHOD( HBQT_RELEASE_WITH_DELETE ) // Exits cleanly
|
||||
//HBQT_SET_RELEASE_METHOD( HBQT_RELEASE_WITH_DESTRUTOR ) // Exits cleanly
|
||||
HBQT_SET_RELEASE_METHOD( HBQT_RELEASE_WITH_DELETE ) // Exits cleanly
|
||||
//HBQT_SET_RELEASE_METHOD( HBQT_RELEASE_WITH_DELETE_LATER ) // Exit with GPF
|
||||
|
||||
//hb_threadStart( {|| _BuildADialog() } )
|
||||
|
||||
Reference in New Issue
Block a user