diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 69fcb02e54..af941cd148 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,87 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-13 19:27 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/resources/curlinehilight.png + + contrib/hbide/resources/horzruler.png + * contrib/hbide/resources/togglelinenumber.png + * contrib/hbide/resources/toolsutilities.ui + * contrib/hbide/resources/toolsutilities.uic + * contrib/hbide/resources/setup.ui + * contrib/hbide/resources/setup.uic + + * contrib/hbqt/qth/HBQPlainTextEdit.qth + * contrib/hbqt/qth/QTableWidget.qth + - contrib/hbqt/qth/HBQSyntaxHighLighter.qth + + contrib/hbqt/qth/HBQSyntaxHighlighter.qth + + * contrib/hbqt/doc/en/class_hbqplaintextedit.txt + * contrib/hbqt/doc/en/class_hbqsyntaxhighlighter.txt + * contrib/hbqt/qtgui/HBQPlainTextEdit.cpp + * contrib/hbqt/qtgui/QTableWidget.cpp + * contrib/hbqt/qtgui/THBQPlainTextEdit.prg + * contrib/hbqt/qtgui/HBQSyntaxHighlighter.cpp + * contrib/hbqt/qtgui/THBQSyntaxHighlighter.prg + + * contrib/hbqt/hbqt_hbqplaintextedit.cpp + * contrib/hbqt/hbqt_hbqplaintextedit.h + * contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp + * contrib/hbqt/hbqt_hbqsyntaxhighlighter.h + + * contrib/hbide/hbide.hbp + + * contrib/hbide/hbide.ch + + * contrib/hbide/hbide.prg + + contrib/hbide/idedict.prg + * contrib/hbide/idedocks.prg + * contrib/hbide/ideedit.prg + * contrib/hbide/ideeditor.prg + * contrib/hbide/idemisc.prg + * contrib/hbide/ideobject.prg + * contrib/hbide/idesaveload.prg + * contrib/hbide/ideshortcuts.prg + * contrib/hbide/idestylesheets.prg + * contrib/hbide/idethemes.prg + * contrib/hbide/idetools.prg + + % Widened padding for menubar prompts to show up at a proper distance. + + + Controlled "RETURN" keyword not to jump to first indentation place, + with env variable - HBIDE_RETURN_ATBEGINING=yes. Scheduled to be + included in "Setup" interface. + + + Allowed hbIDE execution with any text type file. It was accepting .PRG.CPP only. + + + Broadened the scope of keyword coloring for any case, mixed or absolute. + It was all lower or all upper previously. + + + Prepared ground for user defined keywords through user dictionaries. + + + Added new flags in "Setup" dialog ( yet not active ). + Please have a look into the contents of different pages and + let me know what else can qualify to be included therein. + + + More macro for Tools parameter - ${source_fullname_less_ext} + + % Tools & Utilities dialog made modeless. At times it is desirable + to execute a tool multiple times and also to gather output logs. + + + Tools & Utilities dialog now remembers its last opened position. + + + Implemented: user-configurable 5 toolbars which can be populated + through Tool & Utilities interface. Invoke "Tools & Utilities" + interface and play with the toolbars. You will find it really + rewarding. I am also trying to find a way to hook + "Kayboard Mappings" macros to be included under this interface. + Your input is welcome. I will write the help in about a week, + but interface is straight enough to grab/grasp/use. + + + Implemented: to switch on/off horizontal ruler. + + + Implemented: to remember the last settings for next run for + Horizontal Ruler, Line Numbers display and Current Line highlighting. + 2010-06-12 20:20 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * mpkg_nightly.sh ! Deleted leftovers from test session. diff --git a/harbour/contrib/hbide/hbide.ch b/harbour/contrib/hbide/hbide.ch index 9d84ecbac6..2b2463c4aa 100644 --- a/harbour/contrib/hbide/hbide.ch +++ b/harbour/contrib/hbide/hbide.ch @@ -80,8 +80,9 @@ #define INI_TAGGEDPROJECTS 10 #define INI_GENERAL 11 #define INI_TOOLS 12 +#define INI_USERTOOLBARS 13 -#define INI_SECTIONS_COUNT 12 +#define INI_SECTIONS_COUNT 13 /* INI_HBIDE */ @@ -109,8 +110,13 @@ #define CurrentHarbour 22 #define CurrentShortcuts 23 #define TextFileExtensions 24 +#define CurrentLineHighlightMode 25 +#define LineNumbersDisplayMode 26 +#define HorzRulerDisplayMode 27 +#define ToolsDialogGeometry 28 -#define INI_HBIDE_VRBLS 24 + +#define INI_HBIDE_VRBLS 28 /* .hbi structure constants */ #define PRJ_PRP_PROPERTIES 1 diff --git a/harbour/contrib/hbide/hbide.hbp b/harbour/contrib/hbide/hbide.hbp index 488ac8f654..c0b5a90b4f 100644 --- a/harbour/contrib/hbide/hbide.hbp +++ b/harbour/contrib/hbide/hbide.hbp @@ -37,5 +37,6 @@ idetools.prg ideshortcuts.prg ideedit.prg ideplugins.prg +idedict.prg diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 1aadbf9266..ccae2b8538 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -244,6 +244,7 @@ CLASS HbIde DATA lTabCloseRequested INIT .f. DATA isColumnSelectionEnabled INIT .f. DATA lLineNumbersVisible INIT .t. + DATA lHorzRulerVisible INIT .t. DATA lCurrentLineHighlightEnabled INIT .t. DATA cWrkFolderLast INIT "" @@ -284,6 +285,7 @@ CLASS HbIde DATA aLines INIT {} DATA aComments INIT {} DATA aProjects INIT {} + DATA aUserDict INIT {} DATA aMarkTBtns INIT array( 6 ) DATA lClosing INIT .f. @@ -388,6 +390,9 @@ METHOD HbIde:create( aParams ) hbide_loadINI( Self, ::cProjIni ) ENDIF + /* Load User Dictionaries */ + hbide_loadUserDictionaries( Self ) + /* Shortcuts */ ::oSC := IdeShortcuts():new( Self ):create() @@ -397,14 +402,17 @@ METHOD HbIde:create( aParams ) aeval( ::aSrcOnCmdLine, {|e| aadd( ::aINI[ INI_FILES ], hbide_parseSourceComponents( e ) ) } ) /* Set variables from last session */ - ::cWrkTheme := ::aINI[ INI_HBIDE, CurrentTheme ] - ::cWrkCodec := ::aINI[ INI_HBIDE, CurrentCodec ] - ::cWrkEnvironment := ::aINI[ INI_HBIDE, CurrentEnvironment ] - ::cWrkFind := ::aINI[ INI_HBIDE, CurrentFind ] - ::cWrkFolderFind := ::aINI[ INI_HBIDE, CurrentFolderFind ] - ::cWrkReplace := ::aINI[ INI_HBIDE, CurrentReplace ] - ::cWrkView := ::aINI[ INI_HBIDE, CurrentView ] - ::cWrkHarbour := ::aINI[ INI_HBIDE, CurrentHarbour ] + ::cWrkTheme := ::aINI[ INI_HBIDE, CurrentTheme ] + ::cWrkCodec := ::aINI[ INI_HBIDE, CurrentCodec ] + ::cWrkEnvironment := ::aINI[ INI_HBIDE, CurrentEnvironment ] + ::cWrkFind := ::aINI[ INI_HBIDE, CurrentFind ] + ::cWrkFolderFind := ::aINI[ INI_HBIDE, CurrentFolderFind ] + ::cWrkReplace := ::aINI[ INI_HBIDE, CurrentReplace ] + ::cWrkView := ::aINI[ INI_HBIDE, CurrentView ] + ::cWrkHarbour := ::aINI[ INI_HBIDE, CurrentHarbour ] + ::lCurrentLineHighlightEnabled := iif( ::aINI[ INI_HBIDE, CurrentLineHighlightMode ] == "NO", .f., .t. ) + ::lLineNumbersVisible := iif( ::aINI[ INI_HBIDE, LineNumbersDisplayMode ] == "NO", .f., .t. ) + ::lHorzRulerVisible := iif( ::aINI[ INI_HBIDE, HorzRulerDisplayMode ] == "NO", .f., .t. ) /* Store to restore when all preliminary operations are completed */ cView := ::cWrkView @@ -608,6 +616,8 @@ METHOD HbIde:parseParams() aadd( ::aHbpOnCmdLine, s ) CASE cExt $ ".prg.cpp" aadd( ::aSrcOnCmdLine, s ) + CASE hbide_isValidText( s ) + aadd( ::aSrcOnCmdLine, s ) ENDCASE ENDCASE NEXT diff --git a/harbour/contrib/hbide/idedict.prg b/harbour/contrib/hbide/idedict.prg new file mode 100644 index 0000000000..4ef7d8b0c6 --- /dev/null +++ b/harbour/contrib/hbide/idedict.prg @@ -0,0 +1,209 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * + * Copyright 2009-2010 Pritpal Bedi + * www - http://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 + * 11Jun2010 + */ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ + +#include "common.ch" +#include "hbclass.ch" +#include "hbqt.ch" +#include "hbide.ch" +#include "xbp.ch" + +/*----------------------------------------------------------------------*/ + +#define DIC_FILENAME 1 +#define DIC_CASESENSTITIVE 2 +#define DIC_CONVMODE 3 +#define DIC_AUTOCOMPLETE 4 +#define DIC_BGCOLOR 5 + +#define DIC_NUM_VRBLS 5 + +/*----------------------------------------------------------------------*/ + +FUNCTION hbide_loadUserDictionaries( oIde ) + // File , CaseSensitive , ConvMode=asis, upper, lower , include in autocomplete, bgColor + #if 0 + LOCAL aDict := { "C:\harbour\contrib\hbide\hbide.dic;NO;ASIS;YES;{122,133,233}" } + #else + LOCAL aDict := {} + #endif + LOCAL oDict, i + + FOR i := 1 TO len( aDict ) + oDict := IdeDictionary():new( oIde ):create() + oDict:load( aDict[ i ] ) + + aadd( oIde:aUserDict, oDict ) + NEXT + + RETURN NIL + +/*----------------------------------------------------------------------*/ + +CLASS IdeDictionary INHERIT IdeObject + + DATA cDictInfo INIT "" + DATA cFilename INIT "" + DATA lCaseSensitive INIT .f. + DATA cConvMode INIT "ASIS" + DATA lAutoComplete INIT .t. + DATA cBgColor INIT "NONE" + DATA qBgColor + DATA aItems INIT {} + + METHOD new( oIde ) + METHOD create( oIde ) + METHOD destroy() + METHOD load( cDict ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD IdeDictionary:new( oIde ) + + ::oIde := oIde + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeDictionary:create( oIde ) + + DEFAULT oIde TO ::oIde + + ::oIde := oIde + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeDictionary:destroy() + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeDictionary:load( cDict ) + LOCAL a_:= hb_aTokens( cDict, ";" ) + LOCAL s, b_, n, n1, cKeyword, cSyntax, cDesc, q_ + + IF !empty( a_ ) .AND. hb_isArray( a_ ) + asize( a_, DIC_NUM_VRBLS ) + + DEFAULT a_[ DIC_FILENAME ] TO "" + DEFAULT a_[ DIC_CASESENSTITIVE ] TO "NO" + DEFAULT a_[ DIC_CONVMODE ] TO "ASIS" + DEFAULT a_[ DIC_AUTOCOMPLETE ] TO "YES" + DEFAULT a_[ DIC_BGCOLOR ] TO "NONE" + + ::cDictInfo := cDict + ::cFilename := a_[ 1 ] + ::lCaseSensitive := a_[ 2 ] == "YES" + ::cConvMode := a_[ 3 ] + ::lAutoComplete := iif( a_[ 4 ] == "NO", .f., .t. ) + ::cBgColor := a_[ 5 ] + + IF ::cBgColor != "NONE" + q_:= hbide_evalAsIs( ::cBgColor ) + IF hb_isArray( q_ ) .AND. len( q_ ) == 3 + ::qBgColor := QColor():new( q_[ 1 ], q_[ 2 ], q_[ 3 ] ) + ENDIF +HB_TRACE( HB_TR_ALWAYS, ::cBgColor, valtype( q_ ) ) + ENDIF + + IF !empty( a_[ DIC_FILENAME ] ) .AND. hb_fileExists( a_[ DIC_FILENAME ] ) + b_:= hbide_readSource( a_[ DIC_FILENAME ] ) + + FOR EACH s IN b_ + s := alltrim( s ) + IF empty( s ) + LOOP + ENDIF + cKeyword := "" + cSyntax := "" + cDesc := "" + IF ( n := at( "(", s ) ) > 0 + IF ( n1 := at( ")", s ) ) > 0 + cKeyword := alltrim( substr( s, 1, n - 1 ) ) + cSyntax := strtran( substr( s, 1, n1 ), " (", "(" ) + cDesc := alltrim( substr( s, n1 + 1 ) ) + ENDIF + ELSE + cKeyword := s + ENDIF + + IF !empty( cKeyword ) + aadd( ::aItems, { cKeyword, cSyntax, cDesc } ) + ENDIF + NEXT + ENDIF + + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index fe874ab8e6..843ef4944b 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -660,8 +660,13 @@ METHOD IdeDocks:buildToolBarPanels() aadd( aBtns, { "deleteline" , "Delete Current Line" , {|| ::oEM:deleteLine() } } ) aadd( aBtns, { "duplicateline" , "Duplicate Current Line" , {|| ::oEM:duplicateLine() } } ) aadd( aBtns, {} ) + #if 0 aadd( aBtns, { "togglelinenumber", "Toggle Line Numbers" , {|| ::oEM:toggleLineNumbers() } } ) aadd( aBtns, { "curlinehilight" , "Toggle Current Line Hilight", {|| ::oEM:toggleCurrentLineHighlightMode() } } ) + #endif + aadd( aBtns, { "togglelinenumber", "Toggle Line Numbers" , {|| ::oEM:toggleLineNumbers() } } ) + aadd( aBtns, { "horzruler" , "Toggle Horizontal Ruler" , {|| ::oEM:toggleHorzRuler() } } ) + aadd( aBtns, { "curlinehilight" , "Toggle Current Line Hilight", {|| ::oEM:toggleCurrentLineHighlightMode() } } ) FOR EACH a_ IN aBtns IF empty( a_ ) ::qTBarLines:addSeparator() @@ -671,8 +676,8 @@ METHOD IdeDocks:buildToolBarPanels() qTBtn:setIcon( hbide_image( a_[ 1 ] ) ) qTBtn:setMaximumWidth( 20 ) qTBtn:setMaximumHeight( 20 ) - IF a_[ 1 ] == "togglelinenumber" - qTBtn:setCheckable( .t. ) + IF a_[ 1 ] $ "togglelinenumber,curlinehilight,horzruler" + //qTBtn:setCheckable( .t. ) ENDIF ::connect( qTBtn, "clicked()", a_[ 3 ] ) ::qTBarLines:addWidget( qTBtn ) @@ -700,7 +705,7 @@ METHOD IdeDocks:buildToolBarPanels() ELSE qTBtn := QToolButton():new() qTBtn:setTooltip( a_[ 2 ] ) - qTBtn:setIcon( ::resPath + a_[ 1 ] + ".png" ) + qTBtn:setIcon( hbide_image( a_[ 1 ] ) ) qTBtn:setMaximumWidth( 20 ) qTBtn:setMaximumHeight( 20 ) ::connect( qTBtn, "clicked()", a_[ 3 ] ) @@ -717,7 +722,7 @@ METHOD IdeDocks:buildToolBarPanels() ::qTBarDocks:setWindowTitle( "ToolBar: Dockable Widgets" ) ::qTBarDocks:setIconSize( QSize():new( 16,16 ) ) ::qTBarDocks:setToolButtonStyle( Qt_ToolButtonIconOnly ) - ::qTBarPanels:setAllowedAreas( Qt_LeftToolBarArea + Qt_RightToolBarArea + Qt_TopToolBarArea + Qt_BottomToolBarArea ) + ::qTBarDocks:setAllowedAreas( Qt_LeftToolBarArea + Qt_RightToolBarArea + Qt_TopToolBarArea + Qt_BottomToolBarArea ) aBtns := {} aadd( aBtns, { ::oDockPT , "projtree" } ) @@ -750,6 +755,9 @@ METHOD IdeDocks:buildToolBarPanels() ::oDlg:oWidget:addToolBar( Qt_RightToolBarArea, ::qTBarDocks ) + /* User defined toolbars via Tools & Utilities */ + ::oTM:buildUserToolbars() + RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/ideedit.prg b/harbour/contrib/hbide/ideedit.prg index b61eba5de6..36cce8a99c 100644 --- a/harbour/contrib/hbide/ideedit.prg +++ b/harbour/contrib/hbide/ideedit.prg @@ -173,6 +173,7 @@ CLASS IdeEdit INHERIT IdeObject METHOD goto( nLine ) METHOD gotoFunction() METHOD toggleLineNumbers() + METHOD toggleHorzRuler() METHOD toggleSelectionMode() METHOD toggleStreamSelectionMode() @@ -268,12 +269,13 @@ METHOD IdeEdit:create( oEditor, nMode ) ::setFont() - ::qEdit:hbHighlightCurrentLine( .t. ) /* Via user-setup */ ::qEdit:hbSetSpaces( ::nTabSpaces ) ::qEdit:hbSetCompleter( ::qCompleter ) + ::toggleCurrentLineHighlightMode() ::toggleLineNumbers() + ::toggleHorzRuler() FOR EACH nBlock IN ::aBookMarks ::qEdit:hbBookMarks( nBlock ) @@ -471,8 +473,9 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) ::relayMarkButtons() ::updateTitleBar() - ::toggleLineNumbers() ::toggleCurrentLineHighlightMode() + ::toggleLineNumbers() + ::toggleHorzRuler() ::dispStatusInfo() ::oDK:setStatusText( SB_PNL_SELECTEDCHARS, len( ::getSelectedText() ) ) @@ -1295,10 +1298,22 @@ METHOD IdeEdit:presentSkeletons() /*----------------------------------------------------------------------*/ +METHOD IdeEdit:toggleCurrentLineHighlightMode() + ::qEdit:hbHighlightCurrentLine( ::lCurrentLineHighlightEnabled ) + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeEdit:toggleLineNumbers() ::qEdit:hbNumberBlockVisible( ::lLineNumbersVisible ) RETURN Self +/*----------------------------------------------------------------------*/ + +METHOD IdeEdit:toggleHorzRuler() + ::qEdit:hbHorzRulerVisible( ::lHorzRulerVisible ) + RETURN Self + /*----------------------------------------------------------------------*/ /* Fired by icon */ @@ -1338,12 +1353,6 @@ METHOD IdeEdit:togglePersistentSelection() /*----------------------------------------------------------------------*/ -METHOD IdeEdit:toggleCurrentLineHighlightMode() - ::qEdit:hbHighlightCurrentLine( ::lCurrentLineHighlightEnabled ) - RETURN Self - -/*----------------------------------------------------------------------*/ - METHOD IdeEdit:redo() ::qEdit:redo() RETURN Self @@ -2213,21 +2222,44 @@ FUNCTION hbide_getFrontSpacesAndWord( cText, cWord ) /*----------------------------------------------------------------------*/ FUNCTION hbide_isStartingKeyword( cWord ) - STATIC s_b_ := { ; + STATIC s_b_ + + IF empty( s_b_ ) + IF empty( hb_getEnv( "HBIDE_RETURN_ATBEGINING" ) ) + s_b_ := { ; 'function' => NIL,; 'class' => NIL,; 'method' => NIL } + ELSE + s_b_ := { ; + 'function' => NIL,; + 'class' => NIL,; + 'return' => NIL,; + 'method' => NIL } + ENDIF + ENDIF RETURN Lower( cWord ) $ s_b_ /*----------------------------------------------------------------------*/ FUNCTION hbide_isMinimumIndentableKeyword( cWord ) - STATIC s_b_ := { ; + STATIC s_b_ + + IF empty( s_b_ ) + IF empty( hb_getEnv( "HBIDE_RETURN_ATBEGINING" ) ) + s_b_ := { ; 'local' => NIL,; 'static' => NIL,; 'return' => NIL,; 'default' => NIL } + ELSE + s_b_ := { ; + 'local' => NIL,; + 'static' => NIL,; + 'default' => NIL } + ENDIF + ENDIF RETURN Lower( cWord ) $ s_b_ diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index 1c00e2b826..c5c7e21345 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -145,6 +145,7 @@ CLASS IdeEditsManager INHERIT IdeObject METHOD toggleLineSelectionMode() METHOD toggleLineNumbers() + METHOD toggleHorzRuler() METHOD toggleCurrentLineHighlightMode() METHOD getText() @@ -612,13 +613,10 @@ METHOD IdeEditsManager:toggleLineSelectionMode() METHOD IdeEditsManager:toggleCurrentLineHighlightMode() LOCAL oEdit - ::oIde:lCurrentLineHighlightEnabled := ! ::lCurrentLineHighlightEnabled - IF !empty( oEdit := ::getEditObjectCurrent() ) oEdit:toggleCurrentLineHighlightMode() ENDIF - RETURN Self /*----------------------------------------------------------------------*/ @@ -633,6 +631,16 @@ METHOD IdeEditsManager:toggleLineNumbers() /*----------------------------------------------------------------------*/ +METHOD IdeEditsManager:toggleHorzRuler() + LOCAL oEdit + ::oIde:lHorzRulerVisible := ! ::lHorzRulerVisible + IF !empty( oEdit := ::getEditObjectCurrent() ) + oEdit:toggleHorzRuler() + ENDIF + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeEditsManager:duplicateLine() LOCAL oEdit IF !empty( oEdit := ::getEditObjectCurrent() ) @@ -1435,6 +1443,7 @@ METHOD IdeEditor:activateTab( mp1, mp2, oXbp ) oEdit:setDocumentProperties() oEdit:qCoEdit:relayMarkButtons() oEdit:qCoEdit:toggleLineNumbers() + oEdit:qCoEdit:toggleHorzRuler() oEdit:qCoEdit:toggleCurrentLineHighlightMode() oEdit:qCoEdit:dispStatusInfo() ::oUpDn:show() diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index 95cee23bfc..dbdebaa435 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -342,6 +342,19 @@ FUNCTION hbide_evalAsString( cExp ) /*----------------------------------------------------------------------*/ +FUNCTION hbide_evalAsIs( cExp ) + LOCAL xValue + + BEGIN SEQUENCE WITH { || break() } + xValue := eval( &( "{|| " + cExp + "}" ) ) + RECOVER + xValue := cExp + END SEQUENCE + + RETURN xValue + +/*----------------------------------------------------------------------*/ + FUNCTION hbide_setupMetaKeys( a_ ) LOCAL s, n, cKey, cVal LOCAL a4_1 := {} @@ -1925,6 +1938,15 @@ FUNCTION FN_DirExtSet( cFileName, cDirNew, cExtNew ) /*----------------------------------------------------------------------*/ +FUNCTION hbide_array2string( a_, cDlm ) + LOCAL s := "" + + aeval( a_, {|e| s += e + cDlm } ) + + RETURN s + +/*----------------------------------------------------------------------*/ + FUNCTION hbide_nArray2string( a_ ) LOCAL cString := "" LOCAL n @@ -1979,23 +2001,55 @@ FUNCTION hbide_parseSourceComponents( cCompositeSource ) /*----------------------------------------------------------------------*/ -FUNCTION hbide_parseToolComponents( cCompositeTool ) +FUNCTION hbide_parseUserToolbarComponents( cCompositeTool ) LOCAL a_ a_:= hb_atokens( cCompositeTool, "," ) - asize( a_, 6 ) + asize( a_, 7 ) DEFAULT a_[ 1 ] TO "" DEFAULT a_[ 2 ] TO "" DEFAULT a_[ 3 ] TO "" DEFAULT a_[ 4 ] TO "" DEFAULT a_[ 5 ] TO "" DEFAULT a_[ 6 ] TO "" + DEFAULT a_[ 7 ] TO "" a_[ 1 ] := alltrim( a_[ 1 ] ) a_[ 2 ] := alltrim( a_[ 2 ] ) a_[ 3 ] := alltrim( a_[ 3 ] ) a_[ 4 ] := alltrim( a_[ 4 ] ) a_[ 5 ] := alltrim( a_[ 5 ] ) a_[ 6 ] := alltrim( a_[ 6 ] ) + a_[ 7 ] := alltrim( a_[ 7 ] ) + + RETURN a_ + +/*----------------------------------------------------------------------*/ + +FUNCTION hbide_parseToolComponents( cCompositeTool ) + LOCAL a_ + + a_:= hb_atokens( cCompositeTool, "," ) + asize( a_, 10 ) + DEFAULT a_[ 1 ] TO "" + DEFAULT a_[ 2 ] TO "" + DEFAULT a_[ 3 ] TO "" + DEFAULT a_[ 4 ] TO "" + DEFAULT a_[ 5 ] TO "" + DEFAULT a_[ 6 ] TO "" + DEFAULT a_[ 7 ] TO "-1" + DEFAULT a_[ 8 ] TO "YES" + DEFAULT a_[ 9 ] TO "" + DEFAULT a_[10 ] TO "" + a_[ 1 ] := alltrim( a_[ 1 ] ) + a_[ 2 ] := alltrim( a_[ 2 ] ) + a_[ 3 ] := alltrim( a_[ 3 ] ) + a_[ 4 ] := alltrim( a_[ 4 ] ) + a_[ 5 ] := alltrim( a_[ 5 ] ) + a_[ 6 ] := alltrim( a_[ 6 ] ) + a_[ 7 ] := alltrim( a_[ 7 ] ) + a_[ 8 ] := alltrim( a_[ 8 ] ) + a_[ 9 ] := alltrim( a_[ 9 ] ) + a_[10 ] := alltrim( a_[10 ] ) RETURN a_ diff --git a/harbour/contrib/hbide/ideobject.prg b/harbour/contrib/hbide/ideobject.prg index 9b1ea013c6..871c5af94f 100644 --- a/harbour/contrib/hbide/ideobject.prg +++ b/harbour/contrib/hbide/ideobject.prg @@ -155,6 +155,7 @@ CLASS IdeObject ACCESS aTabs INLINE ::oIde:aTabs ACCESS aViews INLINE ::oIde:aViews ACCESS aSkltns INLINE ::oIde:aSkltns + ACCESS aUserDict INLINE ::oIde:aUserDict ACCESS nTabSpaces INLINE ::oIde:nTabSpaces ACCESS cTabSpaces INLINE ::oIde:cTabSpaces @@ -203,6 +204,7 @@ CLASS IdeObject ACCESS lTabCloseRequested INLINE ::oIde:lTabCloseRequested ACCESS isColumnSelectionEnabled INLINE ::oIde:isColumnSelectionEnabled ACCESS lLineNumbersVisible INLINE ::oIde:lLineNumbersVisible + ACCESS lHorzRulerVisible INLINE ::oIde:lHorzRulerVisible ACCESS lStatusBarVisible INLINE ::oIde:lStatusBarVisible ACCESS lCurrentLineHighlightEnabled INLINE ::oIde:lCurrentLineHighlightEnabled diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index d645093b8b..68c54db54d 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -139,6 +139,11 @@ HB_TRACE( HB_TR_ALWAYS, "hbide_saveINI( oIde )", 0, oIde:nRunMode, oIde:cProjIni aadd( txt_, "CurrentShortcuts=" + oIde:cPathShortcuts ) aadd( txt_, "TextFileExtensions=" + oIde:cTextExtensions ) aadd( txt_, "FindInFilesDialogGeometry=" + oIde:aIni[ INI_HBIDE, FindInFilesDialogGeometry ] ) + aadd( txt_, "FindInFilesDialogGeometry=" + oIde:aIni[ INI_HBIDE, FindInFilesDialogGeometry ] ) + aadd( txt_, "CurrentLineHighlightMode=" + iif( oIde:lCurrentLineHighlightEnabled, "YES", "NO" ) ) + aadd( txt_, "LineNumbersDisplayMode=" + iif( oIde:lLineNumbersVisible, "YES", "NO" ) ) + aadd( txt_, "HorzRulerDisplayMode=" + iif( oIde:lHorzRulerVisible, "YES", "NO" ) ) + aadd( txt_, "ToolsDialogGeometry=" + oIde:aIni[ INI_HBIDE, ToolsDialogGeometry ] ) aadd( txt_, " " ) aadd( txt_, "[PROJECTS]" ) @@ -221,22 +226,34 @@ HB_TRACE( HB_TR_ALWAYS, "hbide_saveINI( oIde )", 0, oIde:nRunMode, oIde:cProjIni FOR n := 1 TO len( oIde:aIni[ INI_VIEWS ] ) aadd( txt_, "view_" + hb_ntos( n ) + "=" + oIde:aIni[ INI_VIEWS, n ] ) NEXT + aadd( txt_, " " ) aadd( txt_, "[TAGGEDPROJECTS]" ) aadd( txt_, " " ) FOR n := 1 TO len( oIde:aIni[ INI_TAGGEDPROJECTS ] ) aadd( txt_, "taggedproject_" + hb_ntos( n ) + "=" + oIde:aIni[ INI_TAGGEDPROJECTS, n ] ) NEXT + aadd( txt_, " " ) aadd( txt_, "[TOOLS]" ) aadd( txt_, " " ) FOR n := 1 TO len( oIde:aIni[ INI_TOOLS ] ) s := oIde:aIni[ INI_TOOLS, n, 1 ] + "," + oIde:aIni[ INI_TOOLS, n, 2 ] + "," + oIde:aIni[ INI_TOOLS, n, 3 ] + "," + ; - oIde:aIni[ INI_TOOLS, n, 4 ] + "," + oIde:aIni[ INI_TOOLS, n, 5 ] + "," + oIde:aIni[ INI_TOOLS, n, 6 ] + "," + oIde:aIni[ INI_TOOLS, n, 4 ] + "," + oIde:aIni[ INI_TOOLS, n, 5 ] + "," + oIde:aIni[ INI_TOOLS, n, 6 ] + "," + ; + oIde:aIni[ INI_TOOLS, n, 7 ] + "," + oIde:aIni[ INI_TOOLS, n, 8 ] + "," + oIde:aIni[ INI_TOOLS, n, 9 ] + "," + ; + oIde:aIni[ INI_TOOLS, n, 10 ] aadd( txt_, "tool_" + hb_ntos( n ) + "=" + s ) NEXT - aadd( txt_, " " ) + + aadd( txt_, "[USERTOOLBARS]" ) + aadd( txt_, " " ) + FOR n := 1 TO len( oIde:aIni[ INI_USERTOOLBARS ] ) + s := hbide_array2string( oIde:aIni[ INI_USERTOOLBARS, n ], "," ) + aadd( txt_, "usertoolbars_" + hb_ntos( n ) + "=" + s ) + NEXT + aadd( txt_, " " ) + aadd( txt_, "[General]" ) aadd( txt_, " " ) @@ -280,7 +297,11 @@ FUNCTION hbide_loadINI( oIde, cHbideIni ) "currentcodec" , "pathmk2" , "pathenv" , ; "currentenvironment" , "findinfilesdialoggeometry", "currentfind" , ; "currentreplace" , "currentfolderfind" , "currentview" , ; - "currentharbour" , "currentshortcuts" , "textfileextensions" } + "currentharbour" , "currentshortcuts" , "textfileextensions" , ; + "currentlinehighlightmode", "linenumbersdisplaymode", "horzrulerdisplaymode", ; + "toolsdialoggeometry" ; + } + #if 0 IF empty( cHbideIni ) IF hb_fileExists( "hbide.ini" ) @@ -347,6 +368,9 @@ FUNCTION hbide_loadINI( oIde, cHbideIni ) CASE "[TOOLS]" nPart := INI_TOOLS EXIT + CASE "[USERTOOLBARS]" + nPart := INI_USERTOOLBARS + EXIT OTHERWISE /* * If none of the previous sections are valid, do not let it @@ -427,6 +451,12 @@ FUNCTION hbide_loadINI( oIde, cHbideIni ) aadd( oIde:aIni[ nPart ], a_ ) ENDIF + CASE nPart == INI_USERTOOLBARS + IF hbide_parseKeyValPair( s, @cKey, @cVal ) + a_:= hbide_parseUserToolbarComponents( cVal ) + aadd( oIde:aIni[ nPart ], a_ ) + ENDIF + ENDCASE EXIT ENDSWITCH diff --git a/harbour/contrib/hbide/ideshortcuts.prg b/harbour/contrib/hbide/ideshortcuts.prg index f95e37e41a..b98b718c75 100644 --- a/harbour/contrib/hbide/ideshortcuts.prg +++ b/harbour/contrib/hbide/ideshortcuts.prg @@ -121,6 +121,7 @@ CLASS IdeShortcuts INHERIT IdeObject METHOD evalMacro( cString ) METHOD test( cString, lWarn ) METHOD execKey( oEdit, nKey, lAlt, lCtrl, lShift ) + METHOD execMacroByName( cName ) METHOD mergeMacros( a_ ) METHOD loadDftSCuts() @@ -138,6 +139,7 @@ CLASS IdeShortcuts INHERIT IdeObject METHOD array2controls( nRow ) METHOD array2table( nRow, a_ ) METHOD vrbls2array( nRow ) + METHOD getMacrosList() /* Public API Methods */ METHOD getWord( lSelect ) @@ -773,7 +775,7 @@ METHOD IdeShortcuts:execKey( oEdit, nKey, lAlt, lCtrl, lShift ) cKey := ::aKeys[ n, 2 ] - n := ascan( ::aDftSCuts, {|e_| e_[ 2 ] == cKey .AND. ; + n := ascan( ::aDftSCuts, {|e_| e_[ 2 ] == cKey .AND. ; e_[ 3 ] == iif( lAlt , "YES", "NO" ) .AND. ; e_[ 4 ] == iif( lCtrl , "YES", "NO" ) .AND. ; e_[ 5 ] == iif( lShift, "YES", "NO" ) } ) @@ -790,6 +792,29 @@ METHOD IdeShortcuts:execKey( oEdit, nKey, lAlt, lCtrl, lShift ) /*----------------------------------------------------------------------*/ +METHOD IdeShortcuts:execMacroByName( cName ) + LOCAL n, lExecuted := .f. + + IF ( n := ascan( ::aDftSCuts, {|e_| e_[ 1 ] == cName } ) ) > 0 + ::oEdit := ::oEM:getEditObjectCurrent() + IF ! empty( ::aDftSCuts[ n, 7 ] ) + lExecuted := ::evalMacro( ::aDftSCuts[ n, 7 ] ) + ENDIF + ENDIF + + RETURN lExecuted + +/*----------------------------------------------------------------------*/ + +METHOD IdeShortcuts:getMacrosList() + LOCAL aList := {} + + aeval( ::aDftSCuts, {|e_| aadd( aList, e_[ 1 ] ) } ) + + RETURN aList + +/*----------------------------------------------------------------------*/ + METHOD IdeShortcuts:loadKeys() LOCAL a_ @@ -1648,3 +1673,4 @@ METHOD IdeShortcuts:mergeMacros( a_ ) ENDSWITCH #endif /*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbide/idestylesheets.prg b/harbour/contrib/hbide/idestylesheets.prg index 1c8c290228..e8a4805d4c 100644 --- a/harbour/contrib/hbide/idestylesheets.prg +++ b/harbour/contrib/hbide/idestylesheets.prg @@ -149,7 +149,7 @@ FUNCTION GetStyleSheet( cWidget, nMode ) ENDIF aadd( txt_, 'QMenuBar::item { ' ) aadd( txt_, ' spacing : 3px; /* spacing between menu bar items */ ' ) - aadd( txt_, ' padding : 1px 4px; ' ) + aadd( txt_, ' padding : 1px 10px; ' ) aadd( txt_, ' background : transparent; ' ) aadd( txt_, ' border-radius: 4px; ' ) aadd( txt_, ' color : #000000; ' ) diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index a2b6693e5c..e5682824bc 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -137,7 +137,7 @@ CLASS IdeThemes INHERIT IdeObject METHOD setQuotesRule( qHiliter, cTheme ) METHOD setMultiLineCommentRule( qHiliter, cTheme ) METHOD setSingleLineCommentRule( qHiliter, cTheme ) - METHOD setSyntaxRule( qHiliter, cName, cPattern, aAttr ) + METHOD setSyntaxRule( qHiliter, cName, cPattern, lCaseSensitive, aAttr ) METHOD setSyntaxFormat( qHiliter, cName, aAttr ) METHOD setSyntaxHilighting( qEdit, cTheme, lNew ) METHOD show() @@ -152,6 +152,7 @@ CLASS IdeThemes INHERIT IdeObject METHOD parseINI( lAppend ) METHOD updateLineNumbersBkColor() METHOD updateCurrentLineColor() + METHOD mergeUserDictionaries( qHiliter, cTheme ) ENDCLASS @@ -186,8 +187,8 @@ METHOD IdeThemes:create( oIde, cIniFile ) /* Compiler Directives */ b_:= { "include","define","ifndef","ifdef","else","endif","command","xcommand","translate","xtranslate" } - s := ""; aeval( b_, {|e| s += iif( empty( s ), "", "|" ) + "#" + upper( e ) + "\b|#" + e + "\b" } ) - aadd( ::aPatterns, { "PreprocessorDirectives", s } ) + s := ""; aeval( b_, {|e| s += iif( empty( s ), "", "|" ) + "#" + e + "\b" } ) + aadd( ::aPatterns, { "PreprocessorDirectives", s, .f. } ) /* Harbour Keywords */ b_:= { 'function','return','static','local','default', ; @@ -202,8 +203,8 @@ METHOD IdeThemes:create( oIde, cIniFile ) 'inherit','init','create','virtual','message', 'from', 'setget',; 'begin','sequence','try','catch','always','recover','hb_symbol_unused', ; 'error','handler' } - s := ""; aeval( b_, {|e| s += iif( empty( s ), "", "|" ) + "\b" + upper( e ) + "\b|\b" + e + "\b" } ) - aadd( ::aPatterns, { "HarbourKeywords" , s } ) + s := ""; aeval( b_, {|e| s += iif( empty( s ), "", "|" ) + "\b" + e + "\b" } ) + aadd( ::aPatterns, { "HarbourKeywords" , s, .f. } ) /* C Language Keywords - Only for C or CPP sources - mutually exclusive with Harbour Sources */ b_:= { "char", "class", "const", "double", "enum", "explicit", "friend", "inline", ; @@ -211,16 +212,16 @@ METHOD IdeThemes:create( oIde, cIniFile ) "short", "signals", "signed", "slots", "static", "struct", "template", ; "typedef", "typename", "union", "unsigned", "virtual", "void", "volatile" } s := ""; aeval( b_, {|e| s += iif( empty( s ), "", "|" ) + "\b" + e + "\b" } ) - aadd( ::aPatterns, { "CLanguageKeywords" , s } ) + aadd( ::aPatterns, { "CLanguageKeywords" , s , .t. } ) s := "\:\=|\:|\+|\-|\\|\*|\ IN\ |\ in\ |\=|\>|\<|\^|\%|\$|\&|\@|\.or\.|\.and\.|\.OR\.|\.AND\.|\!" - aadd( ::aPatterns, { "Operators" , s } ) + aadd( ::aPatterns, { "Operators" , s , .f. } ) - aadd( ::aPatterns, { "NumericalConstants", "\b[0-9.]+\b" } ) + aadd( ::aPatterns, { "NumericalConstants", "\b[0-9.]+\b" , .f. } ) - aadd( ::aPatterns, { "BracketsAndBraces" , "\(|\)|\{|\}|\[|\]|\|" } ) + aadd( ::aPatterns, { "BracketsAndBraces" , "\(|\)|\{|\}|\[|\]|\|" , .f. } ) - aadd( ::aPatterns, { "FunctionsBody" , "\b[A-Za-z0-9_]+(?=\()" } ) + aadd( ::aPatterns, { "FunctionsBody" , "\b[A-Za-z0-9_]+(?=\()" , .f. } ) RETURN Self @@ -370,7 +371,7 @@ METHOD IdeThemes:buildSyntaxFormat( aAttr ) LOCAL qFormat qFormat := QTextCharFormat():new() - // + qFormat:setFontItalic( aAttr[ THM_ATR_ITALIC ] ) IF aAttr[ THM_ATR_BOLD ] qFormat:setFontWeight( 1000 ) @@ -430,9 +431,13 @@ METHOD IdeThemes:setMultiLineCommentRule( qHiliter, cTheme ) /*----------------------------------------------------------------------*/ -METHOD IdeThemes:setSyntaxRule( qHiliter, cName, cPattern, aAttr ) +METHOD IdeThemes:setSyntaxRule( qHiliter, cName, cPattern, lCaseSensitive, aAttr ) + LOCAL qRegExp := QRegExp():new() - qHiliter:hbSetRule( cName, cPattern, ::buildSyntaxFormat( aAttr ) ) + qRegExp:setCaseSensitivity( lCaseSensitive ) + qRegExp:setPattern( cPattern ) + + qHiliter:hbSetRuleWithRegExp( cName, qRegExp, ::buildSyntaxFormat( aAttr ) ) RETURN Self @@ -465,9 +470,12 @@ METHOD IdeThemes:setSyntaxHilighting( qEdit, cTheme, lNew ) FOR EACH a_ IN ::aPatterns IF !empty( aAttr := ::getThemeAttribute( a_[ 1 ], cTheme ) ) - ::setSyntaxRule( qHiliter, a_[ 1 ], a_[ 2 ], aAttr ) + ::setSyntaxRule( qHiliter, a_[ 1 ], a_[ 2 ], a_[ 3 ], aAttr ) ENDIF NEXT + + ::mergeUserDictionaries( qHiliter, cTheme ) + ::setMultiLineCommentRule( qHiliter, cTheme ) ::setSingleLineCommentRule( qHiliter, cTheme ) ::setQuotesRule( qHiliter, cTheme ) @@ -489,6 +497,45 @@ METHOD IdeThemes:setSyntaxHilighting( qEdit, cTheme, lNew ) /*----------------------------------------------------------------------*/ +METHOD IdeThemes:mergeUserDictionaries( qHiliter, cTheme ) + LOCAL oDict, s, aAttr, qFormat, qRegExp, cName, a_, aDict + + aDict := ::oIde:aUserDict + FOR EACH oDict IN aDict + IF !empty( oDict:aItems ) + cName := "UserDictionary" + hb_ntos( oDict:__enumIndex() ) + + s := "" + FOR EACH a_ IN oDict:aItems + s += "\b" + a_[ 1 ] + "\b|" + NEXT + s := substr( s, 1, len( s ) - 1 ) + + qRegExp := QRegExp():new() + qRegExp:setCaseSensitivity( oDict:lCaseSensitive ) + qRegExp:setPattern( s ) + + aAttr := ::getThemeAttribute( "UserDictionary", cTheme ) // cName after slots are implemented + + qFormat := QTextCharFormat():new() + qFormat:setFontItalic( aAttr[ THM_ATR_ITALIC ] ) + IF aAttr[ THM_ATR_BOLD ] + qFormat:setFontWeight( 1000 ) + ENDIF + qFormat:setFontUnderline( aAttr[ THM_ATR_ULINE ] ) + qFormat:setForeground( QBrush():new( "QColor", QColor():new( aAttr[ THM_ATR_R ], aAttr[ THM_ATR_G ], aAttr[ THM_ATR_B ] ) ) ) + IF !empty( oDict:qBgColor ) + qFormat:setBackground( QBrush():new( "QColor", oDict:qBgColor ) ) + ENDIF + + qHiliter:hbSetRuleWithRegExp( cName, qRegExp, qFormat ) + ENDIF + NEXT + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeThemes:show() IF empty( ::oUI ) diff --git a/harbour/contrib/hbide/idetools.prg b/harbour/contrib/hbide/idetools.prg index 77214b40c1..f3b330fa28 100644 --- a/harbour/contrib/hbide/idetools.prg +++ b/harbour/contrib/hbide/idetools.prg @@ -71,19 +71,6 @@ /*----------------------------------------------------------------------*/ -#define buttonAdd_clicked 1 -#define buttonDelete_clicked 2 -#define buttonUp_clicked 3 -#define buttonDown_clicked 4 -#define buttonBrowse_clicked 5 -#define buttonUpdate_clicked 6 -#define buttonClose_clicked 7 -#define buttonExec_clicked 8 - -#define listNames_itemSelectionChanged 9 - -/*----------------------------------------------------------------------*/ - CLASS IdeToolsManager INHERIT IdeObject DATA aAct INIT {} @@ -93,14 +80,19 @@ CLASS IdeToolsManager INHERIT IdeObject DATA qPanelsButton DATA qPanelsMenu DATA oProcess + DATA lExecuting INIT .f. + DATA aHdr INIT {} + DATA aBtns INIT {} + DATA aToolbars INIT { NIL,NIL,NIL,NIL,NIL } ACCESS aTools INLINE ::aINI[ INI_TOOLS ] + ACCESS aUserToolBars INLINE ::aINI[ INI_USERTOOLBARS ] METHOD new( oIde ) METHOD create( oIde ) METHOD destroy() METHOD show() - METHOD execEvent( nMode, p ) + METHOD execEvent( cMode, p ) METHOD clearList() METHOD populateList( aList ) METHOD execTool( ... ) @@ -114,6 +106,9 @@ CLASS IdeToolsManager INHERIT IdeObject METHOD finished( nEC, nES, oHbp ) METHOD parseParams( cP ) METHOD macro2value( cMacro ) + METHOD ini2toolbarControls( nIndex, nMode ) + METHOD populateButtonsTable( nIndex ) + METHOD buildUserToolbars() ENDCLASS @@ -136,6 +131,16 @@ METHOD IdeToolsManager:create( oIde ) IF !empty( oAct := ::oAC:getAction( "TB_Tools" ) ) oAct:setMenu( QMenu():new() ) ENDIF + + IF empty( ::aINI[ INI_USERTOOLBARS ] ) + asize( ::aINI[ INI_USERTOOLBARS ], 5 ) + DEFAULT ::aINI[ INI_USERTOOLBARS, 1 ] TO { "","YES","","","YES","YES","YES" } + DEFAULT ::aINI[ INI_USERTOOLBARS, 2 ] TO { "","YES","","","YES","YES","YES" } + DEFAULT ::aINI[ INI_USERTOOLBARS, 3 ] TO { "","YES","","","YES","YES","YES" } + DEFAULT ::aINI[ INI_USERTOOLBARS, 4 ] TO { "","YES","","","YES","YES","YES" } + DEFAULT ::aINI[ INI_USERTOOLBARS, 5 ] TO { "","YES","","","YES","YES","YES" } + ENDIF + RETURN Self /*----------------------------------------------------------------------*/ @@ -158,15 +163,19 @@ METHOD IdeToolsManager:destroy() ::disconnect( ::qPanelsButton, "clicked()" ) - ::disconnect( ::oUI:q_buttonAdd , "clicked()" ) - ::disconnect( ::oUI:q_buttonDelete, "clicked()" ) - ::disconnect( ::oUI:q_buttonUp , "clicked()" ) - ::disconnect( ::oUI:q_buttonDown , "clicked()" ) - ::disconnect( ::oUI:q_buttonExec , "clicked()" ) - ::disconnect( ::oUI:q_buttonBrowse, "clicked()" ) - ::disconnect( ::oUI:q_buttonUpdate, "clicked()" ) - ::disconnect( ::oUI:q_buttonClose , "clicked()" ) - ::disconnect( ::oUI:q_listNames , "itemSelectionChanged()" ) + ::disconnect( ::oUI:q_buttonAdd , "clicked()" ) + ::disconnect( ::oUI:q_buttonDelete , "clicked()" ) + ::disconnect( ::oUI:q_buttonUp , "clicked()" ) + ::disconnect( ::oUI:q_buttonDown , "clicked()" ) + ::disconnect( ::oUI:q_buttonExec , "clicked()" ) + ::disconnect( ::oUI:q_buttonBrowse , "clicked()" ) + ::disconnect( ::oUI:q_buttonUpdate , "clicked()" ) + ::disconnect( ::oUI:q_buttonClose , "clicked()" ) + ::disconnect( ::oUI:q_buttonSetImage , "clicked()" ) + ::disconnect( ::oUI:q_buttonUserToolbarUpd, "clicked()" ) + ::disconnect( ::oUI:q_comboToolbarAsgnd , "currentIndexChanged(int)" ) + ::disconnect( ::oUI:q_listToolbars , "itemSelectionChanged()" ) + ::disconnect( ::oUI:q_listNames , "itemSelectionChanged()" ) ::oUI:destroy() ENDIF @@ -176,9 +185,11 @@ METHOD IdeToolsManager:destroy() /*----------------------------------------------------------------------*/ METHOD IdeToolsManager:show() + LOCAL oTbl, hdr_, n, qItm IF empty( ::oUI ) ::oUI := HbQtUI():new( hbide_uic( "toolsutilities" ), ::oDlg:oWidget ):build() + ::oUI:setWindowFlags( Qt_Sheet ) ::oUI:setWindowIcon( hbide_image( "hbide" ) ) ::oUI:setMaximumWidth( ::oUI:width() ) @@ -186,43 +197,357 @@ METHOD IdeToolsManager:show() ::oUI:setMaximumHeight( ::oUI:height() ) ::oUI:setMinimumHeight( ::oUI:height() ) - ::connect( ::oUI:q_buttonAdd , "clicked()", {|| ::execEvent( buttonAdd_clicked ) } ) - ::connect( ::oUI:q_buttonDelete, "clicked()", {|| ::execEvent( buttonDelete_clicked ) } ) - ::connect( ::oUI:q_buttonUp , "clicked()", {|| ::execEvent( buttonUp_clicked ) } ) - ::connect( ::oUI:q_buttonDown , "clicked()", {|| ::execEvent( buttonDown_clicked ) } ) - ::connect( ::oUI:q_buttonExec , "clicked()", {|| ::execEvent( buttonExec_clicked ) } ) - ::connect( ::oUI:q_buttonBrowse, "clicked()", {|| ::execEvent( buttonBrowse_clicked ) } ) - ::connect( ::oUI:q_buttonUpdate, "clicked()", {|| ::execEvent( buttonUpdate_clicked ) } ) - ::connect( ::oUI:q_buttonClose , "clicked()", {|| ::execEvent( buttonClose_clicked ) } ) + ::connect( ::oUI:q_buttonAdd , "clicked()", {|| ::execEvent( "buttonAdd_clicked" ) } ) + ::connect( ::oUI:q_buttonDelete, "clicked()", {|| ::execEvent( "buttonDelete_clicked" ) } ) + ::connect( ::oUI:q_buttonUp , "clicked()", {|| ::execEvent( "buttonUp_clicked" ) } ) + ::connect( ::oUI:q_buttonDown , "clicked()", {|| ::execEvent( "buttonDown_clicked" ) } ) + ::connect( ::oUI:q_buttonExec , "clicked()", {|| ::execEvent( "buttonExec_clicked" ) } ) + ::connect( ::oUI:q_buttonBrowse, "clicked()", {|| ::execEvent( "buttonBrowse_clicked" ) } ) + ::connect( ::oUI:q_buttonUpdate, "clicked()", {|| ::execEvent( "buttonUpdate_clicked" ) } ) + ::connect( ::oUI:q_buttonClose , "clicked()", {|| ::execEvent( "buttonClose_clicked" ) } ) - ::connect( ::oUI:q_listNames , "itemSelectionChanged()", {|| ::execEvent( listNames_itemSelectionChanged ) } ) + ::connect( ::oUI:q_listNames , "itemSelectionChanged()", {|| ::execEvent( "listNames_itemSelectionChanged" ) } ) + ::oUI:q_buttonBtnDown :setIcon( hbide_image( "dc_down" ) ) + ::oUI:q_buttonBtnUp :setIcon( hbide_image( "dc_up" ) ) + + ::oUI:q_buttonSetImage:setIcon( hbide_image( "open" ) ) + ::connect( ::oUI:q_buttonSetImage, "clicked()", {|| ::execEvent( "buttonSetImage_clicked" ) } ) + + ::connect( ::oUI:q_buttonUserToolbarUpd, "clicked()", {|| ::execEvent( "buttonUserToolbarUpd_clicked" ) } ) + + ::oUI:q_comboToolbarAsgnd:addItem( "User_Toolbar_1" ) + ::oUI:q_comboToolbarAsgnd:addItem( "User_Toolbar_2" ) + ::oUI:q_comboToolbarAsgnd:addItem( "User_Toolbar_3" ) + ::oUI:q_comboToolbarAsgnd:addItem( "User_Toolbar_4" ) + ::oUI:q_comboToolbarAsgnd:addItem( "User_Toolbar_5" ) + ::oUI:q_comboToolbarAsgnd:setCurrentIndex( -1 ) + ::connect( ::oUI:q_comboToolbarAsgnd, "currentIndexChanged(int)", {|p| ::execEvent( "comboToolbarAsgnd_currentIndexChanged", p ) } ) + + ::oUI:q_listToolbars:addItem( "User_Toolbar_1" ) + ::oUI:q_listToolbars:addItem( "User_Toolbar_2" ) + ::oUI:q_listToolbars:addItem( "User_Toolbar_3" ) + ::oUI:q_listToolbars:addItem( "User_Toolbar_4" ) + ::oUI:q_listToolbars:addItem( "User_Toolbar_5" ) + ::connect( ::oUI:q_listToolbars, "itemSelectionChanged()", {|| ::execEvent( "listToolbars_itemSelectionChanged" ) } ) + + ::oUI:q_comboInitPos:addItem( "Left" ) + ::oUI:q_comboInitPos:addItem( "Top" ) + ::oUI:q_comboInitPos:addItem( "Right" ) + ::oUI:q_comboInitPos:addItem( "Bottom" ) + ::oUI:q_comboToolbarAsgnd:setCurrentIndex( -1 ) + + ::oUI:q_checkDockTop :setChecked( .f. ) + ::oUI:q_checkDockLeft :setChecked( .t. ) + ::oUI:q_checkDockBottom:setChecked( .t. ) + ::oUI:q_checkDockRight :setChecked( .t. ) + ::oUI:q_checkFloatable :setChecked( .t. ) + + ::oUI:q_checkToolActive:setChecked( .t. ) + #if 0 + ::connect( ::oUI:q_checkToolActive, "stateChanged(int)", {|i| ::execEvent( "checkToolActive_stateChanged", i ) } ) + #endif + + #if 1 + ::connect( ::oUI:q_checkInactive, "stateChanged(int)", {|i| ::execEvent( "checkToolActive_stateChanged", i ) } ) + #endif + + hdr_:= { { "Img", 30 }, { "Tool", 218 } } + oTbl := ::oUI:q_tableButtons + // + QHeaderView():from( oTbl:verticalHeader() ):hide() + QHeaderView():from( oTbl:horizontalHeader() ):stretchLastSection( .t. ) + oTbl:setAlternatingRowColors( .t. ) + oTbl:setColumnCount( len( hdr_ ) ) + oTbl:setShowGrid( .t. ) + oTbl:setSelectionMode( QAbstractItemView_SingleSelection ) + oTbl:setSelectionBehavior( QAbstractItemView_SelectRows ) + FOR n := 1 TO len( hdr_ ) + qItm := QTableWidgetItem():new() + qItm:setText( hdr_[ n,1 ] ) + oTbl:setHorizontalHeaderItem( n-1, qItm ) + oTbl:setColumnWidth( n-1, hdr_[ n,2 ] ) + aadd( ::aHdr, qItm ) + NEXT + + ::oUI:q_listToolbars:setCurrentRow( 0 ) ENDIF ::clearList() ::populateList( ::aINI[ INI_TOOLS ] ) - ::oUI:exec() + ::oUI:q_listNames:setCurrentRow( 0 ) + ::oIde:setPosByIni( ::oUI:oWidget, ToolsDialogGeometry ) + ::oUI:show() RETURN Nil /*----------------------------------------------------------------------*/ +METHOD IdeToolsManager:execEvent( cMode, p ) + LOCAL cFile, cFileName, nIndex, qItem, cName, nRow + LOCAL aTools := ::aINI[ INI_TOOLS ] + + HB_SYMBOL_UNUSED( p ) + + SWITCH cMode + CASE "checkToolActive_stateChanged" + nRow := ::oUI:q_listToolbars:currentRow() + ::aUserToolbars[ nRow + 1, 3 ] := "YES" + IF !empty( ::aToolbars[ nRow + 1 ] ) + IF p > 0 + ::aToolbars[ nRow + 1 ]:hide() + ELSE + ::aToolbars[ nRow + 1 ]:show() + ENDIF + ENDIF + EXIT + CASE "buttonSetImage_clicked" + cFileName := hbide_fetchAFile( ::oDlg, "Select an PNG image", { { "Image Files", "*.png" } },/* cFolder */ , /*cDftSuffix*/ ) + IF !empty( cFileName ) + ::oUI:q_editImage:setText( hbide_pathNormalized( cFileName, .f. ) ) + ::oUI:q_buttonSetImage:setIcon( hbide_pathToOsPath( cFileName ) ) + ENDIF + EXIT + CASE "buttonUserToolbarUpd_clicked" + ::ini2toolbarControls( ::oUI:q_listToolbars:currentRow(), 2 ) + EXIT + CASE "listToolbars_itemSelectionChanged" + // Clear q_tableButtons and populate with new values + ::ini2toolbarControls( ::oUI:q_listToolbars:currentRow(), 1 ) + ::populateButtonsTable( ::oUI:q_listToolbars:currentRow() ) + EXIT + CASE "comboToolbarAsgnd_currentIndexChanged" + ::oUI:q_listToolbars:setCurrentRow( p ) + EXIT + CASE "listNames_itemSelectionChanged" + qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) + cName := qItem:text() + IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 + ::ini2Controls( nIndex ) + ENDIF + EXIT + CASE "buttonAdd_clicked" + IF !empty( ::oUI:q_editName:text() ) + ::controls2ini() + ::oUI:q_listNames:addItem( ::oUI:q_editName:text() ) + ENDIF + EXIT + CASE "buttonDelete_clicked" + IF ::oUI:q_listNames:currentRow() >= 0 + qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) + cName := qItem:text() + IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 + hb_adel( ::aINI[ INI_TOOLS ], nIndex, .t. ) + ::clearList() + ::populateList() + ENDIF + ENDIF + EXIT + CASE "buttonUp_clicked" + EXIT + CASE "buttonDown_clicked" + EXIT + CASE "buttonExec_clicked" + IF ! ::lExecuting + ::lExecuting := .t. + IF ::oUI:q_listNames:currentRow() >= 0 + qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) + ::execTool( qItem:text() ) + ENDIF + ::lExecuting := .f. + ENDIF + EXIT + CASE "buttonBrowse_clicked" + IF !empty( cFile := hbide_fetchAFile( ::oDlg, "Select a Tool" ) ) + hb_fNameSplit( cFile, , @cFileName ) + ::ini2controls() + ::oUI:q_editName : setText( cFileName ) + ::oUI:q_editCmdLine : setText( cFile ) + ENDIF + EXIT + CASE "buttonUpdate_clicked" + IF ( nRow := ::oUI:q_listNames:currentRow() ) >= 0 + qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) + cName := qItem:text() + + IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 + ::controls2ini( nIndex ) + ::clearList() + ::populateList() + ::oUI:q_listNames:setCurrentRow( nRow ) + ENDIF + ENDIF + EXIT + CASE "buttonClose_clicked" + ::oIde:aIni[ INI_HBIDE, ToolsDialogGeometry ] := hbide_posAndSize( ::oUI:oWidget ) + ::oUI:done( 1 ) + EXIT + CASE "User_Toolbar_clicked" + ::execTool( p ) + EXIT + ENDSWITCH + + RETURN Self + +/*----------------------------------------------------------------------*/ + +STATIC FUNCTION hbide_toolBlock( o, a_ ) + LOCAL cTool := a_[ 1 ] + RETURN {|| o:execEvent( "User_Toolbar_clicked", cTool ) } + +/*----------------------------------------------------------------------*/ + +METHOD IdeToolsManager:buildUserToolbars() + LOCAL a_:={}, b_, qTbar, qTBtn, nn, nIndex + LOCAL area_:= { Qt_LeftToolBarArea, Qt_TopToolBarArea, Qt_RightToolBarArea, Qt_BottomToolBarArea } + LOCAL aIndex := {} + + FOR nIndex := 0 TO 4 + nn := nIndex + 1 + + FOR EACH b_ IN ::aTools + IF !empty( b_[ 7 ] ) .AND. val( b_[ 7 ] ) == nIndex + aadd( a_, b_ ) + aadd( aIndex, b_:__enumIndex() ) + ENDIF + NEXT + IF !empty( a_ ) + qTBar := QToolBar():new() + qTBar:setStyleSheet( GetStyleSheet( "QToolBarLR5", ::nAnimantionMode ) ) + qTBar:setObjectName( "User_Toolbar_" + hb_ntos( nIndex ) ) + qTBar:setWindowTitle( "User Toolbar : " + hb_ntos( nIndex ) ) + qTBar:setIconSize( QSize():new( 16,16 ) ) + qTBar:setToolButtonStyle( Qt_ToolButtonIconOnly ) + qTBar:setAllowedAreas( iif( ::aUserToolbars[ nn,4 ] == "YES", Qt_TopToolBarArea , 0 ) + ; + iif( ::aUserToolbars[ nn,5 ] == "YES", Qt_LeftToolBarArea , 0 ) + ; + iif( ::aUserToolbars[ nn,6 ] == "YES", Qt_BottomToolBarArea, 0 ) + ; + iif( ::aUserToolbars[ nn,7 ] == "YES", Qt_RightToolBarArea , 0 ) ) + + FOR EACH b_ IN a_ + qTBtn := QToolButton():new() + qTBtn:setText( b_[ 1 ] ) + qTBtn:setTooltip( b_[ 10 ] ) + qTBtn:setIcon( hbide_pathToOSPath( b_[ 9 ] ) ) + qTBtn:setMaximumWidth( 20 ) + qTBtn:setMaximumHeight( 20 ) + ::connect( qTBtn, "clicked()", hbide_toolBlock( Self, b_ ) ) + qTBar:addWidget( qTBtn ) + IF b_[ 8 ] != "YES" + qTBtn:setEnabled( .f. ) + ENDIF + aadd( ::aBtns, qTBtn ) + NEXT + + ::oDlg:oWidget:addToolBar( area_[ val( ::aUserToolbars[ nn,4 ] ) + 1 ], qTBar ) + IF ::aUserToolbars[ nn, 3 ] == "YES" + qTBar:hide() + ENDIF + ::aToolbars[ nn ] := qTBar + a_:= {} + ENDIF + NEXT + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeToolsManager:populateButtonsTable( nIndex ) + LOCAL a_:={}, b_, q0, q1, oTbl, nRow + + oTbl := ::oUI:q_tableButtons + oTbl:clearContents() + + IF nIndex > -1 + FOR EACH b_ IN ::aTools + IF !empty( b_[ 7 ] ) .AND. val( b_[ 7 ] ) == nIndex + aadd( a_, b_ ) + ENDIF + NEXT + + oTbl:setRowCount( len( a_ ) ) + + IF !empty( a_ ) + FOR EACH b_ IN a_ + nRow := b_:__enumIndex()-1 + + q0 := QTableWidgetItem():new() + q0:setIcon( hbide_pathToOSPath( b_[ 9 ] ) ) + q0:setTooltip( b_[ 10 ] ) + oTbl:setItem( nRow, 0, q0 ) + + q1 := QTableWidgetItem():new() + q1:setText( b_[ 1 ] ) + oTbl:setItem( nRow, 1, q1 ) + + oTbl:setRowHeight( nRow, 16 ) + NEXT + ENDIF + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeToolsManager:ini2toolbarControls( nIndex, nMode ) + + IF nIndex > -1 + nIndex++ + IF nMode == 1 + ::oUI:q_comboInitPos :setCurrentIndex( val( ::aUserToolBars[ nIndex, 1 ] ) ) + ::oUI:q_checkFloatable :setChecked( ::aUserToolBars[ nIndex, 2 ] == "YES" ) + ::oUI:q_checkInactive :setChecked( ::aUserToolBars[ nIndex, 3 ] == "YES" ) + ::oUI:q_checkDockTop :setChecked( ::aUserToolBars[ nIndex, 4 ] == "YES" ) + ::oUI:q_checkDockLeft :setChecked( ::aUserToolBars[ nIndex, 5 ] == "YES" ) + ::oUI:q_checkDockBottom:setChecked( ::aUserToolBars[ nIndex, 6 ] == "YES" ) + ::oUI:q_checkDockRight :setChecked( ::aUserToolBars[ nIndex, 7 ] == "YES" ) + + ELSE + ::aUserToolBars[ nIndex, 1 ] := hb_ntos( ::oUI:q_comboInitPos:currentIndex() ) + ::aUserToolBars[ nIndex, 2 ] := iif( ::oUI:q_checkFloatable :isChecked(), "YES", "NO" ) + ::aUserToolBars[ nIndex, 3 ] := iif( ::oUI:q_checkInactive :isChecked(), "YES", "NO" ) + ::aUserToolBars[ nIndex, 4 ] := iif( ::oUI:q_checkDockTop :isChecked(), "YES", "NO" ) + ::aUserToolBars[ nIndex, 5 ] := iif( ::oUI:q_checkDockLeft :isChecked(), "YES", "NO" ) + ::aUserToolBars[ nIndex, 6 ] := iif( ::oUI:q_checkDockBottom:isChecked(), "YES", "NO" ) + ::aUserToolBars[ nIndex, 7 ] := iif( ::oUI:q_checkDockRight :isChecked(), "YES", "NO" ) + + ENDIF + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeToolsManager:ini2controls( nIndex ) IF nIndex > 0 - ::oUI:q_editName : setText( ::aTools[ nIndex, 1 ] ) - ::oUI:q_editCmdLine : setText( ::aTools[ nIndex, 2 ] ) - ::oUI:q_editParams : setText( ::aTools[ nIndex, 3 ] ) - ::oUI:q_editStayIn : setText( ::aTools[ nIndex, 4 ] ) - ::oUI:q_checkCapture : setChecked( !empty( ::aTools[ nIndex, 5 ] ) ) - ::oUI:q_checkOpenCons: setChecked( !empty( ::aTools[ nIndex, 6 ] ) ) + ::oUI:q_editName :setText( ::aTools[ nIndex, 1 ] ) + ::oUI:q_editCmdLine :setText( ::aTools[ nIndex, 2 ] ) + ::oUI:q_editParams :setText( ::aTools[ nIndex, 3 ] ) + ::oUI:q_editStayIn :setText( ::aTools[ nIndex, 4 ] ) + ::oUI:q_checkCapture :setChecked( !empty( ::aTools[ nIndex, 5 ] ) ) + ::oUI:q_checkOpenCons :setChecked( !empty( ::aTools[ nIndex, 6 ] ) ) + + ::oUI:q_comboToolbarAsgnd:setCurrentIndex( iif( empty( ::aTools[ nIndex, 7 ] ), -1, val( ::aTools[ nIndex, 7 ] ) ) ) + ::oUI:q_checkToolActive :setChecked( ::aTools[ nIndex, 8 ] == "YES" ) + ::oUI:q_editImage :setText( hbide_pathNormalized( ::aTools[ nIndex, 9 ], .f. ) ) + ::oUI:q_buttonSetImage :setIcon( iif( empty( ::aTools[ nIndex, 9 ] ), hbide_image( "open" ), ; + hbide_pathToOsPath( ::aTools[ nIndex, 9 ] ) ) ) + ::oUI:q_editTooltip :setText( ::aTools[ nIndex, 10 ] ) + ELSE - ::oUI:q_editName : setText( "" ) - ::oUI:q_editCmdLine : setText( "" ) - ::oUI:q_editParams : setText( "" ) - ::oUI:q_editStayIn : setText( "" ) - ::oUI:q_checkCapture : setChecked( .f. ) - ::oUI:q_checkOpenCons: setChecked( .f. ) + ::oUI:q_editName :setText( "" ) + ::oUI:q_editCmdLine :setText( "" ) + ::oUI:q_editParams :setText( "" ) + ::oUI:q_editStayIn :setText( "" ) + ::oUI:q_checkCapture :setChecked( .f. ) + ::oUI:q_checkOpenCons :setChecked( .f. ) + + ::oUI:q_comboToolbarAsgnd:setCurrentIndex( -1 ) + ::oUI:q_checkToolActive :setChecked( .t. ) + ::oUI:q_editImage :setText( "" ) + ::oUI:q_buttonSetImage :setIcon( hbide_image( "open" ) ) + ::oUI:q_editTooltip :setText( "" ) + ENDIF RETURN Self @@ -241,78 +566,13 @@ METHOD IdeToolsManager:controls2ini( nIndex ) hbide_pathNormalized( ::oUI:q_editParams:text() ), ; hbide_pathNormalized( ::oUI:q_editStayIn:text() ), ; iif( ::oUI:q_checkCapture:isChecked(), "YES", "" ), ; - iif( ::oUI:q_checkOpenCons:isChecked(), "YES", "" ) } - RETURN Self - -/*----------------------------------------------------------------------*/ - -METHOD IdeToolsManager:execEvent( nMode, p ) - LOCAL cFile, cFileName, nIndex, qItem, cName, nRow - LOCAL aTools := ::aINI[ INI_TOOLS ] - - HB_SYMBOL_UNUSED( p ) - - SWITCH nMode - CASE listNames_itemSelectionChanged - qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) - cName := qItem:text() - IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 - ::ini2Controls( nIndex ) - ENDIF - EXIT - CASE buttonAdd_clicked - IF !empty( ::oUI:q_editName:text() ) - ::controls2ini() - ::oUI:q_listNames:addItem( ::oUI:q_editName:text() ) - ENDIF - EXIT - CASE buttonDelete_clicked - IF ::oUI:q_listNames:currentRow() >= 0 - qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) - cName := qItem:text() - IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 - hb_adel( ::aINI[ INI_TOOLS ], nIndex, .t. ) - ::clearList() - ::populateList() - ENDIF - ENDIF - EXIT - CASE buttonUp_clicked - EXIT - CASE buttonDown_clicked - EXIT - CASE buttonExec_clicked - IF ::oUI:q_listNames:currentRow() >= 0 - qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) - ::execTool( qItem:text() ) - ENDIF - EXIT - CASE buttonBrowse_clicked - IF !empty( cFile := hbide_fetchAFile( ::oDlg, "Select a Tool" ) ) - hb_fNameSplit( cFile, , @cFileName ) - ::ini2controls() - ::oUI:q_editName : setText( cFileName ) - ::oUI:q_editCmdLine : setText( cFile ) - ENDIF - EXIT - CASE buttonUpdate_clicked - IF ( nRow := ::oUI:q_listNames:currentRow() ) >= 0 - qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) - cName := qItem:text() - - IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 - ::controls2ini( nIndex ) - ::clearList() - ::populateList() - ::oUI:q_listNames:setCurrentRow( nRow ) - ENDIF - ENDIF - EXIT - CASE buttonClose_clicked - ::oUI:done( 1 ) - EXIT - ENDSWITCH - + iif( ::oUI:q_checkOpenCons:isChecked(), "YES", "" ), ; + ; + hb_ntos( ::oUI:q_comboToolbarAsgnd:currentIndex() ), ; + iif( ::oUI:q_checkToolActive:isChecked(), "YES", "NO" ), ; + ::oUI:q_editImage:text(), ; + ::oUI:q_editTooltip:text() ; + } RETURN Self /*----------------------------------------------------------------------*/ @@ -404,6 +664,7 @@ METHOD IdeToolsManager:execToolByParams( cCmd, cParams, cStartIn, lCapture, lOpe IF empty( cCmd ) cCmd := hbide_getShellCommand() cArg := iif( hbide_getOS() == "nix", "", "/C " ) + //cArg := "" ELSE cArg := "" ENDIF @@ -527,12 +788,15 @@ METHOD IdeToolsManager:macro2value( cMacro ) CASE cMacroL == "source_fullname" cVal := hbide_pathToOSPath( cPath + cFile + cExt ) - CASE cMacroL == "source_name" - cVal := cFile + cExt - CASE cMacroL == "source_path" cVal := hbide_pathToOSPath( cPath ) + CASE cMacroL == "source_fullname_less_ext" + cVal := hbide_pathToOSPath( cPath + cFile ) + + CASE cMacroL == "source_name" + cVal := cFile + cExt + CASE cMacroL == "source_ext" cVal := cExt diff --git a/harbour/contrib/hbide/resources/curlinehilight.png b/harbour/contrib/hbide/resources/curlinehilight.png index f556f902e0..cea25aa88f 100644 Binary files a/harbour/contrib/hbide/resources/curlinehilight.png and b/harbour/contrib/hbide/resources/curlinehilight.png differ diff --git a/harbour/contrib/hbide/resources/horzruler.png b/harbour/contrib/hbide/resources/horzruler.png new file mode 100644 index 0000000000..193a0b572a Binary files /dev/null and b/harbour/contrib/hbide/resources/horzruler.png differ diff --git a/harbour/contrib/hbide/resources/setup.ui b/harbour/contrib/hbide/resources/setup.ui index fe38180379..3db11f36a6 100644 --- a/harbour/contrib/hbide/resources/setup.ui +++ b/harbour/contrib/hbide/resources/setup.ui @@ -48,7 +48,7 @@ 0 - 2 + 0 351 365 @@ -56,6 +56,299 @@ + + + + 10 + 2 + 331 + 265 + + + + Source + + + + + 14 + 18 + 301 + 19 + + + + Trim trailing blanks while source is saved ? + + + + + + 10 + 120 + 147 + 135 + + + + Line ending mode + + + + + 8 + 42 + 99 + 19 + + + + Auto detected + + + + + + 8 + 64 + 99 + 19 + + + + OS dependent + + + + + + 8 + 20 + 131 + 19 + + + + CRLF (0D+0A) default + + + + + + 8 + 86 + 82 + 19 + + + + CR (0D) + + + + + + 8 + 110 + 82 + 19 + + + + LF (0A) + + + + + + + 172 + 120 + 149 + 135 + + + + TABS - Indents + + + + + 8 + 18 + 131 + 19 + + + + Convert TAB to spaces + + + + + + 8 + 42 + 85 + 16 + + + + Spaces for a TAB + + + + + + 98 + 42 + 39 + 20 + + + + + + + 8 + 64 + 89 + 19 + + + + Auto indent + + + + + + 8 + 86 + 87 + 19 + + + + Smart indent + + + + + + 8 + 108 + 59 + 16 + + + + Indent size + + + + + + 98 + 104 + 39 + 20 + + + + + + + + 14 + 42 + 301 + 19 + + + + Save source before compiling process starts ? + + + + + + 14 + 66 + 301 + 19 + + + + Supress convertion to uppcase of Harbour keywords ? + + + + + + 14 + 92 + 301 + 19 + + + + Convert tabs to spaces when a source is loaded ? + + + + + + + 10 + 272 + 157 + 83 + + + + Display + + + + + 12 + 16 + 143 + 19 + + + + Show horizontal ruler + + + + + + 12 + 36 + 151 + 19 + + + + Show line numbers + + + + + + 12 + 58 + 149 + 19 + + + + Highlight current line + + + diff --git a/harbour/contrib/hbide/resources/setup.uic b/harbour/contrib/hbide/resources/setup.uic index 48436b6108..d47ba29f43 100644 --- a/harbour/contrib/hbide/resources/setup.uic +++ b/harbour/contrib/hbide/resources/setup.uic @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'setup.ui' ** -** Created: Mon Jun 7 22:16:57 2010 +** Created: Sun Jun 13 18:46:20 2010 ** by: Qt User Interface Compiler version 4.6.2 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! @@ -14,11 +14,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -36,6 +38,29 @@ public: QStackedWidget *stackedWidget; QWidget *page; QGroupBox *groupBox; + QGroupBox *groupBox_11; + QCheckBox *checkBox; + QGroupBox *groupBox_12; + QRadioButton *radioButton_5; + QRadioButton *radioButton_6; + QRadioButton *radioButton_7; + QRadioButton *radioButton_8; + QRadioButton *radioButton_9; + QGroupBox *groupBox_13; + QCheckBox *checkBox_2; + QLabel *label_4; + QLineEdit *lineEdit; + QCheckBox *checkBox_11; + QCheckBox *checkBox_6; + QLabel *label_5; + QLineEdit *lineEdit_2; + QCheckBox *checkBox_10; + QCheckBox *checkBox_7; + QCheckBox *checkBox_8; + QGroupBox *groupBox_14; + QCheckBox *checkBox_3; + QCheckBox *checkBox_4; + QCheckBox *checkBox_5; QWidget *page_2; QGroupBox *groupBox_2; QGroupBox *groupBox_6; @@ -87,7 +112,76 @@ public: page->setObjectName(QString::fromUtf8("page")); groupBox = new QGroupBox(page); groupBox->setObjectName(QString::fromUtf8("groupBox")); - groupBox->setGeometry(QRect(0, 2, 351, 365)); + groupBox->setGeometry(QRect(0, 0, 351, 365)); + groupBox_11 = new QGroupBox(groupBox); + groupBox_11->setObjectName(QString::fromUtf8("groupBox_11")); + groupBox_11->setGeometry(QRect(10, 2, 331, 265)); + checkBox = new QCheckBox(groupBox_11); + checkBox->setObjectName(QString::fromUtf8("checkBox")); + checkBox->setGeometry(QRect(14, 18, 301, 19)); + groupBox_12 = new QGroupBox(groupBox_11); + groupBox_12->setObjectName(QString::fromUtf8("groupBox_12")); + groupBox_12->setGeometry(QRect(10, 120, 147, 135)); + radioButton_5 = new QRadioButton(groupBox_12); + radioButton_5->setObjectName(QString::fromUtf8("radioButton_5")); + radioButton_5->setGeometry(QRect(8, 42, 99, 19)); + radioButton_6 = new QRadioButton(groupBox_12); + radioButton_6->setObjectName(QString::fromUtf8("radioButton_6")); + radioButton_6->setGeometry(QRect(8, 64, 99, 19)); + radioButton_7 = new QRadioButton(groupBox_12); + radioButton_7->setObjectName(QString::fromUtf8("radioButton_7")); + radioButton_7->setGeometry(QRect(8, 20, 131, 19)); + radioButton_8 = new QRadioButton(groupBox_12); + radioButton_8->setObjectName(QString::fromUtf8("radioButton_8")); + radioButton_8->setGeometry(QRect(8, 86, 82, 19)); + radioButton_9 = new QRadioButton(groupBox_12); + radioButton_9->setObjectName(QString::fromUtf8("radioButton_9")); + radioButton_9->setGeometry(QRect(8, 110, 82, 19)); + groupBox_13 = new QGroupBox(groupBox_11); + groupBox_13->setObjectName(QString::fromUtf8("groupBox_13")); + groupBox_13->setGeometry(QRect(172, 120, 149, 135)); + checkBox_2 = new QCheckBox(groupBox_13); + checkBox_2->setObjectName(QString::fromUtf8("checkBox_2")); + checkBox_2->setGeometry(QRect(8, 18, 131, 19)); + label_4 = new QLabel(groupBox_13); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(8, 42, 85, 16)); + lineEdit = new QLineEdit(groupBox_13); + lineEdit->setObjectName(QString::fromUtf8("lineEdit")); + lineEdit->setGeometry(QRect(98, 42, 39, 20)); + checkBox_11 = new QCheckBox(groupBox_13); + checkBox_11->setObjectName(QString::fromUtf8("checkBox_11")); + checkBox_11->setGeometry(QRect(8, 64, 89, 19)); + checkBox_6 = new QCheckBox(groupBox_13); + checkBox_6->setObjectName(QString::fromUtf8("checkBox_6")); + checkBox_6->setGeometry(QRect(8, 86, 87, 19)); + label_5 = new QLabel(groupBox_13); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(8, 108, 59, 16)); + lineEdit_2 = new QLineEdit(groupBox_13); + lineEdit_2->setObjectName(QString::fromUtf8("lineEdit_2")); + lineEdit_2->setGeometry(QRect(98, 104, 39, 20)); + checkBox_10 = new QCheckBox(groupBox_11); + checkBox_10->setObjectName(QString::fromUtf8("checkBox_10")); + checkBox_10->setGeometry(QRect(14, 42, 301, 19)); + checkBox_7 = new QCheckBox(groupBox_11); + checkBox_7->setObjectName(QString::fromUtf8("checkBox_7")); + checkBox_7->setGeometry(QRect(14, 66, 301, 19)); + checkBox_8 = new QCheckBox(groupBox_11); + checkBox_8->setObjectName(QString::fromUtf8("checkBox_8")); + checkBox_8->setGeometry(QRect(14, 92, 301, 19)); + groupBox_14 = new QGroupBox(groupBox); + groupBox_14->setObjectName(QString::fromUtf8("groupBox_14")); + groupBox_14->setGeometry(QRect(10, 272, 157, 83)); + checkBox_3 = new QCheckBox(groupBox_14); + checkBox_3->setObjectName(QString::fromUtf8("checkBox_3")); + checkBox_3->setGeometry(QRect(12, 16, 143, 19)); + checkBox_4 = new QCheckBox(groupBox_14); + checkBox_4->setObjectName(QString::fromUtf8("checkBox_4")); + checkBox_4->setGeometry(QRect(12, 36, 151, 19)); + checkBox_5 = new QCheckBox(groupBox_14); + checkBox_5->setObjectName(QString::fromUtf8("checkBox_5")); + checkBox_5->setGeometry(QRect(12, 58, 149, 19)); stackedWidget->addWidget(page); page_2 = new QWidget(); page_2->setObjectName(QString::fromUtf8("page_2")); @@ -195,6 +289,27 @@ public: { DialogSetup->setWindowTitle(QApplication::translate("DialogSetup", "Setup", 0, QApplication::UnicodeUTF8)); groupBox->setTitle(QString()); + groupBox_11->setTitle(QApplication::translate("DialogSetup", " Source ", 0, QApplication::UnicodeUTF8)); + checkBox->setText(QApplication::translate("DialogSetup", "Trim trailing blanks while source is saved ?", 0, QApplication::UnicodeUTF8)); + groupBox_12->setTitle(QApplication::translate("DialogSetup", " Line ending mode ", 0, QApplication::UnicodeUTF8)); + radioButton_5->setText(QApplication::translate("DialogSetup", "Auto detected", 0, QApplication::UnicodeUTF8)); + radioButton_6->setText(QApplication::translate("DialogSetup", "OS dependent", 0, QApplication::UnicodeUTF8)); + radioButton_7->setText(QApplication::translate("DialogSetup", "CRLF (0D+0A) default", 0, QApplication::UnicodeUTF8)); + radioButton_8->setText(QApplication::translate("DialogSetup", "CR (0D)", 0, QApplication::UnicodeUTF8)); + radioButton_9->setText(QApplication::translate("DialogSetup", "LF (0A)", 0, QApplication::UnicodeUTF8)); + groupBox_13->setTitle(QApplication::translate("DialogSetup", " TABS - Indents", 0, QApplication::UnicodeUTF8)); + checkBox_2->setText(QApplication::translate("DialogSetup", "Convert TAB to spaces", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("DialogSetup", "Spaces for a TAB", 0, QApplication::UnicodeUTF8)); + checkBox_11->setText(QApplication::translate("DialogSetup", "Auto indent", 0, QApplication::UnicodeUTF8)); + checkBox_6->setText(QApplication::translate("DialogSetup", "Smart indent", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("DialogSetup", "Indent size", 0, QApplication::UnicodeUTF8)); + checkBox_10->setText(QApplication::translate("DialogSetup", "Save source before compiling process starts ?", 0, QApplication::UnicodeUTF8)); + checkBox_7->setText(QApplication::translate("DialogSetup", "Supress convertion to uppcase of Harbour keywords ?", 0, QApplication::UnicodeUTF8)); + checkBox_8->setText(QApplication::translate("DialogSetup", "Convert tabs to spaces when a source is loaded ?", 0, QApplication::UnicodeUTF8)); + groupBox_14->setTitle(QApplication::translate("DialogSetup", " Display ", 0, QApplication::UnicodeUTF8)); + checkBox_3->setText(QApplication::translate("DialogSetup", "Show horizontal ruler", 0, QApplication::UnicodeUTF8)); + checkBox_4->setText(QApplication::translate("DialogSetup", "Show line numbers", 0, QApplication::UnicodeUTF8)); + checkBox_5->setText(QApplication::translate("DialogSetup", "Highlight current line", 0, QApplication::UnicodeUTF8)); groupBox_2->setTitle(QString()); groupBox_6->setTitle(QApplication::translate("DialogSetup", "Caret after paste operation", 0, QApplication::UnicodeUTF8)); label->setText(QApplication::translate("DialogSetup", "Stream Selection:", 0, QApplication::UnicodeUTF8)); diff --git a/harbour/contrib/hbide/resources/togglelinenumber.png b/harbour/contrib/hbide/resources/togglelinenumber.png index c850f61f04..cba25c3c2b 100644 Binary files a/harbour/contrib/hbide/resources/togglelinenumber.png and b/harbour/contrib/hbide/resources/togglelinenumber.png differ diff --git a/harbour/contrib/hbide/resources/toolsutilities.ui b/harbour/contrib/hbide/resources/toolsutilities.ui index 9a7cfd35b8..6f3b9cfa1d 100644 --- a/harbour/contrib/hbide/resources/toolsutilities.ui +++ b/harbour/contrib/hbide/resources/toolsutilities.ui @@ -6,7 +6,7 @@ 0 0 - 280 + 602 425 @@ -320,6 +320,300 @@ p, li { white-space: pre-wrap; } Open Output Console ? + + + + 284 + 164 + 307 + 111 + + + + Toolbars: + + + + + 114 + 32 + 93 + 22 + + + + + + + 246 + 28 + 53 + 19 + + + + Top + + + + + + 10 + 18 + 93 + 83 + + + + + + + 246 + 82 + 53 + 19 + + + + Right + + + + + + 246 + 12 + 53 + 16 + + + + Dockable: + + + + + + 246 + 64 + 53 + 19 + + + + Bottom + + + + + + 246 + 46 + 53 + 19 + + + + Left + + + + + + 116 + 14 + 89 + 16 + + + + Iniitial Position: + + + + + + 114 + 60 + 71 + 19 + + + + Floatable + + + + + + 114 + 82 + 71 + 19 + + + + Inactive + + + + + + 182 + 63 + 55 + 37 + + + + Update + + + + + + + 284 + 284 + 307 + 131 + + + + Toolbar Buttons: + + + + + 10 + 16 + 253 + 107 + + + + + + + 272 + 16 + 25 + 20 + + + + ... + + + + + + 272 + 46 + 25 + 20 + + + + ... + + + + + + + 284 + 8 + 307 + 147 + + + + Current Tools Assignment to Toolbar: + + + + + 10 + 20 + 199 + 22 + + + + + + + 10 + 66 + 249 + 20 + + + + + + + 12 + 48 + 81 + 16 + + + + Image: + + + + + + 270 + 66 + 25 + 20 + + + + ... + + + + + + 12 + 98 + 57 + 16 + + + + Tooltip: + + + + + + 10 + 116 + 249 + 20 + + + + + + + 246 + 22 + 57 + 19 + + + + Active + + + diff --git a/harbour/contrib/hbide/resources/toolsutilities.uic b/harbour/contrib/hbide/resources/toolsutilities.uic index d13b8e707c..506ecf0469 100644 --- a/harbour/contrib/hbide/resources/toolsutilities.uic +++ b/harbour/contrib/hbide/resources/toolsutilities.uic @@ -1,10 +1,10 @@ /******************************************************************************** -** Form generated from reading ui file 'toolsutilities.ui' +** Form generated from reading UI file 'toolsutilities.ui' ** -** Created: Sun Apr 4 19:24:53 2010 -** by: Qt User Interface Compiler version 4.5.2 +** Created: Sun Jun 13 00:20:38 2010 +** by: Qt User Interface Compiler version 4.6.2 ** -** WARNING! All changes made in this file will be lost when recompiling ui file! +** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef TOOLSUTILITIES_H @@ -15,13 +15,17 @@ #include #include #include +#include #include #include +#include #include #include #include #include #include +#include +#include QT_BEGIN_NAMESPACE @@ -49,12 +53,36 @@ public: QLineEdit *editStayIn; QCheckBox *checkCapture; QCheckBox *checkOpenCons; + QGroupBox *groupBox; + QComboBox *comboInitPos; + QCheckBox *checkDockTop; + QListWidget *listToolbars; + QCheckBox *checkDockRight; + QLabel *label_4; + QCheckBox *checkDockBottom; + QCheckBox *checkDockLeft; + QLabel *label_3; + QCheckBox *checkFloatable; + QCheckBox *checkInactive; + QPushButton *buttonUserToolbarUpd; + QGroupBox *groupBox_2; + QTableWidget *tableButtons; + QToolButton *buttonBtnDown; + QToolButton *buttonBtnUp; + QGroupBox *groupBox_3; + QComboBox *comboToolbarAsgnd; + QLineEdit *editImage; + QLabel *label_2; + QToolButton *buttonSetImage; + QLabel *label_5; + QLineEdit *editTooltip; + QCheckBox *checkToolActive; void setupUi(QDialog *DialogTools) { if (DialogTools->objectName().isEmpty()) DialogTools->setObjectName(QString::fromUtf8("DialogTools")); - DialogTools->resize(280, 425); + DialogTools->resize(602, 425); labelCmdLine = new QLabel(DialogTools); labelCmdLine->setObjectName(QString::fromUtf8("labelCmdLine")); labelCmdLine->setGeometry(QRect(12, 236, 251, 16)); @@ -120,6 +148,78 @@ public: checkOpenCons = new QCheckBox(DialogTools); checkOpenCons->setObjectName(QString::fromUtf8("checkOpenCons")); checkOpenCons->setGeometry(QRect(134, 362, 131, 19)); + groupBox = new QGroupBox(DialogTools); + groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setGeometry(QRect(284, 164, 307, 111)); + comboInitPos = new QComboBox(groupBox); + comboInitPos->setObjectName(QString::fromUtf8("comboInitPos")); + comboInitPos->setGeometry(QRect(114, 32, 93, 22)); + checkDockTop = new QCheckBox(groupBox); + checkDockTop->setObjectName(QString::fromUtf8("checkDockTop")); + checkDockTop->setGeometry(QRect(246, 28, 53, 19)); + listToolbars = new QListWidget(groupBox); + listToolbars->setObjectName(QString::fromUtf8("listToolbars")); + listToolbars->setGeometry(QRect(10, 18, 93, 83)); + checkDockRight = new QCheckBox(groupBox); + checkDockRight->setObjectName(QString::fromUtf8("checkDockRight")); + checkDockRight->setGeometry(QRect(246, 82, 53, 19)); + label_4 = new QLabel(groupBox); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(246, 12, 53, 16)); + checkDockBottom = new QCheckBox(groupBox); + checkDockBottom->setObjectName(QString::fromUtf8("checkDockBottom")); + checkDockBottom->setGeometry(QRect(246, 64, 53, 19)); + checkDockLeft = new QCheckBox(groupBox); + checkDockLeft->setObjectName(QString::fromUtf8("checkDockLeft")); + checkDockLeft->setGeometry(QRect(246, 46, 53, 19)); + label_3 = new QLabel(groupBox); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(116, 14, 89, 16)); + checkFloatable = new QCheckBox(groupBox); + checkFloatable->setObjectName(QString::fromUtf8("checkFloatable")); + checkFloatable->setGeometry(QRect(114, 60, 71, 19)); + checkInactive = new QCheckBox(groupBox); + checkInactive->setObjectName(QString::fromUtf8("checkInactive")); + checkInactive->setGeometry(QRect(114, 82, 71, 19)); + buttonUserToolbarUpd = new QPushButton(groupBox); + buttonUserToolbarUpd->setObjectName(QString::fromUtf8("buttonUserToolbarUpd")); + buttonUserToolbarUpd->setGeometry(QRect(182, 63, 55, 37)); + groupBox_2 = new QGroupBox(DialogTools); + groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setGeometry(QRect(284, 284, 307, 131)); + tableButtons = new QTableWidget(groupBox_2); + tableButtons->setObjectName(QString::fromUtf8("tableButtons")); + tableButtons->setGeometry(QRect(10, 16, 253, 107)); + buttonBtnDown = new QToolButton(groupBox_2); + buttonBtnDown->setObjectName(QString::fromUtf8("buttonBtnDown")); + buttonBtnDown->setGeometry(QRect(272, 16, 25, 20)); + buttonBtnUp = new QToolButton(groupBox_2); + buttonBtnUp->setObjectName(QString::fromUtf8("buttonBtnUp")); + buttonBtnUp->setGeometry(QRect(272, 46, 25, 20)); + groupBox_3 = new QGroupBox(DialogTools); + groupBox_3->setObjectName(QString::fromUtf8("groupBox_3")); + groupBox_3->setGeometry(QRect(284, 8, 307, 147)); + comboToolbarAsgnd = new QComboBox(groupBox_3); + comboToolbarAsgnd->setObjectName(QString::fromUtf8("comboToolbarAsgnd")); + comboToolbarAsgnd->setGeometry(QRect(10, 20, 199, 22)); + editImage = new QLineEdit(groupBox_3); + editImage->setObjectName(QString::fromUtf8("editImage")); + editImage->setGeometry(QRect(10, 66, 249, 20)); + label_2 = new QLabel(groupBox_3); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(12, 48, 81, 16)); + buttonSetImage = new QToolButton(groupBox_3); + buttonSetImage->setObjectName(QString::fromUtf8("buttonSetImage")); + buttonSetImage->setGeometry(QRect(270, 66, 25, 20)); + label_5 = new QLabel(groupBox_3); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(12, 98, 57, 16)); + editTooltip = new QLineEdit(groupBox_3); + editTooltip->setObjectName(QString::fromUtf8("editTooltip")); + editTooltip->setGeometry(QRect(10, 116, 249, 20)); + checkToolActive = new QCheckBox(groupBox_3); + checkToolActive->setObjectName(QString::fromUtf8("checkToolActive")); + checkToolActive->setGeometry(QRect(246, 22, 57, 19)); retranslateUi(DialogTools); @@ -197,7 +297,24 @@ public: "

