From 9bb591e5e6ca50f4b94d158fdc67bf00395226da Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Wed, 25 Aug 2010 02:05:16 +0000 Subject: [PATCH] 2010-08-24 18:55 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp * contrib/hbide/resources/f-image.png + contrib/hbide/resources/r-page.png + contrib/hbide/resources/r-report.png * contrib/hbide/hbide.qrc * contrib/hbide/idemisc.prg * contrib/hbide/idereportsmanager.prg + Implemented: ideReports Manager: * "Objects" tree now showsup type of object icon. * Rotate selected object clock wise and anti-clock wise. Currently it is 10 deg per click. Later an interface to rotate precisely to be introduced. Rotated objects keep the exact aspect ratio. This is testified on barcode which reads the correct string after 90, 180, 270 and 360 deg rotation. * Atarted API to separate this component from direct calls to hbIDE to gather various info from the application. Right now these are the images which now call app_image() instead of hbide_image(). app_image() function will reside in application so that this class be linked with application independently of hbIDE. --- harbour/ChangeLog | 28 +++ harbour/contrib/hbide/hbide.qrc | 2 + harbour/contrib/hbide/idemisc.prg | 14 +- harbour/contrib/hbide/idereportsmanager.prg | 216 +++++++++++------- harbour/contrib/hbide/resources/f-image.png | Bin 188 -> 438 bytes harbour/contrib/hbide/resources/r-page.png | Bin 0 -> 674 bytes harbour/contrib/hbide/resources/r-report.png | Bin 0 -> 622 bytes .../hbqt/qtgui/hbqt_hbqgraphicsitem.cpp | 7 +- 8 files changed, 180 insertions(+), 87 deletions(-) create mode 100644 harbour/contrib/hbide/resources/r-page.png create mode 100644 harbour/contrib/hbide/resources/r-report.png diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3e0d3d1f10..739406414f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,34 @@ The license applies to all entries newer than 2009-04-28. */ +2010-08-24 18:55 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp + + * contrib/hbide/resources/f-image.png + + contrib/hbide/resources/r-page.png + + contrib/hbide/resources/r-report.png + * contrib/hbide/hbide.qrc + + * contrib/hbide/idemisc.prg + * contrib/hbide/idereportsmanager.prg + + Implemented: ideReports Manager: + * "Objects" tree now showsup type of object icon. + + * Rotate selected object clock wise and anti-clock wise. + Currently it is 10 deg per click. Later an interface + to rotate precisely to be introduced. + + Rotated objects keep the exact aspect ratio. This is + testified on barcode which reads the correct string + after 90, 180, 270 and 360 deg rotation. + + * Atarted API to separate this component from direct calls + to hbIDE to gather various info from the application. + Right now these are the images which now call app_image() + instead of hbide_image(). app_image() function will + reside in application so that this class be linked with + application independently of hbIDE. + 2010-08-24 09:29 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/doc/en/class_hbqgraphicsitem.txt * contrib/hbqt/qtgui/g/HBQGraphicsItem.cpp diff --git a/harbour/contrib/hbide/hbide.qrc b/harbour/contrib/hbide/hbide.qrc index fff5dd012a..2d73224a96 100644 --- a/harbour/contrib/hbide/hbide.qrc +++ b/harbour/contrib/hbide/hbide.qrc @@ -265,6 +265,8 @@ resources/f-strike-1.png resources/toback.png resources/tofront.png +resources/r-page.png +resources/r-report.png diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index fd4be24f07..49aaa1d0ec 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -2119,15 +2119,11 @@ FUNCTION hbide_buildToolbarButton( qToolbar, aBtn ) RETURN qBtn /*----------------------------------------------------------------------*/ +/* An interface component function which will be called by Reports Manager + whenever a request is made. Application will supply the required info + in this case it is hbIDE. */ -FUNCTION hbide_getNextID( cType ) - - STATIC hIDs := {=>} - - IF ! hb_hHasKey( hIDs, cType ) - hIDs[ cType ] := 0 - ENDIF - - RETURN ++hIDs[ cType ] +FUNCTION app_image( cName ) + RETURN hbide_image( cName ) /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/idereportsmanager.prg b/harbour/contrib/hbide/idereportsmanager.prg index b27c2dcb50..13602e4837 100644 --- a/harbour/contrib/hbide/idereportsmanager.prg +++ b/harbour/contrib/hbide/idereportsmanager.prg @@ -154,7 +154,9 @@ CLASS IdeReportsManager INHERIT IdeObject METHOD loadReport( cName ) METHOD saveReport() METHOD prepareReport() - METHOD updateObjectsTree( cType, cParent, cName ) + METHOD getNextID( cType ) + METHOD getImageOfType( cType ) + METHOD updateObjectsTree( cType, cParent, cName, cSubType ) ENDCLASS @@ -293,6 +295,8 @@ METHOD IdeReportsManager:buildDesignReport() ::qPageL01Lay:addWidget( ::qTreeObjects ) ::qTreeObjects:setHeaderHidden( .t. ) ::qTreeObjects:setObjectName( "ObjectsTree" ) + ::qTreeObjects:setIconSize( QSize():new( 12,12 ) ) + ::qTreeObjects:setIndentation( 12 ) ::connect( ::qTreeObjects, "itemClicked(QTWItem)", {|p,p1| ::execEvent( "treeObjects_clicked", p, p1 ) } ) ::qTabL1 := QTabWidget():new() @@ -354,38 +358,6 @@ METHOD IdeReportsManager:buildDesignReport() /*----------------------------------------------------------------------*/ -METHOD IdeReportsManager:updateObjectsTree( cType, cParent, cName ) - LOCAL qParent, qItem - - DO CASE - CASE cType == "ReportName" - qItem := QTreeWidgetItem():new() ; qItem:setText( 0, cName ) - ::qTreeObjects:addTopLevelItem( qItem ) - ::hObjTree[ cName ] := qItem - qItem:setExpanded( .t. ) - - CASE cType == "Page" .OR. cType == "Object" .OR. cType == "Field" - IF hb_hHasKey( ::hObjTree, cParent ) - qParent := ::hObjTree[ cParent ] - ENDIF - IF !empty( qParent ) - IF hb_hHasKey( ::hObjTree, cName ) - // - ENDIF - qItem := QTreeWidgetItem():new() ; qItem:setText( 0, cName ) - qParent:addChild( qItem ) - ::hObjTree[ cName ] := qItem - - qParent:setExpanded( .t. ) - ENDIF - - - ENDCASE - - RETURN Self - -/*----------------------------------------------------------------------*/ - METHOD IdeReportsManager:loadReport( cName ) LOCAL aSource, qItem, qItmC, aFld, a_, i, b_ @@ -484,8 +456,10 @@ METHOD IdeReportsManager:execEvent( cEvent, p, p1, p2 ) DO CASE CASE p == 21101 // Object selected IF hb_hHasKey( ::hObjTree, p1 ) - ::qCurGraphicsItem := ::hObjTree[ p1 ] - ::qTreeObjects:setCurrentItem( ::qCurGraphicsItem ) + ::qCurGraphicsItem := ::hItems[ p1 ] + ::qTreeObjects:setCurrentItem( ::hObjTree[ p1 ] ) + ELSE + ::qCurGraphicsItem := NIL ENDIF ENDCASE @@ -505,6 +479,16 @@ METHOD IdeReportsManager:execEvent( cEvent, p, p1, p2 ) ENDIF EXIT + CASE "buttonRotateL_clicked" + IF !empty( ::qCurGraphicsItem ) + ::qCurGraphicsItem:rotate( -10 ) + ENDIF + EXIT + CASE "buttonRotateR_clicked" + IF !empty( ::qCurGraphicsItem ) + ::qCurGraphicsItem:rotate( 10 ) + ENDIF + EXIT CASE "buttonToBack_clicked" EXIT CASE "buttonToFront_clicked" @@ -543,13 +527,13 @@ METHOD IdeReportsManager:execEvent( cEvent, p, p1, p2 ) METHOD IdeReportsManager:addObject( qPos, cType ) LOCAL oWidget, cName, nW, nH, qGrad, cCode, qStrList, i - cName := cType + "_" + hb_ntos( hbide_getNextID( cType ) ) + cName := cType + "_" + hb_ntos( ::getNextID( cType ) ) SWITCH cType CASE "Image" nW := 300 ; nH := 300 oWidget := HBQGraphicsItem():new( HBQT_GRAPHICSITEM_PICTURE ) - oWidget:setPixmap( QPixmap():new( hbide_image( "hbide" ) ) ) + oWidget:setPixmap( QPixmap():new( app_image( "hbide" ) ) ) oWidget:setBorderWidth( 2 ) EXIT CASE "Chart" @@ -570,7 +554,7 @@ METHOD IdeReportsManager:addObject( qPos, cType ) EXIT CASE "Barcode" nW := 300 ; nH := 200 - cCode := ::fetchBarString( "Harbour" ) + cCode := ::fetchBarString( "51550621" ) qStrList := QStringList():new() FOR i := 1 TO len( cCode ) IF substr( cCode, i, 1 ) == "1" @@ -602,7 +586,7 @@ METHOD IdeReportsManager:addObject( qPos, cType ) oWidget:setPos( qPos ) ENDIF ::hItems[ cName ] := oWidget - ::updateObjectsTree( "Object", "Page_1", cName ) + ::updateObjectsTree( "Object", "Page_1", cName, cType ) RETURN Self @@ -612,7 +596,7 @@ METHOD IdeReportsManager:addField( qPos, cAlias, cField ) LOCAL oWidget, nW := 300, nH := 50 LOCAL cName := cAlias + "..." + cField - cName := cName + "_" + hb_ntos( hbide_getNextID( cName ) ) + cName := cName + "_" + hb_ntos( ::getNextID( cName ) ) oWidget := HBQGraphicsItem():new( HBQT_GRAPHICSITEM_SIMPLETEXT ) oWidget:setText( cName ) @@ -629,7 +613,48 @@ METHOD IdeReportsManager:addField( qPos, cAlias, cField ) ENDIF ::hItems[ cName ] := oWidget - ::updateObjectsTree( "Field", "Page_1", cName ) + ::updateObjectsTree( "Field", "Page_1", cName, NIL ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeReportsManager:updateObjectsTree( cType, cParent, cName, cSubType ) + LOCAL qParent, qItem + + DO CASE + CASE cType == "ReportName" + qItem := QTreeWidgetItem():new() ; qItem:setText( 0, cName ) + qItem:setIcon( 0, app_image( "r-report" ) ) + ::qTreeObjects:addTopLevelItem( qItem ) + ::hObjTree[ cName ] := qItem + qItem:setExpanded( .t. ) + + CASE cType == "Page" .OR. cType == "Object" .OR. cType == "Field" + IF hb_hHasKey( ::hObjTree, cParent ) + qParent := ::hObjTree[ cParent ] + ENDIF + IF !empty( qParent ) + IF hb_hHasKey( ::hObjTree, cName ) + // + ENDIF + qItem := QTreeWidgetItem():new() ; qItem:setText( 0, cName ) + qParent:addChild( qItem ) + ::hObjTree[ cName ] := qItem + + IF cType == "Page" + qItem:setIcon( 0, app_image( "r-page" ) ) + ELSEIF cType == "Object" + qItem:setIcon( 0, ::getImageOfType( cSubType ) ) + ELSEIF cType == "Field" + qItem:setIcon( 0, ::getImageOfType( "Field" ) ) + ENDIF + + qParent:setExpanded( .t. ) + ENDIF + + + ENDCASE RETURN Self @@ -674,14 +699,17 @@ METHOD IdeReportsManager:buildToolbar() ::qToolbar:orientation := Qt_Horizontal ::qToolbar:create( "ReportManager_Top_Toolbar" ) - ::qToolbar:addToolButton( "New" , "New Report" , hbide_image( "new" ), {|| ::execEvent( "buttonNew_clicked" ) } ) - ::qToolbar:addToolButton( "Open" , "Open Report" , hbide_image( "open3" ), {|| ::execEvent( "buttonOpen_clicked" ) } ) - ::qToolbar:addToolButton( "Save" , "Save Report" , hbide_image( "save3" ), {|| ::execEvent( "buttonSave_clicked" ) } ) - ::qToolbar:addToolButton( "Close", "Close Report", hbide_image( "close3" ), {|| ::execEvent( "buttonClose_clicked" ) } ) - ::qToolbar:addToolButton( "Print", "Print Report", hbide_image( "print" ), {|| ::execEvent( "buttonPrint_clicked" ) } ) + ::qToolbar:addToolButton( "New" , "New Report" , app_image( "new" ), {|| ::execEvent( "buttonNew_clicked" ) } ) + ::qToolbar:addToolButton( "Open" , "Open Report" , app_image( "open3" ), {|| ::execEvent( "buttonOpen_clicked" ) } ) + ::qToolbar:addToolButton( "Save" , "Save Report" , app_image( "save3" ), {|| ::execEvent( "buttonSave_clicked" ) } ) + ::qToolbar:addToolButton( "Close" , "Close Report" , app_image( "close3" ), {|| ::execEvent( "buttonClose_clicked" ) } ) + ::qToolbar:addToolButton( "Print" , "Print Report" , app_image( "print" ), {|| ::execEvent( "buttonPrint_clicked" ) } ) ::qToolbar:addSeparator() - ::qToolbar:addToolButton( "ToBack" , "Push to back" , hbide_image( "toback" ), {|| ::execEvent( "buttonToBack_clicked" ) }, .f., .f. ) - ::qToolbar:addToolButton( "ToFront", "Bring to front", hbide_image( "tofront"), {|| ::execEvent( "buttonToFront_clicked" ) }, .f., .f. ) + ::qToolbar:addToolButton( "ToBack" , "Push to back" , app_image( "toback" ), {|| ::execEvent( "buttonToBack_clicked" ) }, .f., .f. ) + ::qToolbar:addToolButton( "ToFront", "Bring to front", app_image( "tofront" ), {|| ::execEvent( "buttonToFront_clicked" ) }, .f., .f. ) + ::qToolbar:addSeparator() + ::qToolbar:addToolButton( "RotateL", "Rotate anti-clock wise", app_image( "unload_1" ), {|| ::execEvent( "buttonRotateL_clicked" ) }, .f., .f. ) + ::qToolbar:addToolButton( "RotateR", "Rotate clock wise" , app_image( "load_1" ), {|| ::execEvent( "buttonRotateR_clicked" ) }, .f., .f. ) ::qToolbar:addSeparator() RETURN Self @@ -694,37 +722,37 @@ METHOD IdeReportsManager:buildToolbarAlign() ::qToolbarAlign:orientation := Qt_Horizontal ::qToolbarAlign:create( "ReportManager_Top_Toolbar_Align" ) - ::qToolbarAlign:addToolButton( "FontG" , "Font" , hbide_image( "f-generic" ), {|| ::execEvent( "button_clicked" ) }, .f., .f. ) + ::qToolbarAlign:addToolButton( "FontG" , "Font" , app_image( "f-generic" ), {|| ::execEvent( "button_clicked" ) }, .f., .f. ) ::qToolbarAlign:addSeparator() - ::qToolbarAlign:addToolButton( "FontB" , "Text Bold" , hbide_image( "f-bold-1" ), {|| ::execEvent( "button_clicked" ) } ) - ::qToolbarAlign:addToolButton( "FontI" , "Text Italic" , hbide_image( "f-italic-1" ), {|| ::execEvent( "button_clicked" ) } ) - ::qToolbarAlign:addToolButton( "FontU" , "Text Underlined" , hbide_image( "f-underline-1" ), {|| ::execEvent( "button_clicked" ) } ) - ::qToolbarAlign:addToolButton( "FontS" , "Text Strikethrough", hbide_image( "f-strike-1" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "FontB" , "Text Bold" , app_image( "f-bold-1" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "FontI" , "Text Italic" , app_image( "f-italic-1" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "FontU" , "Text Underlined" , app_image( "f-underline-1" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "FontS" , "Text Strikethrough", app_image( "f-strike-1" ), {|| ::execEvent( "button_clicked" ) } ) ::qToolbarAlign:addSeparator() - ::qToolbarAlign:addToolButton( "JustL" , "Align left" , hbide_image( "f_align_left" ), {|| ::execEvent( "button_clicked" ) } ) - ::qToolbarAlign:addToolButton( "JustC" , "Align center" , hbide_image( "f_align_center" ), {|| ::execEvent( "button_clicked" ) } ) - ::qToolbarAlign:addToolButton( "JustR" , "Align right" , hbide_image( "f_align_right" ), {|| ::execEvent( "button_clicked" ) } ) - ::qToolbarAlign:addToolButton( "JustJ" , "Align justify" , hbide_image( "f_align_justify" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "JustL" , "Align left" , app_image( "f_align_left" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "JustC" , "Align center" , app_image( "f_align_center" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "JustR" , "Align right" , app_image( "f_align_right" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "JustJ" , "Align justify" , app_image( "f_align_justify" ), {|| ::execEvent( "button_clicked" ) } ) ::qToolbarAlign:addSeparator() - ::qToolbarAlign:addToolButton( "JustT" , "Align top" , hbide_image( "f_align_top" ), {|| ::execEvent( "button_clicked" ) } ) - ::qToolbarAlign:addToolButton( "JustM" , "Align middle" , hbide_image( "f_align_middle" ), {|| ::execEvent( "button_clicked" ) } ) - ::qToolbarAlign:addToolButton( "JustB" , "Align bottom" , hbide_image( "f_align_bottom" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "JustT" , "Align top" , app_image( "f_align_top" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "JustM" , "Align middle" , app_image( "f_align_middle" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "JustB" , "Align bottom" , app_image( "f_align_bottom" ), {|| ::execEvent( "button_clicked" ) } ) ::qToolbarAlign:addSeparator() - ::qToolbarAlign:addToolButton( "BoxT" , "Box-frame top" , hbide_image( "f_box_top" ), {|| ::execEvent( "button_clicked" ) }, .t., .f. ) - ::qToolbarAlign:addToolButton( "BoxL" , "Box-frame left" , hbide_image( "f_box_left" ), {|| ::execEvent( "button_clicked" ) }, .t., .f. ) - ::qToolbarAlign:addToolButton( "BoxB" , "Box-frame bottom" , hbide_image( "f_box_bottom" ), {|| ::execEvent( "button_clicked" ) }, .t., .f. ) - ::qToolbarAlign:addToolButton( "BoxR" , "Box-frame right" , hbide_image( "f_box_right" ), {|| ::execEvent( "button_clicked" ) }, .t., .f. ) + ::qToolbarAlign:addToolButton( "BoxT" , "Box-frame top" , app_image( "f_box_top" ), {|| ::execEvent( "button_clicked" ) }, .t., .f. ) + ::qToolbarAlign:addToolButton( "BoxL" , "Box-frame left" , app_image( "f_box_left" ), {|| ::execEvent( "button_clicked" ) }, .t., .f. ) + ::qToolbarAlign:addToolButton( "BoxB" , "Box-frame bottom" , app_image( "f_box_bottom" ), {|| ::execEvent( "button_clicked" ) }, .t., .f. ) + ::qToolbarAlign:addToolButton( "BoxR" , "Box-frame right" , app_image( "f_box_right" ), {|| ::execEvent( "button_clicked" ) }, .t., .f. ) ::qToolbarAlign:addSeparator() - ::qToolbarAlign:addToolButton( "BoxA" , "Box-frame all" , hbide_image( "f_box_all" ), {|| ::execEvent( "button_clicked" ) } ) - ::qToolbarAlign:addToolButton( "BoxP" , "No box-frame" , hbide_image( "f_box_plain" ), {|| ::execEvent( "button_clicked" ) } ) - ::qToolbarAlign:addToolButton( "BoxS" , "Box shadowed" , hbide_image( "f_box_shadow" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "BoxA" , "Box-frame all" , app_image( "f_box_all" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "BoxP" , "No box-frame" , app_image( "f_box_plain" ), {|| ::execEvent( "button_clicked" ) } ) + ::qToolbarAlign:addToolButton( "BoxS" , "Box shadowed" , app_image( "f_box_shadow" ), {|| ::execEvent( "button_clicked" ) } ) ::qToolbarAlign:addSeparator() - ::qToolbarAlign:addToolButton( "ZoomIn" , "Zoom In" , hbide_image( "zoomin3" ), {|| ::execEvent( "buttonZoom_clicked", 1 ) } ) - ::qToolbarAlign:addToolButton( "ZoomOut", "Zoom Out" , hbide_image( "zoomout3" ), {|| ::execEvent( "buttonZoom_clicked", 2 ) } ) - ::qToolbarAlign:addToolButton( "ZoomWYS", "Zoom WYSIWYG" , hbide_image( "zoomin" ), {|| ::execEvent( "buttonZoom_clicked", 3 ) } ) - ::qToolbarAlign:addToolButton( "ZoomOrg", "Zoom Original" , hbide_image( "zoomout" ), {|| ::execEvent( "buttonZoom_clicked", 4 ) } ) + ::qToolbarAlign:addToolButton( "ZoomIn" , "Zoom In" , app_image( "zoomin3" ), {|| ::execEvent( "buttonZoom_clicked", 1 ) } ) + ::qToolbarAlign:addToolButton( "ZoomOut", "Zoom Out" , app_image( "zoomout3" ), {|| ::execEvent( "buttonZoom_clicked", 2 ) } ) + ::qToolbarAlign:addToolButton( "ZoomWYS", "Zoom WYSIWYG" , app_image( "zoomin" ), {|| ::execEvent( "buttonZoom_clicked", 3 ) } ) + ::qToolbarAlign:addToolButton( "ZoomOrg", "Zoom Original" , app_image( "zoomout" ), {|| ::execEvent( "buttonZoom_clicked", 4 ) } ) ::qToolbarAlign:addSeparator() - ::qToolbarAlign:addToolButton( "Grid" , "Show Grid" , hbide_image( "grid" ), {|| ::execEvent( "buttonGrid_clicked", 4 ) }, .t., .f. ) + ::qToolbarAlign:addToolButton( "Grid" , "Show Grid" , app_image( "grid" ), {|| ::execEvent( "buttonGrid_clicked", 4 ) }, .t., .f. ) ::qToolbarAlign:addSeparator() ::qToolbarAlign:setItemChecked( "Grid", .t. ) @@ -739,11 +767,11 @@ METHOD IdeReportsManager:buildToolbarLeft() ::qToolbarL:orientation := Qt_Vertical ::qToolbarL:create( "ReportManager_Left_Toolbar" ) - ::qToolbarL:addToolButton( "Image" , "Image" , hbide_image( "f-image" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) - ::qToolbarL:addToolButton( "Chart" , "Chart" , hbide_image( "f_chart" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) - ::qToolbarL:addToolButton( "Gradient", "Gradient", hbide_image( "f_gradient" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) - ::qToolbarL:addToolButton( "Barcode" , "Barcode" , hbide_image( "f_barcode" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) - ::qToolbarL:addToolButton( "Text" , "Text" , hbide_image( "text" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) + ::qToolbarL:addToolButton( "Image" , "Image" , app_image( "f-image" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) + ::qToolbarL:addToolButton( "Chart" , "Chart" , app_image( "f_chart" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) + ::qToolbarL:addToolButton( "Gradient", "Gradient", app_image( "f_gradient" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) + ::qToolbarL:addToolButton( "Barcode" , "Barcode" , app_image( "f_barcode" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) + ::qToolbarL:addToolButton( "Text" , "Text" , app_image( "text" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) RETURN Self @@ -774,6 +802,40 @@ METHOD IdeReportsManager:buildStatusBar() RETURN Self +/*----------------------------------------------------------------------*/ + +METHOD IdeReportsManager:getImageOfType( cType ) + LOCAL cImage + + DO CASE + CASE cType == "Image" + cImage := "f-image" + CASE cType == "Barcode" + cImage := "f_barcode" + CASE cType == "Chart" + cImage := "f_chart" + CASE cType == "Gradient" + cImage := "f_gradient" + CASE cType == "Text" + cImage := "text" + CASE cType == "Field" + cImage := "text" + ENDCASE + + RETURN app_image( cImage ) + +/*----------------------------------------------------------------------*/ + +METHOD IdeReportsManager:getNextID( cType ) + + STATIC hIDs := {=>} + + IF ! hb_hHasKey( hIDs, cType ) + hIDs[ cType ] := 0 + ENDIF + + RETURN ++hIDs[ cType ] + /*----------------------------------------------------------------------*/ /* */ /* NOTE: the code below is works of someone else I do not remmeber */ diff --git a/harbour/contrib/hbide/resources/f-image.png b/harbour/contrib/hbide/resources/f-image.png index bba8ccc5c040213129a8d1b1a013dd36a87af61b..bffa64daa946e088ff737649a3a9d0d587296e82 100644 GIT binary patch delta 413 zcmV;O0b>5V0k#8>BYy#XNkl)MI0gXVRktiAjpg`h4kwODWA<%NK?%iyAFZP;(xrBrrGsz_T`@WgkA%nrd4CR~w z0-;0`BtzT9lLuE90qm}n*%Wa4NQD49OGQS$92d`?FayvP34a=89atDcf5ae3vViTT z!HDUM@Zyza01FiZ>Lr~&Ou!2w=$bzGJpcAD5!h;Ij9BgnyHwWG0-b~q#0iu&1uB{f zGOzuFGY+6<`7?JiG^=^2sbfZL4zOb5*FmaC2+7z@>(90a5f`YJ3@GLls7jax{1xLc z;xmc3Lv<=L1AkBs(1o^8l^7!q2bdg?Br#a53q$`NY@X@ljVoFZ#y+GAkckGGG6#9J z#vLree7*&(@^ZQb6VG3c^qzeQ7!3dAV1M%Ej8ICkP$&oiJkR6D#Lrnb454#oh!*$_@D9m06PAO900000NkvXX Hu0mjfQ^K}T delta 161 zcmV;S0AByL1H1u{BYyycNklS1c}7BoLZQ$LQAnC5q48~ZZDw{& zA;M8)C!YD{%$ZpY@VXd|g63NNP}6nL;O|x9M~DKr5HMT(n%I{4=HY|($A3ap{EyMk zpuOITmdhphzK=-)48s6T)1WL%2}qKRqR(v8eC2uW#R_0J8VBurt!S}WK#UOA^B|66 z=yWm1$O#IIY;#`HhHWIP7Oc~!XpmNPId6FB3bqar3s@DQG6`CE)T z=x%PrD}W?PqU&l!T3%Q)QGdOTPGTwP5-U;mdd0*5Z$N&O^KrlhAky20yZ}WD^s|h zPOD%;PJvY18iaDTlS&1W-6(*$hGmZPJKJSkC0nx;_0|1DI< zm_Q%$@Y&PKgR{$F(7M}*@+`xbIhtl-B9{X9~3BdNk{?3*HoP0YE?)Y95$4lB@**{hQQK0-1stIr@ zpMKLc%2I@TyW0wI{Pla_I*w9+CQ=TWN&VBET5%i~Il7#NL~0Q3_qq!3;qz%wGtGz$ zB`u0GTYL(?d(+vrub__!cpZ9ka;QjHJ00ScGo#swiv~eW4z-LlX(5bA{5Wq5x z@WozF0p1;b3V2Z-QnCb8rBy4XJQt!+U)l$1&2y}Sm;3#}Z&5w4AnaZGoB#j-07*qo IM6N<$f}Zd?Z~y=R literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbide/resources/r-report.png b/harbour/contrib/hbide/resources/r-report.png new file mode 100644 index 0000000000000000000000000000000000000000..e0909c7b392579822f6b70ab602e28c1a8ef47e7 GIT binary patch literal 622 zcmV-!0+IcRP)YuG7zgnGE-X~KZcAEuDHSWWXfOs6IVg#I06m#Bp7dZ$JT;N@qBr!wO)nk@iHF97 zgrncU1BuuuDIpq+bVY(<2(nOCv9P?Xvs0{HEuG}aCNs0YeV&QxGvi5_7xpatJQMD)^=bZeFQV;K{c8W1&niN zVX&@<4u?YzRI62b2FA`O%oNt}Yw-?tovV`)5nV2q9;j3*6fj9|G5!7?6#I3QZFfdl?M^_w`HS#(ms-Fk^LZLu`VOPdna|3PR8hYj>UE!qBz!?n`@cDdt zAfL}uV7mPV&eA&Cwp-X1ZbFiO(sj>*jRJqp!0-3#fowKQ0lxVP^PeB1%llA1{SdoK zpRQ}IY+zZ;@)imNgF!uz$z&*?^arqhd4ZjUt5Cq9KOF6sz_JX4W3)fSP$;Aa(&==L zq!?&*x=_`_FJA*@EoQQ=is5j04@e{uGd$0`1wnYgaolCC*+@)HXrL~M0U2AeEI;aW zIu(Zep37wN5(x(hfdoI!?6~&P@rzm=KS*e~X{Rb{-A`ikH^Ar5{wf+5_y7O^07*qo IM6N<$g5pISy#N3J literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp index 5025aaef9c..16b221febb 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp @@ -110,7 +110,7 @@ HBQGraphicsItem::HBQGraphicsItem( int type, QGraphicsItem * parent ) : QGraphics m_barsIdentation = 1 / UNIT; m_showLabels = true; - m_toColorFactor = 2; + m_toColorFactor = 1.5; m_drawBorder = true; m_showGrid = true; @@ -1245,6 +1245,7 @@ void HBQGraphicsItem::drawBarcode39( QPainter * painter, const QStyleOptionGraph QRectF rect = adjustOption( painter, option ); QRectF rc = rect.adjusted( 5, 5, -10, -10 ); + QColor fl( Qt::white ); QColor clr( Qt::black ); int iBars = m_barValues.size(); qreal w = rc.width() / iBars; @@ -1255,6 +1256,10 @@ void HBQGraphicsItem::drawBarcode39( QPainter * painter, const QStyleOptionGraph { painter->fillRect( QRectF( rc.x() + x, rc.y(), w, rc.height() ), clr ); } + else + { + painter->fillRect( QRectF( rc.x() + x, rc.y(), w, rc.height() ), fl ); + } x += w; } }