diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 861e032a4f..c65a69e9a4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-11-24 07:43 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbxbp/xbplistbox.prg + * contrib/hbxbp/xbptreeview.prg + * contrib/hbide/hbide.hbp + * contrib/hbide/hbide.prg + + contrib/hbide/ideactions.prg + + More grandulariy. + * contrib/hbide/idemisc.prg + + Added and fixed many artifacts. + 2009-11-24 14:29 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbsetup.h * minor extension to CPU detection macros diff --git a/harbour/contrib/hbide/hbide.hbp b/harbour/contrib/hbide/hbide.hbp index fa4d078982..90161829c7 100644 --- a/harbour/contrib/hbide/hbide.hbp +++ b/harbour/contrib/hbide/hbide.hbp @@ -14,6 +14,8 @@ hbide.prg idestylesheets.prg idetags.prg idemisc.prg +ideactions.prg freadlin.c ideparseexpr.c + diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 5d5b1fa6f1..c5a2bb55bd 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -141,6 +141,8 @@ CLASS HbIde DATA oNewDlg DATA oTabWidget + DATA oCurProjItem + DATA oProjRoot DATA oExes DATA oLibs @@ -156,14 +158,14 @@ CLASS HbIde METHOD destroy() METHOD buildDialog() - METHOD buildMenu() METHOD buildStatusBar() - METHOD buildToolbar() METHOD executeAction() METHOD buildTabPage() METHOD buildProjectTree() METHOD manageFuncContext() + METHOD manageProjectContext() + METHOD buildFuncList() METHOD buildBottomArea() METHOD buildCompileResults() @@ -192,6 +194,7 @@ CLASS HbIde DATA aComments INIT {} METHOD createTags() + METHOD loadUI() ENDCLASS @@ -284,6 +287,8 @@ METHOD HbIde:create( cProjectOrSource ) ::qSplitter:show() #endif + ::loadUI( "newproject" ) + ::oDlg:setPos( { 100, 60 } ) /* Editor's Font */ @@ -291,9 +296,9 @@ METHOD HbIde:create( cProjectOrSource ) ::oFont:fixed := .t. ::oFont:create( "10.Courier" ) - ::buildMenu() + buildMainMenu( ::oDlg, Self ) + ::oTBar := buildToolBar( ::oDlg, Self ) ::buildStatusBar() - ::buildToolBar() ::editSource( ::cProjFile ) @@ -304,26 +309,31 @@ METHOD HbIde:create( cProjectOrSource ) ::nEvent := AppEvent( @::mp1, @::mp2, @::oXbp ) IF ::nEvent == xbeP_Quit + HBXBP_DEBUG( "xbeP_Quit" ) EXIT ENDIF // HBXBP_DEBUG( ::nEvent, ::mp1, ::mp2 ) IF ::nEvent == xbeP_Close + HBXBP_DEBUG( "xbeP_Close" ) ::closeAllSources() EXIT ELSEIF ( ::nEvent == xbeP_Keyboard .and. ::mp1 == xbeK_ESC ) ::closeSource() + #if 0 IF ::qTabWidget:count() == 0 EXIT ENDIF - + #endif ENDIF ::oXbp:handleEvent( ::nEvent, ::mp1, ::mp2 ) ENDDO + HBXBP_DEBUG( "EXITING.................." ) + /* Very important - destroy resources */ ::oDlg:destroy() @@ -335,7 +345,6 @@ METHOD HbIde:updateFuncList() ::oFuncList:clear() IF !empty( ::aTags ) -// aeval( ::aTags, {|e| ::oFuncList:addItem( e[ 2 ] + " " + e[ 5 ] ) } ) aeval( ::aTags, {|e_| ::oFuncList:addItem( e_[ 7 ] ) } ) ENDIF @@ -556,6 +565,8 @@ METHOD HbIde:buildProjectTree() ::oProjTree:hasButtons := .T. ::oProjTree:create( ::oDa, , { 0,0 }, { 10,10 }, , .t. ) ::oProjTree:setColorBG( GraMakeRGBColor( { 223,240,255 } ) ) + ::oProjTree:itemMarked := {|oItem| ::oCurProjItem := oItem } + ::oProjTree:hbContextMenu := {|mp1, mp2, oXbp| ::manageProjectContext( mp1, mp2, oXbp ) } ::oProjTree:oWidget:setMaximumWidth( 200 ) @@ -619,6 +630,10 @@ METHOD HbIde:executeAction( cKey ) LOCAL cFile DO CASE + + CASE cKey == "Exit" + PostAppEvent( xbeP_Close, NIL, NIL, ::oDlg ) + CASE cKey == "NewProject" ::fetchNewProject() @@ -631,8 +646,8 @@ METHOD HbIde:executeAction( cKey ) CASE cKey == "Save" ::saveSource( ::getCurrentTab(), .f. ) - CASE cKey == "5" - ::closeSource( ::nCurTab, .t. ) + CASE cKey == "Close" + ::closeSource() CASE cKey == "11" IF ::lDockBVisible @@ -660,95 +675,6 @@ METHOD HbIde:executeAction( cKey ) /*----------------------------------------------------------------------*/ -METHOD HbIde:buildToolBar() - - ::oTBar := XbpToolBar():new( ::oDA ) - ::oTBar:create( , , { 0, ::oDa:currentSize()[ 2 ]-60 }, { ::oDa:currentSize()[ 1 ], 60 } ) - - ::oTBar:imageWidth := 20 - ::oTBar:imageHeight := 20 - - ::oTBar:oWidget:setMaximumHeight( 30 ) - - ::oTBar:addItem( "Exit" , s_resPath + "exit.png" , , , , , "1" ) - ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) - ::oTBar:addItem( "New Project" , s_resPath + "properties.png" , , , , , "NewProject" ) - ::oTBar:addItem( "Open" , s_resPath + "open.png" , , , , , "Open" ) - ::oTBar:addItem( "Save" , s_resPath + "save.png" , , , , , "Save" ) - ::oTBar:addItem( "Close" , s_resPath + "close.png" , , , , , "5" ) - ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) - ::oTBar:addItem( "Compile" , s_resPath + "compile.png" , , , , , "5" ) - ::oTBar:addItem( "Compile to PPO" , s_resPath + "ppo.png" , , , , , "6" ) - ::oTBar:addItem( "Build Project" , s_resPath + "build.png" , , , , , "7" ) - ::oTBar:addItem( "Build and Launch Project" , s_resPath + "buildlaunch.png" , , , , , "8" ) - ::oTBar:addItem( "Rebuild Project" , s_resPath + "rebuild.png" , , , , , "9" ) - ::oTBar:addItem( "Rebuild and Launch Project" , s_resPath + "rebuildlaunch.png" , , , , , "10" ) - ::oTBar:addItem( "Show/Hide Build Error Info" , s_resPath + "builderror.png" , , , , , "11" ) - ::oTBar:addItem( "Module Function List" , s_resPath + "modulelist.png" , , , , , "12" ) - // - ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) - ::oTBar:addItem( "Undo" , s_resPath + "undo.png" , , , , , "13" ) - ::oTBar:addItem( "Redo" , s_resPath + "redo.png" , , , , , "14" ) - ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) - ::oTBar:addItem( "Cut" , s_resPath + "cut.png" , , , , , "15" ) - ::oTBar:addItem( "Copy" , s_resPath + "copy.png" , , , , , "16" ) - ::oTBar:addItem( "Paste" , s_resPath + "paste.png" , , , , , "17" ) - ::oTBar:addItem( "Select All" , s_resPath + "selectall.png" , , , , , "18" ) - ::oTBar:addItem( "Column/Stream Selection" , s_resPath + "stream.png" , , , , , "19" ) - ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) - ::oTBar:addItem( "Find" , s_resPath + "find.png" , , , , , "20" ) - ::oTBar:addItem( "Search" , s_resPath + "search.png" , , , , , "21" ) - ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) - ::oTBar:addItem( "Place/Remove Mark" , s_resPath + "placeremovemark.png", , , , , "22" ) - ::oTBar:addItem( "Goto Mark" , s_resPath + "gotomark.png" , , , , , "23" ) - ::oTBar:addItem( "Goto Line" , s_resPath + "gotoline.png" , , , , , "24" ) - ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) - ::oTBar:addItem( "To Upper" , s_resPath + "toupper.png" , , , , , "25" ) - ::oTBar:addItem( "To Lower" , s_resPath + "tolower.png" , , , , , "26" ) - ::oTBar:addItem( "Invert Case" , s_resPath + "invertcase.png" , , , , , "27" ) - ::oTBar:addItem( "Match Pairs" , s_resPath + "matchobj.png" , , , , , "28" ) - ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) - - ::oTBar:transparentColor := GraMakeRGBColor( { 0,255,255 } ) // GRA_CLR_INVALID - ::oTBar:buttonClick := {|oButton| ::executeAction( oButton:key ) } - - RETURN nil - -/*----------------------------------------------------------------------*/ - -METHOD HbIde:buildMenu() - LOCAL oMenuBar, oSubMenu - - oMenuBar := SetAppWindow():MenuBar() - - oSubMenu := XbpMenu():new( oMenuBar ):create() - oSubMenu:title := "~File" - oSubMenu:addItem( { "Open" , {|| ::executeAction( "Open" ) } } ) - oSubMenu:addItem( { "Save" , {|| ::executeAction( "Save" ) } } ) - MenuAddSep( oSubMenu ) - oSubMenu:addItem( { "Exit" , {|| ::executeAction( "Exit" ) } } ) - oMenuBar:addItem( { oSubMenu, NIL } ) - - oSubMenu := XbpMenu():new( oMenuBar ):create() - oSubMenu:title := "~Project" - oSubMenu:addItem( { "New" , {|| ::executeAction( "NewProject" ) } } ) - MenuAddSep( oSubMenu ) - oSubMenu:addItem( { "Save and Build" , {|| ::executeAction( "SaveBuild" ) } } ) - oSubMenu:addItem( { "Save, Build and Launch" , {|| ::executeAction( "SaveBuildLaunch" ) } } ) - oSubMenu:addItem( { "Save and Re-build" , {|| ::executeAction( "SaveRebuild" ) } } ) - oSubMenu:addItem( { "Save, Re-build and Launch" , {|| ::executeAction( "SaveRebuildLaunch" ) } } ) - MenuAddSep( oSubMenu ) - oSubMenu:addItem( { "Save and Compile Current File", {|| ::executeAction( "SaveCompileCurrent" ) } } ) - oSubMenu:addItem( { "Save and Create PPO Output" , {|| ::executeAction( "SavePPO" ) } } ) - MenuAddSep( oSubMenu ) - oSubMenu:addItem( { "Project Properties" , {|| ::executeAction( "Properties" ) } } ) - - oMenuBar:addItem( { oSubMenu, NIL } ) - - Return Self - -/*----------------------------------------------------------------------*/ - METHOD HbIde:buildStatusBar() LOCAL oPanel @@ -796,6 +722,23 @@ METHOD HbIde:gotoFunction( mp1, mp2, oListBox ) /*----------------------------------------------------------------------*/ +METHOD HbIde:manageProjectContext( mp1 ) + LOCAL aPops := {} + + /* Decide the contex options from */ + + IF !empty( ::oCurProjItem ) + aadd( aPops, { ::oCurProjItem:caption, {|| NIL } } ) + aadd( aPops, { ::oCurProjItem:caption, {|| NIL } } ) + aadd( aPops, { ::oCurProjItem:caption, {|| NIL } } ) + + ExecPopup( aPops, mp1 ) + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD HbIde:manageFuncContext( mp1 ) LOCAL aPops := {} @@ -955,28 +898,98 @@ METHOD HbIde:CreateTags() //----------------------------------------------------------------------// METHOD HbIde:fetchNewProject() - LOCAL oBtnOK, oBtnCancel, qLayout + #if 1 + LOCAL oDlg, oBtnOK, oBtnCn, qLayout, nRet + LOCAL oPrjName + LOCAL qPrjLabel, qTypLabel - ::oNewDlg := XbpWindow():new( ::oDlg ) - ::oNewDlg:oWidget := QDialog():new( QT_PTROFXBP( ::oDlg ) ) + oDlg := XbpWindow():new() + oDlg:oWidget := QDialog():new( QT_PTROFXBP( ::oDlg ) ) + oDlg:oWidget:setWindowTitle( "New Project Properties" ) - oBtnCancel := XbpPushButton():new( ::oNewDlg, , {0,0}, {100,30}, , .t. ):create() - oBtnCancel:setCaption( "Cancel" ) + qPrjLabel := QLabel():new() + qPrjLabel:setText( "Project Title" ) - oBtnOK := XbpPushButton():new( ::oNewDlg, , {0,100}, {100,30}, , .t. ):create() - oBtnOK:setCaption( "Ok" ) + qTypLabel := QLabel():new() + qTypLabel:setText( "Project Type" ) + + oPrjName := XbpSLE():new():create( oDlg, , {0,0}, {10,10}, , .t. ) + + oBtnOk := XbpPushButton():new( oDlg, , {0,0}, {10,30}, , .t. ):create() + oBtnOk:setCaption( "Ok" ) + oBtnOk:activate := {|| oDlg:oWidget:done( 1 ) } + + oBtnCn := XbpPushButton():new( oDlg, , {0,0}, {10,30}, , .t. ):create() + oBtnCn:setCaption( "Cancel" ) + oBtnCn:activate := {|| oDlg:oWidget:done( 2 ) } qLayout := QGridLayout():new() - //qLayout:setColumnStretch( 1,1 ) + qLayout:setColumnStretch( 0,1 ) + qLayout:setColumnMinimumWidth( 0,100 ) + qLayout:setColumnMinimumWidth( 1,250 ) + // R C + qLayout:addWidget( QT_PTROF( qPrjLabel ) , 0, 0 ) + qLayout:addWidget( QT_PTROF( qTypLabel ) , 1, 0 ) + qLayout:addWidget( QT_PTROFXBP( oPrjName ), 0, 1 ) + // + qLayout:addWidget( QT_PTROFXBP( oBtnOK ), 2, 1 ) + qLayout:addWidget( QT_PTROFXBP( oBtnCn ), 3, 1 ) + + oDlg:oWidget:setLayout( QT_PTROF( qLayout ) ) + + nRet := oDlg:oWidget:exec() + + HBXBP_DEBUG( "Done", nRet ) + + oDlg:destroy() + + #else + + LOCAL qBtnOk, qBtnCn, qLayout, qDlg + + qDlg := QDialog():new() + + qBtnOk := QPushButton():new() + qBtnOk:setText( "Ok" ) + + qBtnCn := QPushButton():new() + qBtnCn:setText( "Cancel" ) + + qLayout := QGridLayout():new() + qLayout:setColumnStretch( 1,1 ) qLayout:setColumnMinimumWidth( 1,250 ) - qLayout:addWidget_1( QT_PTROFXBP( oBtnOK ), 0, 0 ) - qLayout:addWidget_1( QT_PTROFXBP( oBtnCancel ), 1, 0 ) + qLayout:addWidget( QT_PTROF( qBtnOK ), 0, 0 ) + qLayout:addWidget( QT_PTROF( qBtnCn ), 1, 0 ) - ::oNewDlg:oWidget:setLayout( QT_PTROF( qLayout ) ) - - ::oNewDlg:oWidget:exec() + qDlg:setLayout( QT_PTROF( qLayout ) ) + qDlg:exec() + #endif RETURN self /*----------------------------------------------------------------------*/ + +METHOD HbIde:loadUI( cUi ) + + HB_SYMBOL_UNUSED( cUi ) + + #if 0 + LOCAL qUiLoader, qStrList + LOCAL cUiFull := s_resPath + cUi + ".ui" + + HBXBP_DEBUG( 0, cUiFull ) + qUiLoader := QUiLoader():new() + HBXBP_DEBUG( 1 ) + qUiLoader:load( cUiFull, QT_PTROFXBP( ::oDlg ) ) + HBXBP_DEBUG( 2 ) + qStrList := QStringList():configure( qUiLoader:availableWidgets() ) + HBXBP_DEBUG( 3 ) + HBXBP_DEBUG( qStrList:count() ) + HBXBP_DEBUG( 4 ) + HBXBP_DEBUG( qUiLoader:workingDirectory() ) + #endif + + RETURN Self + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg new file mode 100644 index 0000000000..8474620f96 --- /dev/null +++ b/harbour/contrib/hbide/ideactions.prg @@ -0,0 +1,162 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/* + * EkOnkar + * ( The LORD is ONE ) + * + * Harbour-Qt IDE + * + * Pritpal Bedi + * 23Nov2009 + */ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ + +#include "common.ch" +#include "xbp.ch" + +/*----------------------------------------------------------------------*/ + +FUNCTION buildToolBar( oWnd, oIde ) + LOCAL oTBar + LOCAL cResPath := hb_DirBase() + "resources" + hb_OsPathSeparator() + + oTBar := XbpToolBar():new( oWnd ) + oTBar:create( , , { 0, oWnd:currentSize()[ 2 ]-60 }, { oWnd:currentSize()[ 1 ], 60 } ) + + oTBar:imageWidth := 20 + oTBar:imageHeight := 20 + + oTBar:oWidget:setMaximumHeight( 30 ) + + oTBar:addItem( "Exit" , cResPath + "exit.png" , , , , , "Exit" ) + oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + oTBar:addItem( "New Project" , cResPath + "properties.png" , , , , , "NewProject" ) + oTBar:addItem( "Open" , cResPath + "open.png" , , , , , "Open" ) + oTBar:addItem( "Save" , cResPath + "save.png" , , , , , "Save" ) + oTBar:addItem( "Close" , cResPath + "close.png" , , , , , "Close" ) + oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + oTBar:addItem( "Compile" , cResPath + "compile.png" , , , , , "Compile" ) + oTBar:addItem( "Compile to PPO" , cResPath + "ppo.png" , , , , , "6" ) + oTBar:addItem( "Build Project" , cResPath + "build.png" , , , , , "7" ) + oTBar:addItem( "Build and Launch Project" , cResPath + "buildlaunch.png" , , , , , "8" ) + oTBar:addItem( "Rebuild Project" , cResPath + "rebuild.png" , , , , , "9" ) + oTBar:addItem( "Rebuild and Launch Project" , cResPath + "rebuildlaunch.png" , , , , , "10" ) + oTBar:addItem( "Show/Hide Build Error Info" , cResPath + "builderror.png" , , , , , "11" ) + oTBar:addItem( "Module Function List" , cResPath + "modulelist.png" , , , , , "12" ) + // + oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + oTBar:addItem( "Undo" , cResPath + "undo.png" , , , , , "13" ) + oTBar:addItem( "Redo" , cResPath + "redo.png" , , , , , "14" ) + oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + oTBar:addItem( "Cut" , cResPath + "cut.png" , , , , , "15" ) + oTBar:addItem( "Copy" , cResPath + "copy.png" , , , , , "16" ) + oTBar:addItem( "Paste" , cResPath + "paste.png" , , , , , "17" ) + oTBar:addItem( "Select All" , cResPath + "selectall.png" , , , , , "18" ) + oTBar:addItem( "Column/Stream Selection" , cResPath + "stream.png" , , , , , "19" ) + oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + oTBar:addItem( "Find" , cResPath + "find.png" , , , , , "20" ) + oTBar:addItem( "Search" , cResPath + "search.png" , , , , , "21" ) + oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + oTBar:addItem( "Place/Remove Mark" , cResPath + "placeremovemark.png", , , , , "22" ) + oTBar:addItem( "Goto Mark" , cResPath + "gotomark.png" , , , , , "23" ) + oTBar:addItem( "Goto Line" , cResPath + "gotoline.png" , , , , , "24" ) + oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + oTBar:addItem( "To Upper" , cResPath + "toupper.png" , , , , , "25" ) + oTBar:addItem( "To Lower" , cResPath + "tolower.png" , , , , , "26" ) + oTBar:addItem( "Invert Case" , cResPath + "invertcase.png" , , , , , "27" ) + oTBar:addItem( "Match Pairs" , cResPath + "matchobj.png" , , , , , "28" ) + oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + + oTBar:transparentColor := GraMakeRGBColor( { 0,255,255 } ) // GRA_CLR_INVALID + oTBar:buttonClick := {|oButton| oIde:executeAction( oButton:key ) } + + RETURN oTBar + +/*----------------------------------------------------------------------*/ + +FUNCTION buildMainMenu( oWnd, oIde ) + LOCAL oMenuBar, oSubMenu + + oMenuBar := oWnd:MenuBar() + + oSubMenu := XbpMenu():new( oMenuBar ):create() + oSubMenu:title := "~File" + oSubMenu:addItem( { "Open" , {|| oIde:executeAction( "Open" ) } } ) + oSubMenu:addItem( { "Save" , {|| oIde:executeAction( "Save" ) } } ) + MenuAddSep( oSubMenu ) + oSubMenu:addItem( { "Exit" , {|| oIde:executeAction( "Exit" ) } } ) + oMenuBar:addItem( { oSubMenu, NIL } ) + + oSubMenu := XbpMenu():new( oMenuBar ):create() + oSubMenu:title := "~Project" + oSubMenu:addItem( { "New" , {|| oIde:executeAction( "NewProject" ) } } ) + MenuAddSep( oSubMenu ) + oSubMenu:addItem( { "Save and Build" , {|| oIde:executeAction( "SaveBuild" ) } } ) + oSubMenu:addItem( { "Save, Build and Launch" , {|| oIde:executeAction( "SaveBuildLaunch" ) } } ) + oSubMenu:addItem( { "Save and Re-build" , {|| oIde:executeAction( "SaveRebuild" ) } } ) + oSubMenu:addItem( { "Save, Re-build and Launch" , {|| oIde:executeAction( "SaveRebuildLaunch" ) } } ) + MenuAddSep( oSubMenu ) + oSubMenu:addItem( { "Save and Compile Current File", {|| oIde:executeAction( "SaveCompileCurrent" ) } } ) + oSubMenu:addItem( { "Save and Create PPO Output" , {|| oIde:executeAction( "SavePPO" ) } } ) + MenuAddSep( oSubMenu ) + oSubMenu:addItem( { "Project Properties" , {|| oIde:executeAction( "Properties" ) } } ) + + oMenuBar:addItem( { oSubMenu, NIL } ) + + Return Nil + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index 8326741a0c..abd65f2c4b 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -80,7 +80,7 @@ PROCEDURE JustACall() /*----------------------------------------------------------------------*/ FUNCTION ExecPopup( aPops, aPos ) - LOCAL i, qPop, qPoint, qAct, nAct, cAct, xRet + LOCAL i, qPop, qPoint, qAct, nAct, cAct, xRet, pAct qPop := QMenu():new() @@ -89,14 +89,16 @@ FUNCTION ExecPopup( aPops, aPos ) NEXT qPoint := QPoint():new( aPos[ 1 ], aPos[ 2 ] ) - qAct := QAction():configure( qPop:exec_1( QT_PTROF( qPoint ) ) ) - - IF !empty( cAct := qAct:text() ) + pAct := qPop:exec_1( QT_PTROF( qPoint ) ) + qAct := QAction():configure( pAct ) + IF !empty( qAct:pPtr ) .and. !empty( cAct := qAct:text() ) IF ( nAct := ascan( aPops, {|e_| e_[ 1 ] == cAct } ) ) > 0 xRet := eval( aPops[ nAct,2 ] ) ENDIF ENDIF + qPop:pPtr := 0 + RETURN xRet /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbplistbox.prg b/harbour/contrib/hbxbp/xbplistbox.prg index e5f50213a6..e1383ed745 100644 --- a/harbour/contrib/hbxbp/xbplistbox.prg +++ b/harbour/contrib/hbxbp/xbplistbox.prg @@ -178,7 +178,7 @@ METHOD XbpListBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) /* Window Events */ ::oWidget:installEventFilter( SetEventFilter() ) - Qt_Connect_Event( ::pWidget, QEvent_ContextMenu, {|o,e| ::exeBlock( 4, e, o ) } ) + ::connectEvent( ::pWidget, QEvent_ContextMenu, {|o,e| ::grabEvent( QEvent_ContextMenu, e, o ) } ) /* Signal-slots */ ::Connect( ::pWidget, "clicked(QModelIndex)" , {|o,i| ::exeBlock( 1,i,o ) } ) @@ -215,11 +215,6 @@ METHOD XbpListBox:exeBlock( nMode, pModel ) IF hb_isBlock( ::sl_itemSelected ) eval( ::sl_itemSelected, NIL, NIL, self ) ENDIF - ELSEIF nMode == 4 /* Context Menu */ - IF hb_isBlock( ::hb_contextMenu ) - oModel := QContextMenuEvent():configure( pModel ) - eval( ::hb_contextMenu, { oModel:globalX(), oModel:globalY() }, NIL, Self ) - ENDIF ENDIF RETURN nil diff --git a/harbour/contrib/hbxbp/xbptreeview.prg b/harbour/contrib/hbxbp/xbptreeview.prg index 0c19994e37..fe1659d241 100644 --- a/harbour/contrib/hbxbp/xbptreeview.prg +++ b/harbour/contrib/hbxbp/xbptreeview.prg @@ -169,7 +169,7 @@ METHOD XbpTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) /* Window Events */ ::oWidget:installEventFilter( SetEventFilter() ) - Qt_Connect_Event( ::pWidget, QEvent_ContextMenu, {|o,e| ::exeBlock( 4, e, o ) } ) + ::connectEvent( ::pWidget, QEvent_ContextMenu, {|o,e| ::grabEvent( QEvent_ContextMenu, e, o ) } ) //::connect( ::pWidget, "currentItemChanged(QTWItem)" , {|o,p1,p2| ::exeBlock( 1, p1, p2, o ) } ) //::connect( ::pWidget, "itemActivated(QTWItem)" , {|o,p1,p2| ::exeBlock( 2, p1, p2, o ) } ) @@ -195,11 +195,11 @@ METHOD XbpTreeView:ExeBlock( nMsg, p1, p2 ) LOCAL oItem, n HB_SYMBOL_UNUSED( nMsg ) - HB_SYMBOL_UNUSED( p1 ) - HB_SYMBOL_UNUSED( p2 ) + HB_SYMBOL_UNUSED( p1 ) + HB_SYMBOL_UNUSED( p2 ) IF hb_isPointer( p1 ) - IF ( n := ascan( ::aItems, {|o| o:oWidget:pPtr == p1 } ) ) > 0 + IF ( n := ascan( ::aItems, {|o| o:qPointer == p1 } ) ) > 0 oItem := ::aItems[ n ] ENDIF ENDIF @@ -346,6 +346,7 @@ CLASS XbpTreeViewItem INHERIT XbpDataRef DATA hItem DATA oParent DATA oXbpTree + DATA qPointer DATA aChilds INIT {} @@ -382,6 +383,7 @@ METHOD XbpTreeViewItem:addItem( xItem, xNormalImage, xMarkedImage, xExpandedImag oItem:caption := xItem oItem:oWidget := QTreeWidgetItem():new() oItem:oWidget:setText( 0, oItem:caption ) + oItem:qPointer := HBQT_QTPTR_FROM_GCPOINTER( oItem:oWidget:pPtr ) ELSE oItem := xItem // aNode ENDIF