This has the bearing on visiblity of the widget. The output will ever be routed therein no matter this box is checked or not.

", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP checkOpenCons->setText(QApplication::translate("DialogTools", "Open Output Console ?", 0, QApplication::UnicodeUTF8)); - Q_UNUSED(DialogTools); + groupBox->setTitle(QApplication::translate("DialogTools", " Toolbars: ", 0, QApplication::UnicodeUTF8)); + checkDockTop->setText(QApplication::translate("DialogTools", "Top", 0, QApplication::UnicodeUTF8)); + checkDockRight->setText(QApplication::translate("DialogTools", "Right", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("DialogTools", "Dockable:", 0, QApplication::UnicodeUTF8)); + checkDockBottom->setText(QApplication::translate("DialogTools", "Bottom", 0, QApplication::UnicodeUTF8)); + checkDockLeft->setText(QApplication::translate("DialogTools", "Left", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("DialogTools", "Iniitial Position:", 0, QApplication::UnicodeUTF8)); + checkFloatable->setText(QApplication::translate("DialogTools", "Floatable", 0, QApplication::UnicodeUTF8)); + checkInactive->setText(QApplication::translate("DialogTools", "Inactive", 0, QApplication::UnicodeUTF8)); + buttonUserToolbarUpd->setText(QApplication::translate("DialogTools", "Update", 0, QApplication::UnicodeUTF8)); + groupBox_2->setTitle(QApplication::translate("DialogTools", " Toolbar Buttons: ", 0, QApplication::UnicodeUTF8)); + buttonBtnDown->setText(QApplication::translate("DialogTools", "...", 0, QApplication::UnicodeUTF8)); + buttonBtnUp->setText(QApplication::translate("DialogTools", "...", 0, QApplication::UnicodeUTF8)); + groupBox_3->setTitle(QApplication::translate("DialogTools", " Current Tools Assignment to Toolbar: ", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("DialogTools", "Image:", 0, QApplication::UnicodeUTF8)); + buttonSetImage->setText(QApplication::translate("DialogTools", "...", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("DialogTools", "Tooltip:", 0, QApplication::UnicodeUTF8)); + checkToolActive->setText(QApplication::translate("DialogTools", "Active", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; diff --git a/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt b/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt index 54932f607e..8145062a7e 100644 --- a/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt +++ b/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt @@ -77,6 +77,7 @@ :hbApplyKey( nKey, nModifiers, cTxt ) -> NIL :hbHighlightArea( nTop, nLeft, nBottom, nRight, nMode ) -> NIL :hbTogglePersistentSelection() -> NIL + :hbHorzRulerVisible( lVisible ) -> NIL $DESCRIPTION$ diff --git a/harbour/contrib/hbqt/doc/en/class_hbqsyntaxhighlighter.txt b/harbour/contrib/hbqt/doc/en/class_hbqsyntaxhighlighter.txt index ae9130715a..29cf8d8694 100644 --- a/harbour/contrib/hbqt/doc/en/class_hbqsyntaxhighlighter.txt +++ b/harbour/contrib/hbqt/doc/en/class_hbqsyntaxhighlighter.txt @@ -33,6 +33,7 @@ :hbSetRule( cName, cPattern, pFormat ) -> NIL :hbSetFormat( cName, pFormat ) -> NIL :hbSetFormatColumnSelection( nStart, nCount, pColor ) -> NIL + :hbSetRuleWithRegExp( cName, pReg, pFormat ) -> NIL $DESCRIPTION$ diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp index 4c9a7bfb81..a62b85fb81 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp @@ -112,6 +112,7 @@ HBQPlainTextEdit::HBQPlainTextEdit( QWidget * parent ) : QPlainTextEdit( parent selectionDisplay = selectionDisplay_none; isColumnSelectionON = false; isLineSelectionON = false; + horzRulerHeight = 20; horzRuler = new HorzRuler( this ); caretState = 0; isSelectionByApplication = false; @@ -1251,13 +1252,13 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event ) void HBQPlainTextEdit::keyPressEvent( QKeyEvent * event ) { -HB_TRACE( HB_TR_ALWAYS, ( "keyPressEvent %i 000", event->key() ) ); +//HB_TRACE( HB_TR_ALWAYS, ( "keyPressEvent %i 000", event->key() ) ); if( hbKeyPressSelection( event ) ) { QApplication::processEvents(); return; } -HB_TRACE( HB_TR_ALWAYS, ( "keyPressEvent %i", event->key() ) ); +//HB_TRACE( HB_TR_ALWAYS, ( "keyPressEvent %i", event->key() ) ); if( c && c->popup()->isVisible() ) { // The following keys are forwarded by the completer to the widget @@ -1343,9 +1344,9 @@ void HBQPlainTextEdit::resizeEvent( QResizeEvent *e ) QPlainTextEdit::resizeEvent( e ); QRect cr = contentsRect(); - lineNumberArea->setGeometry( QRect( cr.left(), cr.top() + HORZRULER_HEIGHT, hbLineNumberAreaWidth(), cr.height() ) ); + lineNumberArea->setGeometry( QRect( cr.left(), cr.top() + horzRulerHeight, hbLineNumberAreaWidth(), cr.height() ) ); - horzRuler->setGeometry( QRect( cr.left(), cr.top(), cr.width(), HORZRULER_HEIGHT ) ); + horzRuler->setGeometry( QRect( cr.left(), cr.top(), cr.width(), horzRulerHeight ) ); } /*----------------------------------------------------------------------*/ @@ -1858,15 +1859,23 @@ int HBQPlainTextEdit::hbLineNumberAreaWidth() /*----------------------------------------------------------------------*/ +void HBQPlainTextEdit::hbUpdateHorzRulerHeight( int height ) +{ + horzRulerHeight = height; + setViewportMargins( hbLineNumberAreaWidth(), horzRulerHeight, 0, 0 ); +} + +/*----------------------------------------------------------------------*/ + void HBQPlainTextEdit::hbUpdateLineNumberAreaWidth( int ) { if( numberBlock ) { - setViewportMargins( hbLineNumberAreaWidth(), HORZRULER_HEIGHT, 0, 0 ); + setViewportMargins( hbLineNumberAreaWidth(), horzRulerHeight, 0, 0 ); } else { - setViewportMargins( 0, HORZRULER_HEIGHT, 0, 0 ); + setViewportMargins( 0, horzRulerHeight, 0, 0 ); } } diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h index 2fe0b41c23..a93f9e5095 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h @@ -70,12 +70,9 @@ #include "hbqt_hbqsyntaxhighlighter.h" -#define HORZRULER_HEIGHT 20 - class LineNumberArea; class HorzRuler; - class HBQPlainTextEdit : public QPlainTextEdit { Q_OBJECT @@ -116,6 +113,8 @@ public: void hbHighlightCurrentLine( bool b ) { highlightCurLine = b; update(); }; bool hbHighlightCurrentLine() { return highlightCurLine; }; void hbSetEventBlock( PHB_ITEM pBlock ); + int horzRulerHeight; + void hbUpdateHorzRulerHeight( int height ); private: QVector bookMark; @@ -206,6 +205,7 @@ public slots: void hbApplyKey( int key, Qt::KeyboardModifiers modifiers = 0, const QString & txt = "" ); void hbHighlightArea( int, int, int, int, int ); void hbTogglePersistentSelection(); + void hbHorzRulerVisible( bool visible ) { hbUpdateHorzRulerHeight( visible ? 20 : 0 ); }; private slots: void hbSlotCursorPositionChanged(); @@ -258,7 +258,7 @@ public: protected: QSize sizeHint() const { - return QSize( codeEditor->viewport()->width(), HORZRULER_HEIGHT ); + return QSize( codeEditor->viewport()->width(), codeEditor->horzRulerHeight ); } private: diff --git a/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp b/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp index 072ae772c0..c6d6b33c67 100644 --- a/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp @@ -106,6 +106,10 @@ void HBQSyntaxHighlighter::hbSetRule( QString name, QString pattern, const QText else HighlightingRules.remove( name ); } +void HBQSyntaxHighlighter::hbSetRuleWithRegExp( QString name, const QRegExp & reg, const QTextCharFormat & format ) +{ + HighlightingRules.insert( name, HighlightingRule( reg, format ) ); +} void HBQSyntaxHighlighter::hbSetFormat( QString name, const QTextCharFormat & format ) { if( ( QString ) "TerminatedStrings" == name ) @@ -118,7 +122,6 @@ void HBQSyntaxHighlighter::hbSetFormat( QString name, const QTextCharFormat & fo { HighlightingRule rule = HighlightingRules.value( name ); QRegExp reg = rule.pattern; - HighlightingRules.insert( name, HighlightingRule( reg, format ) ); } else @@ -168,6 +171,7 @@ void HBQSyntaxHighlighter::highlightBlock( const QString &text ) foreach( const HighlightingRule &rule, HighlightingRules ) { + #if 0 QRegExp expression( rule.pattern ); index = expression.indexIn( text ); while( index >= 0 ) @@ -176,6 +180,14 @@ void HBQSyntaxHighlighter::highlightBlock( const QString &text ) setFormat( index, length, rule.format ); index = expression.indexIn( text, index + length ); } + #endif + index = rule.pattern.indexIn( text ); + while( index >= 0 ) + { + int length = rule.pattern.matchedLength(); + setFormat( index, length, rule.format ); + index = rule.pattern.indexIn( text, index + length ); + } } /* Quoted text */ diff --git a/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.h b/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.h index b7b30ebedc..848498f979 100644 --- a/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.h +++ b/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.h @@ -89,6 +89,7 @@ public: void hbSetRule( QString name, QString pattern, const QTextCharFormat & format ); void hbSetFormat( QString name, const QTextCharFormat & format ); void hbSetFormatColumnSelection( int start, int count, const QColor & color ); + void hbSetRuleWithRegExp( QString name, const QRegExp & reg, const QTextCharFormat & format ); protected: void highlightBlock( const QString &text ); diff --git a/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp b/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp index f670b5e01d..f4bea37fd5 100644 --- a/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp +++ b/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp @@ -846,6 +846,20 @@ HB_FUNC( QT_HBQPLAINTEXTEDIT_HBTOGGLEPERSISTENTSELECTION ) } } +/* + * void hbHorzRulerVisible( bool visible ) + */ +HB_FUNC( QT_HBQPLAINTEXTEDIT_HBHORZRULERVISIBLE ) +{ + HBQPlainTextEdit * p = hbqt_par_HBQPlainTextEdit( 1 ); + if( p ) + ( p )->hbHorzRulerVisible( hb_parl( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQPLAINTEXTEDIT_HBHORZRULERVISIBLE FP=( p )->hbHorzRulerVisible( hb_parl( 2 ) ); p is NULL" ) ); + } +} + /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ diff --git a/harbour/contrib/hbqt/qtgui/HBQSyntaxHighlighter.cpp b/harbour/contrib/hbqt/qtgui/HBQSyntaxHighlighter.cpp index 77155b1348..c8bb50f963 100644 --- a/harbour/contrib/hbqt/qtgui/HBQSyntaxHighlighter.cpp +++ b/harbour/contrib/hbqt/qtgui/HBQSyntaxHighlighter.cpp @@ -217,6 +217,20 @@ HB_FUNC( QT_HBQSYNTAXHIGHLIGHTER_HBSETFORMATCOLUMNSELECTION ) } } +/* + * void hbSetRuleWithRegExp( QString name, const QRegExp & reg, const QTextCharFormat & format ) + */ +HB_FUNC( QT_HBQSYNTAXHIGHLIGHTER_HBSETRULEWITHREGEXP ) +{ + HBQSyntaxHighlighter * p = hbqt_par_HBQSyntaxHighlighter( 1 ); + if( p ) + ( p )->hbSetRuleWithRegExp( HBQSyntaxHighlighter::tr( hb_parc( 2 ) ), *hbqt_par_QRegExp( 3 ), *hbqt_par_QTextCharFormat( 4 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQSYNTAXHIGHLIGHTER_HBSETRULEWITHREGEXP FP=( p )->hbSetRuleWithRegExp( HBQSyntaxHighlighter::tr( hb_parc( 2 ) ), *hbqt_par_QRegExp( 3 ), *hbqt_par_QTextCharFormat( 4 ) ); p is NULL" ) ); + } +} + /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ diff --git a/harbour/contrib/hbqt/qtgui/QTableWidget.cpp b/harbour/contrib/hbqt/qtgui/QTableWidget.cpp index b8e747c89f..271c44e516 100644 --- a/harbour/contrib/hbqt/qtgui/QTableWidget.cpp +++ b/harbour/contrib/hbqt/qtgui/QTableWidget.cpp @@ -66,7 +66,7 @@ /*----------------------------------------------------------------------*/ /* - * Constructed[ 46/53 [ 86.79% ] ] + * Constructed[ 46/54 [ 85.19% ] ] * * *** Unconvered Prototypes *** * ----------------------------- @@ -78,6 +78,7 @@ * } * } * } + * } */ #include @@ -527,12 +528,14 @@ HB_FUNC( QT_QTABLEWIDGET_SETHORIZONTALHEADERLABELS ) */ HB_FUNC( QT_QTABLEWIDGET_SETITEM ) { - QTableWidget * p = hbqt_par_QTableWidget( 1 ); - if( p ) - ( p )->setItem( hb_parni( 2 ), hb_parni( 3 ), hbqt_par_QTableWidgetItem( 4 ) ); - else + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 4 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QTABLEWIDGET_SETITEM()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QTABLEWIDGET_SETITEM FP=( p )->setItem( hb_parni( 2 ), hb_parni( 3 ), hbqt_par_QTableWidgetItem( 4 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QTABLEWIDGET_SETITEM() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QTableWidget( 1 )->setItem( hb_parni( 2 ), hb_parni( 3 ), hbqt_par_QTableWidgetItem( 4 ) ); } } diff --git a/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg b/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg index d813c342b8..981092eb8d 100644 --- a/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg +++ b/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg @@ -116,6 +116,7 @@ CREATE CLASS HBQPlainTextEdit INHERIT HbQtObjectHandler, QPlainTextEdit METHOD hbApplyKey( nKey, nModifiers, cTxt ) METHOD hbHighlightArea( nTop, nLeft, nBottom, nRight, nMode ) METHOD hbTogglePersistentSelection() + METHOD hbHorzRulerVisible( lVisible ) ENDCLASS @@ -324,3 +325,7 @@ METHOD HBQPlainTextEdit:hbHighlightArea( nTop, nLeft, nBottom, nRight, nMode ) METHOD HBQPlainTextEdit:hbTogglePersistentSelection() RETURN Qt_HBQPlainTextEdit_hbTogglePersistentSelection( ::pPtr ) + +METHOD HBQPlainTextEdit:hbHorzRulerVisible( lVisible ) + RETURN Qt_HBQPlainTextEdit_hbHorzRulerVisible( ::pPtr, lVisible ) + diff --git a/harbour/contrib/hbqt/qtgui/THBQSyntaxHighlighter.prg b/harbour/contrib/hbqt/qtgui/THBQSyntaxHighlighter.prg index 1205f51a3c..c4b8b9f676 100644 --- a/harbour/contrib/hbqt/qtgui/THBQSyntaxHighlighter.prg +++ b/harbour/contrib/hbqt/qtgui/THBQSyntaxHighlighter.prg @@ -72,6 +72,7 @@ CREATE CLASS HBQSyntaxHighlighter INHERIT HbQtObjectHandler, QSyntaxHighlighter METHOD hbSetRule( cName, cPattern, pFormat ) METHOD hbSetFormat( cName, pFormat ) METHOD hbSetFormatColumnSelection( nStart, nCount, pColor ) + METHOD hbSetRuleWithRegExp( cName, pReg, pFormat ) ENDCLASS @@ -104,3 +105,7 @@ METHOD HBQSyntaxHighlighter:hbSetFormat( cName, pFormat ) METHOD HBQSyntaxHighlighter:hbSetFormatColumnSelection( nStart, nCount, pColor ) RETURN Qt_HBQSyntaxHighlighter_hbSetFormatColumnSelection( ::pPtr, nStart, nCount, hbqt_ptr( pColor ) ) + +METHOD HBQSyntaxHighlighter:hbSetRuleWithRegExp( cName, pReg, pFormat ) + RETURN Qt_HBQSyntaxHighlighter_hbSetRuleWithRegExp( ::pPtr, cName, hbqt_ptr( pReg ), hbqt_ptr( pFormat ) ) + diff --git a/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth b/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth index 1a7459ee8f..84c3554ca3 100644 --- a/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth +++ b/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth @@ -147,6 +147,7 @@ HB_FUNC( QT_HBQPLAINTEXTEDIT ) void hbApplyKey( int key, Qt::KeyboardModifiers modifiers = 0, const QString & txt ) void hbHighlightArea( int top, int left, int bottom, int right, int mode ) void hbTogglePersistentSelection() + void hbHorzRulerVisible( bool visible ) diff --git a/harbour/contrib/hbqt/qth/HBQSyntaxHighlighter.qth b/harbour/contrib/hbqt/qth/HBQSyntaxHighlighter.qth new file mode 100644 index 0000000000..1985bb388b --- /dev/null +++ b/harbour/contrib/hbqt/qth/HBQSyntaxHighlighter.qth @@ -0,0 +1,114 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * 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. + * + */ +/*----------------------------------------------------------------------*/ +; +; Header File to Generate QT Wrapper Sources +; + + +QObject = +Inherits = QSyntaxHighlighter +Type = +New = + + + + + + + + + +#include +#include "../hbqt_hbqsyntaxhighlighter.h" + +/* + * + * + */ +HB_FUNC( QT_HBQSYNTAXHIGHLIGHTER ) +{ + hb_retptr( new HBQSyntaxHighlighter( hbqt_par_QTextDocument( 1 ) ) ); +} + + + + + + + +void hbSetMultiLineCommentFormat( const QTextCharFormat & format ) +void hbSetSingleLineCommentFormat( const QTextCharFormat & format ) +void hbSetRule( QString name, QString pattern, QTextCharFormat & format ) +void hbSetFormat( QString name, const QTextCharFormat & format ) +void hbSetFormatColumnSelection( int start, int count, const QColor & color ) +void hbSetRuleWithRegExp( QString name, const QRegExp & reg, const QTextCharFormat & format ) + +# QTextBlock currentBlock () const +# int currentBlockState () const +# QTextBlockUserData * currentBlockUserData () const +# QTextCharFormat format ( int position ) const +# virtual void highlightBlock ( const QString & text ) = 0 +# int previousBlockState () const +# void setCurrentBlockState ( int newState ) +# void setCurrentBlockUserData ( QTextBlockUserData * data ) +# void setFormat ( int start, int count, const QTextCharFormat & format ) +# void setFormat ( int start, int count, const QColor & color ) +# void setFormat ( int start, int count, const QFont & font ) + + + + + + + + diff --git a/harbour/contrib/hbqt/qth/QTableWidget.qth b/harbour/contrib/hbqt/qth/QTableWidget.qth index edf4ce1c9a..3e1abf073a 100644 --- a/harbour/contrib/hbqt/qth/QTableWidget.qth +++ b/harbour/contrib/hbqt/qth/QTableWidget.qth @@ -140,7 +140,19 @@ void setHorizontalHeaderItem ( int column, QTableWidgetItem * item ){ } void setHorizontalHeaderLabels ( const QStringList & labels ) -void setItem ( int row, int column, QTableWidgetItem * item ) + +void setItem ( int row, int column, QTableWidgetItem * item ){ + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 4 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QTABLEWIDGET_SETITEM()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QTABLEWIDGET_SETITEM() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QTableWidget( 1 )->setItem( hb_parni( 2 ), hb_parni( 3 ), hbqt_par_QTableWidgetItem( 4 ) ); + } +} + void setItemPrototype ( const QTableWidgetItem * item ) void setRangeSelected ( const QTableWidgetSelectionRange & range, bool select ) void setRowCount ( int rows )