From 234bff10c3dd1ea561d33a2a026b97f24201b868 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 8 Jul 2010 17:27:04 +0000 Subject: [PATCH] 2010-07-08 10:21 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/hbide.prg * contrib/hbide/idedocks.prg ! More fix to previous. Now the visibility of source behavior is Ok. * contrib/hbide/ideeditor.prg ! Changed: numeric to character events notation. * contrib/hbide/idesaveload.prg ! Minor. --- harbour/ChangeLog | 11 ++++++ harbour/contrib/hbide/hbide.prg | 10 ++---- harbour/contrib/hbide/idedocks.prg | 19 +++++++++++ harbour/contrib/hbide/ideeditor.prg | 48 ++++++++++++++++----------- harbour/contrib/hbide/idesaveload.prg | 2 +- 5 files changed, 61 insertions(+), 29 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b06ad18400..3bd04025e1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,17 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-08 10:21 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/hbide.prg + * contrib/hbide/idedocks.prg + ! More fix to previous. Now the visibility of source behavior is Ok. + + * contrib/hbide/ideeditor.prg + ! Changed: numeric to character events notation. + + * contrib/hbide/idesaveload.prg + ! Minor. + 2010-07-08 17:39 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL * contrib/hbqt/hbqts.hbp diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index ecabb2b0f3..717e551290 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -510,15 +510,9 @@ METHOD HbIde:create( aParams ) ::oDK:animateComponents( val( ::oINI:cIdeAnimated ) ) ::oSetup:setSystemStyle( ::oINI:cIdeTheme ) + ::oDK:setViewInitials( "Main" ) FOR EACH cV IN ::oINI:aViews - ::oDK:setView( cV ) - IF ::qTabWidget:count() == 1 - ::oEM:setSourceVisibleByIndex( 0 ) - ELSE - ::qTabWidget:setCurrentIndex( 0 ) - ::qTabWidget:setCurrentIndex( ::qTabWidget:count() - 1 ) - ::qTabWidget:setCurrentIndex( 0 ) - ENDIF + ::oDK:setViewInitials( cV ) NEXT /* Refresh Stylesheet for all components at once */ diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index eadc3acafe..de9b8e1954 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -134,6 +134,7 @@ CLASS IdeDocks INHERIT IdeObject METHOD buildUpDownWidget() METHOD buildSystemTray() METHOD showDlgBySystemTrayIconCommand() + METHOD setViewInitials( cView ) ENDCLASS @@ -565,6 +566,24 @@ METHOD IdeDocks:getADockWidget( nAreas, cObjectName, cWindowTitle, nFlags, cEven /*----------------------------------------------------------------------*/ +METHOD IdeDocks:setViewInitials( cView ) + + ::setView( cView ) + +HB_TRACE( HB_TR_ALWAYS, cView, ::qTabWidget:count() ) + + IF ::qTabWidget:count() == 1 + ::oEM:setSourceVisibleByIndex( 0 ) + ELSE + ::qTabWidget:setCurrentIndex( 0 ) + ::qTabWidget:setCurrentIndex( ::qTabWidget:count() - 1 ) + ::qTabWidget:setCurrentIndex( 0 ) + ENDIF + + RETURN Self + +/*------------------------------------------------------------------------*/ + METHOD IdeDocks:setView( cView ) LOCAL n, nIndex diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index afa5ba19e6..4e1dc6128f 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -73,13 +73,6 @@ /*----------------------------------------------------------------------*/ -#define blockCountChanged 21 -#define contentsChange 22 -#define timerTimeout 23 - -#define qcompleter_activated 101 -#define qTab_contextMenu 111 - #define EDT_LINNO_WIDTH 50 /*----------------------------------------------------------------------*/ @@ -95,7 +88,7 @@ CLASS IdeEditsManager INHERIT IdeObject METHOD destroy() METHOD removeSourceInTree( cSourceFile ) METHOD addSourceInTree( cSourceFile, cView ) - METHOD execEvent( nMode, p ) + METHOD execEvent( cEvent, p ) METHOD buildEditor( cSourceFile, nPos, nHPos, nVPos, cTheme, cView, aBookMarks ) METHOD getTabBySource( cSource ) METHOD getTabCurrent() @@ -235,7 +228,7 @@ METHOD IdeEditsManager:create( oIde ) ::oIde:qProtoList := QStringList():new() ::oIde:qCompModel := QStringListModel():new() ::oIde:qCompleter := QCompleter():new() - ::connect( ::qCompleter, "activated(QString)", {|p| ::execEvent( qcompleter_activated, p ) } ) + ::connect( ::qCompleter, "activated(QString)", {|p| ::execEvent( "qcompleter_activated", p ) } ) ::updateCompleter() RETURN Self @@ -327,11 +320,11 @@ array2table( /*----------------------------------------------------------------------*/ -METHOD IdeEditsManager:execEvent( nMode, p ) +METHOD IdeEditsManager:execEvent( cEvent, p ) LOCAL oEdit DO CASE - CASE nMode == qcompleter_activated + CASE cEvent == "qcompleter_activated" IF !empty( oEdit := ::getEditObjectCurrent() ) oEdit:completeCode( p ) ENDIF @@ -1130,7 +1123,7 @@ CLASS IdeEditor INHERIT IdeObject METHOD split( nOrient, oEditP ) METHOD relay( oEdit ) METHOD destroy() - METHOD execEvent( nMode, p ) + METHOD execEvent( cEvent, p ) METHOD setDocumentProperties() METHOD activateTab( mp1, mp2, oXbp ) METHOD buildTabPage( cSource ) @@ -1239,6 +1232,8 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme, cView, a ::connect( ::oEdit:qEdit, "updateRequest(QRect,int)", {|| ::scrollThumbnail() } ) ::qDocument := QTextDocument():configure( ::qEdit:document() ) + ::connect( ::qDocument, "documentLayoutChanged()", {|| ::execEvent( "qDocument_documentLayoutChanged" ) } ) + ::qDocLayout := QPlainTextDocumentLayout():new( ::qDocument ) ::qDocument:setDocumentLayout( ::qDocLayout ) @@ -1442,7 +1437,7 @@ METHOD IdeEditor:setDocumentProperties() IF ::cType $ "PRG,C,CPP,H,CH" ::qTimerSave := QTimer():New() ::qTimerSave:setInterval( max( 30000, ::oINI:nTmpBkpPrd * 1000 ) ) - ::connect( ::qTimerSave, "timeout()", {|| ::execEvent( qTimeSave_timeout ) } ) + ::connect( ::qTimerSave, "timeout()", {|| ::execEvent( "qTimeSave_timeout" ) } ) ::qTimerSave:start() ENDIF @@ -1465,21 +1460,36 @@ METHOD IdeEditor:setDocumentProperties() /*----------------------------------------------------------------------*/ -METHOD IdeEditor:execEvent( nMode, p ) +METHOD IdeEditor:execEvent( cEvent, p ) LOCAL cFileTemp, aPops := {} + //LOCAL qRFrame, qFFormat p := p - SWITCH nMode - CASE qTimeSave_timeout + SWITCH cEvent + CASE "qDocument_documentLayoutChanged" + #if 0 + HB_TRACE( HB_TR_ALWAYS, "qDocument_documentLayoutChanged" ) + + qRFrame := QTextFrame():from( ::qDocument:rootFrame() ) +// qFFormat := 0 + qFFormat := QTextFrameFormat():from( qRFrame ) +// qFFormat:setMargin( 0 ) +// qFFormat:setPadding( 0 ) + qRFrame:setFrameFormat( qFFormat ) + hbide_justACall( qRFrame, qFFormat ) + #endif + EXIT + + CASE "qTimeSave_timeout" IF ::qDocument:isModified() cFileTemp := hbide_pathToOSPath( ::cPath + ::cFile + ::cExt + ".tmp" ) hb_memowrit( cFileTemp, ::qEdit:toPlainText() ) ENDIF EXIT - CASE qTab_contextMenu -HB_TRACE( HB_TR_ALWAYS, "IdeEditor:execEvent( nMode, p )" ) + CASE "qTab_contextMenu" +HB_TRACE( HB_TR_ALWAYS, "IdeEditor:execEvent( cMode, p )" ) aadd( aPops, { "Close", {|| MsgBox( "closing" ) } } ) hbide_ExecPopup( aPops, p, ::oTab:oWidget ) @@ -1524,8 +1534,6 @@ METHOD IdeEditor:buildTabPage( cSource ) ::oTab:create() ::qTabWidget:setTabTooltip( ::qTabWidget:indexOf( ::oTab:oWidget ), cSource ) - //::connect( ::oTab:oWidget, "customContextMenuRequested(QPoint)", {|p| ::execEvent( qTab_contextMenu, p ) } ) - //::oTab:hbContextMenu := {|| ::execEvent( qTab_contextMenu, p ) } ::oTab:tabActivate := {|mp1,mp2,oXbp| ::activateTab( mp1, mp2, oXbp ) } RETURN Self diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index 978caf3f7c..fa29a669a8 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -1366,7 +1366,7 @@ METHOD IdeSetup:execEvent( cEvent, p, p1 ) EXIT CASE "buttonThmAdd_clicked" IF !empty( cTheme := hbide_fetchAString( ::oDlg:oWidget, cTheme, "Name the Theme", "New Theme" ) ) - aadd( ::oINI:aAppThemes, cTheme + "," + "," + "," + "," ) + aadd( ::oINI:aAppThemes, cTheme + "," + ::fetchThemeColorsString() ) qItem := QListWidgetItem():new() qItem:setText( cTheme ) ::oUI:q_listThemes:addItem_1( qItem )