From 1ec0e2619233e60d6a8a78c3e72578e66f020fe8 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sat, 21 May 2011 00:37:39 +0000 Subject: [PATCH] 2011-05-20 17:27 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/idethemes.prg + Added: "NOT" as Harbour keyword. * contrib/hbide/ideactions.prg + Added: Toggle actions for MDI editing area's top and left toolbars. ; TODO: to retain these settings for next run. * contrib/hbide/idedocks.prg * contrib/hbide/ideedit.prg * contrib/hbide/idemain.prg ! Fixed: many artifacts when MDI editing is switched off. ! Started: to provide "Stats -> Welcome" a different home. A difficult job but seems it has to be done anyway. ! Changed: default mimimize to system tray => minimize to task bar. ; TODO: should be user definable. --- harbour/ChangeLog | 17 +++++++++ harbour/contrib/hbide/ideactions.prg | 5 +++ harbour/contrib/hbide/idedocks.prg | 56 +++++++++++++++++++++++++--- harbour/contrib/hbide/ideedit.prg | 6 ++- harbour/contrib/hbide/idemain.prg | 2 + harbour/contrib/hbide/idethemes.prg | 2 +- 6 files changed, 81 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0e4858794e..af17e2af3c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,23 @@ The license applies to all entries newer than 2009-04-28. */ +2011-05-20 17:27 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/idethemes.prg + + Added: "NOT" as Harbour keyword. + + * contrib/hbide/ideactions.prg + + Added: Toggle actions for MDI editing area's top and left toolbars. + ; TODO: to retain these settings for next run. + + * contrib/hbide/idedocks.prg + * contrib/hbide/ideedit.prg + * contrib/hbide/idemain.prg + ! Fixed: many artifacts when MDI editing is switched off. + ! Started: to provide "Stats -> Welcome" a different home. + A difficult job but seems it has to be done anyway. + ! Changed: default mimimize to system tray => minimize to task bar. + ; TODO: should be user definable. + 2011-05-20 17:26 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/gtwvg/gtwvg.c ! Applied: GTWVT fix by Przemek regarding HB_GTI_FONTSIZE. diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index 0dc0ad12b4..d1b18cbb5d 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -572,6 +572,11 @@ METHOD IdeActions:buildMainMenu() oSubMenu:oWidget:addAction( ::oDockB2:oWidget:toggleViewAction() ) * oSubMenu:oWidget:addAction( ::oDockB1:oWidget:toggleViewAction() ) * oSubMenu:oWidget:addAction( ::oDockB:oWidget:toggleViewAction() ) + IF ::oIde:lCurEditsMdi + oSubMenu:oWidget:addSeparator() + oSubMenu:oWidget:addAction( ::oDK:qMdiToolbarL:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction( ::oDK:qMdiToolbar:oWidget:toggleViewAction() ) + ENDIF /*----------------------------------------------------------------------------*/ /* Project */ diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index 786e322f9c..cb8bfb37d9 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -94,9 +94,11 @@ CLASS IdeDocks INHERIT IdeObject DATA qTimer DATA nPrevWindowState INIT Qt_WindowNoState DATA lSystemTrayAvailable INIT .f. - DATA lMinimizeInSystemTray INIT .t. // .f. + DATA lMinimizeInSystemTray INIT .f. /* TODO: make it user definable */ DATA qAct1 DATA qAct2 + DATA cOldView INIT "" + METHOD new( oIde ) METHOD create( oIde ) @@ -154,6 +156,8 @@ CLASS IdeDocks INHERIT IdeObject METHOD restState( nMode ) METHOD setButtonState( cButton, lChecked ) METHOD buildFormatWidget() + METHOD showStats() + METHOD hideStats() ENDCLASS @@ -213,8 +217,10 @@ METHOD IdeDocks:destroy() IF !empty( ::oSys ) ::oIde:oSys : disconnect( "activated(QSystemTrayIcon::ActivationReason)" ) - ::qAct1 : disconnect( "triggered(bool)" ) - ::qAct2 : disconnect( "triggered(bool)" ) + IF hb_isObject( ::qAct1 ) + ::qAct1 : disconnect( "triggered(bool)" ) + ::qAct2 : disconnect( "triggered(bool)" ) + ENDIF ::oIde:oSys := NIL ::qAct1 := NIL @@ -1028,6 +1034,8 @@ METHOD IdeDocks:setViewInitials() METHOD IdeDocks:setView( cView ) LOCAL n, nIndex + ::cOldView := ::oIde:cWrkView + SWITCH cView CASE "New..." @@ -1061,6 +1069,8 @@ METHOD IdeDocks:setView( cView ) ::oIde:qTabWidget:setCurrentIndex( nIndex ) /* TODO: Must be last saved */ ENDIF ENDIF + ELSE + ::showStats() ENDIF IF ::oIde:lCurEditsMdi ::oStackedWidget:oWidget:setActiveSubWindow( ::oIde:aMdies[ n ] ) @@ -1077,11 +1087,39 @@ METHOD IdeDocks:setView( cView ) /*------------------------------------------------------------------------*/ +METHOD IdeDocks:hideStats() + + IF len( ::oIde:aMdies ) >= 1 + ::oIde:aMdies[ 1 ]:hide() + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeDocks:showStats() + + IF len( ::oIde:aMdies ) >= 1 + IF ::oIde:aMdies[ 1 ]:isHidden() + ::oIde:aMdies[ 1 ]:show() + ELSE + ::oIde:aMdies[ 1 ]:hide() + ::setView( "Main" ) + ENDIF + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeDocks:buildMdiToolbarLeft() ::qMdiToolbarL := HbqToolbar():new() ::qMdiToolbarL:orientation := Qt_Vertical ::qMdiToolbarL:create( "EditsManager_Left_Toolbar" ) + ::qMdiToolbarL:setWindowTitle( "Toolbar: Editing Area's Left" ) + ::qMdiToolbarL:setObjectName( "ToolbarEditingAreaLeft" ) + ::qMdiToolbarL:setStyleSheet( GetStyleSheet( "QToolBar", ::nAnimantionMode ) ) ::qMdiToolbarL:addToolButton( "ViewTabbed" , "Toggle tabbed view" , hbide_image( "view_tabbed" ), {|| ::execEvent( "buttonViewTabbed_clicked" ) }, .f. ) ::qMdiToolbarL:addSeparator() @@ -1126,6 +1164,8 @@ METHOD IdeDocks:buildMdiToolbar() ::qMdiToolbar:orientation := Qt_Horizontal ::qMdiToolbar:create( "EditsManager_Top_Toolbar" ) ::qMdiToolbar:setStyleSheet( GetStyleSheet( "QToolBar", ::nAnimantionMode ) ) + ::qMdiToolbar:setObjectName( "ToolbarEditingAreaTop" ) + ::qMdiToolbar:setWindowTitle( "Toolbar: Editing Area's Top" ) qTBar := ::qMdiToolbar @@ -1243,7 +1283,7 @@ METHOD IdeDocks:buildViewWidget( cView ) qDrop:setAcceptDrops( .t. ) qDrop:connect( QEvent_DragEnter, {|p| ::execEvent( "editWidget_dragEnterEvent", p ) } ) - qDrop:connect( QEvent_DragMove , {|p| ::execEvent( "editWidget_dragMoveEvent", p ) } ) + qDrop:connect( QEvent_DragMove , {|p| ::execEvent( "editWidget_dragMoveEvent" , p ) } ) qDrop:connect( QEvent_Drop , {|p| ::execEvent( "editWidget_dropEvent" , p ) } ) ENDIF @@ -1793,7 +1833,13 @@ METHOD IdeDocks:buildStatusBar() /*----------------------------------------------------------------------*/ METHOD IdeDocks:setStatusText( nPart, xValue ) - LOCAL oPanel := ::oSBar:getItem( nPart ) + LOCAL oPanel + + IF ! hb_isObject( ::oSBar ) + RETURN Self + ENDIF + + oPanel := ::oSBar:getItem( nPart ) SWITCH nPart diff --git a/harbour/contrib/hbide/ideedit.prg b/harbour/contrib/hbide/ideedit.prg index cd84ff2f66..55fc8b316d 100644 --- a/harbour/contrib/hbide/ideedit.prg +++ b/harbour/contrib/hbide/ideedit.prg @@ -452,7 +452,7 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) ::oEM:aActions[ 19, 2 ]:setEnabled( len( ::oEditor:aEdits ) == 0 .OR. ::oEditor:nSplOrient == -1 .OR. ::oEditor:nSplOrient == 2 ) ::oEM:aActions[ 21, 2 ]:setEnabled( n > 0 ) - IF ! ( qAct := ::oEM:qContextMenu:exec( qEdit:mapToGlobal( QPoint( p ) ) ) ):hasValidPointer() + IF ! ( qAct := ::oEM:qContextMenu:exec( qEdit:mapToGlobal( p ) ) ):hasValidPointer() RETURN Self ENDIF @@ -466,6 +466,9 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) EXIT CASE "Close Split Window" IF n > 0 /* 1 == Main Edit */ + IF ! ::oIde:lCurEditsMdi + ::oIde:oUpDn:oUI:setParent( ::oEditor:qEdit ) + ENDIF oo := ::oEditor:aEdits[ n ] hb_adel( ::oEditor:aEdits, n, .t. ) oo:destroy( .f. ) @@ -2587,6 +2590,7 @@ FUNCTION hbide_isHarbourKeyword( cWord, oIde ) 'in' => NIL,; 'nil' => NIL,; 'or' => NIL,; + 'not' => NIL,; 'and' => NIL } HB_SYMBOL_UNUSED( oIde ) diff --git a/harbour/contrib/hbide/idemain.prg b/harbour/contrib/hbide/idemain.prg index ab894ce1fb..0b8df59e64 100644 --- a/harbour/contrib/hbide/idemain.prg +++ b/harbour/contrib/hbide/idemain.prg @@ -725,6 +725,8 @@ METHOD HbIde:create( aParams ) qSplash := NIL qPixMap := NIL + ::oDK:hideStats() /* A Work in progress */ + /* Load tags last tagged projects */ ::oFN:loadTags( ::oINI:aTaggedProjects ) diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index d611b5306b..9b54c1db3b 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -221,7 +221,7 @@ METHOD IdeThemes:create( oIde, cThemesFile ) 'do','while','exit','enddo','loop',; 'for','each','next','step','to','in',; 'with','object','endwith','request',; - 'nil','and','or','in','self',; + 'nil','and','or','in','not','self',; 'class','endclass','method','data','var','destructor','inline','assign','access',; 'inherit','init','create','virtual','message', 'from', 'setget',; 'begin','sequence','try','catch','always','recover','hb_symbol_unused', ;