From 562ca599a3539bfb47acc295025f37bd2bc62b77 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sun, 4 Jul 2010 16:08:52 +0000 Subject: [PATCH] 2010-07-04 08:40 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/hbqt.ch * contrib/hbqt/hbqt_hbslots.cpp * contrib/hbqt/hbqt_hbslots.h + Added: more slots covering QMdiArea and QMdiSubWindow classes. * contrib/hbxbp/xbpbrowse.prg ! Reworked: event handelling methods more spontaneous. + contrib/hbide/resources/browser.png + contrib/hbide/resources/formview.png + contrib/hbide/resources/thumbnail.png + contrib/hbide/resources/view_cascaded.png + contrib/hbide/resources/view_organized.png + contrib/hbide/resources/view_tabbed.png + contrib/hbide/resources/view_tiled.png * contrib/hbide/hbide.qrc + Added: few images as above. * contrib/hbide/hbide.prg * contrib/hbide/ideactions.prg * contrib/hbide/idebrowse.prg * contrib/hbide/idedocks.prg * contrib/hbide/ideeditor.prg * contrib/hbide/idemisc.prg * contrib/hbide/ideskeletons.prg * contrib/hbide/idestylesheets.prg * contrib/hbide/idethemes.prg * contrib/hbide/idetools.prg + Reworked: application theme management. Now it includes the missing components from previous. + Reworked: ideDBU interface. Now it is hosted in a MDI interface which is more natural to table management, including relational views. User can rearrange and resize the browsers to his personal tastes. Here is the layout hirarchy of ideDBU: hbIDE ideDBU - docking pane, right-hand, floatable, dockable. Toolbar Add a table, Form View, Tabbed View, Original View, Cascaded View, Tiled View, Remove browser, Panels - create button, switch menu Panels - user defined, only one visible at a time Panel 1 Browser 1 - .dbf, an array ( TODO, functionality is there ) Browser 2 Browser n Panel 2 Browser 1 Browser 2 Browser n Panel n Browser 1 Browser 2 Browser n Panels retain their last contents and are presented on next run as is. The only exception being panel "Main" is always the first visible. NOTE: there is a lot on my drawing board. So far I was struggling to make the behavior of XbpBrowser stable per TBrowse specs and interface design. Rest will follow soon. --- harbour/ChangeLog | 68 +++ harbour/contrib/hbide/hbide.prg | 4 +- harbour/contrib/hbide/hbide.qrc | 7 + harbour/contrib/hbide/ideactions.prg | 52 +- harbour/contrib/hbide/idebrowse.prg | 533 ++++++++++++++---- harbour/contrib/hbide/idedocks.prg | 97 ++-- harbour/contrib/hbide/ideeditor.prg | 24 +- harbour/contrib/hbide/idemisc.prg | 2 + harbour/contrib/hbide/ideskeletons.prg | 3 +- harbour/contrib/hbide/idestylesheets.prg | 14 + harbour/contrib/hbide/idethemes.prg | 20 +- harbour/contrib/hbide/idetools.prg | 18 + harbour/contrib/hbide/resources/browser.png | Bin 0 -> 114 bytes harbour/contrib/hbide/resources/formview.png | Bin 0 -> 592 bytes harbour/contrib/hbide/resources/thumbnail.png | Bin 0 -> 380 bytes .../contrib/hbide/resources/view_cascaded.png | Bin 0 -> 639 bytes .../hbide/resources/view_organized.png | Bin 0 -> 383 bytes .../contrib/hbide/resources/view_tabbed.png | Bin 0 -> 344 bytes .../contrib/hbide/resources/view_tiled.png | Bin 0 -> 301 bytes harbour/contrib/hbqt/hbqt.ch | 13 + harbour/contrib/hbqt/hbqt_hbslots.cpp | 15 + harbour/contrib/hbqt/hbqt_hbslots.h | 6 + harbour/contrib/hbxbp/xbpbrowse.prg | 116 ++-- 23 files changed, 754 insertions(+), 238 deletions(-) create mode 100644 harbour/contrib/hbide/resources/browser.png create mode 100644 harbour/contrib/hbide/resources/formview.png create mode 100644 harbour/contrib/hbide/resources/thumbnail.png create mode 100644 harbour/contrib/hbide/resources/view_cascaded.png create mode 100644 harbour/contrib/hbide/resources/view_organized.png create mode 100644 harbour/contrib/hbide/resources/view_tabbed.png create mode 100644 harbour/contrib/hbide/resources/view_tiled.png diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1182860413..041c979cf6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,74 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-04 08:40 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/hbqt.ch + * contrib/hbqt/hbqt_hbslots.cpp + * contrib/hbqt/hbqt_hbslots.h + + Added: more slots covering QMdiArea and QMdiSubWindow classes. + + * contrib/hbxbp/xbpbrowse.prg + ! Reworked: event handelling methods more spontaneous. + + + contrib/hbide/resources/browser.png + + contrib/hbide/resources/formview.png + + contrib/hbide/resources/thumbnail.png + + contrib/hbide/resources/view_cascaded.png + + contrib/hbide/resources/view_organized.png + + contrib/hbide/resources/view_tabbed.png + + contrib/hbide/resources/view_tiled.png + + * contrib/hbide/hbide.qrc + + Added: few images as above. + + * contrib/hbide/hbide.prg + * contrib/hbide/ideactions.prg + * contrib/hbide/idebrowse.prg + * contrib/hbide/idedocks.prg + * contrib/hbide/ideeditor.prg + * contrib/hbide/idemisc.prg + * contrib/hbide/ideskeletons.prg + * contrib/hbide/idestylesheets.prg + * contrib/hbide/idethemes.prg + * contrib/hbide/idetools.prg + + + Reworked: application theme management. + Now it includes the missing components from previous. + + + Reworked: ideDBU interface. + Now it is hosted in a MDI interface which is more natural + to table management, including relational views. User can + rearrange and resize the browsers to his personal tastes. + Here is the layout hirarchy of ideDBU: + + hbIDE + ideDBU - docking pane, right-hand, floatable, dockable. + Toolbar + Add a table, Form View, Tabbed View, Original View, + Cascaded View, Tiled View, Remove browser, + Panels - create button, switch menu + Panels - user defined, only one visible at a time + Panel 1 + Browser 1 - .dbf, an array ( TODO, functionality is there ) + Browser 2 + Browser n + Panel 2 + Browser 1 + Browser 2 + Browser n + Panel n + Browser 1 + Browser 2 + Browser n + Panels retain their last contents and are presented + on next run as is. The only exception being panel "Main" + is always the first visible. + + NOTE: there is a lot on my drawing board. + So far I was struggling to make the behavior of + XbpBrowser stable per TBrowse specs and interface + design. Rest will follow soon. + 2010-07-04 15:53 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * harbour-win-spec * harbour-wce-spec diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 30912944b5..bcfcccfae2 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -509,7 +509,6 @@ METHOD HbIde:create( aParams ) ENDIF ::oDockB2:hide() /* This widget never contains anything so must be forced to hide */ - ::oQScintillaDock:hide() /* Request Main Window to Appear on the Screen */ ::oHM:refresh() @@ -524,6 +523,9 @@ METHOD HbIde:create( aParams ) ::qTabWidget:setCurrentIndex( 0 ) NEXT + /* Refresh Stylesheet for all components at once */ + ::oDK:animateComponents( ::nAnimantionMode ) + ::oDlg:Show() IF ::nRunMode == HBIDE_RUN_MODE_PRG ::oDockPT:hide() diff --git a/harbour/contrib/hbide/hbide.qrc b/harbour/contrib/hbide/hbide.qrc index fa9f6efd72..1825670c33 100644 --- a/harbour/contrib/hbide/hbide.qrc +++ b/harbour/contrib/hbide/hbide.qrc @@ -4,6 +4,7 @@ resources/blockcomment.png resources/blockindentl.png resources/blockindentr.png +resources/browser.png resources/build.png resources/builderror.png resources/buildlaunch.png @@ -67,6 +68,7 @@ resources/fl_txt.png resources/folder.png resources/font.png +resources/formview.png resources/fullscreen.png resources/go-bottom.png resources/go-down.png @@ -174,6 +176,7 @@ resources/tabunmodified.png resources/tests.png resources/text.png +resources/thumbnail.png resources/togglelinenumber.png resources/tolower.png resources/tools.png @@ -183,6 +186,10 @@ resources/unload_1.png resources/up.png resources/up16.png +resources/view_cascaded.png +resources/view_organized.png +resources/view_tabbed.png +resources/view_tiled.png resources/vr-16x16.png resources/vr.png resources/xmate.png diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index 190c04fb8b..dc2e0ce52c 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -382,14 +382,17 @@ METHOD IdeActions:buildToolBar() METHOD IdeActions:buildMainMenu() LOCAL oMenuBar, oSubMenu, oSubMenu2, n, f LOCAL oIde := ::oIde + // LOCAL cTheme := "QMenuPop" oMenuBar := ::oDlg:MenuBar() - oMenuBar:setStyleSheet( GetStyleSheet( "QMenuBar", ::nAnimantionMode ) ) + //oMenuBar:setStyleSheet( GetStyleSheet( "QMenuBar", ::nAnimantionMode ) ) /*----------------------------------------------------------------------------*/ /* File */ /*----------------------------------------------------------------------------*/ oSubMenu := XbpMenu():new( oMenuBar ):create() + //oSubMenu:oWidget:setStyleSheet( GetStyleSheet( cTheme ) ) + oSubMenu:title := "~File" oSubMenu2 := XbpMenu():new( oSubMenu ):create() @@ -523,36 +526,37 @@ METHOD IdeActions:buildMainMenu() oSubMenu := XbpMenu():new( oMenuBar ):create() oSubMenu:title := "~View" oMenuBar:addItem( { oSubMenu, NIL } ) + //oSubMenu:oWidget:setStyleSheet( GetStyleSheet( cTheme ) ) - oSubMenu:addItem( { "Toggle Animation", {|| oIde:execAction( "Animate" ) } } ) + oSubMenu:addItem( { "Toggle Animation", {|| oIde:execAction( "Animate" ) } } ) oSubMenu:oWidget:addSeparator() - oSubMenu:oWidget:addAction_4( ::oIde:oMainToolbar:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::qTBarPanels:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::qTBarLines:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::qTBarDocks:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oIde:oMainToolbar:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::qTBarPanels:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::qTBarLines:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::qTBarDocks:toggleViewAction() ) oSubMenu:addItem( { "Toggle Statusbar", {|| oIde:execAction( "ToggleStatusBar" ) } } ) oSubMenu:oWidget:addSeparator() - oSubMenu:oWidget:addAction_4( ::oDockPT:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oDockED:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oSkltnsTreeDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oDockPT:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oDockED:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oSkltnsTreeDock:oWidget:toggleViewAction() ) oSubMenu:oWidget:addSeparator() - oSubMenu:oWidget:addAction_4( ::oHelpDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oDocViewDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oDocWriteDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oFuncDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oFunctionsDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oPropertiesDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oEnvironDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oSkeltnDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oThemesDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oFindDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oSourceThumbnailDock:oWidget:toggleViewAction() ) - oSubMenu:oWidget:addAction_4( ::oQScintillaDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oHelpDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oDocViewDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oDocWriteDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oFuncDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oFunctionsDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oPropertiesDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oEnvironDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oSkeltnDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oThemesDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oFindDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oSourceThumbnailDock:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oQScintillaDock:oWidget:toggleViewAction() ) oSubMenu:oWidget:addSeparator() - oSubMenu:oWidget:addAction_4( ::oDockB2:oWidget:toggleViewAction() ) - * oSubMenu:oWidget:addAction_4( ::oDockB1:oWidget:toggleViewAction() ) - * oSubMenu:oWidget:addAction_4( ::oDockB:oWidget:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::oDockB2:oWidget:toggleViewAction() ) + * oSubMenu:oWidget:addAction_4( ::oDockB1:oWidget:toggleViewAction() ) + * oSubMenu:oWidget:addAction_4( ::oDockB:oWidget:toggleViewAction() ) /*----------------------------------------------------------------------------*/ /* Project */ diff --git a/harbour/contrib/hbide/idebrowse.prg b/harbour/contrib/hbide/idebrowse.prg index cb1fbae5ae..551ac2f529 100644 --- a/harbour/contrib/hbide/idebrowse.prg +++ b/harbour/contrib/hbide/idebrowse.prg @@ -75,6 +75,26 @@ #define BRW_TYPE_DBF 1 #define BRW_TYPE_ARRAY 2 +/*------------------------------------------------------------------------*/ + +#define TBL_PANEL 1 +#define TBL_NAME 2 +#define TBL_ALIAS 3 +#define TBL_DRIVER 4 +#define TBL_INDEX 5 +#define TBL_RECORD 6 +#define TBL_CURSOR 7 +#define TBL_GEOMETRY 8 +#define TBL_NEXT 9 + +#define TBL_VRBLS 9 + +#define SUB_ID 1 +#define SUB_WINDOW 2 +#define SUB_GEOMETRY 3 +#define SUB_BROWSER 4 +#define SUB_NIL 5 + /*----------------------------------------------------------------------*/ CLASS IdeBrowseManager INHERIT IdeObject @@ -92,21 +112,28 @@ CLASS IdeBrowseManager INHERIT IdeObject DATA oCurBrw DATA oCurPanel + DATA qPanelsMenu + DATA qPanelsButton + DATA aPanelsAct INIT {} + METHOD new( oIde ) METHOD create( oIde ) METHOD show() METHOD destroy() METHOD buildToolbar() - METHOD execEvent( cEvent, p ) - METHOD addTable( cFileDBF, cAlias ) + METHOD execEvent( cEvent, p, p1 ) + METHOD addTable( cFileDBF, cAlias, aInfo ) METHOD addArray( aData, aAttr ) METHOD getPanelNames() METHOD getPanelsInfo() METHOD addPanels() METHOD addPanel( cPanel ) - METHOD showPanel( cPanel ) + METHOD setPanel( cPanel ) METHOD isPanel( cPanel ) METHOD loadTables() + METHOD buildPanelsButton() + METHOD addPanelsMenu( cPanel ) + METHOD setStyleSheet( nMode ) ENDCLASS @@ -119,22 +146,51 @@ METHOD IdeBrowseManager:new( oIde ) /*----------------------------------------------------------------------*/ METHOD IdeBrowseManager:getPanelNames() - LOCAL aNames := {} - aeval( ::aPanels, {|e| aadd( aNames, e:cPanel ) } ) + LOCAL oPanel, aNames := {}, aAttr + + FOR EACH oPanel IN ::aPanels + aAttr := {} + + aadd( aAttr, oPanel:cPanel ) + aadd( aAttr, hb_ntos( oPanel:viewMode() ) ) + aadd( aAttr, hb_ntos( oPanel:nViewStyle ) ) + + aadd( aNames, hbide_array2String( aAttr, "," ) ) + NEXT RETURN aNames /*----------------------------------------------------------------------*/ METHOD IdeBrowseManager:getPanelsInfo() - LOCAL oBrw, oPanel - LOCAL aInfo := {} + LOCAL oBrw, oPanel, aSub + LOCAL aInfo := {}, aAttr FOR EACH oPanel IN ::aPanels - FOR EACH oBrw IN oPanel:aItems + FOR EACH aSub IN oPanel:subWindows() + aAttr := array( TBL_VRBLS ) + aAttr[ TBL_PANEL ] := oPanel:cPanel + + oBrw := aSub[ 4 ] + IF oBrw:nType == BRW_TYPE_DBF - aadd( aInfo, oPanel:cPanel + "," + oBrw:cTable + "," + oBrw:cAlias + "," + oBrw:cDriver + "," + ; - hb_ntos( oBrw:nOrder ) + "," + hb_ntos( oBrw:recNo() ) + hb_ntos( oBrw:nCursorType ) ) + aAttr[ TBL_NAME ] := oBrw:cTable + aAttr[ TBL_ALIAS ] := oBrw:cAlias + aAttr[ TBL_DRIVER ] := oBrw:cDriver + aAttr[ TBL_INDEX ] := hb_ntos( oBrw:indexOrd() ) + aAttr[ TBL_RECORD ] := hb_ntos( oBrw:recNo() ) + aAttr[ TBL_CURSOR ] := hb_ntos( oBrw:nCursorType ) + IF !hb_isObject( aSub[ 3 ] ) + aSub[ 3 ] := QRect():from( aSub[ 2 ]:geometry() ) + ENDIF + aAttr[ TBL_GEOMETRY ] := hb_ntos( aSub[ 3 ]:x() ) + " " + hb_ntos( aSub[ 3 ]:y() ) + " " + ; + hb_ntos( aSub[ 3 ]:width() ) + " " + hb_ntos( aSub[ 3 ]:height() ) + aAttr[ TBL_NEXT ] := "" + + ELSEIF oBrw:nType == BRW_TYPE_ARRAY + // ENDIF + + aadd( aInfo, hbide_array2String( aAttr, "," ) ) NEXT NEXT @@ -142,19 +198,16 @@ METHOD IdeBrowseManager:getPanelsInfo() /*----------------------------------------------------------------------*/ +METHOD IdeBrowseManager:setStyleSheet( nMode ) + + ::qToolbar:setStyleSheet( GetStyleSheet( "QToolBar", nMode ) ) + ::qPanelsMenu:setStyleSheet( GetStyleSheet( "QMenuPop", nMode ) ) + + RETURN Self + +/*------------------------------------------------------------------------*/ + METHOD IdeBrowseManager:destroy() - LOCAL oPanel, oBrw - - FOR EACH oPanel IN ::aPanels - FOR EACH oBrw IN oPanel:aItems - oBrw:destroy() - oBrw := NIL - NEXT - oPanel:aItems := NIL - oPanel := NIL - NEXT - ::aPanels := NIL - RETURN Self /*----------------------------------------------------------------------*/ @@ -197,6 +250,9 @@ METHOD IdeBrowseManager:create( oIde ) /* Spread tables onto panels */ ::loadTables() + /* Switch to the default panel */ + ::setPanel( "Main" ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -208,45 +264,58 @@ METHOD IdeBrowseManager:buildToolbar() ::qToolbar:setIconSize( QSize():new( 16,16 ) ) ::qToolbar:setStyleSheet( GetStyleSheet( "QToolBar", ::nAnimantionMode ) ) - aadd( ::aButtons, { "Open a table" , "open" , "clicked()", {|| ::execEvent( "buttonOpen_clicked" ) }, .f. } ) - aadd( ::aButtons, { "Close current table", "close" , "clicked()", {|| ::execEvent( "buttonClose_clicked" ) }, .f. } ) - aadd( ::aButtons, { "Show/hide form view", "fullscreen" , "clicked()", {|| ::execEvent( "buttonShowForm_clicked" ) }, .t. } ) + aadd( ::aButtons, { "Open a table" , "dc_plus" , "clicked()", {|| ::execEvent( "buttonOpen_clicked" ) }, .f. } ) + aadd( ::aButtons, {} ) + aadd( ::aButtons, { "Show/hide form view", "formview" , "clicked()", {|| ::execEvent( "buttonShowForm_clicked" ) }, .t. } ) + aadd( ::aButtons, {} ) + aadd( ::aButtons, { "Toggle View" , "view_tabbed" , "clicked()", {|| ::execEvent( "buttonViewTabbed_clicked" ) }, .f. } ) + aadd( ::aButtons, {} ) + aadd( ::aButtons, { "View as arranged" , "view_organized", "clicked()", {|| ::execEvent( "buttonViewOrganized_clicked" ) }, .f. } ) + aadd( ::aButtons, { "View as cascaded" , "view_cascaded" , "clicked()", {|| ::execEvent( "buttonViewCascaded_clicked" ) }, .f. } ) + aadd( ::aButtons, { "View as tiled" , "view_tiled" , "clicked()", {|| ::execEvent( "buttonViewTiled_clicked" ) }, .f. } ) + aadd( ::aButtons, {} ) + aadd( ::aButtons, { "Close current table", "dc_delete" , "clicked()", {|| ::execEvent( "buttonClose_clicked" ) }, .f. } ) + aadd( ::aButtons, {} ) FOR EACH aBtn IN ::aButtons - qBtn := QToolButton():new() - qBtn:setTooltip( aBtn[ 1 ] ) - qBtn:setAutoRaise( .t. ) - qBtn:setIcon( hbide_image( aBtn[ 2 ] ) ) - IF aBtn[ 5 ] - qBtn:setCheckable( .t. ) + IF empty( aBtn ) + ::qToolbar:addSeparator() + ELSE + qBtn := QToolButton():new() + qBtn:setTooltip( aBtn[ 1 ] ) + qBtn:setAutoRaise( .t. ) + qBtn:setIcon( hbide_image( aBtn[ 2 ] ) ) + IF aBtn[ 5 ] + qBtn:setCheckable( .t. ) + ENDIF + ::connect( qBtn, aBtn[ 3 ], aBtn[ 4 ] ) + ::qToolBar:addWidget( qBtn ) + aadd( ::aToolBtns, qBtn ) ENDIF - - ::connect( qBtn, aBtn[ 3 ], aBtn[ 4 ] ) - - ::qToolBar:addWidget( qBtn ) - - aadd( ::aToolBtns, qBtn ) NEXT + ::buildPanelsButton() + RETURN Self /*----------------------------------------------------------------------*/ METHOD IdeBrowseManager:addPanels() - LOCAL cPanel, aPanel + LOCAL cPanel, aPnl - ::addPanel( "Main" ) /* The default one */ + ::addPanel( "Main", .t. ) /* The default one */ - FOR EACH cPanel IN ::oINI:aDbuPanelsInfo - aPanel := hb_aTokens( cPanel ) - IF aPanel[ 1 ] != "Main" - ::addPanel( aPanel[ 1 ] ) + FOR EACH cPanel IN ::oINI:aDbuPanelNames + aPnl := hb_aTokens( cPanel, "," ) + aSize( aPnl, 2 ) + IF empty( aPnl[ 2 ] ) + aPnl[ 2 ] := "NO" + ENDIF + IF aPnl[ 1 ] != "Main" + ::addPanel( aPnl[ 1 ], aPnl[ 2 ] == "YES" ) ENDIF NEXT - ::qStack:setCurrentWidget( ::aPanels[ 1 ] ) /* Always start with main */ - ::oCurPanel := ::aPanels[ 1 ] - RETURN Self /*----------------------------------------------------------------------*/ @@ -260,6 +329,19 @@ METHOD IdeBrowseManager:addPanel( cPanel ) aadd( ::aPanels, qPanel ) + ::addPanelsMenu( cPanel ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeBrowseManager:addPanelsMenu( cPanel ) + LOCAL qAct + + ( qAct := QAction():from( ::qPanelsMenu:addAction( cPanel ) ) ):setIcon( hbide_image( "panel_7" ) ) + ::connect( qAct, "triggered(bool)", {|| ::setPanel( cPanel ) } ) + aadd( ::aPanelsAct, qAct ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -269,22 +351,38 @@ METHOD IdeBrowseManager:isPanel( cPanel ) /*----------------------------------------------------------------------*/ -METHOD IdeBrowseManager:showPanel( cPanel ) +METHOD IdeBrowseManager:setPanel( cPanel ) LOCAL n IF ( n := ascan( ::aPanels, {|o| o:qWidget:objectName() == cPanel } ) ) > 0 - ::qStack:setCurrentWidget( ::aPanels[ n ] ) + ::qStack:setCurrentWidget( ::aPanels[ n ]:qWidget ) ::oCurPanel := ::aPanels[ n ] + + ::oCurPanel:prepare() + + #if 0 + ::oCurPanel:nViewStyle := 0 + + ::oCurPanel:saveGeometry() + ::oCurPanel:tileSubWindows() + ::oCurPanel:nViewStyle := 1 + ::oCurPanel:prepare() + + ::oCurPanel:nViewStyle := 0 + ::oCurPanel:restGeometry() + ::oCurPanel:prepare() + #endif ENDIF RETURN Self /*----------------------------------------------------------------------*/ -METHOD IdeBrowseManager:execEvent( cEvent, p ) - LOCAL cTable, cPath, n, oBrw +METHOD IdeBrowseManager:execEvent( cEvent, p, p1 ) + LOCAL cTable, cPath, cPanel HB_SYMBOL_UNUSED( p ) + HB_SYMBOL_UNUSED( p1 ) SWITCH cEvent CASE "buttonShowForm_clicked" @@ -299,15 +397,13 @@ METHOD IdeBrowseManager:execEvent( cEvent, p ) ENDIF EXIT + CASE "buttonCloseX_clicked" + ::oCurPanel:destroyByX( p ) + EXIT + CASE "buttonClose_clicked" IF !empty( ::oCurBrw ) - IF ( n := ascan( ::oCurPanel:aItems, {|o| o == ::oCurBrw } ) ) > 0 - hb_adel( ::oCurPanel:aItems, n, .t. ) - ::oCurBrw:destroy() - FOR EACH oBrw IN ::oCurPanel:aItems - oBrw:oBrw:configure() - NEXT - ENDIF + ::oCurPanel:destroy( ::oCurBrw ) ENDIF EXIT @@ -319,8 +415,60 @@ METHOD IdeBrowseManager:execEvent( cEvent, p ) ENDIF EXIT + CASE "qPanelsButton_clicked" + cPanel := hbide_fetchAString( ::qToolbar, "New...", "Name the Panel", "New Panel" ) + IF cPanel != "New..." .AND. cPanel != "Main" + IF ::isPanel( cPanel ) + MsgBox( "Panel: " + cPanel + ", already exists" ) + ELSE + ::addPanel( cPanel ) + ::setPanel( cPanel ) + ENDIF + ENDIF + EXIT + + CASE "mdiSubWindow_aboutToActivate" +// ::oCurPanel:prepare( p ) + EXIT + + CASE "mdiSubWindow_windowStateChanged" +//HB_TRACE( HB_TR_ALWAYS, "mdiSubWindow_windowStateChanged", p, p1 ) + EXIT + + CASE "buttonViewOrganized_clicked" + ::oCurPanel:nViewStyle := 0 + ::oCurPanel:restGeometry() + ::oCurPanel:prepare() + EXIT + + CASE "buttonViewTiled_clicked" + ::oCurPanel:saveGeometry() + ::oCurPanel:tileSubWindows() + ::oCurPanel:nViewStyle := 1 + ::oCurPanel:prepare() + EXIT + + CASE "buttonViewCascaded_clicked" + ::oCurPanel:saveGeometry() + ::oCurPanel:cascadeSubWindows() + ::oCurPanel:nViewStyle := 2 + ::oCurPanel:prepare() + EXIT + + CASE "buttonViewTabbed_clicked" + ::oCurPanel:setViewMode( iif( ::oCurPanel:viewMode() == QMdiArea_TabbedView, QMdiArea_SubWindowView, QMdiArea_TabbedView ) ) + EXIT + ENDSWITCH + #if 0 + activateNextSubWindow() + activatePreviousSubWindow() + closeActiveSubWindow() + closeAllSubWindows() + setActiveSubWindow( QMdiSubWindow ) + #endif + RETURN Self /*----------------------------------------------------------------------*/ @@ -334,20 +482,19 @@ METHOD IdeBrowseManager:loadTables() aPanel := hb_aTokens( cInfo, "," ) IF ::isPanel( aPanel[ 1 ] ) IF hb_fileExists( cTable := hbide_pathToOSPath( aPanel[ 2 ] ) ) - ::showPanel( aPanel[ 1 ] ) - ::addTable( cTable ) + ::setPanel( aPanel[ 1 ] ) + ::addTable( cTable, , aPanel ) ENDIF ENDIF NEXT ::qStack:setCurrentWidget( oCurPanel ) - RETURN Self /*----------------------------------------------------------------------*/ -METHOD IdeBrowseManager:addTable( cFileDBF, cAlias ) - LOCAL oBrw +METHOD IdeBrowseManager:addTable( cFileDBF, cAlias, aInfo ) + LOCAL oBrw, qSubWindow oBrw := IdeBrowse():new() oBrw:cTable := cFileDBF @@ -356,9 +503,14 @@ METHOD IdeBrowseManager:addTable( cFileDBF, cAlias ) oBrw:create() - ::oCurPanel:addBrowser( oBrw ) + qSubWindow := ::oCurPanel:addBrowser( oBrw, aInfo ) - aadd( ::oCurPanel:aItems, oBrw ) + ::connect( qSubWindow, "aboutToActivate()", {|| ::execEvent( "mdiSubWindow_aboutToActivate", qSubWindow ) } ) + ::connect( qSubWindow, "windowStateChanged(Qt::WindowStates,Qt::WindowStates)", ; + {|p,p1| ::execEvent( "mdiSubWindow_windowStateChanged", p, p1, qSubWindow ) } ) + + qSubWindow:installEventFilter( ::pEvents ) + ::connect( qSubWindow, QEvent_Close, {|| ::execEvent( "buttonCloseX_clicked", qSubWindow ) } ) RETURN Self @@ -371,6 +523,25 @@ METHOD IdeBrowseManager:addArray( aData, aAttr ) RETURN Self +/*----------------------------------------------------------------------*/ + +METHOD IdeBrowseManager:buildPanelsButton() + + ::qPanelsMenu := QMenu():new() + ::qPanelsMenu:setStyleSheet( GetStyleSheet( "QMenuPop", ::nAnimantionMode ) ) + + ::qPanelsButton := QToolButton():new() + ::qPanelsButton:setTooltip( "ideDBU Panels" ) + ::qPanelsButton:setIcon( hbide_image( "panel_8" ) ) + ::qPanelsButton:setPopupMode( QToolButton_MenuButtonPopup ) + ::qPanelsButton:setMenu( ::qPanelsMenu ) + + ::connect( ::qPanelsButton, "clicked()", {|| ::execEvent( "qPanelsButton_clicked" ) } ) + + ::qToolbar:addWidget( ::qPanelsButton ) + + RETURN Self + /*----------------------------------------------------------------------*/ // // Class IdeBrowsePanel @@ -379,16 +550,37 @@ METHOD IdeBrowseManager:addArray( aData, aAttr ) CLASS IdeBrowsePanel INHERIT IdeObject - DATA cPanel INIT "" - DATA qWidget - DATA qLayout - DATA qVSplitter + DATA qMenuWindows - DATA aItems INIT {} + DATA cPanel INIT "" + DATA nViewStyle INIT 0 /* 0=asWindows 1=tabbed */ + DATA lLayoutLocked INIT .f. + + DATA aSubWindows INIT {} + ACCESS subWindows() INLINE ::aSubWindows METHOD new( oIde, cPanel ) - METHOD addBrowser( oBrw ) + METHOD destroy( oBrw ) + METHOD destroyByX( qSubWindow ) + + METHOD addBrowser( oBrw, aInfo ) + METHOD prepare() + METHOD saveGeometry() + METHOD restGeometry() + + METHOD viewMode() INLINE ::qWidget:viewMode() + METHOD setViewMode( nMode ) INLINE ::qWidget:setViewMode( nMode ) + METHOD tileSubWindows() INLINE ::qWidget:tileSubWindows() + METHOD cascadeSubWindows() INLINE ::qWidget:cascadeSubWindows() + METHOD activateNextSubWindow() INLINE ::qWidget:activateNextSubWindow() + METHOD activatePreviousSubWindow() INLINE ::qWidget:activatePreviousSubWindow() + + #if 0 + closeActiveSubWindow() + closeAllSubWindows() + setActiveSubWindow( QMdiSubWindow ) + #endif ENDCLASS @@ -399,28 +591,118 @@ METHOD IdeBrowsePanel:new( oIde, cPanel ) ::oIde := oIde ::cPanel := cPanel - ::qWidget := QWidget():new() + ::qWidget := QMdiArea():new() ::qWidget:setObjectName( ::cPanel ) - - ::qLayout := QHBoxLayout():new() - ::qLayout:setContentsMargins( 0,0,0,0 ) - ::qLayout:setSpacing( 2 ) - - ::qVSplitter := QSplitter():new() - ::qVSplitter:setOrientation( Qt_Vertical ) - - ::qLayout:addWidget( ::qVSplitter ) - - ::qWidget:setLayout( ::qLayout ) + ::qWidget:setDocumentMode( .t. ) + ::qWidget:setOption( QMdiArea_DontMaximizeSubWindowOnActivation, .t. ) RETURN Self /*----------------------------------------------------------------------*/ -METHOD IdeBrowsePanel:addBrowser( oBrw ) +METHOD IdeBrowsePanel:destroy( oBrw ) + LOCAL n, oSub - ::qVSplitter:addWidget( oBrw:oWnd:oWidget ) + IF ( n := ascan( ::aSubWindows, {|e_| e_[ 4 ] == oBrw } ) ) > 0 + oSub := ::aSubWindows[ n, 2 ] + ::qWidget:removeSubWindow( oSub ) + oBrw:destroy() + oSub := NIL + + hb_adel( ::aSubWindows, n, .t. ) + ENDIF + + RETURN Self + +/*------------------------------------------------------------------------*/ + +METHOD IdeBrowsePanel:destroyByX( qSubWindow ) + LOCAL n, oSub + + IF ( n := ascan( ::aSubWindows, {|e_| e_[ 2 ] == qSubWindow } ) ) > 0 + oSub := ::aSubWindows[ n, 2 ] + + ::qWidget:removeSubWindow( oSub ) + ::aSubWindows[ n, 4 ]:destroy() + oSub := NIL + + hb_adel( ::aSubWindows, n, .t. ) + ENDIF + + RETURN Self + +/*------------------------------------------------------------------------*/ + +METHOD IdeBrowsePanel:prepare() + LOCAL aSub + + FOR EACH aSub IN ::aSubWindows + aSub[ SUB_BROWSER ]:configure() + NEXT + + RETURN Self + +/*------------------------------------------------------------------------*/ + +METHOD IdeBrowsePanel:addBrowser( oBrw, aInfo ) + LOCAL qSubWindow, qRect, cR + + STATIC nID := 0 + + nID++ /* Unique for current run */ + + qSubWindow := QMdiSubWindow():new( ::oDlg:oWidget ) + + qSubWindow:setWidget( oBrw:oWnd:oWidget ) + qSubWindow:setWindowTitle( oBrw:cTable ) + qSubWindow:setObjectName( hb_ntos( nID ) ) + + IF !empty( aInfo ) .AND. !empty( aInfo[ TBL_GEOMETRY ] ) + qRect := hb_aTokens( aInfo[ TBL_GEOMETRY ], " " ) + FOR EACH cR IN qRect + cR := val( cR ) + NEXT + qRect := QRect():new( qRect[ 1 ], qRect[ 2 ], qRect[ 3 ], qRect[ 4 ] ) + qSubWindow:setGeometry( qRect ) + ELSE + //qSubWindow:resize( 300, 200 ) + ENDIF + + ::qWidget:addSubWindow( qSubWindow ) + + oBrw:oWnd:oWidget:show() + qSubWindow:show() + + aadd( ::aSubWindows, { nId, qSubWindow, qRect, oBrw, NIL } ) + + RETURN qSubWindow + +/*------------------------------------------------------------------------*/ + +METHOD IdeBrowsePanel:saveGeometry() + LOCAL aSubWindow + + IF ::nViewStyle == 0 /* Only if in self organized mode */ + FOR EACH aSubWindow IN ::aSubWindows + aSubWindow[ 3 ] := QRect():from( aSubWindow[ 2 ]:geometry() ) + NEXT + ENDIF + + RETURN Self + +/*------------------------------------------------------------------------*/ + +METHOD IdeBrowsePanel:restGeometry() + LOCAL aSubWindow + + IF ::nViewStyle == 0 + FOR EACH aSubWindow IN ::aSubWindows + IF hb_isObject( aSubWindow[ 3 ] ) + aSubWindow[ 2 ]:setGeometry( aSubWindow[ 3 ] ) + ENDIF + NEXT + ENDIF RETURN Self /*----------------------------------------------------------------------*/ @@ -454,8 +736,14 @@ CLASS IdeBrowse INHERIT IdeObject DATA nCursorType INIT XBPBRW_CURSOR_CELL DATA lOpened INIT .f. + DATA qVerSpl + DATA qClose + + ACCESS indexOrd() INLINE ::nOrder + METHOD new( oIde ) METHOD create( oIde ) + METHOD configure() METHOD destroy() METHOD execEvent( cEvent, p, p1 ) METHOD buildBrowser() @@ -471,9 +759,9 @@ CLASS IdeBrowse INHERIT IdeObject METHOD lastRec() METHOD next() METHOD previous() - METHOD activated() METHOD buildForm() METHOD populateForm() + METHOD fetchAlias( cTable ) ENDCLASS @@ -487,8 +775,20 @@ METHOD IdeBrowse:new( oIde ) /*----------------------------------------------------------------------*/ +METHOD IdeBrowse:fetchAlias( cTable ) + LOCAL cFile + + STATIC n := 0 + n++ + + hb_fNameSplit( cTable, , @cFile ) + + RETURN upper( "C" + cFile + hb_ntos( n ) ) + +/*------------------------------------------------------------------------*/ + METHOD IdeBrowse:create( oIde ) - LOCAL xVrb, cT + LOCAL xVrb, cT, cAlias LOCAL lMissing := .t. DEFAULT oIde TO ::oIde @@ -498,6 +798,12 @@ METHOD IdeBrowse:create( oIde ) ::nType := BRW_TYPE_ARRAY ENDIF + #if 0 + IF empty( ::cAlias ) + ::cAlias := ::fetchAlias( ::cTable ) + ENDIF + #endif + IF ::nType == BRW_TYPE_DBF IF !empty( ::cAlias ) .AND. empty( ::cTable ) IF select( ::cAlias ) > 0 @@ -509,7 +815,8 @@ METHOD IdeBrowse:create( oIde ) IF empty( ::cAlias ) USE ( ::cTable ) SHARED NEW VIA ( ::cDriver ) ELSE - USE ( ::cTable ) SHARED NEW ALIAS ( ::cAlias ) VIA ( ::cDriver ) + cAlias := ::cAlias + USE ( ::cTable ) ALIAS ( cAlias ) SHARED NEW VIA ( ::cDriver ) ENDIF IF NetErr() MsgBox( ::cTable, "Could not been opened!" ) @@ -570,6 +877,25 @@ METHOD IdeBrowse:destroy() /*----------------------------------------------------------------------*/ +METHOD IdeBrowse:configure() + LOCAL nRowPos := ::oBrw:rowPos() + LOCAL nColPos := ::oBrw:colPos() + + ::oBrw:configure() + + IF nRowPos > ::oBrw:rowCount() + ::oBrw:rowPos := ::oBrw:rowCount() + ENDIF + ::oBrw:colPos := nColPos + + ::oBrw:refreshAll() + ::oBrw:forceStable() + ::oBrw:setCurrentIndex( .f. ) + + RETURN Self + +/*------------------------------------------------------------------------*/ + METHOD IdeBrowse:buildBrowser() LOCAL qLayout, oWnd, oXbpBrowse @@ -605,14 +931,12 @@ METHOD IdeBrowse:buildBrowser() oXbpBrowse:goPosBlock := {|n| ::goto( n ) } oXbpBrowse:phyPosBlock := {| | ::recNo() } - oXbpBrowse:setInputFocus := {|| ::activated() } - /* Form View */ ::qForm := QWidget():new() ::qFLayout := QFormLayout():new() ::qForm:setLayout( ::qFLayout ) - ::qSplitter:addWidget( ::qForm ) + //::qSplitter:addWidget( ::qForm ) ::qForm:hide() /* Form view defaults to hidden */ @@ -620,6 +944,17 @@ METHOD IdeBrowse:buildBrowser() ::oWnd := oWnd ::oBrw := oXbpBrowse + ::qVerSpl := QSplitter():new( Qt_Vertical ) + ::qSplitter:addWidget( ::qVerSpl ) + + ::qVerSpl:addWidget( ::qForm ) + + ::qClose := QToolButton():new() + ::qClose:setIcon( hbide_image( "closetab" ) ) + ::qClose:hide() + + ::qVerSpl:addWidget( ::qClose ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -642,15 +977,6 @@ METHOD IdeBrowse:execEvent( cEvent, p, p1 ) /*----------------------------------------------------------------------*/ -METHOD IdeBrowse:activated() - -HB_TRACE( HB_TR_ALWAYS, "ACTIVATED" ) - ::oQScintillaDock:oWidget:setWindowTitle( ::cTable ) - - RETURN Self - -/*----------------------------------------------------------------------*/ - STATIC FUNCTION hbide_xtosForForm( xVrb ) LOCAL cType := valtype( xVrb ) @@ -858,14 +1184,14 @@ METHOD IdeBrowse:goTo( nRec ) /*----------------------------------------------------------------------*/ METHOD IdeBrowse:next() - LOCAL nSaveRecNum := recno() + LOCAL nSaveRecNum := ( ::cAlias )->( recno() ) LOCAL lMoved := .T. IF ( ::cAlias )->( Eof() ) lMoved := .F. ELSE ( ::cAlias )->( DBSkip( 1 ) ) - IF Eof() + IF ( ::cAlias )->( Eof() ) lMoved := .F. ( ::cAlias )->( DBGoTo( nSaveRecNum ) ) ENDIF @@ -876,12 +1202,12 @@ METHOD IdeBrowse:next() /*----------------------------------------------------------------------*/ METHOD IdeBrowse:previous() - LOCAL nSaveRecNum := Recno() + LOCAL nSaveRecNum := ( ::cAlias )->( recno() ) LOCAL lMoved := .T. ( ::cAlias )->( DBSkip( -1 ) ) - IF Bof() + IF ( ::cAlias )->( Bof() ) ( ::cAlias )->( DBGoTo( nSaveRecNum ) ) lMoved := .F. ENDIF @@ -889,3 +1215,4 @@ METHOD IdeBrowse:previous() RETURN lMoved /*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index 4ea9bdf3e2..d1233fea82 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -696,22 +696,24 @@ METHOD IdeDocks:buildToolBarPanels() ::qTBarDocks:setAllowedAreas( Qt_LeftToolBarArea + Qt_RightToolBarArea + Qt_TopToolBarArea + Qt_BottomToolBarArea ) aBtns := {} - aadd( aBtns, { ::oDockPT , "projtree" } ) - aadd( aBtns, { ::oDockED , "editstree" } ) - aadd( aBtns, { ::oSkltnsTreeDock, "projtree" } ) + aadd( aBtns, { ::oDockPT , "projtree" } ) + aadd( aBtns, { ::oDockED , "editstree" } ) + aadd( aBtns, { ::oSkltnsTreeDock , "projtree" } ) aadd( aBtns, {} ) - aadd( aBtns, { ::oHelpDock , "help" } ) - aadd( aBtns, { ::oDocViewDock , "harbourhelp" } ) - aadd( aBtns, { ::oDocWriteDock , "docwriter" } ) - aadd( aBtns, { ::oFuncDock , "dc_function" } ) - aadd( aBtns, { ::oFunctionsDock , "ffn" } ) - aadd( aBtns, { ::oPropertiesDock, "properties" } ) - aadd( aBtns, { ::oEnvironDock , "envconfig" } ) - aadd( aBtns, { ::oSkeltnDock , "codeskeletons" } ) - aadd( aBtns, { ::oThemesDock , "syntaxhiliter" } ) - aadd( aBtns, { ::oFindDock , "search" } ) + aadd( aBtns, { ::oHelpDock , "help" } ) + aadd( aBtns, { ::oDocViewDock , "harbourhelp" } ) + aadd( aBtns, { ::oDocWriteDock , "docwriter" } ) + aadd( aBtns, { ::oFuncDock , "dc_function" } ) + aadd( aBtns, { ::oFunctionsDock , "ffn" } ) + aadd( aBtns, { ::oPropertiesDock , "properties" } ) + aadd( aBtns, { ::oEnvironDock , "envconfig" } ) + aadd( aBtns, { ::oSkeltnDock , "codeskeletons" } ) + aadd( aBtns, { ::oThemesDock , "syntaxhiliter" } ) + aadd( aBtns, { ::oFindDock , "search" } ) + aadd( aBtns, { ::oSourceThumbnailDock, "thumbnail" } ) + aadd( aBtns, { ::oQScintillaDock , "browser" } ) aadd( aBtns, {} ) - aadd( aBtns, { ::oDockB2 , "builderror" } ) + aadd( aBtns, { ::oDockB2 , "builderror" } ) FOR EACH a_ IN aBtns IF empty( a_ ) @@ -1227,7 +1229,7 @@ METHOD IdeDocks:getMarkWidget( nIndex ) /*----------------------------------------------------------------------*/ METHOD IdeDocks:animateComponents( nMode ) - LOCAL cStyle + LOCAL cStyle, oView IF nMode == NIL ::oIde:nAnimantionMode := iif( ::nAnimantionMode == HBIDE_ANIMATION_NONE, HBIDE_ANIMATION_GRADIENT, HBIDE_ANIMATION_NONE ) @@ -1236,38 +1238,53 @@ METHOD IdeDocks:animateComponents( nMode ) ::oIde:nAnimantionMode := nMode ::oIde:oINI:cIdeAnimated := hb_ntos( ::nAnimantionMode ) - ::oDlg:menubar():setStyleSheet( GetStyleSheet( "QMenuBar", nMode ) ) + /* Main Window */ + ::oDlg:setStyleSheet( GetStyleSheet( "QMainWindow", ::nAnimantionMode ) ) - ::qTBarPanels:setStyleSheet( GetStyleSheet( "QToolBarLR5", nMode ) ) - ::qTBarLines:setStyleSheet( GetStyleSheet( "QToolBarLR5", nMode ) ) - ::qTBarDocks:setStyleSheet( GetStyleSheet( "QToolBarLR5", nMode ) ) + /* Main Menu Bar with all its submenus */ + ::oDlg:menubar():setStyleSheet( GetStyleSheet( "QMenuBar", nMode ), GetStyleSheet( "QMenuPop", nMode ) ) - ::oMainToolbar:setStyleSheet( GetStyleSheet( "QToolBar", nMode ) ) + /* Toolbars */ + ::oMainToolbar:setStyleSheet( GetStyleSheet( "QToolBar" , nMode ) ) + ::qTBarPanels :setStyleSheet( GetStyleSheet( "QToolBarLR5", nMode ) ) + ::qTBarLines :setStyleSheet( GetStyleSheet( "QToolBarLR5", nMode ) ) + ::qTBarDocks :setStyleSheet( GetStyleSheet( "QToolBarLR5", nMode ) ) + + /* User defined toolbars */ + ::oTM:setStyleSheet( GetStyleSheet( "QToolBarLR5", nMode ) ) + + ::oEM:setStyleSheet( nMode ) + ::oBM:setStyleSheet( nMode ) + + /* Statusbar */ ::oSBar:oWidget:setStyleSheet( GetStyleSheet( "QStatusBar", nMode ) ) + /* Docking Widgets */ cStyle := GetStyleSheet( "QDockWidget", nMode ) + // + ::oDockPT:oWidget : setStyleSheet( cStyle ) + ::oDockED:oWidget : setStyleSheet( cStyle ) + ::oSkltnsTreeDock:oWidget : setStyleSheet( cStyle ) + ::oHelpDock:oWidget : setStyleSheet( cStyle ) + ::oDocViewDock:oWidget : setStyleSheet( cStyle ) + ::oDocWriteDock:oWidget : setStyleSheet( cStyle ) + ::oFuncDock:oWidget : setStyleSheet( cStyle ) + ::oFunctionsDock:oWidget : setStyleSheet( cStyle ) + ::oPropertiesDock:oWidget : setStyleSheet( cStyle ) + ::oEnvironDock:oWidget : setStyleSheet( cStyle ) + ::oSkeltnDock:oWidget : setStyleSheet( cStyle ) + ::oThemesDock:oWidget : setStyleSheet( cStyle ) + ::oFindDock:oWidget : setStyleSheet( cStyle ) + ::oDockB2:oWidget : setStyleSheet( cStyle ) + ::oQScintillaDock:oWidget : setStyleSheet( cStyle ) + ::oSourceThumbnailDock:oWidget : setStyleSheet( cStyle ) - ::oDockPT:oWidget :setStyleSheet( cStyle ) - ::oDockED:oWidget :setStyleSheet( cStyle ) - ::oSkltnsTreeDock:oWidget:setStyleSheet( cStyle ) - ::oHelpDock:oWidget :setStyleSheet( cStyle ) - ::oDocViewDock:oWidget :setStyleSheet( cStyle ) - ::oDocWriteDock:oWidget :setStyleSheet( cStyle ) - ::oFuncDock:oWidget :setStyleSheet( cStyle ) - ::oFunctionsDock:oWidget :setStyleSheet( cStyle ) - ::oPropertiesDock:oWidget:setStyleSheet( cStyle ) - ::oEnvironDock:oWidget :setStyleSheet( cStyle ) - ::oSkeltnDock:oWidget :setStyleSheet( cStyle ) - ::oThemesDock:oWidget :setStyleSheet( cStyle ) - ::oFindDock:oWidget :setStyleSheet( cStyle ) - ::oDockB2:oWidget :setStyleSheet( cStyle ) - ::oQScintillaDock:oWidget:setStyleSheet( cStyle ) - ::oSourceThumbnailDock:oWidget:setStyleSheet( cStyle ) + ::oProjTree:setStyleSheet( GetStyleSheet( "QTreeWidgetHB", ::nAnimantionMode ) ) - #if 1 - // should be iteration - ::qTabWidget:setStyleSheet( GetStyleSheet( "QTabWidget", nMode ) ) - #endif + /* Edior Tab Widget */ + FOR EACH oView IN ::aViews + oView:oTabWidget:oWidget:setStyleSheet( GetStyleSheet( "QTabWidget", nMode ) ) + NEXT RETURN Self diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index 5fb33dfedc..196002e645 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -87,6 +87,7 @@ CLASS IdeEditsManager INHERIT IdeObject DATA qContextMenu + DATA qContextSub DATA aActions INIT {} METHOD new( oIde ) @@ -173,6 +174,7 @@ CLASS IdeEditsManager INHERIT IdeObject METHOD changeThumbnail() METHOD spaces2tabs() METHOD qscintilla() + METHOD setStyleSheet( nMode ) ENDCLASS @@ -186,8 +188,16 @@ METHOD IdeEditsManager:new( oIde ) /*----------------------------------------------------------------------*/ +METHOD IdeEditsManager:setStyleSheet( nMode ) + + ::qContextMenu:setStyleSheet( GetStyleSheet( "QMenuPop", nMode ) ) + ::qContextSub:setStyleSheet( GetStyleSheet( "QMenuPop", nMode ) ) + + RETURN Self + +/*------------------------------------------------------------------------*/ + METHOD IdeEditsManager:create( oIde ) - LOCAL oSub DEFAULT oIde TO ::oIde @@ -213,12 +223,12 @@ METHOD IdeEditsManager:create( oIde ) aadd( ::aActions, { "Apply Theme" , ::qContextMenu:addAction( "Apply Theme" ) } ) aadd( ::aActions, { "Save as Skltn", ::qContextMenu:addAction( "Save as Skeleton..." ) } ) - oSub := QMenu():configure( ::qContextMenu:addMenu_1( "Split" ) ) + ::qContextSub := QMenu():configure( ::qContextMenu:addMenu_1( "Split" ) ) // - aadd( ::aActions, { "Split H" , oSub:addAction( "Split Horizontally" ) } ) - aadd( ::aActions, { "Split V" , oSub:addAction( "Split Vertically" ) } ) - aadd( ::aActions, { "" , oSub:addSeparator() } ) - aadd( ::aActions, { "Close Split" , oSub:addAction( "Close Split Window" ) } ) + aadd( ::aActions, { "Split H" , ::qContextSub:addAction( "Split Horizontally" ) } ) + aadd( ::aActions, { "Split V" , ::qContextSub:addAction( "Split Vertically" ) } ) + aadd( ::aActions, { "" , ::qContextSub:addSeparator() } ) + aadd( ::aActions, { "Close Split" , ::qContextSub:addAction( "Close Split Window" ) } ) ::oIde:qProtoList := QStringList():new() ::oIde:qCompModel := QStringListModel():new() @@ -1233,7 +1243,7 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme, cView, a /* Populate right at creation */ ::oEM:addSourceInTree( ::sourceFile, ::cView ) - ::qTabWidget:setStyleSheet( GetStyleSheet( "QTabWidget", ::nAnimantionMode ) ) + //::qTabWidget:setStyleSheet( GetStyleSheet( "QTabWidget", ::nAnimantionMode ) ) IF ::lReadOnly ::oEdit:setReadOnly( .t. ) ::qEdit:setTextInteractionFlags( Qt_TextSelectableByMouse + Qt_TextSelectableByKeyboard ) diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index dd2307e186..276dd3d31a 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -113,6 +113,7 @@ FUNCTION hbide_execPopup( aPops, aqPos, qParent ) LOCAL i, qPop, qPoint, qAct, cAct, xRet, pAct, a_, qSub, b_ qPop := QMenu():new( iif( hb_isObject( qParent ), qParent, NIL ) ) + qPop:setStyleSheet( GetStyleSheet( "QMenuPop", hbide_setIde():nAnimantionMode ) ) FOR i := 1 TO len( aPops ) IF empty( aPops[ i,1 ] ) @@ -122,6 +123,7 @@ FUNCTION hbide_execPopup( aPops, aqPos, qParent ) qPop:addAction_4( aPops[ i, 1 ] ) ELSEIF hb_isArray( aPops[ i, 1 ] ) /* Sub-menu */ qSub := QMenu():new( qPop ) + qSub:setStyleSheet( GetStyleSheet( "QMenuPop", hbide_setIde():nAnimantionMode ) ) FOR EACH a_ IN aPops[ i, 1 ] qSub:addAction( a_[ 1 ] ) NEXT diff --git a/harbour/contrib/hbide/ideskeletons.prg b/harbour/contrib/hbide/ideskeletons.prg index 662f5e7eec..7e41ff74d6 100644 --- a/harbour/contrib/hbide/ideskeletons.prg +++ b/harbour/contrib/hbide/ideskeletons.prg @@ -499,7 +499,6 @@ METHOD IdeSkeletons:showTree() ::oTree:hasButtons := .T. ::oTree:create( ::oSkltnsTreeDock, , { 0,0 }, { 10,10 }, , .t. ) - ::oTree:setStyleSheet( GetStyleSheet( "QTreeWidgetHB", ::nAnimantionMode ) ) ::oTree:oWidget:setMinimumWidth( 100 ) ::oTree:oWidget:setSizePolicy_1( QSizePolicy_MinimumExpanding, QSizePolicy_Preferred ) ::oTree:oWidget:setIconSize( QSize():new( 12,12 ) ) @@ -517,6 +516,8 @@ METHOD IdeSkeletons:showTree() ::oSkltnsTreeDock:oWidget:setWidget( ::oTree:oWidget ) ENDIF + ::oTree:setStyleSheet( GetStyleSheet( "QTreeWidgetHB", ::nAnimantionMode ) ) + RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/idestylesheets.prg b/harbour/contrib/hbide/idestylesheets.prg index e14e44972a..44f13c9db5 100644 --- a/harbour/contrib/hbide/idestylesheets.prg +++ b/harbour/contrib/hbide/idestylesheets.prg @@ -81,6 +81,17 @@ FUNCTION GetStyleSheet( cWidget, nMode ) DO CASE + CASE cWidget == "QMenuPop" + IF nMode == HBIDE_ANIMATION_GRADIENT + aadd( txt_, 'QMenu { ' ) + aadd( txt_, hbide_ideThemeColorCSS( "MenuPop", 1 ) ) + aadd( txt_, '} ' ) + ELSE + aadd( txt_, 'QMenu { ' ) + aadd( txt_, hbide_cssColorString( "bg-std" ) ) + aadd( txt_, '} ' ) + ENDIF + CASE cWidget == "QMenu" aadd( txt_, ' QMenu { ' ) @@ -486,6 +497,9 @@ STATIC FUNCTION hbide_ideThemeColorCSS( cPart, nTheme ) cPart := lower( cPart ) DO CASE + CASE cPart == "menupop" + cCSS := ' background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, ' + ; + hbide_buildGradientString( hbide_loadIdeTheme( nTheme ) ) + "); " CASE cPart == "menubartop" cCSS := ' background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, ' + ; hbide_buildGradientString( hbide_loadIdeTheme( nTheme ) ) + "); " diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index bf53b2ec45..5992fdfede 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -551,21 +551,21 @@ METHOD IdeThemes:show() ::oThemesDock:oWidget:setWidget( ::oUI ) ::oUI:signal( "listThemes" , "currentRowChanged(int)" , {|i| ::execEvent( listThemes_currentRowChanged, i ) } ) - ::oUI:signal( "listItems" , "currentRowChanged(int)" , {|i| ::execEvent( listItems_currentRowChanged, i ) } ) + ::oUI:signal( "listItems" , "currentRowChanged(int)" , {|i| ::execEvent( listItems_currentRowChanged, i ) } ) - ::oUI:signal( "buttonColor" , "clicked()" , {|| ::updateColor() } ) - ::oUI:signal( "buttonSave" , "clicked()" , {|| ::save( .f. ) } ) - ::oUI:signal( "buttonSaveAs" , "clicked()" , {|| ::save( .t. ) } ) - ::oUI:signal( "buttonCopy" , "clicked()" , {|| ::copy( .t. ) } ) - ::oUI:signal( "buttonApply" , "clicked()" , {|| ::execEvent( applyMenu_triggered_applyToCurrentTab ) } ) - ::oUI:signal( "buttonApplyAll", "clicked()" , {|| ::execEvent( applyMenu_triggered_applyToAllTabs ) } ) - ::oUI:signal( "buttonDefault" , "clicked()" , {|| ::execEvent( applyMenu_triggered_setAsDefault ) } ) + ::oUI:signal( "buttonColor" , "clicked()" , {| | ::updateColor() } ) + ::oUI:signal( "buttonSave" , "clicked()" , {| | ::save( .f. ) } ) + ::oUI:signal( "buttonSaveAs" , "clicked()" , {| | ::save( .t. ) } ) + ::oUI:signal( "buttonCopy" , "clicked()" , {| | ::copy( .t. ) } ) + ::oUI:signal( "buttonApply" , "clicked()" , {| | ::execEvent( applyMenu_triggered_applyToCurrentTab ) } ) + ::oUI:signal( "buttonApplyAll", "clicked()" , {| | ::execEvent( applyMenu_triggered_applyToAllTabs ) } ) + ::oUI:signal( "buttonDefault" , "clicked()" , {| | ::execEvent( applyMenu_triggered_setAsDefault ) } ) ::oUI:signal( "checkItalic" , "stateChanged(int)" , {|i| ::updateAttribute( THM_ATR_ITALIC, i ) } ) ::oUI:signal( "checkBold" , "stateChanged(int)" , {|i| ::updateAttribute( THM_ATR_BOLD , i ) } ) ::oUI:signal( "checkUnderline", "stateChanged(int)" , {|i| ::updateAttribute( THM_ATR_ULINE , i ) } ) - ::oUI:signal( "buttonClose" , "clicked()" , {|| ::oThemesDock:hide() } ) + ::oUI:signal( "buttonClose" , "clicked()" , {| | ::oThemesDock:hide() } ) /* Fill Themes Dialog Values */ ::oUI:setWindowTitle( GetKeyValue( ::aControls, "dialogTitle" ) ) @@ -584,7 +584,7 @@ METHOD IdeThemes:show() ::oUI:qObj[ "buttonCopy" ]:setText( GetKeyValue( ::aControls, "buttonCopy" , "Copy" ) ) aeval( ::aThemes, {|e_| ::oUI:q_listThemes:addItem( e_[ 1 ] ) } ) - aeval( ::aItems , {|e_| ::oUI:q_listItems:addItem( e_[ 2 ] ) } ) + aeval( ::aItems , {|e_| ::oUI:q_listItems:addItem( e_[ 2 ] ) } ) ::qEdit := ::oUI:q_plainThemeText ::qEdit:setPlainText( GetSource() ) diff --git a/harbour/contrib/hbide/idetools.prg b/harbour/contrib/hbide/idetools.prg index 7b089f4f77..f99c6e37d6 100644 --- a/harbour/contrib/hbide/idetools.prg +++ b/harbour/contrib/hbide/idetools.prg @@ -111,6 +111,7 @@ CLASS IdeToolsManager INHERIT IdeObject METHOD populateButtonsTable( nIndex ) METHOD buildUserToolbars() METHOD populatePlugins( lClear ) + METHOD setStyleSheet( cCSS ) ENDCLASS @@ -124,6 +125,21 @@ METHOD IdeToolsManager:new( oIde ) /*----------------------------------------------------------------------*/ +METHOD IdeToolsManager:setStyleSheet( cCSS ) + LOCAL oToolbar + + FOR EACH oToolbar IN ::aToolbars + IF !empty( oToolbar ) + oToolbar:setStyleSheet( cCSS ) + ENDIF + NEXT + ::qToolsMenu:setStyleSheet( GetStyleSheet( "QMenuPop", ::nAnimantionMode ) ) + ::qPanelsMenu:setStyleSheet( GetStyleSheet( "QMenuPop", ::nAnimantionMode ) ) + + RETURN Self + +/*------------------------------------------------------------------------*/ + METHOD IdeToolsManager:create( oIde ) LOCAL oAct @@ -634,6 +650,7 @@ METHOD IdeToolsManager:buildToolsButton() LOCAL a_, qAct ::qToolsMenu := QMenu():new() + ::qToolsMenu:setStyleSheet( GetStyleSheet( "QMenuPop", ::nAnimantionMode ) ) FOR EACH a_ IN ::aTools qAct := ::qToolsMenu:addAction( a_[ 1 ] ) ::connect( qAct, "triggered(bool)", {|| ::execTool( a_[ 1 ] ) } ) @@ -655,6 +672,7 @@ METHOD IdeToolsManager:buildPanelsButton() LOCAL cView ::qPanelsMenu := QMenu():new() + ::qPanelsMenu:setStyleSheet( GetStyleSheet( "QMenuPop", ::nAnimantionMode ) ) ::addPanelsMenu( "Main" ) FOR EACH cView IN ::oINI:aViews ::addPanelsMenu( cView ) diff --git a/harbour/contrib/hbide/resources/browser.png b/harbour/contrib/hbide/resources/browser.png new file mode 100644 index 0000000000000000000000000000000000000000..4a9a6db12ade76b33d6ab427a70376f66e73404c GIT binary patch literal 114 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`mYyz-Ar-fhb22i1oOfVMV3E9V zA;5pyv$i%jElG!s;;&u{>Sg5Qq&Pf#EY#c?e7qr0zo#nkz+MK1FVdQ&MBb@04rW4Pyhe` literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/formview.png b/harbour/contrib/hbide/resources/formview.png new file mode 100644 index 0000000000000000000000000000000000000000..cda2d6a4f4c77c97ebf925798bb8424e26540636 GIT binary patch literal 592 zcmV-W0k7R5*>L z)4^^MK^({N?+m*XlynzFD<(!$PTq(o9-uV6ZM?&!(Y^rEhtS1vs8?Q~eSq3D^=2At zXiV^;U}9?u2T2ghuCU!54>VH5#5DYpIsQJA{O3PHDaAaIbF~3sS=QpBVeCXB(FfNl zI*!xscDqloENg9V|3F<$5Cs1{d;4$I%IaD{0~n1)v|4RSrRRX4TrOjn29-*MPxboL z%?hwz+W7tjDo~mRFdUB1be+=XCjI_7182a^Sd2ox!0Go>K#Z#j6pDf4`~fup&-3W@ zdTej+0E+eXr?~DfcHiuB^6dmEB|?fZpcKzGHW1b$4n8qmf4u#; z!vqjOBpl{zqk*P{Sk0}V>pIP5llosn1juAEL?V$1pz9$_(;%NOU@XSColF9d%jL*s zvopZb(j6AU`UH?N#D(Yas{Demu3_6YsZ@$;wMwm4n*nUwM$@MNi5WN9+Ir26=mJuX zH@sLZ((m_Y04XK%@)DaB0TUvXWx-T8TbER<3#KYA?8tuMcubJ!u=OZFT@bsZIZG1O@dithk?quM-65v1VlZa&$o`HAWlM(GWx4etR?5gI-ODO#rNehmiwRHZW?%0v`JSq1p@qTu1~IP}d)!e|mieY*B~9 zq?dE&psWS}*%CrPSin=U-*=dX@!#JXs+TcfMz9qL?+93~I|te+rtHd}g&p6ma1$5; zRub<4I1%n$ou?7H!0M7ZJf2067 aX8i(Xas(jWEgvNS0000l^nh zR;!3gsenQuM+qrGfnku(&muRIN9^Nhd^{R%0x*gNMH;r5xE<}g2_&k#OoMPFf-7eo z`)GUPAAoUFBX6v0kh%}*3{yYS@O!ViXnUXP6V>EjKu6~Re((M+u^AkC2bN=@Rw|(s z;>hK60?1`^cpZEt#(5bSNJZZducPBB5n#31_+!T{BH+TcJ|rg7l5VP3Rw6L)41V9u zEwl}Z0EffDpRn7(a~!OmOZYPJ{m(Sd3*Wqw$rfR3DWzu)XPyotrJ!dTg;P+;WFVBt<+8{olOVYnguR#Jq5}cIFf2x5W6g#rqJZ9>i^3zJmP**NHTU}a?d@%CNTkwq8wr+bG(`cY zPo2cv4cy#!>vqs=He(`@M1^)4wB=<*0dBW@9zff=(;R7TF=?kW85};?g%y<*MFB3C z3k&~&awt?PaZ$= Z{RVq;BW8-t~*9|Jyl#*5c){paN1z^Y)% zqzMekX&DUo?7;$?8CDynFxv002ovPDHLkV1k0Jtd#%& literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/view_tabbed.png b/harbour/contrib/hbide/resources/view_tabbed.png new file mode 100644 index 0000000000000000000000000000000000000000..684b33d5fa68d45c102f0b97542bb2d6a036f51a GIT binary patch literal 344 zcmV-e0jK_nP)|HJ)6 zfE)urdKra{ZQi>l6bp#(a}(`+$=6R9F0%_U>|WIOfzjR5>-`b47y)86bNu?ru>HbD z1{dRC2FtU{KQIOa1iXLcn~uc*hz}SUA#6rQMlc&fGchnRF*5M4ne>4%C@A=SM{hsT zEkECb@>Vj%{sS+j;L142SVsARzE)#Mov8X5u##8sSsNsa-{)#cAY=`2n` qNx74Qlaq%O%|E_>|MKA8-Esi13~KWs@C9xF0000BW8-t~*9|Jyl#*5c){paN1z^Y)% zqzMekX&DUowkDeBqKg~Mh9n?|8fe77?Qvk`@eVR_BCo68lm{)8S$or4GS4u z60%3r!9b@224Fg1AUhpgzIdKdKtO;2UpfE)Ts7j4DwU$}00000NkvXXu0mjfUA}|| literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbqt/hbqt.ch b/harbour/contrib/hbqt/hbqt.ch index 6b4ddc122b..413702e85b 100644 --- a/harbour/contrib/hbqt/hbqt.ch +++ b/harbour/contrib/hbqt/hbqt.ch @@ -2228,6 +2228,19 @@ #define QSystemTrayIcon_Trigger 3 // The system tray entry was clicked #define QSystemTrayIcon_MiddleClick 4 // The system tray entry was clicked with the middle mouse button +/* QMdiArea */ +#define QMdiArea_SubWindowView 0 +#define QMdiArea_TabbedView 1 + +#define QMdiArea_CreationOrder 0 +#define QMdiArea_StackingOrder 1 +#define QMdiArea_ActivationHistoryOrder 2 + +#define QMdiArea_DontMaximizeSubWindowOnActivation 1 + +#define QMdiSubWindow_RubberBandResize 0x04 +#define QMdiSubWindow_RubberBandMove 0x08 + /*----------------------------------------------------------------------*/ #define _HBQT_CH diff --git a/harbour/contrib/hbqt/hbqt_hbslots.cpp b/harbour/contrib/hbqt/hbqt_hbslots.cpp index 286a5b65ae..516c9edd46 100644 --- a/harbour/contrib/hbqt/hbqt_hbslots.cpp +++ b/harbour/contrib/hbqt/hbqt_hbslots.cpp @@ -234,6 +234,11 @@ static bool connect_signal( QString signal, QObject * object, HBSlots * t_slots if( signal == ( QString ) "toggled(bool)" ) return object->connect( object, SIGNAL( toggled( bool ) ), t_slots, SLOT( toggled( bool ) ), Qt::AutoConnection ); /* QSystemTrayIcon */ if( signal == ( QString ) "activated(QSystemTrayIcon::ActivationReason)" ) return object->connect( object, SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ), t_slots, SLOT( activated( QSystemTrayIcon::ActivationReason ) ), Qt::AutoConnection ); + /* QMdiArea */ + if( signal == ( QString ) "subWindowActivated(QMdiSubWindow)" ) return object->connect( object, SIGNAL( subWindowActivated( QMdiSubWindow * ) ), t_slots, SLOT( subWindowActivated( QMdiSubWindow * ) ), Qt::AutoConnection ); + /* QMdiSubWindow */ + if( signal == ( QString ) "aboutToActivate()" ) return object->connect( object, SIGNAL( aboutToActivate() ), t_slots, SLOT( aboutToActivate() ), Qt::AutoConnection ); + if( signal == ( QString ) "windowStateChanged(Qt::WindowStates,Qt::WindowStates)" ) return object->connect( object, SIGNAL( windowStateChanged( Qt::WindowStates, Qt::WindowStates ) ), t_slots, SLOT( windowStateChanged( Qt::WindowStates, Qt::WindowStates ) ), Qt::AutoConnection ); /* New */ return false; } @@ -405,6 +410,11 @@ static bool disconnect_signal( QObject * object, const char * signal ) if( signal == ( QString ) "toggled(bool)" ) return object->disconnect( SIGNAL( toggled( bool ) ) ); /* QSystemTrayIcon */ if( signal == ( QString ) "activated(QSystemTrayIcon::ActivationReason)" ) return object->disconnect( SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ) ); + /* QMdiArea */ + if( signal == ( QString ) "subWindowActivated(QMdiSubWindow)" ) return object->disconnect( SIGNAL( subWindowActivated( QMdiSubWindow * ) ) ); + /* QMdiSubWindow */ + if( signal == ( QString ) "aboutToActivate()" ) return object->disconnect( SIGNAL( aboutToActivate() ) ); + if( signal == ( QString ) "windowStateChanged(Qt::WindowStates,Qt::WindowStates)" ) return object->disconnect( SIGNAL( windowStateChanged( Qt::WindowStates, Qt::WindowStates ) ) ); /* new */ return false; @@ -1030,6 +1040,11 @@ void HBSlots::highlighted( const QModelIndex & index ) void HBSlots::toggled( bool checked ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "toggled(bool)", checked ); } /* QSystemTrayIcon */ void HBSlots::activated( QSystemTrayIcon::ActivationReason reason ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "activated(QSystemTrayIcon::ActivationReason)", reason ); } +/* QMdiArea */ +void HBSlots::subWindowActivated( QMdiSubWindow * window ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "subWindowActivated(QMdiSubWindow)", window ); } +/* QMdiSubWindow */ +void HBSlots::aboutToActivate() { hbqt_SlotsExec( this, qobject_cast( sender() ), "aboutToActivate()" ); } +void HBSlots::windowStateChanged( Qt::WindowStates oldState, Qt::WindowStates newState ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "windowStateChanged(Qt::WindowStates,Qt::WindowStates)", oldState, newState ); } /* Latest */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/hbqt_hbslots.h b/harbour/contrib/hbqt/hbqt_hbslots.h index d1d7e77191..e2bba664e3 100644 --- a/harbour/contrib/hbqt/hbqt_hbslots.h +++ b/harbour/contrib/hbqt/hbqt_hbslots.h @@ -67,6 +67,7 @@ #include #include #include +#include /*----------------------------------------------------------------------*/ @@ -284,6 +285,11 @@ public slots: void toggled( bool checked ); /* QSystemTrayIcon */ void activated( QSystemTrayIcon::ActivationReason reason ); + /* QMdiArea */ + void subWindowActivated( QMdiSubWindow * window ); + /* QMdiSubWindow */ + void aboutToActivate(); + void windowStateChanged( Qt::WindowStates oldState, Qt::WindowStates newState ); /* Latest */ }; diff --git a/harbour/contrib/hbxbp/xbpbrowse.prg b/harbour/contrib/hbxbp/xbpbrowse.prg index 55f8fc0f4a..5c0cd62a7d 100644 --- a/harbour/contrib/hbxbp/xbpbrowse.prg +++ b/harbour/contrib/hbxbp/xbpbrowse.prg @@ -365,7 +365,6 @@ PROTECTED: DATA lFirst INIT .t. DATA nRowsInView INIT 1 - METHOD setCurrentIndex( lReset ) METHOD setHorzOffset() METHOD setVertScrollBarRange( lPageStep ) METHOD setHorzScrollBarRange( lPageStep ) @@ -435,7 +434,12 @@ EXPORTED: DATA nLeftFrozen INIT 0 DATA nRightFrozen INIT 0 + DATA gridStyle INIT Qt_SolidLine + METHOD destroy() + DATA nCellHeight INIT 20 + METHOD setCellHeight( nCellHeight ) + METHOD setCurrentIndex( lReset ) ENDCLASS @@ -469,7 +473,7 @@ METHOD XbpBrowse:buildLeftFreeze() ::oLeftView:setVerticalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) ::oLeftView:setTabKeyNavigation( .t. ) ::oLeftView:setShowGrid( .t. ) - ::oLeftView:setGridStyle( Qt_DotLine ) /* to be based on column definition */ + ::oLeftView:setGridStyle( ::gridStyle ) /* to be based on column definition */ ::oLeftView:setSelectionMode( QAbstractItemView_SingleSelection ) ::oLeftView:setSelectionBehavior( IF( ::cursorMode == XBPBRW_CURSOR_ROW, QAbstractItemView_SelectRows, QAbstractItemView_SelectItems ) ) // @@ -519,7 +523,7 @@ METHOD XbpBrowse:buildRightFreeze() ::oRightView:setVerticalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) ::oRightView:setTabKeyNavigation( .t. ) ::oRightView:setShowGrid( .t. ) - ::oRightView:setGridStyle( Qt_DotLine ) /* to be based on column definition */ + ::oRightView:setGridStyle( ::gridStyle ) /* to be based on column definition */ ::oRightView:setSelectionMode( QAbstractItemView_SingleSelection ) ::oRightView:setSelectionBehavior( IF( ::cursorMode == XBPBRW_CURSOR_ROW, QAbstractItemView_SelectRows, QAbstractItemView_SelectItems ) ) // @@ -572,7 +576,7 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) /* Some parameters */ ::oTableView:setTabKeyNavigation( .t. ) ::oTableView:setShowGrid( .t. ) - ::oTableView:setGridStyle( Qt_DotLine ) /* to be based on column definition */ + ::oTableView:setGridStyle( ::gridStyle ) /* to be based on column definition */ ::oTableView:setSelectionMode( QAbstractItemView_SingleSelection ) ::oTableView:setSelectionBehavior( IF( ::cursorMode == XBPBRW_CURSOR_ROW, QAbstractItemView_SelectRows, QAbstractItemView_SelectItems ) ) @@ -747,10 +751,11 @@ METHOD XbpBrowse:destroy() /*----------------------------------------------------------------------*/ METHOD XbpBrowse:execSlot( nEvent, p1, p2, p3 ) - LOCAL oWheelEvent, oMouseEvent, i, nCol, nColPos, oPoint + LOCAL oWheelEvent, oMouseEvent, oPoint // i, nCol, nColPos HB_SYMBOL_UNUSED( p2 ) -//HB_TRACE( HB_TR_DEBUG, " XbpBrowse:execSlot:", nEvent, 0, memory( 1001 ) ) + // HB_TRACE( HB_TR_DEBUG, " XbpBrowse:execSlot:", nEvent, 0, memory( 1001 ) ) + DO CASE CASE nEvent == 1 /* Keypress Event */ SetAppEvent( xbeP_Keyboard, XbpQKeyEventToAppEvent( p1 ), NIL, self ) @@ -787,15 +792,15 @@ METHOD XbpBrowse:execSlot( nEvent, p1, p2, p3 ) oWheelEvent := QWheelEvent():configure( p1 ) IF oWheelEvent:orientation() == Qt_Vertical IF oWheelEvent:delta() > 0 - ::up() + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_Skip, -1, Self ) ELSE - ::down() + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_Skip, 1, Self ) ENDIF ELSE IF oWheelEvent:delta() > 0 - ::right() + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_SkipCols, 1, Self ) ELSE - ::left() + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_SkipCols, -1, Self ) ENDIF ENDIF @@ -809,27 +814,27 @@ METHOD XbpBrowse:execSlot( nEvent, p1, p2, p3 ) CASE QAbstractSlider_SliderNoAction RETURN NIL CASE QAbstractSlider_SliderSingleStepAdd - ::down() + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_Skip, 1, Self ) ::updateVertScrollBar() EXIT CASE QAbstractSlider_SliderSingleStepSub - ::up() + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_Skip, -1, Self ) ::updateVertScrollBar() EXIT CASE QAbstractSlider_SliderPageStepAdd - ::pageDown() + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_NextPage, 1, Self ) ::updateVertScrollBar() EXIT CASE QAbstractSlider_SliderPageStepSub - ::pageUp() + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_PrevPage, 1, Self ) ::updateVertScrollBar() EXIT CASE QAbstractSlider_SliderToMinimum - ::goTop() + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_GoTop, 1, Self ) ::updateVertScrollBar() EXIT CASE QAbstractSlider_SliderToMaximum - ::goBottom() + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_GoBottom, 1, Self ) ::updateVertScrollBar() EXIT CASE QAbstractSlider_SliderMove @@ -843,31 +848,11 @@ METHOD XbpBrowse:execSlot( nEvent, p1, p2, p3 ) ::oTableView:setFocus() CASE nEvent == 103 /* Horizontal Scrollbar: Slider moved */ - nCol := ::oHScrollBar:value()+1 - nColPos := ::colPos - IF nCol < nColPos - FOR i := 1 TO ( nColPos - nCol ) - ::left() - NEXT - ELSEIF nCol > nColPos - FOR i := 1 TO ( nCol - nColPos ) - ::right() - NEXT - ENDIF + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_SkipCols, ( ::oHScrollBar:value() + 1 ) - ::colPos, Self ) ::oTableView:setFocus() CASE nEvent == 104 /* Horizontal Scrollbar: Slider Released */ - nCol := ::oHScrollBar:value()+1 - nColPos := ::colPos - IF nCol < nColPos - FOR i := 1 TO ( nColPos - nCol ) - ::left() - NEXT - ELSEIF nCol > nColPos - FOR i := 1 TO ( nCol - nColPos ) - ::right() - NEXT - ENDIF + SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_SkipCols, ( ::oHScrollBar:value() + 1 ) - ::colPos, Self ) ::oTableView:setFocus() CASE nEvent == 111 /* Column Header Pressed */ @@ -968,11 +953,17 @@ METHOD handleEvent( nEvent, mp1, mp2 ) CLASS XbpBrowse CASE nEvent == xbeBRW_Navigate DO CASE CASE mp1 == XBPBRW_Navigate_NextLine + ::down() CASE mp1 == XBPBRW_Navigate_PrevLine + ::up() CASE mp1 == XBPBRW_Navigate_NextPage + ::pageDown() CASE mp1 == XBPBRW_Navigate_PrevPage + ::pageUp() CASE mp1 == XBPBRW_Navigate_GoTop + ::goTop() CASE mp1 == XBPBRW_Navigate_GoBottom + ::goBottom() CASE mp1 == XBPBRW_Navigate_Skip IF mp2 < 0 FOR i := 1 TO abs( mp2 ) @@ -984,10 +975,15 @@ METHOD handleEvent( nEvent, mp1, mp2 ) CLASS XbpBrowse NEXT ENDIF CASE mp1 == XBPBRW_Navigate_NextCol + ::right() CASE mp1 == XBPBRW_Navigate_PrevCol + ::left() CASE mp1 == XBPBRW_Navigate_FirstCol + ::firstCol() CASE mp1 == XBPBRW_Navigate_LastCol + ::lastCol() CASE mp1 == XBPBRW_Navigate_GoPos + // CASE mp1 == XBPBRW_Navigate_SkipCols IF mp2 < 0 FOR i := 1 TO abs( mp2 ) @@ -1000,7 +996,9 @@ METHOD handleEvent( nEvent, mp1, mp2 ) CLASS XbpBrowse ENDIF CASE mp1 == XBPBRW_Navigate_GotoItem + // CASE mp1 == XBPBRW_Navigate_GotoRecord + // OTHERWISE lNavgt := .f. ENDCASE @@ -1153,7 +1151,7 @@ METHOD fetchColumnInfo( nInfo, nArea, nRow, nCol ) CLASS XbpBrowse RETURN oCol:dAlignment CASE HBQT_BRW_DATHEIGHT - RETURN oCol:dHeight + RETURN ::nCellHeight //oCol:dHeight CASE HBQT_BRW_CELLDECORATION IF oCol:type == XBPCOL_TYPE_FILEICON @@ -1173,7 +1171,7 @@ METHOD fetchColumnInfo( nInfo, nArea, nRow, nCol ) CLASS XbpBrowse IF nArea == 0 /* Header Area */ SWITCH nInfo CASE HBQT_BRW_COLHEIGHT - RETURN oCol:hHeight + RETURN ::nCellHeight //oCol:hHeight CASE HBQT_BRW_COLHEADER RETURN oCol:heading CASE HBQT_BRW_COLALIGN @@ -1186,7 +1184,7 @@ METHOD fetchColumnInfo( nInfo, nArea, nRow, nCol ) CLASS XbpBrowse ELSE /* Footer Area */ SWITCH nInfo CASE HBQT_BRW_COLHEIGHT - RETURN oCol:fHeight + RETURN ::nCellHeight //oCol:fHeight CASE HBQT_BRW_COLHEADER RETURN oCol:footing CASE HBQT_BRW_COLALIGN @@ -1374,6 +1372,22 @@ METHOD XbpBrowse:setLeftFrozen( aColFrozens ) /*----------------------------------------------------------------------*/ +METHOD setCellHeight( nCellHeight ) CLASS XbpBrowse + LOCAL i + + FOR i := 1 TO ::nRowsInView + ::oTableView : setRowHeight( i-1, nCellHeight ) + IF !empty( ::oLeftView ) + ::oLeftView : setRowHeight( i-1, nCellHeight ) + ENDIF + IF !empty( ::oRightView ) + ::oRightView : setRowHeight( i-1, nCellHeight ) + ENDIF + NEXT + RETURN Self + +/*------------------------------------------------------------------------*/ + METHOD doConfigure() CLASS XbpBrowse LOCAL oCol LOCAL aCol, aVal, aValA @@ -1548,18 +1562,15 @@ METHOD doConfigure() CLASS XbpBrowse nMaxCellH := 0 aeval( ::columns, {|o| nMaxCellH := max( nMaxCellH, o:dHeight ) } ) // - nViewH := ::oViewport:height() + nViewH := ::oViewport:height() //- ::oHeaderView:height() ::nRowsInView := Int( nViewH / nMaxCellH ) IF ( nViewH % nMaxCellH ) > ( nMaxCellH / 2 ) ::nRowsInView++ ENDIF /* Probably this is the appropriate time to update row heights */ - FOR i := 1 TO ::nRowsInView - ::oTableView:setRowHeight( i-1, nMaxCellH ) - ::oLeftView:setRowHeight( i-1, nMaxCellH ) - ::oRightView:setRowHeight( i-1, nMaxCellH ) - NEXT + ::nCellHeight := nMaxCellH + ::setCellHeight( nMaxCellH ) /* Implement Column Resizing Mode */ ::oHeaderView:setResizeMode( IF( ::lSizeCols, QHeaderView_Interactive, QHeaderView_Fixed ) ) @@ -1621,17 +1632,17 @@ METHOD doConfigure() CLASS XbpBrowse ENDIF - IF ::nLeftFrozen == 0 .and. hb_isObject( ::oLeftView ) + IF ::nLeftFrozen == 0 .AND. hb_isObject( ::oLeftView ) ::oLeftView:hide() ::oLeftFooterView:hide() - ELSEIF ::nLeftFrozen > 0 .and. hb_isObject( ::oLeftView ) + ELSEIF ::nLeftFrozen > 0 .AND. hb_isObject( ::oLeftView ) ::oLeftView:show() ::oLeftFooterView:show() ENDIF - IF ::nRightFrozen == 0 .and. hb_isObject( ::oRightView ) + IF ::nRightFrozen == 0 .AND. hb_isObject( ::oRightView ) ::oRightView:hide() ::oRightFooterView:hide() - ELSEIF ::nRightFrozen > 0 .and. hb_isObject( ::oRightView ) + ELSEIF ::nRightFrozen > 0 .AND. hb_isObject( ::oRightView ) ::oRightView:show() ::oRightFooterView:show() ENDIF @@ -1689,9 +1700,10 @@ METHOD doConfigure() CLASS XbpBrowse ::nRowPos := 1 ENDIF - ::setHorzScrollBarRange() + ::setCellHeight( ::nCellHeight ) + /* Inform Qt about number of rows and columns browser implements */ ::oDbfModel:hbSetRowColumns( ::rowCount - 1, ::colCount - 1 ) /* Tell Qt to Reload Everything */