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.
This commit is contained in:
Pritpal Bedi
2009-11-17 10:46:15 +00:00
parent 5a0350795a
commit 1013e3d7c3
59 changed files with 1103 additions and 31 deletions

View File

@@ -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

View File

@@ -0,0 +1,405 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* 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
/*----------------------------------------------------------------------*/

View File

@@ -0,0 +1,7 @@
#
# $Id$
#
../hbxbp/hbxbp.hbc
-w3 -es2

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

View File

@@ -211,6 +211,7 @@ QStyleOptionToolBox.qth
QStyleOptionToolButton.qth
QStyleOptionViewItem.qth
QStylePainter.qth
QSyntaxHighlighter.qth
QSystemTrayIcon.qth
QTabBar.qth
QTableView.qth

View File

@@ -73,7 +73,8 @@
#xtranslate HBQT_DEBUG( [<x,...>] ) => 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<ProcessEventsFlag>. 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

View File

@@ -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 ) )

View File

@@ -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

View File

@@ -340,4 +340,42 @@ protected:
};
/*----------------------------------------------------------------------*/
#include <QSyntaxHighlighter>
#include <QHash>
#include <QTextCharFormat>
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<HighlightingRule> highlightingRules;
QRegExp commentStartExpression;
QRegExp commentEndExpression;
QTextCharFormat keywordFormat;
QTextCharFormat classFormat;
QTextCharFormat singleLineCommentFormat;
QTextCharFormat multiLineCommentFormat;
QTextCharFormat quotationFormat;
QTextCharFormat functionFormat;
};
/*----------------------------------------------------------------------*/
#endif

View File

@@ -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<void*>(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

View File

@@ -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 <pritpal@vouchcac.com>
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
* 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 <QtCore/QPointer>
#include <QtGui/QSyntaxHighlighter>
#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 */
/*----------------------------------------------------------------------*/

View File

@@ -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 <pritpal@vouchcac.com>
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
* 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 )

View File

@@ -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 \

View File

@@ -0,0 +1,105 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* QT Source Generator for Harbour
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* 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
;
<CLASS>
QObject =
Inherits = QObject
Type =
New =
</CLASS>
<SUBCLASS>
</SUBCLASS>
<DOC>
oSynHiliter := QSyntaxHighlighter():new( pObject )
oSynHiliter := QSyntaxHighlighter():new( "QTextDocument", pQTextDocument )
oSynHiliter := QSyntaxHighlighter():new( "QTextEdit", pQTextEdit )
</DOC>
<CODE>
#include <QtGui/QSyntaxHighlighter>
#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 ) ) );
}
}
</CODE>
<ENUMS>
</ENUMS>
<PROTOS>
QTextDocument * document () const
void setDocument ( QTextDocument * doc )
</PROTOS>
<SLOTS>
void rehighlight ()
</SLOTS>
<SIGNALS>
</SIGNALS>

View File

@@ -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
/*----------------------------------------------------------------------*/

View File

@@ -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"

View File

@@ -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