From 1013e3d7c390fdbbdc404c49ff5907272c598651 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 17 Nov 2009 10:46:15 +0000 Subject: [PATCH] 2009-11-17 02:29 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + contrib/hbide + contrib/hbide/hbide.prg + contrib/hbide/hbmk.hbm + contrib/hbide/resources + contrib/hbide/resources/build.png + contrib/hbide/resources/buildlaunch.png + contrib/hbide/resources/buildrun.png + contrib/hbide/resources/close.png + contrib/hbide/resources/column.png + contrib/hbide/resources/compile.png + contrib/hbide/resources/copy.png + contrib/hbide/resources/cut.png + contrib/hbide/resources/debug.png + contrib/hbide/resources/envconfig.png + contrib/hbide/resources/exit.png + contrib/hbide/resources/filec.png + contrib/hbide/resources/fileprg.png + contrib/hbide/resources/find.png + contrib/hbide/resources/gotoline.png + contrib/hbide/resources/gotomark.png + contrib/hbide/resources/info.png + contrib/hbide/resources/invertcase.png + contrib/hbide/resources/launch.png + contrib/hbide/resources/lense.png + contrib/hbide/resources/matchobj.png + contrib/hbide/resources/new.png + contrib/hbide/resources/notepad.png + contrib/hbide/resources/open.png + contrib/hbide/resources/paste.png + contrib/hbide/resources/placeremovemark.png + contrib/hbide/resources/ppo.png + contrib/hbide/resources/print.png + contrib/hbide/resources/properties.png + contrib/hbide/resources/rebuild.png + contrib/hbide/resources/rebuildlaunch.png + contrib/hbide/resources/redo.png + contrib/hbide/resources/save.png + contrib/hbide/resources/search.png + contrib/hbide/resources/selectall.png + contrib/hbide/resources/stream.png + contrib/hbide/resources/text.png + contrib/hbide/resources/tolower.png + contrib/hbide/resources/tools.png + contrib/hbide/resources/toupper.png + contrib/hbide/resources/trashpage.png + contrib/hbide/resources/undo.png + contrib/hbide/resources/vr.png * contrib/hbqt/generator/qt45.qtp + contrib/hbqt/qth/QSyntaxHighlighter.qth * * contrib/hbqt/hbqt.ch * contrib/hbqt/hbqt.h * contrib/hbqt/hbqt_slots.cpp * contrib/hbqt/hbqt_slots.h * contrib/hbqt/moc_slots.cpp * contrib/hbqt/qtgui/filelist.mk + contrib/hbqt/qtgui/QSyntaxHighlighter.cpp + contrib/hbqt/qtgui/TQSyntaxHighlighter.prg * contrib/hbxbp/xbpmenubar.prg * contrib/hbxbp/xbptoolbar.prg * contrib/hbxbp/tests/demoxbp.prg + Added first commit of HBIDE, just something in the making. NOTE: I have extracted icons from xMate.exe ( with due apology to Andy ) to give it a familiar look and feel of xMate because of wide acceptance of its user interface. EXECUTE HbIde.exe hbide.prg ( or any .c or .prg file name ) Suggestions are welcome. --- harbour/ChangeLog | 78 ++++ harbour/contrib/hbide/hbide.prg | 405 ++++++++++++++++++ harbour/contrib/hbide/hbmk.hbm | 7 + harbour/contrib/hbide/resources/build.png | Bin 0 -> 137 bytes .../contrib/hbide/resources/buildlaunch.png | Bin 0 -> 185 bytes harbour/contrib/hbide/resources/buildrun.png | Bin 0 -> 188 bytes harbour/contrib/hbide/resources/close.png | Bin 0 -> 195 bytes harbour/contrib/hbide/resources/column.png | Bin 0 -> 138 bytes harbour/contrib/hbide/resources/compile.png | Bin 0 -> 201 bytes harbour/contrib/hbide/resources/copy.png | Bin 0 -> 186 bytes harbour/contrib/hbide/resources/cut.png | Bin 0 -> 169 bytes harbour/contrib/hbide/resources/debug.png | Bin 0 -> 183 bytes harbour/contrib/hbide/resources/envconfig.png | Bin 0 -> 263 bytes harbour/contrib/hbide/resources/exit.png | Bin 0 -> 170 bytes harbour/contrib/hbide/resources/filec.png | Bin 0 -> 184 bytes harbour/contrib/hbide/resources/fileprg.png | Bin 0 -> 160 bytes harbour/contrib/hbide/resources/find.png | Bin 0 -> 179 bytes harbour/contrib/hbide/resources/gotoline.png | Bin 0 -> 179 bytes harbour/contrib/hbide/resources/gotomark.png | Bin 0 -> 208 bytes harbour/contrib/hbide/resources/info.png | Bin 0 -> 166 bytes .../contrib/hbide/resources/invertcase.png | Bin 0 -> 200 bytes harbour/contrib/hbide/resources/launch.png | Bin 0 -> 152 bytes harbour/contrib/hbide/resources/lense.png | Bin 0 -> 247 bytes harbour/contrib/hbide/resources/matchobj.png | Bin 0 -> 140 bytes harbour/contrib/hbide/resources/new.png | Bin 0 -> 149 bytes harbour/contrib/hbide/resources/notepad.png | Bin 0 -> 216 bytes harbour/contrib/hbide/resources/open.png | Bin 0 -> 192 bytes harbour/contrib/hbide/resources/paste.png | Bin 0 -> 218 bytes .../hbide/resources/placeremovemark.png | Bin 0 -> 224 bytes harbour/contrib/hbide/resources/ppo.png | Bin 0 -> 204 bytes harbour/contrib/hbide/resources/print.png | Bin 0 -> 223 bytes .../contrib/hbide/resources/properties.png | Bin 0 -> 191 bytes harbour/contrib/hbide/resources/rebuild.png | Bin 0 -> 189 bytes .../contrib/hbide/resources/rebuildlaunch.png | Bin 0 -> 217 bytes harbour/contrib/hbide/resources/redo.png | Bin 0 -> 146 bytes harbour/contrib/hbide/resources/save.png | Bin 0 -> 154 bytes harbour/contrib/hbide/resources/search.png | Bin 0 -> 230 bytes harbour/contrib/hbide/resources/selectall.png | Bin 0 -> 132 bytes harbour/contrib/hbide/resources/stream.png | Bin 0 -> 178 bytes harbour/contrib/hbide/resources/text.png | Bin 0 -> 155 bytes harbour/contrib/hbide/resources/tolower.png | Bin 0 -> 160 bytes harbour/contrib/hbide/resources/tools.png | Bin 0 -> 229 bytes harbour/contrib/hbide/resources/toupper.png | Bin 0 -> 165 bytes harbour/contrib/hbide/resources/trashpage.png | Bin 0 -> 208 bytes harbour/contrib/hbide/resources/undo.png | Bin 0 -> 148 bytes harbour/contrib/hbide/resources/vr.png | Bin 0 -> 349 bytes harbour/contrib/hbqt/generator/qt45.qtp | 1 + harbour/contrib/hbqt/hbqt.ch | 9 +- harbour/contrib/hbqt/hbqt.h | 1 + harbour/contrib/hbqt/hbqt_slots.cpp | 90 +++- harbour/contrib/hbqt/hbqt_slots.h | 38 ++ harbour/contrib/hbqt/moc_slots.cpp | 45 +- .../contrib/hbqt/qtgui/QSyntaxHighlighter.cpp | 175 ++++++++ .../hbqt/qtgui/TQSyntaxHighlighter.prg | 105 +++++ harbour/contrib/hbqt/qtgui/filelist.mk | 2 + .../contrib/hbqt/qth/QSyntaxHighlighter.qth | 105 +++++ harbour/contrib/hbxbp/tests/demoxbp.prg | 20 +- harbour/contrib/hbxbp/xbpmenubar.prg | 8 +- harbour/contrib/hbxbp/xbptoolbar.prg | 45 +- 59 files changed, 1103 insertions(+), 31 deletions(-) create mode 100644 harbour/contrib/hbide/hbide.prg create mode 100644 harbour/contrib/hbide/hbmk.hbm create mode 100644 harbour/contrib/hbide/resources/build.png create mode 100644 harbour/contrib/hbide/resources/buildlaunch.png create mode 100644 harbour/contrib/hbide/resources/buildrun.png create mode 100644 harbour/contrib/hbide/resources/close.png create mode 100644 harbour/contrib/hbide/resources/column.png create mode 100644 harbour/contrib/hbide/resources/compile.png create mode 100644 harbour/contrib/hbide/resources/copy.png create mode 100644 harbour/contrib/hbide/resources/cut.png create mode 100644 harbour/contrib/hbide/resources/debug.png create mode 100644 harbour/contrib/hbide/resources/envconfig.png create mode 100644 harbour/contrib/hbide/resources/exit.png create mode 100644 harbour/contrib/hbide/resources/filec.png create mode 100644 harbour/contrib/hbide/resources/fileprg.png create mode 100644 harbour/contrib/hbide/resources/find.png create mode 100644 harbour/contrib/hbide/resources/gotoline.png create mode 100644 harbour/contrib/hbide/resources/gotomark.png create mode 100644 harbour/contrib/hbide/resources/info.png create mode 100644 harbour/contrib/hbide/resources/invertcase.png create mode 100644 harbour/contrib/hbide/resources/launch.png create mode 100644 harbour/contrib/hbide/resources/lense.png create mode 100644 harbour/contrib/hbide/resources/matchobj.png create mode 100644 harbour/contrib/hbide/resources/new.png create mode 100644 harbour/contrib/hbide/resources/notepad.png create mode 100644 harbour/contrib/hbide/resources/open.png create mode 100644 harbour/contrib/hbide/resources/paste.png create mode 100644 harbour/contrib/hbide/resources/placeremovemark.png create mode 100644 harbour/contrib/hbide/resources/ppo.png create mode 100644 harbour/contrib/hbide/resources/print.png create mode 100644 harbour/contrib/hbide/resources/properties.png create mode 100644 harbour/contrib/hbide/resources/rebuild.png create mode 100644 harbour/contrib/hbide/resources/rebuildlaunch.png create mode 100644 harbour/contrib/hbide/resources/redo.png create mode 100644 harbour/contrib/hbide/resources/save.png create mode 100644 harbour/contrib/hbide/resources/search.png create mode 100644 harbour/contrib/hbide/resources/selectall.png create mode 100644 harbour/contrib/hbide/resources/stream.png create mode 100644 harbour/contrib/hbide/resources/text.png create mode 100644 harbour/contrib/hbide/resources/tolower.png create mode 100644 harbour/contrib/hbide/resources/tools.png create mode 100644 harbour/contrib/hbide/resources/toupper.png create mode 100644 harbour/contrib/hbide/resources/trashpage.png create mode 100644 harbour/contrib/hbide/resources/undo.png create mode 100644 harbour/contrib/hbide/resources/vr.png create mode 100644 harbour/contrib/hbqt/qtgui/QSyntaxHighlighter.cpp create mode 100644 harbour/contrib/hbqt/qtgui/TQSyntaxHighlighter.prg create mode 100644 harbour/contrib/hbqt/qth/QSyntaxHighlighter.qth diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7ddedf39a5..83282d9d2e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,84 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-11-17 02:29 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + + contrib/hbide + + contrib/hbide/hbide.prg + + contrib/hbide/hbmk.hbm + + contrib/hbide/resources + + contrib/hbide/resources/build.png + + contrib/hbide/resources/buildlaunch.png + + contrib/hbide/resources/buildrun.png + + contrib/hbide/resources/close.png + + contrib/hbide/resources/column.png + + contrib/hbide/resources/compile.png + + contrib/hbide/resources/copy.png + + contrib/hbide/resources/cut.png + + contrib/hbide/resources/debug.png + + contrib/hbide/resources/envconfig.png + + contrib/hbide/resources/exit.png + + contrib/hbide/resources/filec.png + + contrib/hbide/resources/fileprg.png + + contrib/hbide/resources/find.png + + contrib/hbide/resources/gotoline.png + + contrib/hbide/resources/gotomark.png + + contrib/hbide/resources/info.png + + contrib/hbide/resources/invertcase.png + + contrib/hbide/resources/launch.png + + contrib/hbide/resources/lense.png + + contrib/hbide/resources/matchobj.png + + contrib/hbide/resources/new.png + + contrib/hbide/resources/notepad.png + + contrib/hbide/resources/open.png + + contrib/hbide/resources/paste.png + + contrib/hbide/resources/placeremovemark.png + + contrib/hbide/resources/ppo.png + + contrib/hbide/resources/print.png + + contrib/hbide/resources/properties.png + + contrib/hbide/resources/rebuild.png + + contrib/hbide/resources/rebuildlaunch.png + + contrib/hbide/resources/redo.png + + contrib/hbide/resources/save.png + + contrib/hbide/resources/search.png + + contrib/hbide/resources/selectall.png + + contrib/hbide/resources/stream.png + + contrib/hbide/resources/text.png + + contrib/hbide/resources/tolower.png + + contrib/hbide/resources/tools.png + + contrib/hbide/resources/toupper.png + + contrib/hbide/resources/trashpage.png + + contrib/hbide/resources/undo.png + + contrib/hbide/resources/vr.png + + * contrib/hbqt/generator/qt45.qtp + + + contrib/hbqt/qth/QSyntaxHighlighter.qth + * + * contrib/hbqt/hbqt.ch + * contrib/hbqt/hbqt.h + * contrib/hbqt/hbqt_slots.cpp + * contrib/hbqt/hbqt_slots.h + * contrib/hbqt/moc_slots.cpp + + * contrib/hbqt/qtgui/filelist.mk + + contrib/hbqt/qtgui/QSyntaxHighlighter.cpp + + contrib/hbqt/qtgui/TQSyntaxHighlighter.prg + + * contrib/hbxbp/xbpmenubar.prg + * contrib/hbxbp/xbptoolbar.prg + + * contrib/hbxbp/tests/demoxbp.prg + + + Added first commit of HBIDE, just something in the making. + + NOTE: I have extracted icons from xMate.exe ( with due apology to Andy ) + to give it a familiar look and feel of xMate because of wide + acceptance of its user interface. + + EXECUTE HbIde.exe hbide.prg ( or any .c or .prg file name ) + + Suggestions are welcome. + 2009-11-17 10:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/errapi.c * src/rtl/philes.c diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg new file mode 100644 index 0000000000..dee6e9c81e --- /dev/null +++ b/harbour/contrib/hbide/hbide.prg @@ -0,0 +1,405 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "common.ch" +#include "xbp.ch" +#include "appevent.ch" +#include "inkey.ch" +#include "gra.ch" +#include "set.ch" +#include "hbclass.ch" + +#ifdef __HARBOUR__ + #define UNU( x ) HB_SYMBOL_UNUSED( x ) +#else + #define UNU( x ) ( x := x ) +#endif + +/*----------------------------------------------------------------------*/ + +#define TAB_1 1 +#define TAB_2 2 +#define TAB_3 3 +#define TAB_4 4 +#define TAB_5 5 +#define TAB_6 6 +#define TAB_7 7 +#define TAB_8 8 + +#define CRLF chr( 13 )+chr( 10 ) + +STATIC s_resPath + +/*----------------------------------------------------------------------*/ + +PROCEDURE Main( cProjectOrSource ) + LOCAL oIde + + s_resPath := hb_DirBase() + "resources" + hb_OsPathSeparator() + + oIde := HbIde():new( cProjectOrSource ) + oIde:create() + oIde:destroy() + + RETURN + +/*----------------------------------------------------------------------*/ + +PROCEDURE AppSys() + RETURN + +/*----------------------------------------------------------------------*/ + +CLASS HbIde + + DATA oDlg + DATA mp1, mp2, oXbp, nEvent + DATA oDa + DATA oSBar + DATA oMenu + DATA oTBar + DATA aTabs INIT {} + DATA cProjFile + + DATA nCurTab INIT 0 + DATA nPrevTab INIT 0 + + DATA qLayout + DATA oFont + + METHOD new( cProjectOrSource ) + METHOD create( cProjectOrSource ) + METHOD destroy() + + METHOD buildDialog() + METHOD buildMenu() + METHOD buildStatusBar() + METHOD buildToolbar() + METHOD manageToolBar() + METHOD manageMenu() + METHOD editSource() + METHOD buildTabPage() + #if 0 + METHOD () + METHOD () + METHOD () + #endif + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:destroy() + ::oSBar := NIL + ::oMenu := NIL + ::oTBar := NIL + RETURN self + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:new( cProjectOrSource ) + + ::cProjFile := cProjectOrSource + + RETURN self + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:create( cProjectOrSource ) + LOCAL aSize + + IF hb_isChar( cProjectOrSource ) + ::cProjFile := cProjectOrSource + ENDIF + + /* Create Application Window */ + ::BuildDialog() + + /* In this block just ceck if any of the documents are edited and are not saved */ + ::oDlg:close := {|| MsgBox( "You can also close me by pressing [ESC]" ), .T. } + + SetAppWindow( ::oDlg ) + ::oDlg:Show() + + ::oDa := ::oDlg:drawingArea + + ::oDa:oTabWidget := XbpTabWidget():new( ::oDa, , ::oDa:aPos, ::oDa:aSize, , .t. ):create() + ::oDa:oTabWidget:oWidget:setTabsClosable( .t. ) + + ::qLayout := QBoxLayout():new() + ::qLayout:setDirection( 0 ) + ::qLayout:setContentsMargins( 0,0,0,0 ) + + ::qLayout:addWidget( QT_PTROFXBP( ::oDa:oTabWidget ) ) + + ::oDa:oWidget:setLayout( QT_PTROF( ::qLayout ) ) + + /* Obtain desktop dimensions */ + aSize := AppDesktop():currentSize() + /* Place on the center of desktop */ + ::oDlg:setPos( { ( aSize[ 1 ] - ::oDlg:currentSize()[ 1 ] ) / 2, ; + ( aSize[ 2 ] - ::oDlg:currentSize()[ 2 ] ) / 2 } ) + + /* Editor's Font */ + ::oFont := XbpFont():new() + ::oFont:fixed := .t. + ::oFont:create( "10.Courier" ) + + /* Install menu system */ + ::buildMenu() + + /* Install Statusbar */ + ::buildStatusBar() + + /* Install Toolbar */ + ::buildToolBar() + + ::editSource() + + ::oDlg:Show() + + /* Enter Xbase++ Event Loop - working */ + DO WHILE .t. + ::nEvent := AppEvent( @::mp1, @::mp2, @::oXbp ) + IF ( ::nEvent == xbeP_Close ) .OR. ( ::nEvent == xbeP_Keyboard .and. ::mp1 == xbeK_ESC ) + EXIT + ENDIF + ::oXbp:handleEvent( ::nEvent, ::mp1, ::mp2 ) + ENDDO + + /* Very important - destroy resources */ + ::oDlg:destroy() + + RETURN self + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:buildDialog() + + ::oDlg := XbpDialog():new( , , {10,10}, {900,500}, , .f. ) + + ::oDlg:icon := s_resPath + "vr.png" //"hbide.ico" + ::oDlg:title := "Harbour-Qt IDE" + + ::oDlg:create() + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:buildTabPage( oWnd, cSource ) + LOCAL aPos := { 5,5 } + LOCAL aSize := { 890, 420 } + LOCAL oTab + LOCAL cPath, cFile, cExt//, qIcon + LOCAL nIndex := len( ::aTabs ) + + DEFAULT cSource TO "Untitled" + + hb_fNameSplit( cSource, @cPath, @cFile, @cExt ) + + oTab := XbpTabPage():new( oWnd, , aPos, aSize, , .t. ) + oTab:caption := cFile + cExt + oTab:minimized := .F. + + oTab:create() + + IF lower( cExt ) $ ".c;.cpp" + ::oDa:oTabWidget:oWidget:setTabIcon( nIndex, s_resPath + "filec.png" ) + ELSE + ::oDa:oTabWidget:oWidget:setTabIcon( nIndex, s_resPath + "fileprg.png" ) + ENDIF + ::oDa:oTabWidget:oWidget:setTabTooltip( nIndex, cSource ) + + RETURN oTab + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:editSource( cSourceFile ) + LOCAL oTab, qEdit, qHiliter, qLayout + + DEFAULT cSourceFile TO ::cProjFile + + oTab := ::buildTabPage( ::oDa, cSourceFile ) + + qEdit := QTextEdit():new( QT_PTROFXBP( oTab ) ) + qEdit:setLineWrapMode( QTextEdit_NoWrap ) + qEdit:setPlainText( memoread( ::cProjFile ) ) + qEdit:setFont( QT_PTROFXBP( ::oFont ) ) + qEdit:setTextBackgroundColor( QT_PTROF( QColor():new( 255,255,255 ) ) ) + + qLayout := QBoxLayout():new() + qLayout:setDirection( 0 ) + qLayout:setContentsMargins( 0,0,0,0 ) + qLayout:addWidget( QT_PTROF( qEdit ) ) + + oTab:oWidget:setLayout( QT_PTROF( qLayout ) ) + + qHiliter := QSyntaxHighlighter():new( qEdit:document() ) + + qEdit:show() + + aadd( ::aTabs, { oTab, qEdit, qHiliter, qLayout, cSourceFile } ) + + ::nPrevTab := ::nCurTab + ::nCurTab := len( ::aTabs ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:buildMenu() + LOCAL oMenuBar, oSubMenu + + oMenuBar := SetAppWindow():MenuBar() + + oSubMenu := XbpMenu():new( oMenuBar ):create() + oSubMenu:title := "~File" + oSubMenu:addItem( { "Open", {|| ::manageMenu( 1 ) } } ) + oSubMenu:addItem( { "Save", {|| ::manageMenu( 2 ) } } ) + oSubMenu:addItem( { NIL, NIL, XBPMENUBAR_MIS_SEPARATOR, NIL } ) + oSubMenu:addItem( { "Exit", {|| ::manageMenu( 3 ) } } ) + oMenuBar:addItem( { oSubMenu, NIL } ) + + Return Self + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:manageMenu( nMode ) + + DO CASE + CASE nMode == 1 + CASE nMode == 2 + ENDCASE + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:buildToolBar() + + ::oTBar := XbpToolBar():new( ::oDA ) + ::oTBar:create( , , { 0, ::oDa:currentSize()[ 2 ]-60 }, ; + { ::oDa:currentSize()[ 1 ], 60 } ) + + ::oTBar:imageWidth := 20 + ::oTBar:imageHeight := 20 + + ::oTBar:addItem( "Exit" , s_resPath + "exit.png" , , , , , "1" ) + ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + ::oTBar:addItem( "Properties" , s_resPath + "properties.png" , , , , , "2" ) + ::oTBar:addItem( "Open" , s_resPath + "open.png" , , , , , "3" ) + ::oTBar:addItem( "Save" , s_resPath + "save.png" , , , , , "4" ) + ::oTBar:addItem( "Close" , s_resPath + "close.png" , , , , , "5" ) + ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + ::oTBar:addItem( "Compile" , s_resPath + "compile.png" , , , , , "5" ) + ::oTBar:addItem( "Compile to PPO" , s_resPath + "ppo.png" , , , , , "6" ) + ::oTBar:addItem( "Build Project" , s_resPath + "build.png" , , , , , "7" ) + ::oTBar:addItem( "Build and Launch Project" , s_resPath + "buildlaunch.png" , , , , , "8" ) + ::oTBar:addItem( "Rebuild Project" , s_resPath + "rebuild.png" , , , , , "9" ) + ::oTBar:addItem( "Rebuild and Launch Project" , s_resPath + "rebuildlaunch.png" , , , , , "10" ) + ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + // + // + ::oTBar:addItem( "Undo" , s_resPath + "undo.png" , , , , , "13" ) + ::oTBar:addItem( "Redo" , s_resPath + "redo.png" , , , , , "14" ) + ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + ::oTBar:addItem( "Cut" , s_resPath + "cut.png" , , , , , "15" ) + ::oTBar:addItem( "Copy" , s_resPath + "copy.png" , , , , , "16" ) + ::oTBar:addItem( "Paste" , s_resPath + "paste.png" , , , , , "17" ) + ::oTBar:addItem( "Select All" , s_resPath + "selectall.png" , , , , , "18" ) + ::oTBar:addItem( "Column/Stream Selection" , s_resPath + "stream.png" , , , , , "19" ) + ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + ::oTBar:addItem( "Find" , s_resPath + "find.png" , , , , , "20" ) + ::oTBar:addItem( "Search" , s_resPath + "search.png" , , , , , "21" ) + ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + ::oTBar:addItem( "Place/Remove Mark" , s_resPath + "placeremovemark.png", , , , , "22" ) + ::oTBar:addItem( "Goto Mark" , s_resPath + "gotomark.png" , , , , , "23" ) + ::oTBar:addItem( "Goto Line" , s_resPath + "gotoline.png" , , , , , "24" ) + ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + ::oTBar:addItem( "To Upper" , s_resPath + "toupper.png" , , , , , "25" ) + ::oTBar:addItem( "To Lower" , s_resPath + "tolower.png" , , , , , "26" ) + ::oTBar:addItem( "Invert Case" , s_resPath + "invertcase.png" , , , , , "27" ) + ::oTBar:addItem( "Match Pairs" , s_resPath + "matchobj.png" , , , , , "28" ) + ::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR ) + + ::oTBar:transparentColor := GraMakeRGBColor( { 0,255,255 } ) // GRA_CLR_INVALID + ::oTBar:buttonClick := {|oButton| ::manageToolbar( oButton ) } + + RETURN nil + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:manageToolbar( oButton ) + + DO CASE + CASE oButton:caption == "Save" + CASE oButton:caption == "Open" + ENDCASE + + RETURN nil + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:buildStatusBar() + LOCAL oPanel + + ::oSBar := XbpStatusBar():new() + ::oSBar:create( ::oDlg, , { 0,0 }, { ::oDlg:currentSize()[1],30 } ) + + oPanel := ::oSBar:getItem( 1 ) + oPanel:caption := "Ready" + oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_SPRING + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbide/hbmk.hbm b/harbour/contrib/hbide/hbmk.hbm new file mode 100644 index 0000000000..9d9c3f7056 --- /dev/null +++ b/harbour/contrib/hbide/hbmk.hbm @@ -0,0 +1,7 @@ +# +# $Id$ +# + +../hbxbp/hbxbp.hbc + +-w3 -es2 diff --git a/harbour/contrib/hbide/resources/build.png b/harbour/contrib/hbide/resources/build.png new file mode 100644 index 0000000000000000000000000000000000000000..c257bc17efc39d30267d6a9ff1ff77519617e973 GIT binary patch literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC}{2J z;uvDlo1F0D|NO>PGt$_UxXn#W5<>g@=X_&pV$nPp!K-pL^hC`s36D_y{$rmqboft4 fER&M^!p6jq_8_E2u2^Xq&=>|!S3j3^P6*q frv9J<-sf3bZ9LNyX3f$BTFc<+>gTe~DWM4f-s(dN literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/buildrun.png b/harbour/contrib/hbide/resources/buildrun.png new file mode 100644 index 0000000000000000000000000000000000000000..0a0042e35542a3ae36d7164e04efde79062e2a6d GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmD46Hz z;uvDldv;PF*8u|#XWL!o??3ooi!e?~l;0$D>3XI~^l7(jnHl}>_;l6(+8MYkRhaN| z^$&+wMz=tRRa;A5-!QWMGhJtS&on=;op(}9r-)fGoe9|abZxGph{fUiOJelO%(F96 iYNvcWeR%D}54L8jJ<~*Ac^m`U%;4$j=d#Wzp$P!|tV8es literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/close.png b/harbour/contrib/hbide/resources/close.png new file mode 100644 index 0000000000000000000000000000000000000000..b8c56a5ea717d24f1cdf59c84339c80905bc4043 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC|K(0 z;uvDldvtOmUxNaN%g>U3a~54oV<|hCyK}Bj8^4RFq427I?C*^EUl>SzXzE=QKEv_0 zZOxk1$!pal=RSLvtnzo3>gvX_<}|VWPXiKD?U^Q@T`@s!)xOs~mn-?FCq}mFMzCy4 ploSZ$?6yD3ESPw{P1US``TGrltGdpsHUk~N;OXk;vd$@?2>=`GMNI$z literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/column.png b/harbour/contrib/hbide/resources/column.png new file mode 100644 index 0000000000000000000000000000000000000000..8d07af90d6c6055b0f9fc31366c525aa257460b4 GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC}`v9 z;uvDlo1F0D|NO>PGq$lYd0NQL(L3@qDyQPZu7Zq~hX-~}xbi`&Ceh+Yti^|oK0Vy* hW;~v~fmJ&M7+yBKG5B*U?f}pn22WQ%mvv4FO#mMIE+hZ| literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/compile.png b/harbour/contrib/hbide/resources/compile.png new file mode 100644 index 0000000000000000000000000000000000000000..6af8f18e3eabde7960c6140f9200a904291ffe1b GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC|K?3 z;uvDldv&rm-vI><7fUPi<;y0zykw}maV15J@0W{+lAue-qxp;uscb^G}NJjl_)Dogu;J ug~aP=gTd3)&t;ucLK6UP<3hmz literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/copy.png b/harbour/contrib/hbide/resources/copy.png new file mode 100644 index 0000000000000000000000000000000000000000..52b249587d33354e52fd5de9f2e0dd520f0f4a2e GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmD465v z;uvDl`*hMpt_B4GmiL$6pFi7iC1w57ZPnTmf(HwyoQc{T^iSuF@{{g@|0gg) ztbTUK(CeXU=?*ck#fLb>_%=rUsOg&iTD$dkZVO z;uvDld-swf7lQ%^i^KeP=XISDIfESeA1+*Rdc#h^&Vbia4Dasl-qdGHrj@uBU+yn67{Pzw*D~+N(fo O7(8A5T-G@yGywn@p*Obx literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/debug.png b/harbour/contrib/hbide/resources/debug.png new file mode 100644 index 0000000000000000000000000000000000000000..feadd1d9e7997e20d07a95b3f86e5f7a1a9e03f3 GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmD46N# z;uvDldvr=8*8v3%m%kFVdQ&MBb@0Q)*YCIA2c literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/envconfig.png b/harbour/contrib/hbide/resources/envconfig.png new file mode 100644 index 0000000000000000000000000000000000000000..bfcbba89f8e9004994f4836b07e0da923910dc6c GIT binary patch literal 263 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmD7e$p z#WBR9ckkptp%w!UXUnSoYqK|Yo9Zf9T`c{!cw5O6!KSVir&hmSf8g4ze>`&px=Z#n z{xG|cu(zBwr&(I#aAs?@(xktAP9_3bUZF4N1^=j>#kKxI^I===7Oo%DZ*Ol({3L2q z-J!xz{Q6@|#02(7d!xGE+Fa8zdQ_|s_2K?qmeZY1&rLrsXGqI>Z1E z;uvDl`}WF3E(bvY*NdNDK0ojNZmDLvaw#;e?&Y2kV6E`^jASZ*=3?Us zd^IdlA4E5})_<^^u=V}C4~YW5sy7{|^Uth2r1$qx$kBCg4r=GH_e^8xZjroWZgunl P&>jX)S3j3^P6KS64&X2Zs29 z)rl!mlDlSc$Ap$^m~0Wayu9(=qAH%bwbOX6+p)WBpKN+$dbA~nV7Z(7)} d^p9KxW4&+Ot0o@CUqD+KJYD@<);T3K0RRD{I@16E literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/fileprg.png b/harbour/contrib/hbide/resources/fileprg.png new file mode 100644 index 0000000000000000000000000000000000000000..603d4de385519e360847fa1f3d4b96eef8efbead GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC>Z4F z;uvDlo1F0D|NO>P6&z9=Dj$=Ic#g1k7>P`8d?94O{E#j9YU_^}uP*M3y!ja!2TZ1j zhzF%8>{}sI`mmrtapMdN=0=Gn6C!-3G>SZQ%vWHT|DxndnbLV4py>>ru6{1-oD!M< DU!O8R literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/find.png b/harbour/contrib/hbide/resources/find.png new file mode 100644 index 0000000000000000000000000000000000000000..8a28d64a6b9c7375fb4f5641f95a1eaa8561b74b GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmD46Q$ z;uvDldv(%HP6h)G=ezY<=C400Cy6pom1`9d{B%JfFgs+Gf8%3u#ab4N`RpaX)77u2 z<@Wuuc8C;btJ>hBXkcKl`O4{*ymM?BzE2(2S|v==pOaYjMN+`Jd$vPKs?K38TmCme X8@Il8RCWg1&cNX5>gTe~DWM4fC`371 literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/gotoline.png b/harbour/contrib/hbide/resources/gotoline.png new file mode 100644 index 0000000000000000000000000000000000000000..3b57714deafb4235b192c9bac2189b4457711cba GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmD46Q$ z;uvDl`*e~c-vI>fV9$75f-wzCOnwF0u2I`r%O9OFZ66aZ=y<$~B;c44$rjF6*2Ung9rLLEr!Y literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/gotomark.png b/harbour/contrib/hbide/resources/gotomark.png new file mode 100644 index 0000000000000000000000000000000000000000..eccfe794fdeeef2084e38ab6b5da5679076ad6e9 GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmDA?rb z;uvDldv;Pc*8v3%*WV@fXYGrP%NELX*_sLIT{>|%GqlU&=B)b-E-LexO4pjQJz^tKa^udcgNY)_#}BfyG>nZ#Oq6 zwp|gJrhog4^^x=OMqe7PWl8S1`ynSmEAxR*AA20XcZ>hm5-nz+YZyFT{an^LB{Ts5 DD)LSr literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/info.png b/harbour/contrib/hbide/resources/info.png new file mode 100644 index 0000000000000000000000000000000000000000..905e2a572c32e7b551ae38ee99b15d71c9569851 GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC>Y`C z;uvDl`}Wd7E(Qe-=79hIm%r6|6m`0Tk5ewFis#gsyM5o-e-?4`v`2UwNIM8D)Ojbe z=E65_#|cZCIgL+UvSqnfHAQX)TWIG0fS-05rhAt=cuB0B&(7YV6>-T`BJvl|4hBzG KKbLh*2~7YVk2Yrj literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/invertcase.png b/harbour/contrib/hbide/resources/invertcase.png new file mode 100644 index 0000000000000000000000000000000000000000..b7cfe2cbee7bba3b283563aff65dd7bc90219c4b GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC|Kp` z;uvDldvuZ`-vI>NByOQEBr~;kDz~JfX=d#Wzp$P!juST)} literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/launch.png b/harbour/contrib/hbide/resources/launch.png new file mode 100644 index 0000000000000000000000000000000000000000..c6a743e117fa54c84f968ba742fe826885e55aac GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmDCp(s z;uvDld-dW$P6h)Wr@-&=R!fw@N+3%Vl{nzlYrF{xlE_m<@|Kb>(2XexuJtDnm{r-UW|Z3!|; literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/lense.png b/harbour/contrib/hbide/resources/lense.png new file mode 100644 index 0000000000000000000000000000000000000000..488f0283a22ab958e2e14bda13bc0f5a46dd462e GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmD7ezo z#WBR9_vvJBz6Jvh7fUPm*JoEf)em!hd@RFgW8*KG1*|V*9KXPEhV%8}XM3k)E9{&wX>&9? zU%AFEMicRywi!EF72Y5Ay{4uY@IGBM_!5Y)IYl3yd{ r?6P6;~WqC>*Z0P;=#5-S|U9cyZnp2Q4WNjc*;kyv`?1E8lQ%GW63h j6`1SN;pf$S*MZ@!`(sOYjXPmLlNdZ*{an^LB{Ts5*U>6< literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/new.png b/harbour/contrib/hbide/resources/new.png new file mode 100644 index 0000000000000000000000000000000000000000..fab50edad56273c4c60b194fbe83ca8718c6b51d GIT binary patch literal 149 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmDCq9# z;uvDl`}UkQAAVQTvc)I$ztaD0e0sx+6FZBQb literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/notepad.png b/harbour/contrib/hbide/resources/notepad.png new file mode 100644 index 0000000000000000000000000000000000000000..59c72b606ec673e03ec51816d81b02abc36ed2aa GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmDA?uc z;uvDldv*#VUxNaNtEH9u=d>lh(uNcAH&460ecQ3mshkrza?fr*V70ulu~csR{K18JbF0fv#fk MboFyt=akR{09L?Lz5oCK literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/open.png b/harbour/contrib/hbide/resources/open.png new file mode 100644 index 0000000000000000000000000000000000000000..fb2e7120fd2eae6b9d83744a6310e8a67da94b99 GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^qChOd!3HFgyvvM%6lZ})WHAE+-(e7DJf6QI1t?hL z>Eak-(ff9?H{SsT4i`%+^W!&;-HNCyeX&kWcrl-TgO`fa(_ahqnLYHTI)q<{u>bZj zXzH5nr@Hs7_WbqHFpqK8C2?2b7iXm}Nbsb;+IAqz^Gfiuh~@pZ8XQ}US{tN9*rG1< o_$>Igc$ekkKa*Eo62HLqZlcY~icRu&fVMMuy85}Sb4q9e0D477J^%m! literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/paste.png b/harbour/contrib/hbide/resources/paste.png new file mode 100644 index 0000000000000000000000000000000000000000..16a17e28680e3953a905df2638e66cd06f1ba049 GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmDA?oa z;uvDldv)?%z5@b0ZnjnOYxA%DJn5yms(7<%`;k{aI1~k1SO1BTh(5S+gZPp_t&IQI z4&7icGCHTgWyMKpn4Z{af!_S&6PS!wo OF?hQAxvXH}r literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/placeremovemark.png b/harbour/contrib/hbide/resources/placeremovemark.png new file mode 100644 index 0000000000000000000000000000000000000000..b6c4e40f86abf6f3be717d704e1f77922efa134a GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC^*T} z#WBR9cke|;z6J#j)_}fq7xzeZCMG&M?Yy&Z+r)fF2A2&c|C>womtK$xnCBqWls?0c zV_uSq;RA^miE@89s+bE5Hhs zoyLue9vYPWn^MgxC_U*=-?Z0HwU0T-yGmS^zkadol!S%mnU`fAT-^;X*RYxA%UIW& T@g#o$x{krq)z4*}Q$iB};TBLT literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/ppo.png b/harbour/contrib/hbide/resources/ppo.png new file mode 100644 index 0000000000000000000000000000000000000000..afb0a642a506f4dd8e28400c24edcffe57dbe0da GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC|Kv| z;uvDlyLJ*c-vI>Gr-Gj93mXNz?wg)}V97%8>hRYqXe;l=4hH@X+r-^jcH< zANmV@s(6mPVrtp-Yhi$s>Ln&#RgtQ_AA`)Cxid8R-snaI@h@C6>wOi24(pw*G0R?R z+1M{Q{b|X5)<>JKd#my=Zfu={%O1Iia!GJT9Gk!h(fzTk|bhZvT^Es$$TP%6b(h S|E?D3I0jEwKbLh*2~7ZDVNqTH literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/properties.png b/harbour/contrib/hbide/resources/properties.png new file mode 100644 index 0000000000000000000000000000000000000000..b68303f54b203180982c9c41bff79eb7308f2089 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC|Ky} z;uvDl`}WF3t^*1jtO545^PkP%nZc?Q7ktaPhjsh(7gIz9J1?yM$#J8~y!Oqcc_ufi z(#k#`5G_bB>~dJH(yM5~lI}di_3{ZhM2P?Z literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/rebuild.png b/harbour/contrib/hbide/resources/rebuild.png new file mode 100644 index 0000000000000000000000000000000000000000..1af9b8dfc5b52710a09d688dc748dc50df8224df GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmD46f* z;uvDldvf}P^ZJY2zi$Mo9k}D2oVHDe;VxT}i`dko%e);GetW-=pYO{RQFX)m j_?y3V36)QbV)gTe~DWM4fSs+7? literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/rebuildlaunch.png b/harbour/contrib/hbide/resources/rebuildlaunch.png new file mode 100644 index 0000000000000000000000000000000000000000..35682b2b292081a5548eff1a6bea1e495a1c60a0 GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmDA?`k z;uvDlyLIwyz5@yz&Ob~3-#Ho^bNJLz1Nn|f)8k5WJ>GxH&ShM5C2Fy|ZLNJl$J9j! zdRA`?s1?=Nyl$zOv8WPypmZT?1`xja8CN~4ec^11A_*;Iu0 zil487Q+TqlQ+U(dvKKqM+MMohVAA<}n#Zm2<)&LY%$uh#YdAQQIee`_fw)w_YoN0j NJYD@<);T3K0RSU5Qsn>u literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/redo.png b/harbour/contrib/hbide/resources/redo.png new file mode 100644 index 0000000000000000000000000000000000000000..4c992935fb8187e985913f054817832edd16165d GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmDCpwp z;uvDlo1F0D|NO>P6;}={Oj2+@Trc7?vGE4afiwfX?v9`qz5er0RU|v)WI_rRJ=q@d pN}C+kFq^O_#W?H1ipB~P6&;csDkl&9;K|8o(6B0az!1k1>>SFx@}1L+TY=1mye-;Cngg#0 xCM#^5k)^j}*7TKfZOl0eJ6Vqi=<%;?U}T>7r^%?$EevQbgQu&X%Q~loCICY6F9`qu literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/search.png b/harbour/contrib/hbide/resources/search.png new file mode 100644 index 0000000000000000000000000000000000000000..5e642e047e79ed30fc82fbf7552eccb6d248b036 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC^*B@ z#WBR9_v)p)d<_a5tO;^|ZD!@W-8`VMF|lg$>4n>Bt^WxaUcUBEUf_VGL9Jz?Yr?Pa zD@~@Ux!xP6&;csDhFr8*o85BmI>N1x4TIMT|K=x(L$=NS(Qg}MWhAKKZ7Mq aYz!T#j9Oh5)2m9IT_9N WxK_I3+81k}eGHzielF{r5}E*(7(Gq^ literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/text.png b/harbour/contrib/hbide/resources/text.png new file mode 100644 index 0000000000000000000000000000000000000000..614ad480ac6bff265dfc066e052fa7a9ef60e7b3 GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmDCq0y z;uvDlo1F0D|NO>P6;~W&x+MMupLdv$Xkhb$SLIm1qCZ4F z;uvDlo1F0D|NO>P6;}=jrYkrft~ZdI!*+=0aH2-Xl3k4wZAq7#udeo}$$59+ozaYg zEIcYFTP4^YeKhksY`}9|baPA6oL6j*z8aZ+JYg)rV3ES$k;*;)GSGAePgg&ebxsLQ E0C<-+GXMYp literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/tools.png b/harbour/contrib/hbide/resources/tools.png new file mode 100644 index 0000000000000000000000000000000000000000..148b72a7dac65dec7b827f7357d1fea994d59421 GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC^+5I z#WBR9ckAUwt^*1jECKd^|J@PHPN-VyD$TL_sPoy*6{oKL5M^TDS-|+V1jSIo?p0}L4zkL$OP89ZJ6T-G@yGywptH(A{P literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/toupper.png b/harbour/contrib/hbide/resources/toupper.png new file mode 100644 index 0000000000000000000000000000000000000000..c30dfb8367af3e43aece3c9b0463cda4ffd32e52 GIT binary patch literal 165 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmC>ZYP z;uvDlo1F0D|NO>P6;}=fGIM6;{op^woTt!nBvWG7!V1-iJVy*f);C)0X*|0(VsF=( z<5|+Pv<+iAt~=CB+Hpu=HnWG}goHDTBAi;Ldzw#}Rq;fUgW|%GqlU&=B)b-E-LexO4pjQJz^tKa^udcgNY)_#}BfyG>nZ#Oq6 zwp|gJrhog4^^x=OMqe7PWl8S1`ynSmEAxR*AA20XcZ>hm5-nz+YZyFT{an^LB{Ts5 DD)LSr literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/undo.png b/harbour/contrib/hbide/resources/undo.png new file mode 100644 index 0000000000000000000000000000000000000000..2f0ee64a78c740a41aad690f897f9b86ac6e846a GIT binary patch literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`kNVGw3Kp1&dmDCp+t z;uvDlo1F0D|NO>P6;}={%u#SYTrc9YrSU~qp=879fH`^xmvhcvSh3g5$6!K=!qwQ0 s^8t$vPnZ(1d{v{1`s_gF_W6wrhd%LZt$!Ny31}jNr>mdKI;Vst06ZKsD*ylh literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/vr.png b/harbour/contrib/hbide/resources/vr.png new file mode 100644 index 0000000000000000000000000000000000000000..e67cc3183e3efe910b19a47f5b9f74df5be60cda GIT binary patch literal 349 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvVv45dj$D1FjT2AFf_CmdKI;Vst04*SS@&Et; literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbqt/generator/qt45.qtp b/harbour/contrib/hbqt/generator/qt45.qtp index 1c78b6c0cf..e6d7ee76de 100644 --- a/harbour/contrib/hbqt/generator/qt45.qtp +++ b/harbour/contrib/hbqt/generator/qt45.qtp @@ -211,6 +211,7 @@ QStyleOptionToolBox.qth QStyleOptionToolButton.qth QStyleOptionViewItem.qth QStylePainter.qth +QSyntaxHighlighter.qth QSystemTrayIcon.qth QTabBar.qth QTableView.qth diff --git a/harbour/contrib/hbqt/hbqt.ch b/harbour/contrib/hbqt/hbqt.ch index 72292e150b..9d61a4274e 100644 --- a/harbour/contrib/hbqt/hbqt.ch +++ b/harbour/contrib/hbqt/hbqt.ch @@ -73,7 +73,8 @@ #xtranslate HBQT_DEBUG( [] ) => iif( .T.,, ) #endif -#define QT_PTROF( oObj ) ( oObj:pPtr ) +#define QT_PTROF( oObj ) ( oObj:pPtr ) +#define QT_PTROFXBP( oXbp ) ( oXbp:oWidget:pPtr ) #define QEvent_None 0 // Not an event. #define QEvent_Timer 1 // Regular timer events (QTimerEvent). @@ -2129,6 +2130,12 @@ #define QEventLoop_WaitForMoreEvents 0x04 // Wait for events if no pending events are available. #define QEventLoop_DeferredDeletion 0x10 // deprecated - do not use. // The ProcessEventsFlags type is a typedef for QFlags. It stores an OR combination of ProcessEventsFlag values. + +#define QTextEdit_NoWrap 0 +#define QTextEdit_WidgetWidth 1 +#define QTextEdit_FixedPixelWidth 2 +#define QTextEdit_FixedColumnWidth 3 + /*----------------------------------------------------------------------*/ #define _HBQT_CH diff --git a/harbour/contrib/hbqt/hbqt.h b/harbour/contrib/hbqt/hbqt.h index 36c7eed773..ea123e9d62 100644 --- a/harbour/contrib/hbqt/hbqt.h +++ b/harbour/contrib/hbqt/hbqt.h @@ -291,6 +291,7 @@ const HB_GC_FUNCS * gcFuncs( void ); #define hbqt_par_QStyleOptionViewItem( n ) ( ( QStyleOptionViewItem * ) hbqt_gcpointer( n ) ) #define hbqt_par_QStyleOptionViewItem( n ) ( ( QStyleOptionViewItem * ) hbqt_gcpointer( n ) ) #define hbqt_par_QStylePainter( n ) ( ( QStylePainter * ) hbqt_gcpointer( n ) ) +#define hbqt_par_QSyntaxHighlighter( n ) ( ( QSyntaxHighlighter * ) hbqt_gcpointer( n ) ) #define hbqt_par_QSystemTrayIcon( n ) ( ( QSystemTrayIcon * ) hbqt_gcpointer( n ) ) #define hbqt_par_QTabBar( n ) ( ( QTabBar * ) hbqt_gcpointer( n ) ) #define hbqt_par_QTableView( n ) ( ( QTableView * ) hbqt_gcpointer( n ) ) diff --git a/harbour/contrib/hbqt/hbqt_slots.cpp b/harbour/contrib/hbqt/hbqt_slots.cpp index 7ecb3ab72c..c1287aef33 100644 --- a/harbour/contrib/hbqt/hbqt_slots.cpp +++ b/harbour/contrib/hbqt/hbqt_slots.cpp @@ -2737,7 +2737,7 @@ HB_FUNC( QT_MUTEXDESTROY ) } /*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ +/* */ /*----------------------------------------------------------------------*/ MyDrawingArea::MyDrawingArea(QWidget *parent) @@ -2769,6 +2769,94 @@ HB_FUNC( QT_MYDRAWINGAREA ) hb_retptr( ( MyDrawingArea * ) new MyDrawingArea() ); } +/*----------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------*/ + +HbSyntaxHighlighter::HbSyntaxHighlighter( QTextDocument *parent ) + : QSyntaxHighlighter( parent ) +{ + HighlightingRule rule; + + keywordFormat.setForeground( Qt::darkBlue ); + keywordFormat.setFontWeight( QFont::Bold ); + QStringList keywordPatterns; + keywordPatterns << "\\bchar\\b" << "\\bclass\\b" << "\\bconst\\b" + << "\\bdouble\\b" << "\\benum\\b" << "\\bexplicit\\b" + << "\\bfriend\\b" << "\\binline\\b" << "\\bint\\b" + << "\\blong\\b" << "\\bnamespace\\b" << "\\boperator\\b" + << "\\bprivate\\b" << "\\bprotected\\b" << "\\bpublic\\b" + << "\\bshort\\b" << "\\bsignals\\b" << "\\bsigned\\b" + << "\\bslots\\b" << "\\bstatic\\b" << "\\bstruct\\b" + << "\\btemplate\\b" << "\\btypedef\\b" << "\\btypename\\b" + << "\\bunion\\b" << "\\bunsigned\\b" << "\\bvirtual\\b" + << "\\bvoid\\b" << "\\bvolatile\\b"; + foreach ( const QString &pattern, keywordPatterns ) { + rule.pattern = QRegExp( pattern ); + rule.format = keywordFormat; + highlightingRules.append( rule ); + } + + classFormat.setFontWeight( QFont::Bold ); + classFormat.setForeground( Qt::darkMagenta ); + rule.pattern = QRegExp( "\\bQ[A-Za-z]+\\b" ); + rule.format = classFormat; + highlightingRules.append( rule ); + + singleLineCommentFormat.setForeground( Qt::red ); + rule.pattern = QRegExp( "//[^\n]*" ); + rule.format = singleLineCommentFormat; + highlightingRules.append( rule ); + + multiLineCommentFormat.setForeground( Qt::red ); + + quotationFormat.setForeground( Qt::darkGreen ); + rule.pattern = QRegExp( "\".*\"" ); + rule.format = quotationFormat; + highlightingRules.append( rule ); + + functionFormat.setFontItalic( true ); + functionFormat.setForeground( Qt::blue ); + rule.pattern = QRegExp( "\\b[A-Za-z0-9_]+(?=\\()" ); + rule.format = functionFormat; + highlightingRules.append( rule ); + + commentStartExpression = QRegExp("/\\*"); + commentEndExpression = QRegExp("\\*/"); +} + +void HbSyntaxHighlighter::highlightBlock( const QString &text ) +{ + foreach ( const HighlightingRule &rule, highlightingRules ) { + QRegExp expression( rule.pattern ); + int index = expression.indexIn( text ); + while ( index >= 0 ) { + int length = expression.matchedLength(); + setFormat( index, length, rule.format ); + index = expression.indexIn( text, index + length ); + } + } + setCurrentBlockState( 0 ); + + int startIndex = 0; + if ( previousBlockState() != 1 ) + startIndex = commentStartExpression.indexIn( text ); + + while ( startIndex >= 0 ) { + int endIndex = commentEndExpression.indexIn( text, startIndex ); + int commentLength; + if ( endIndex == -1 ) { + setCurrentBlockState( 1 ); + commentLength = text.length() - startIndex; + } else { + commentLength = endIndex - startIndex + + commentEndExpression.matchedLength(); + } + setFormat( startIndex, commentLength, multiLineCommentFormat ); + startIndex = commentStartExpression.indexIn( text, startIndex + commentLength ); + } +} + /*----------------------------------------------------------------------*/ #endif diff --git a/harbour/contrib/hbqt/hbqt_slots.h b/harbour/contrib/hbqt/hbqt_slots.h index 96e3a48b32..93b21fe79a 100644 --- a/harbour/contrib/hbqt/hbqt_slots.h +++ b/harbour/contrib/hbqt/hbqt_slots.h @@ -340,4 +340,42 @@ protected: }; /*----------------------------------------------------------------------*/ + +#include +#include +#include + +class QTextDocument; + +class HbSyntaxHighlighter : public QSyntaxHighlighter +{ + Q_OBJECT + +public: + HbSyntaxHighlighter( QTextDocument *parent = 0 ); + +protected: + void highlightBlock( const QString &text ); + +private: + struct HighlightingRule + { + QRegExp pattern; + QTextCharFormat format; + }; + QVector highlightingRules; + + QRegExp commentStartExpression; + QRegExp commentEndExpression; + + QTextCharFormat keywordFormat; + QTextCharFormat classFormat; + QTextCharFormat singleLineCommentFormat; + QTextCharFormat multiLineCommentFormat; + QTextCharFormat quotationFormat; + QTextCharFormat functionFormat; +}; + +/*----------------------------------------------------------------------*/ + #endif diff --git a/harbour/contrib/hbqt/moc_slots.cpp b/harbour/contrib/hbqt/moc_slots.cpp index b9cb972c50..fab98e1ac9 100644 --- a/harbour/contrib/hbqt/moc_slots.cpp +++ b/harbour/contrib/hbqt/moc_slots.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'hbqt_slots.h' ** -** Created: Sun Nov 1 13:17:43 2009 +** Created: Sun Nov 15 13:20:23 2009 ** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2) ** ** WARNING! All changes made in this file will be lost! @@ -725,4 +725,47 @@ int Events::qt_metacall(QMetaObject::Call _c, int _id, void **_a) return _id; return _id; } +static const uint qt_meta_data_HbSyntaxHighlighter[] = { + + // content: + 2, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + + 0 // eod +}; + +static const char qt_meta_stringdata_HbSyntaxHighlighter[] = { + "HbSyntaxHighlighter\0" +}; + +const QMetaObject HbSyntaxHighlighter::staticMetaObject = { + { &QSyntaxHighlighter::staticMetaObject, qt_meta_stringdata_HbSyntaxHighlighter, + qt_meta_data_HbSyntaxHighlighter, 0 } +}; + +const QMetaObject *HbSyntaxHighlighter::metaObject() const +{ + return &staticMetaObject; +} + +void *HbSyntaxHighlighter::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_HbSyntaxHighlighter)) + return static_cast(const_cast< HbSyntaxHighlighter*>(this)); + return QSyntaxHighlighter::qt_metacast(_clname); +} + +int HbSyntaxHighlighter::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QSyntaxHighlighter::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} QT_END_MOC_NAMESPACE diff --git a/harbour/contrib/hbqt/qtgui/QSyntaxHighlighter.cpp b/harbour/contrib/hbqt/qtgui/QSyntaxHighlighter.cpp new file mode 100644 index 0000000000..926ba867a4 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/QSyntaxHighlighter.cpp @@ -0,0 +1,175 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * 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. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "../hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + +#include + +#include +#include "../hbqt_slots.h" + +/* + * QSyntaxHighlighter ( QObject * parent ) + * QSyntaxHighlighter ( QTextDocument * parent ) + * QSyntaxHighlighter ( QTextEdit * parent ) + * virtual ~QSyntaxHighlighter () + */ + +typedef struct +{ + void * ph; + QT_G_FUNC_PTR func; + QPointer< QSyntaxHighlighter > pq; +} QGC_POINTER_QSyntaxHighlighter; + +QT_G_FUNC( release_QSyntaxHighlighter ) +{ + QGC_POINTER_QSyntaxHighlighter * p = ( QGC_POINTER_QSyntaxHighlighter * ) Cargo; + + HB_TRACE( HB_TR_DEBUG, ( "release_QSyntaxHighlighter p=%p", p)); + HB_TRACE( HB_TR_DEBUG, ( "release_QSyntaxHighlighter ph=%p pq=%p", p->ph, (void *)(p->pq))); + + if( p && p->ph && p->pq ) + { + const QMetaObject * m = ( ( QObject * ) p->ph )->metaObject(); + if( ( QString ) m->className() != ( QString ) "QObject" ) + { + ( ( QSyntaxHighlighter * ) p->ph )->~QSyntaxHighlighter(); + p->ph = NULL; + HB_TRACE( HB_TR_DEBUG, ( "release_QSyntaxHighlighter Object deleted!" ) ); + #if defined( __HB_DEBUG__ ) + hbqt_debug( " YES release_QSyntaxHighlighter %i B %i KB", ( int ) hb_xquery( 1001 ), hbqt_getmemused() ); + #endif + } + else + { + HB_TRACE( HB_TR_DEBUG, ( "release_QSyntaxHighlighter Object Name Missing!" ) ); + #if defined( __HB_DEBUG__ ) + hbqt_debug( " NO release_QSyntaxHighlighter" ); + #endif + } + } + else + { + HB_TRACE( HB_TR_DEBUG, ( "release_QSyntaxHighlighter Object Allready deleted!" ) ); + #if defined( __HB_DEBUG__ ) + hbqt_debug( " DEL release_QSyntaxHighlighter" ); + #endif + } +} + +void * gcAllocate_QSyntaxHighlighter( void * pObj ) +{ + QGC_POINTER_QSyntaxHighlighter * p = ( QGC_POINTER_QSyntaxHighlighter * ) hb_gcAllocate( sizeof( QGC_POINTER_QSyntaxHighlighter ), gcFuncs() ); + + p->ph = pObj; + p->func = release_QSyntaxHighlighter; + new( & p->pq ) QPointer< QSyntaxHighlighter >( ( QSyntaxHighlighter * ) pObj ); + #if defined( __HB_DEBUG__ ) + hbqt_debug( " new_QSyntaxHighlighter %i B %i KB", ( int ) hb_xquery( 1001 ), hbqt_getmemused() ); + #endif + return( p ); +} + +HB_FUNC( QT_QSYNTAXHIGHLIGHTER ) +{ + void * pObj = NULL; + + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + pObj = new HbSyntaxHighlighter( hbqt_par_QTextDocument( 1 ) ) ; + } + + hb_retptrGC( gcAllocate_QSyntaxHighlighter( pObj ) ); +} +/* + * QTextDocument * document () const + */ +HB_FUNC( QT_QSYNTAXHIGHLIGHTER_DOCUMENT ) +{ + hb_retptr( ( QTextDocument* ) hbqt_par_QSyntaxHighlighter( 1 )->document() ); +} + +/* + * void setDocument ( QTextDocument * doc ) + */ +HB_FUNC( QT_QSYNTAXHIGHLIGHTER_SETDOCUMENT ) +{ + hbqt_par_QSyntaxHighlighter( 1 )->setDocument( hbqt_par_QTextDocument( 2 ) ); +} + +/* + * void rehighlight () + */ +HB_FUNC( QT_QSYNTAXHIGHLIGHTER_REHIGHLIGHT ) +{ + hbqt_par_QSyntaxHighlighter( 1 )->rehighlight(); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtgui/TQSyntaxHighlighter.prg b/harbour/contrib/hbqt/qtgui/TQSyntaxHighlighter.prg new file mode 100644 index 0000000000..944f8d13a8 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/TQSyntaxHighlighter.prg @@ -0,0 +1,105 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * 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. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QSyntaxHighlighter INHERIT QObject + + VAR pPtr + + METHOD new() + METHOD configure( xObject ) + + METHOD document() + METHOD setDocument( pDoc ) + METHOD rehighlight() + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD QSyntaxHighlighter:new( pParent ) + ::pPtr := Qt_QSyntaxHighlighter( pParent ) + RETURN Self + + +METHOD QSyntaxHighlighter:configure( xObject ) + IF hb_isObject( xObject ) + ::pPtr := xObject:pPtr + ELSEIF hb_isPointer( xObject ) + ::pPtr := xObject + ENDIF + RETURN Self + + +METHOD QSyntaxHighlighter:document() + RETURN Qt_QSyntaxHighlighter_document( ::pPtr ) + + +METHOD QSyntaxHighlighter:setDocument( pDoc ) + RETURN Qt_QSyntaxHighlighter_setDocument( ::pPtr, pDoc ) + + +METHOD QSyntaxHighlighter:rehighlight() + RETURN Qt_QSyntaxHighlighter_rehighlight( ::pPtr ) + diff --git a/harbour/contrib/hbqt/qtgui/filelist.mk b/harbour/contrib/hbqt/qtgui/filelist.mk index 824b976777..9f858105a0 100644 --- a/harbour/contrib/hbqt/qtgui/filelist.mk +++ b/harbour/contrib/hbqt/qtgui/filelist.mk @@ -165,6 +165,7 @@ CPP_SOURCES := \ QStyleOptionToolButton.cpp \ QStyleOptionViewItem.cpp \ QStylePainter.cpp \ + QSyntaxHighlighter.cpp \ QSystemTrayIcon.cpp \ QTabBar.cpp \ QTableView.cpp \ @@ -374,6 +375,7 @@ PRG_SOURCES := \ TQStyleOptionToolButton.prg \ TQStyleOptionViewItem.prg \ TQStylePainter.prg \ + TQSyntaxHighlighter.prg \ TQSystemTrayIcon.prg \ TQTabBar.prg \ TQTableView.prg \ diff --git a/harbour/contrib/hbqt/qth/QSyntaxHighlighter.qth b/harbour/contrib/hbqt/qth/QSyntaxHighlighter.qth new file mode 100644 index 0000000000..1b64608fbe --- /dev/null +++ b/harbour/contrib/hbqt/qth/QSyntaxHighlighter.qth @@ -0,0 +1,105 @@ +/* + * $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 = QObject +Type = +New = + + + + + + +oSynHiliter := QSyntaxHighlighter():new( pObject ) +oSynHiliter := QSyntaxHighlighter():new( "QTextDocument", pQTextDocument ) +oSynHiliter := QSyntaxHighlighter():new( "QTextEdit", pQTextEdit ) + + + +#include +#include "../hbqt_slots.h" + +/* + * QSyntaxHighlighter ( QObject * parent ) + * QSyntaxHighlighter ( QTextDocument * parent ) + * QSyntaxHighlighter ( QTextEdit * parent ) + * virtual ~QSyntaxHighlighter () + */ +HB_FUNC( QT_QSYNTAXHIGHLIGHTER ) +{ + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( new HbSyntaxHighlighter( hbqt_par_QTextDocument( 1 ) ) ); + } +} + + + + + + +QTextDocument * document () const +void setDocument ( QTextDocument * doc ) + + + +void rehighlight () + + + + diff --git a/harbour/contrib/hbxbp/tests/demoxbp.prg b/harbour/contrib/hbxbp/tests/demoxbp.prg index 67e89c0764..35ee4d27d5 100644 --- a/harbour/contrib/hbxbp/tests/demoxbp.prg +++ b/harbour/contrib/hbxbp/tests/demoxbp.prg @@ -432,7 +432,7 @@ STATIC FUNCTION MyFunctionXbp( nMode ) /*----------------------------------------------------------------------*/ FUNCTION Build_ToolBar( oDA ) - LOCAL oTBar + LOCAL oTBar, s, txt_:= {} // Create an XbpToolBar object and // add it at the top of the dialog @@ -466,6 +466,24 @@ FUNCTION Build_ToolBar( oDA ) oTBar:transparentColor := GRA_CLR_INVALID oTBar:buttonClick := {|oButton| ExeToolbar( oButton, oDa ) } + #ifdef __HARBOUR__ + aadd( txt_, ' ' ) + aadd( txt_, ' QToolBar { ' ) + aadd( txt_, ' background: cyan; ' ) + aadd( txt_, ' spacing: 3px; /* spacing between items in the tool bar */ ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' QToolBar::handle { ' ) + aadd( txt_, ' image: url(save.png); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' ' ) + + s := "" + aeval( txt_, {|e| s += e + chr( 13 )+chr( 10 ) } ) + + oTBar:setStyleSheet( s ) + #endif + RETURN nil /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpmenubar.prg b/harbour/contrib/hbxbp/xbpmenubar.prg index 4891d2b47c..06a1da3ef0 100644 --- a/harbour/contrib/hbxbp/xbpmenubar.prg +++ b/harbour/contrib/hbxbp/xbpmenubar.prg @@ -260,11 +260,8 @@ METHOD xbpMenuBar:delItem( nItemIndex ) LOCAL lResult := .T. LOCAL oAction -//HBXBP_DEBUG( nItemIndex, len( ::aMenuItems ), len( ::aMenuItems[ nItemIndex ] ) ) - IF nItemIndex > 0 .AND. nItemIndex <= ::numItems() IF ::aMenuItems[ nItemIndex, 1 ] == QMF_POPUP -//HBXBP_DEBUG( valtype( ::aMenuItems[ nItemIndex, 4 ] ), __ObjGetClsName( ::aMenuItems[ nItemIndex, 4 ] ) ) //::aMenuItems[ nItemIndex, 4 ]:destroy() ELSE oAction := ::aMenuItems[ nItemIndex, 5 ] @@ -272,8 +269,8 @@ METHOD xbpMenuBar:delItem( nItemIndex ) QT_DISCONNECT_SIGNAL( QT_PTROF( oAction ), "hovered()" ) oAction:pPtr := 0 ENDIF -// ADEL( ::aMenuItems, nItemIndex ) -// ASIZE( ::aMenuItems, LEN( ::aMenuItems ) - 1 ) + ADEL( ::aMenuItems, nItemIndex ) + ASIZE( ::aMenuItems, LEN( ::aMenuItems ) - 1 ) ENDIF RETURN lResult @@ -302,7 +299,6 @@ METHOD xbpMenuBar:placeItem( xCaption, bAction, nStyle, nAttrb, nMode, nPos ) ELSE oAction:pPtr := ::oWidget:addSeparator() ENDIF - //aItem := { QMF_SEPARATOR, 0, 0, NIL, NIL, oAction } aItem := { QMF_SEPARATOR, 0, 0, NIL, oAction } CASE cType == "C" diff --git a/harbour/contrib/hbxbp/xbptoolbar.prg b/harbour/contrib/hbxbp/xbptoolbar.prg index d0574b5392..919a17e897 100644 --- a/harbour/contrib/hbxbp/xbptoolbar.prg +++ b/harbour/contrib/hbxbp/xbptoolbar.prg @@ -179,7 +179,6 @@ METHOD XbpToolbar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::show() ENDIF - ::setStyle() ::oParent:AddChild( SELF ) RETURN Self @@ -200,17 +199,13 @@ METHOD XbpToolbar:destroy() //Win_DeleteObject( ::aItems[ i,2 ]:hotImage ) ENDIF -// QT_DISCONNECT_SIGNAL( QT_PTROF( ::aMenuItems[ i, 5 ] ), "triggered(bool)" ) -// QT_DISCONNECT_SIGNAL( QT_PTROF( ::aMenuItems[ i, 5 ] ), "hovered()" ) - ::aItems[ i,2 ]:oAction:pPtr := 0 - ::aItems[ i,2 ]:oAction := NIL + IF ::aItems[ i,3 ] == XBPTOOLBAR_BUTTON_DEFAULT + ::aItems[ i,2 ]:oAction:pPtr := 0 + ::aItems[ i,2 ]:oAction := NIL + ENDIF NEXT ENDIF - IF !empty( ::hImageList ) - //WAPI_ImageList_Destroy( ::hImageList ) - ENDIF - ::xbpWindow:destroy() RETURN NIL @@ -239,26 +234,34 @@ METHOD XbpToolbar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nS HB_SYMBOL_UNUSED( cDLL ) HB_SYMBOL_UNUSED( nMapRGB ) + DEFAULT nStyle TO XBPTOOLBAR_BUTTON_DEFAULT + oBtn := XbpToolbarButton():new( cCaption, nStyle, cKey ) oBtn:index := ::numItems + 1 oBtn:command := 100 + oBtn:index - /* Create an action */ - oBtn:oAction := QAction():new( QT_PTROF( ::oWidget ) ) - oBtn:oAction:setText( cCaption ) + IF nStyle == XBPTOOLBAR_BUTTON_SEPARATOR + ::oWidget:addSeparator() + + ELSE + /* Create an action */ + oBtn:oAction := QAction():new( QT_PTROF( ::oWidget ) ) + oBtn:oAction:setText( cCaption ) + + IF valtype( xImage ) == "C" .and. hb_FileExists( xImage ) + oBtn:oAction:setIcon( xImage ) + ENDIF + + /* Attach codeblock to be triggered */ + ::Connect( QT_PTROF( oBtn:oAction ), "triggered(bool)", {|| ::exeBlock( oBtn ) } ) + + /* Attach Action with Toolbar */ + ::oWidget:addAction( QT_PTROF( oBtn:oAction ) ) - IF valtype( xImage ) == "C" .and. hb_FileExists( xImage ) - oBtn:oAction:setIcon( xImage ) ENDIF - /* Attach codeblock to be triggered */ - ::Connect( QT_PTROF( oBtn:oAction ), "triggered(bool)", {|| ::exeBlock( oBtn ) } ) - - /* Attach Action with Toolbar */ - ::oWidget:addAction( QT_PTROF( oBtn:oAction ) ) - - aadd( ::aItems, { oBtn:command, oBtn } ) + aadd( ::aItems, { oBtn:command, oBtn, nStyle } ) RETURN oBtn