diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ea94778bee..8af58046eb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,23 @@ The license applies to all entries newer than 2009-04-28. */ +2012-07-18 01:29 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/hbide.qrc + + contrib/hbide/resources/maximize.png + + contrib/hbide/resources/maximize_all.png + + contrib/hbide/resources/minimize.png + + contrib/hbide/resources/minimize_all.png + + Added: more images. + + * contrib/hbide/ideprojectwizard.prg + * contrib/hbide/projectwizard.ui + ! Advanced: user interface is almost done and is ready for + final show-down. Please review the working of the components. + + ; QUESTION: should everything go inside .hbp or should I introduce + templates to hold the project sections and be reloadable + by 1) only switches and parameters, 2) sources also. + 2012-07-18 09:41 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbide/resources/collapse_m.png * contrib/hbide/resources/expand_m.png diff --git a/harbour/contrib/hbide/hbide.qrc b/harbour/contrib/hbide/hbide.qrc index b3d7b64bfe..d1cde7e807 100644 --- a/harbour/contrib/hbide/hbide.qrc +++ b/harbour/contrib/hbide/hbide.qrc @@ -1,295 +1,299 @@ - - -resources/arguments.png -resources/blockcomment.png -resources/blockindentl.png -resources/blockindentr.png -resources/bookmark.png -resources/browser.png -resources/build.png -resources/builderror.png -resources/buildlaunch.png -resources/buildrun.png -resources/buildsource.png -resources/check.png -resources/clean.png -resources/cleanrun.png -resources/close.png -resources/close3.png -resources/closeall.png -resources/closeexcept.png -resources/closetab.png -resources/codeskeletons.png -resources/column.png -resources/compile.png -resources/copy-filname.png -resources/copy.png -resources/curlinehilight.png -resources/cut.png -resources/cutb16.png -resources/database.png -resources/database_accept.png -resources/database_add.png -resources/database_remove.png -resources/database_lock.png -resources/database_process.png -resources/database_up.png -resources/database_down.png -resources/database_previous.png -resources/database_next.png -resources/database_search.png -resources/dbl2sglquote.png -resources/dbstruct.png -resources/dbf_p1.png -resources/dbf_p2.png -resources/dbf_p3.png -resources/dbf_p4.png -resources/dbf_p5.png -resources/dbf_p6.png -resources/dbf_p7.png -resources/dbf_p8.png -resources/dbf_p9.png -resources/dbf_p10.png -resources/dc_delete.png -resources/dc_down.png -resources/dc_folder.png -resources/dc_function.png -resources/dc_home.png -resources/dc_left.png -resources/dc_pdffile.png -resources/dc_plus.png -resources/dc_print.png -resources/dc_quit.png -resources/dc_refresh.png -resources/dc_right.png -resources/dc_textdoc.png -resources/dc_textdocument.png -resources/dc_up.png -resources/debug.png -resources/decreaseindent.png -resources/deleteline.png -resources/description.png -resources/designer.png -resources/docwriter.png -resources/down.png -resources/down16.png -resources/duplicateline.png -resources/editstree.png -resources/envconfig.png -resources/example.png -resources/exit.png -resources/exit3.png -resources/exporthtml.png -resources/ffn.png -resources/filec.png -resources/fileprg.png -resources/find.png -resources/fl_c.png -resources/fl_dll.png -resources/fl_exe.png -resources/fl_ini.png -resources/fl_lib.png -resources/fl_prg.png -resources/fl_res.png -resources/fl_txt.png -resources/file-open.png -resources/folder.png -resources/font.png -resources/formview.png -resources/fullscreen.png -resources/go-bottom.png -resources/go-down.png -resources/go-first.png -resources/go-jump.png -resources/go-last.png -resources/go-next.png -resources/go-prev.png -resources/go-top.png -resources/go-up.png -resources/gotoline.png -resources/gotoline3.png -resources/gotomark.png -resources/grid.png -resources/harbour.png -resources/harbourhelp.png -resources/hb-16x16.png -resources/hb-32x32.png -resources/hbide.png -resources/hbidesplash.png -resources/hbidesplashwatermark.png -resources/help.png -resources/help1.png -resources/helpdoc.png -resources/hilight-all.png -resources/home3.png -resources/horzruler.png -resources/idepreferences.png -resources/increaseindent.png -resources/indent-more.png -resources/indent-less.png -resources/info.png -resources/infotips.png -resources/insert-datetime.png -resources/insert-external-file.png -resources/insert-procname.png -resources/insert-separator.png -resources/invertcase.png -resources/keyboardmappings.png -resources/launch.png -resources/lense.png -resources/list-developers.png -resources/list-users.png -resources/load_1.png -resources/load_2.png -resources/load_3.png -resources/Lookup.png -resources/matchobj.png -resources/minus.png -resources/modulelist.png -resources/movelinedown.png -resources/movelineup.png -resources/new.png -resources/new2.png -resources/next.png -resources/notepad.png -resources/open.png -resources/open2.png -resources/open3.png -resources/panel_1.png -resources/panel_2.png -resources/panel_3.png -resources/panel_4.png -resources/panel_5.png -resources/panel_6.png -resources/panel_7.png -resources/panel_8.png -resources/panel_9.png -resources/panel_10.png -resources/panel_11.png -resources/panel_12.png -resources/panel_13.png -resources/paste.png -resources/placeremovemark.png -resources/ppo.png -resources/previous.png -resources/print.png -resources/project.png -resources/projectadd.png -resources/projectdel.png -resources/projectstree.png -resources/projtree.png -resources/properties.png -resources/readonly.png -resources/rebuild.png -resources/rebuildlaunch.png -resources/redo.png -resources/richtext.png -resources/run.png -resources/runscript.png -resources/runnodebug.png -resources/save.png -resources/save3.png -resources/saveall.png -resources/saveas.png -resources/search.png -resources/selectall.png -resources/selectionline.png -resources/setmain.png -resources/sgl2dblquote.png -resources/sort.png -resources/sortdescend.png -resources/source_c.png -resources/source_cpp.png -resources/source_h.png -resources/source_o.png -resources/source_prg.png -resources/source_res.png -resources/source_txt.png -resources/source_unknown.png -resources/statistics.png -resources/spacestotabs.png -resources/stream.png -resources/streamcomment.png -resources/syntaxhiliter.png -resources/tabcmodified.png -resources/tabmodified.png -resources/tabreadonly.png -resources/tabs.png -resources/tabstospaces.png -resources/tabunmodified.png -resources/tests.png -resources/text.png -resources/thumbnail.png -resources/togglelinenumber.png -resources/tolower.png -resources/tools.png -resources/toupper.png -resources/trashpage.png -resources/undo.png -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/view_vertstacked.png -resources/view_horzstacked.png -resources/view_zoomin.png -resources/view_zoomout.png -resources/view_refresh.png -resources/vr-16x16.png -resources/vr.png -resources/xmate.png -resources/zoomin.png -resources/zoomout.png -resources/zoomin3.png -resources/zoomout3.png -resources/f_align_left.png -resources/f_align_right.png -resources/f_align_center.png -resources/f_align_justify.png -resources/f_align_top.png -resources/f_align_middle.png -resources/f_align_bottom.png -resources/f_box_top.png -resources/f_box_left.png -resources/f_box_bottom.png -resources/f_box_right.png -resources/f_box_all.png -resources/f_box_plain.png -resources/f_box_shadow.png -resources/f-generic.png -resources/f-image.png -resources/f_chart.png -resources/f_gradient.png -resources/f_barcode.png -resources/f-bold-1.png -resources/f-italic-1.png -resources/f-underline-1.png -resources/f-strike-1.png -resources/toback.png -resources/tofront.png -resources/r-page.png -resources/r-report.png -resources/r-landscape.png -resources/r-portrait.png -resources/rp_arc.png -resources/rp_chord.png -resources/rp_diamond.png -resources/rp_triangle.png -resources/rp_rectangle.png -resources/rp_roundrectangle.png -resources/rp_linevert.png -resources/rp_linehorz.png -resources/rp_linediagright.png -resources/rp_linediagleft.png -resources/rp_ellipse.png -resources/rp_shapes.png -resources/memo.png -resources/hideshow.png -resources/cuied.png -resources/expand_m.png -resources/collapse_m.png - + + + resources/minimize_all.png + resources/maximize_all.png + resources/maximize.png + resources/minimize.png + resources/arguments.png + resources/blockcomment.png + resources/blockindentl.png + resources/blockindentr.png + resources/bookmark.png + resources/browser.png + resources/build.png + resources/builderror.png + resources/buildlaunch.png + resources/buildrun.png + resources/buildsource.png + resources/check.png + resources/clean.png + resources/cleanrun.png + resources/close.png + resources/close3.png + resources/closeall.png + resources/closeexcept.png + resources/closetab.png + resources/codeskeletons.png + resources/column.png + resources/compile.png + resources/copy-filname.png + resources/copy.png + resources/curlinehilight.png + resources/cut.png + resources/cutb16.png + resources/database.png + resources/database_accept.png + resources/database_add.png + resources/database_remove.png + resources/database_lock.png + resources/database_process.png + resources/database_up.png + resources/database_down.png + resources/database_previous.png + resources/database_next.png + resources/database_search.png + resources/dbl2sglquote.png + resources/dbstruct.png + resources/dbf_p1.png + resources/dbf_p2.png + resources/dbf_p3.png + resources/dbf_p4.png + resources/dbf_p5.png + resources/dbf_p6.png + resources/dbf_p7.png + resources/dbf_p8.png + resources/dbf_p9.png + resources/dbf_p10.png + resources/dc_delete.png + resources/dc_down.png + resources/dc_folder.png + resources/dc_function.png + resources/dc_home.png + resources/dc_left.png + resources/dc_pdffile.png + resources/dc_plus.png + resources/dc_print.png + resources/dc_quit.png + resources/dc_refresh.png + resources/dc_right.png + resources/dc_textdoc.png + resources/dc_textdocument.png + resources/dc_up.png + resources/debug.png + resources/decreaseindent.png + resources/deleteline.png + resources/description.png + resources/designer.png + resources/docwriter.png + resources/down.png + resources/down16.png + resources/duplicateline.png + resources/editstree.png + resources/envconfig.png + resources/example.png + resources/exit.png + resources/exit3.png + resources/exporthtml.png + resources/ffn.png + resources/filec.png + resources/fileprg.png + resources/find.png + resources/fl_c.png + resources/fl_dll.png + resources/fl_exe.png + resources/fl_ini.png + resources/fl_lib.png + resources/fl_prg.png + resources/fl_res.png + resources/fl_txt.png + resources/file-open.png + resources/folder.png + resources/font.png + resources/formview.png + resources/fullscreen.png + resources/go-bottom.png + resources/go-down.png + resources/go-first.png + resources/go-jump.png + resources/go-last.png + resources/go-next.png + resources/go-prev.png + resources/go-top.png + resources/go-up.png + resources/gotoline.png + resources/gotoline3.png + resources/gotomark.png + resources/grid.png + resources/harbour.png + resources/harbourhelp.png + resources/hb-16x16.png + resources/hb-32x32.png + resources/hbide.png + resources/hbidesplash.png + resources/hbidesplashwatermark.png + resources/help.png + resources/help1.png + resources/helpdoc.png + resources/hilight-all.png + resources/home3.png + resources/horzruler.png + resources/idepreferences.png + resources/increaseindent.png + resources/indent-more.png + resources/indent-less.png + resources/info.png + resources/infotips.png + resources/insert-datetime.png + resources/insert-external-file.png + resources/insert-procname.png + resources/insert-separator.png + resources/invertcase.png + resources/keyboardmappings.png + resources/launch.png + resources/lense.png + resources/list-developers.png + resources/list-users.png + resources/load_1.png + resources/load_2.png + resources/load_3.png + resources/Lookup.png + resources/matchobj.png + resources/minus.png + resources/modulelist.png + resources/movelinedown.png + resources/movelineup.png + resources/new.png + resources/new2.png + resources/next.png + resources/notepad.png + resources/open.png + resources/open2.png + resources/open3.png + resources/panel_1.png + resources/panel_2.png + resources/panel_3.png + resources/panel_4.png + resources/panel_5.png + resources/panel_6.png + resources/panel_7.png + resources/panel_8.png + resources/panel_9.png + resources/panel_10.png + resources/panel_11.png + resources/panel_12.png + resources/panel_13.png + resources/paste.png + resources/placeremovemark.png + resources/ppo.png + resources/previous.png + resources/print.png + resources/project.png + resources/projectadd.png + resources/projectdel.png + resources/projectstree.png + resources/projtree.png + resources/properties.png + resources/readonly.png + resources/rebuild.png + resources/rebuildlaunch.png + resources/redo.png + resources/richtext.png + resources/run.png + resources/runscript.png + resources/runnodebug.png + resources/save.png + resources/save3.png + resources/saveall.png + resources/saveas.png + resources/search.png + resources/selectall.png + resources/selectionline.png + resources/setmain.png + resources/sgl2dblquote.png + resources/sort.png + resources/sortdescend.png + resources/source_c.png + resources/source_cpp.png + resources/source_h.png + resources/source_o.png + resources/source_prg.png + resources/source_res.png + resources/source_txt.png + resources/source_unknown.png + resources/statistics.png + resources/spacestotabs.png + resources/stream.png + resources/streamcomment.png + resources/syntaxhiliter.png + resources/tabcmodified.png + resources/tabmodified.png + resources/tabreadonly.png + resources/tabs.png + resources/tabstospaces.png + resources/tabunmodified.png + resources/tests.png + resources/text.png + resources/thumbnail.png + resources/togglelinenumber.png + resources/tolower.png + resources/tools.png + resources/toupper.png + resources/trashpage.png + resources/undo.png + 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/view_vertstacked.png + resources/view_horzstacked.png + resources/view_zoomin.png + resources/view_zoomout.png + resources/view_refresh.png + resources/vr-16x16.png + resources/vr.png + resources/xmate.png + resources/zoomin.png + resources/zoomout.png + resources/zoomin3.png + resources/zoomout3.png + resources/f_align_left.png + resources/f_align_right.png + resources/f_align_center.png + resources/f_align_justify.png + resources/f_align_top.png + resources/f_align_middle.png + resources/f_align_bottom.png + resources/f_box_top.png + resources/f_box_left.png + resources/f_box_bottom.png + resources/f_box_right.png + resources/f_box_all.png + resources/f_box_plain.png + resources/f_box_shadow.png + resources/f-generic.png + resources/f-image.png + resources/f_chart.png + resources/f_gradient.png + resources/f_barcode.png + resources/f-bold-1.png + resources/f-italic-1.png + resources/f-underline-1.png + resources/f-strike-1.png + resources/toback.png + resources/tofront.png + resources/r-page.png + resources/r-report.png + resources/r-landscape.png + resources/r-portrait.png + resources/rp_arc.png + resources/rp_chord.png + resources/rp_diamond.png + resources/rp_triangle.png + resources/rp_rectangle.png + resources/rp_roundrectangle.png + resources/rp_linevert.png + resources/rp_linehorz.png + resources/rp_linediagright.png + resources/rp_linediagleft.png + resources/rp_ellipse.png + resources/rp_shapes.png + resources/memo.png + resources/hideshow.png + resources/cuied.png + resources/expand_m.png + resources/collapse_m.png + diff --git a/harbour/contrib/hbide/ideprojectwizard.prg b/harbour/contrib/hbide/ideprojectwizard.prg index 033b9768dc..f1b11b8beb 100644 --- a/harbour/contrib/hbide/ideprojectwizard.prg +++ b/harbour/contrib/hbide/ideprojectwizard.prg @@ -94,6 +94,8 @@ CREATE CLASS IdeProjectWizard INHERIT IdeObject METHOD loadSwichesSections() METHOD deleteTreeItem( oChild ) METHOD addTreeItem( oParent ) + METHOD addDropIndicator( oTree, oNode, cMsg, cCSS, nIndex ) + METHOD addSourceFile( cFile ) ENDCLASS @@ -209,7 +211,6 @@ METHOD IdeProjectWizard:show() ::oUI := ui_projectWizard():new( ::oIde:oDlg:oWidget ) ::oUI:oWidget:connect( QEvent_Close, {|| ::oUI:oWidget:done( 0 ) } ) - ::oUI:btnSwPlus : connect( "clicked()", {|| ::execEvent( "btnSw_clicked", "plus" ) } ) ::oUI:btnSwAZ : connect( "clicked()", {|| ::execEvent( "btnSw_clicked", "az" ) } ) ::oUI:btnSwZA : connect( "clicked()", {|| ::execEvent( "btnSw_clicked", "za" ) } ) ::oUI:btnSwUpper : connect( "clicked()", {|| ::execEvent( "btnSw_clicked", "upper" ) } ) @@ -222,12 +223,18 @@ METHOD IdeProjectWizard:show() ::oUI:btnSave : connect( "clicked()", {|| ::execEvent( "btnSave_clicked" ) } ) ::oUI:btnCancel : connect( "clicked()", {|| ::oUI:oWidget:done( 0 ) } ) - ::oUI:toolGetSrc : connect( "clicked()", {|| ::execEvent( "toolGetSrc_clicked" ) } ) + ::oUI:btnSwMax : connect( "clicked()", {|| ::execEvent( "btnSwMax_clicked" ) } ) + ::oUI:btnSwMin : connect( "clicked()", {|| ::execEvent( "btnSwMin_clicked" ) } ) - ::oUI:comboProjType : addItem( "Executable" ) - ::oUI:comboProjType : addItem( "Library" ) + ::oUI:toolSrcGet : connect( "clicked()", {|| ::execEvent( "toolSrcGet_clicked" ) } ) + ::oUI:toolSrcMax : connect( "clicked()", {|| ::execEvent( "toolSrcMax_clicked" ) } ) + ::oUI:toolSrcMin : connect( "clicked()", {|| ::execEvent( "toolSrcMin_clicked" ) } ) + ::oUI:toolSrcDel : connect( "clicked()", {|| ::execEvent( "toolSrcDel_clicked" ) } ) + + ::oUI:comboProjType : addItem( "Executable" ) + ::oUI:comboProjType : addItem( "Library" ) ::oUI:comboProjType : addItem( "DLL - Without HVM" ) - ::oUI:comboProjType : addItem( "DLL - With HVM" ) + ::oUI:comboProjType : addItem( "DLL - With HVM" ) ::oUI:comboGT : addItem( "gtCGI" ) ::oUI:comboGT : addItem( "gtCRS" ) @@ -288,6 +295,12 @@ METHOD IdeProjectWizard:show() ::clear() + + ::oUI:frameSrc:setAcceptDrops( .t. ) + ::oUI:frameSrc:connect( QEvent_DragEnter, {|p| ::execEvent( "frameSrc_dragEnterEvent", p ) } ) + ::oUI:frameSrc:connect( QEvent_DragMove , {|p| ::execEvent( "frameSrc_dragMoveEvent" , p ) } ) + ::oUI:frameSrc:connect( QEvent_Drop , {|p| ::execEvent( "frameSrc_dropEvent" , p ) } ) + ENDIF IF ::loadDefaults() @@ -299,94 +312,30 @@ METHOD IdeProjectWizard:show() /*----------------------------------------------------------------------*/ -STATIC FUNCTION blockBtnClicked( o, cEvent, nAct ) - RETURN {|| o:execEvent( cEvent, nAct ) } - -/*----------------------------------------------------------------------*/ - -METHOD IdeProjectWizard:loadSwichesSections() - LOCAL oTree := ::oUI:treeProps - LOCAL qItm, aAct, oFont, qTBtn - - oFont := QTreeWidgetItem():font( 0 ) - oFont:setBold( .t. ) - FOR EACH aAct IN ::aItmProps - qItm := QTreeWidgetItem() - aAct[ 1 ] := qItm - qItm:setFlags( 0 ) - qItm:setFlags( hb_bitOr( Qt_ItemIsSelectable, Qt_ItemIsDropEnabled, Qt_ItemIsEnabled ) ) - qItm:setText( 0, space( 7 ) + aAct[ 2 ] ) - qItm:setBackground( 0, aAct[ 3 ] ) - qItm:setForeground( 0, QBrush( QColor( 255,255,255 ) ) ) - qItm:setFont( 0, oFont ) - qItm:setTooltip( 0, "Double-click to add a value !" ) - oTree:addTopLevelItem( qItm ) - oTree:setFirstItemColumnSpanned( qItm, .t. ) - qItm:setChildIndicatorPolicy( QTreeWidgetItem_ShowIndicator ) - NEXT - FOR EACH aAct IN ::aItmProps - qTBtn := QToolButton() - aAct[ 6 ] := qTBtn - qTBtn:setIcon( QIcon( hbide_image( "expand_m" ) ) ) - qTBtn:setAutoFillBackground( .t. ) - qTBtn:setAutoRaise( .t. ) - qTBtn:setMaximumWidth( 20 ) - qTBtn:setMaximumHeight( 20 ) - qTBtn:setStyleSheet( "" ) - qTBtn:setStyleSheet( aAct[ 7 ] ) - qTBtn:connect( "clicked()", blockBtnClicked( Self, "qTBtn_clicked", aAct:__enumIndex() ) ) - oTree:setItemWidget( aAct[ 1 ], 1, qTBtn ) - NEXT - RETURN Self - -/*----------------------------------------------------------------------*/ - -METHOD IdeProjectWizard:loadSourcesSections() - LOCAL oTree := ::oUI:treeSrc - LOCAL qItm, aAct, oFont, qTBtn - - oFont := QTreeWidgetItem():font( 0 ) - oFont:setBold( .t. ) - FOR EACH aAct IN ::aItmSrc - qItm := QTreeWidgetItem() - aAct[ 1 ] := qItm - qItm:setFlags( 0 ) - qItm:setFlags( hb_bitOr( Qt_ItemIsSelectable, Qt_ItemIsDropEnabled, Qt_ItemIsEnabled ) ) - qItm:setText( 0, " " + aAct[ 2 ] ) - qItm:setBackground( 0, aAct[ 3 ] ) - qItm:setForeground( 0, QBrush( QColor( 255,255,255 ) ) ) - qItm:setFont( 0, oFont ) - qItm:setTooltip( 0, "Drag and drop a source OR select with open icon at the top !" ) - oTree:addTopLevelItem( qItm ) - oTree:setFirstItemColumnSpanned( qItm, .t. ) - qItm:setChildIndicatorPolicy( QTreeWidgetItem_ShowIndicator ) - NEXT - FOR EACH aAct IN ::aItmSrc - qTBtn := QToolButton() - aAct[ 6 ] := qTBtn - qTBtn:setIcon( QIcon( hbide_image( "expand_m" ) ) ) - qTBtn:setAutoFillBackground( .t. ) - qTBtn:setAutoRaise( .t. ) - qTBtn:setMaximumWidth( 20 ) - qTBtn:setMaximumHeight( 20 ) - qTBtn:setStyleSheet( "" ) - qTBtn:setStyleSheet( aAct[ 7 ] ) - qTBtn:connect( "clicked()", blockBtnClicked( Self, "qSBtn_clicked", aAct:__enumIndex() ) ) - oTree:setItemWidget( aAct[ 1 ], 1, qTBtn ) - NEXT - - RETURN Self - -/*----------------------------------------------------------------------*/ - METHOD IdeProjectWizard:execEvent( xEvent, p, p1 ) - LOCAL cText, qItm, n, i, oFont, aMenu, oParent, aFiles, aFilt, cFile, cExt, lTop, nChildren, qChild + LOCAL cText, qItm, n, i, oFont, aMenu, aFiles, aFilt, cFile, lTop, nChildren, qChild + LOCAL qMime, qUrl, qList, aItm - HB_SYMBOL_UNUSED( p ) HB_SYMBOL_UNUSED( p1 ) SWITCH xEvent + CASE "frameSrc_dragMoveEvent" + CASE "frameSrc_dragEnterEvent" + p:acceptProposedAction() + EXIT + CASE "frameSrc_dropEvent" + qMime := p:mimeData() + IF qMime:hasUrls() + qList := qMime:urls() + FOR i := 0 TO qList:size() - 1 + qUrl := qList:at( i ) + ::addSourceFile( hbide_pathToOSPath( qUrl:toLocalFile() ) ) + NEXT + p:setDropAction( Qt_CopyAction ) + p:accept() + ENDIF + EXIT CASE "treeProps_itemSelectionChanged" IF ! empty( qItm := ::oUI:treeProps:currentItem() ) lTop := ::oUI:treeProps:indexOfTopLevelItem( qItm ) >= 0 @@ -440,7 +389,47 @@ METHOD IdeProjectWizard:execEvent( xEvent, p, p1 ) ENDIF ::aItmSrc[ p,1 ]:setSelected( .t. ) EXIT - CASE "toolGetSrc_clicked" + CASE "toolSrcDel_clicked" + IF hbide_getYesNo( "Do you really want to delete all sources ?", "Dangerous Action", "Confirmation Required!", ::oUI:oWidget ) + FOR EACH aItm IN ::aItmSrc + IF ! empty( aItm[ 1 ] ) + n := aItm[ 1 ]:childCount() + FOR i := 1 TO n + aItm[ 1 ]:removeChild( aItm[ 1 ]:child( 0 ) ) + NEXT + ENDIF + NEXT + ENDIF + EXIT + CASE "toolSrcMin_clicked" + FOR EACH aItm IN ::aItmSrc + IF ! empty( aItm[ 1 ] ) + aItm[ 1 ]:setExpanded( .F. ) + ENDIF + NEXT + EXIT + CASE "toolSrcMax_clicked" + FOR EACH aItm IN ::aItmSrc + IF ! empty( aItm[ 1 ] ) + aItm[ 1 ]:setExpanded( .T. ) + ENDIF + NEXT + EXIT + CASE "btnSwMin_clicked" + FOR EACH aItm IN ::aItmProps + IF ! empty( aItm[ 1 ] ) + aItm[ 1 ]:setExpanded( .F. ) + ENDIF + NEXT + EXIT + CASE "btnSwMax_clicked" + FOR EACH aItm IN ::aItmProps + IF ! empty( aItm[ 1 ] ) + aItm[ 1 ]:setExpanded( .T. ) + ENDIF + NEXT + EXIT + CASE "toolSrcGet_clicked" aFilt := {} aadd( aFilt, { "Program Files", "*.prg" } ) aadd( aFilt, { "C Files" , "*.c" } ) @@ -454,19 +443,7 @@ METHOD IdeProjectWizard:execEvent( xEvent, p, p1 ) oFont := QFont( "Courier New" ) oFont:setPointSize( 8 ) FOR EACH cFile IN aFiles - hb_fNameSplit( cFile, , , @cExt ) - IF ( n := ascan( ::aItmSrc, {|e_| e_[ 5 ] == lower( cExt ) } ) ) == 0 - n := len( ::aItmSrc ) - ENDIF - oParent := ::aItmSrc[ n,1 ] - ::oUI:treeSrc:expandItem( oParent ) - qItm := QTreeWidgetItem() - oParent:addChild( qItm ) - qItm:setFlags( 0 ) - qItm:setFlags( hb_bitOr( Qt_ItemIsSelectable, Qt_ItemIsDragEnabled, Qt_ItemIsEnabled ) ) - qItm:setText( 0, cFile ) - qItm:setFont( 0, oFont ) - qItm:setBackground( 0, ::aItmSrc[ 1, 4 ] ) + ::addSourceFile( cFile ) NEXT ENDIF EXIT @@ -474,15 +451,21 @@ METHOD IdeProjectWizard:execEvent( xEvent, p, p1 ) IF ! empty( qItm := ::oUI:treeSrc:itemAt( p ) ) cText := substr( qItm:text( 0 ), 8 ) aMenu := {} - IF ( n := ascan( ::aItmSrc, {|e_| e_[ 2 ] == cText } ) ) == 0 - aadd( aMenu, { ::oAC:getAction( "Delete" ) } ) - ELSE + aadd( aMenu, { ::oAC:getAction( "Delete" ) } ) + IF ( n := ascan( ::aItmSrc, {|e_| e_[ 2 ] == cText } ) ) > 0 aadd( aMenu, { ::oAC:getAction( "SortAZ" ) } ) aadd( aMenu, { ::oAC:getAction( "SortZA" ) } ) ENDIF cText := hbide_execPopup( aMenu, ::oUI:treeSrc:mapToGlobal( p ), ::oUI:treeSrc ) IF cText == "Delete" - ::deleteTreeItem( qItm ) + IF n > 0 + n := qItm:childCount() + FOR i := 1 TO n + ::deleteTreeItem( qItm:child( 0 ) ) + NEXT + ELSE + ::deleteTreeItem( qItm ) + ENDIF ELSEIF cText == "Sort Ascending" ::aItmSrc[ n,1 ]:sortChildren( 0, Qt_AscendingOrder ) ELSEIF cText == "Sort Descending" @@ -494,15 +477,21 @@ METHOD IdeProjectWizard:execEvent( xEvent, p, p1 ) IF ! empty( qItm := ::oUI:treeProps:itemAt( p ) ) cText := substr( qItm:text( 0 ), 8 ) aMenu := {} - IF ( n := ascan( ::aItmProps, {|e_| e_[ 2 ] == cText } ) ) == 0 - aadd( aMenu, { ::oAC:getAction( "Delete" ) } ) - ELSE + aadd( aMenu, { ::oAC:getAction( "Delete" ) } ) + IF ( n := ascan( ::aItmProps, {|e_| e_[ 2 ] == cText } ) ) > 0 aadd( aMenu, { ::oAC:getAction( "SortAZ" ) } ) aadd( aMenu, { ::oAC:getAction( "SortZA" ) } ) ENDIF cText := hbide_execPopup( aMenu, ::oUI:treeProps:mapToGlobal( p ), ::oUI:treeProps ) IF cText == "Delete" - ::deleteTreeItem( qItm ) + IF n > 0 + n := qItm:childCount() + FOR i := 1 TO n + ::deleteTreeItem( qItm:child( 0 ) ) + NEXT + ELSE + ::deleteTreeItem( qItm ) + ENDIF ELSEIF cText == "Sort Ascending" ::aItmProps[ n,1 ]:sortChildren( 0, Qt_AscendingOrder ) ELSEIF cText == "Sort Descending" @@ -578,6 +567,48 @@ METHOD IdeProjectWizard:execEvent( xEvent, p, p1 ) /*----------------------------------------------------------------------*/ +METHOD IdeProjectWizard:addSourceFile( cFile ) + LOCAL oParent, qItm, cExt, n, cSource, lExists, i + LOCAL oFont := QFont( "Courier New" ) + + oFont:setPointSize( 8 ) + + IF hbide_isValidText( cFile ) + hb_fNameSplit( cFile, , , @cExt ) + IF ( n := ascan( ::aItmSrc, {|e_| e_[ 5 ] == lower( cExt ) } ) ) == 0 + n := len( ::aItmSrc ) + ENDIF + oParent := ::aItmSrc[ n,1 ] + + cSource := hbide_prepareSourceForHbp( hbide_stripRoot( ::cProjPath, cFile ) ) + + lExists := .f. + IF ( n := oParent:childCount() ) > 0 + FOR i := 1 TO n + IF lower( oParent:child( i-1 ):text( 0 ) ) == lower( cSource ) + lExists := .t. + EXIT + ENDIF + NEXT + ENDIF + + IF ! lExists + oParent:setExpanded( .t. ) + qItm := QTreeWidgetItem() + oParent:addChild( qItm ) + qItm:setFlags( 0 ) + qItm:setFlags( hb_bitOr( Qt_ItemIsSelectable, Qt_ItemIsDragEnabled, Qt_ItemIsEnabled ) ) + qItm:setText( 0, cSource ) + qItm:setTooltip( 0, cFile ) + qItm:setFont( 0, oFont ) + qItm:setBackground( 0, QBrush( QColor( 250, 250, 250 ) ) ) + ENDIF + ENDIF + + RETURN .t. + +/*----------------------------------------------------------------------*/ + METHOD IdeProjectWizard:addTreeItem( oParent ) LOCAL oFont, qItm @@ -592,7 +623,7 @@ METHOD IdeProjectWizard:addTreeItem( oParent ) qItm:setFlags( hb_bitOr( Qt_ItemIsSelectable, Qt_ItemIsDragEnabled, Qt_ItemIsEnabled, Qt_ItemIsEditable ) ) qItm:setText( 0, "" ) qItm:setFont( 0, oFont ) - qItm:setBackground( 0, QBrush( QColor( 245,245,245 ) ) ) + qItm:setBackground( 0, QBrush( QColor( 250, 250, 250 ) ) ) qItm:setFirstColumnSpanned( .t. ) oParent:treeWidget():editItem( qItm, 0 ) @@ -615,6 +646,77 @@ METHOD IdeProjectWizard:deleteTreeItem( oChild ) /*----------------------------------------------------------------------*/ +METHOD IdeProjectWizard:addDropIndicator( oTree, oNode, cMsg, cCSS, nIndex ) + LOCAL qTBtn := QToolButton() + + qTBtn:setIcon( QIcon( hbide_image( "expand_m" ) ) ) + qTBtn:setAutoFillBackground( .t. ) + qTBtn:setAutoRaise( .t. ) + qTBtn:setMaximumWidth( 20 ) + qTBtn:setMaximumHeight( 20 ) + qTBtn:setStyleSheet( "" ) + qTBtn:setStyleSheet( cCSS ) + qTBtn:connect( "clicked()", {|| ::execEvent( cMsg, nIndex ) } ) + oTree:setItemWidget( oNode, 1, qTBtn ) + + RETURN qTBtn + +/*----------------------------------------------------------------------*/ + +METHOD IdeProjectWizard:loadSwichesSections() + LOCAL oTree := ::oUI:treeProps + LOCAL qItm, aAct, oFont + + oFont := QTreeWidgetItem():font( 0 ) + oFont:setBold( .t. ) + FOR EACH aAct IN ::aItmProps + qItm := QTreeWidgetItem() + aAct[ 1 ] := qItm + qItm:setFlags( 0 ) + qItm:setFlags( hb_bitOr( Qt_ItemIsSelectable, Qt_ItemIsDropEnabled, Qt_ItemIsEnabled ) ) + qItm:setText( 0, space( 7 ) + aAct[ 2 ] ) + qItm:setBackground( 0, aAct[ 3 ] ) + qItm:setForeground( 0, QBrush( QColor( 255,255,255 ) ) ) + qItm:setFont( 0, oFont ) + qItm:setTooltip( 0, "Double-click to add a value !" ) + oTree:addTopLevelItem( qItm ) + oTree:setFirstItemColumnSpanned( qItm, .t. ) + qItm:setChildIndicatorPolicy( QTreeWidgetItem_ShowIndicator ) + + aAct[ 6 ] := ::addDropIndicator( oTree, aAct[ 1 ], "qTBtn_clicked", aAct[ 7 ], aAct:__enumIndex() ) + NEXT + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeProjectWizard:loadSourcesSections() + LOCAL oTree := ::oUI:treeSrc + LOCAL qItm, aAct, oFont + + oFont := QTreeWidgetItem():font( 0 ) + oFont:setBold( .t. ) + FOR EACH aAct IN ::aItmSrc + qItm := QTreeWidgetItem() + aAct[ 1 ] := qItm + qItm:setFlags( 0 ) + qItm:setFlags( hb_bitOr( Qt_ItemIsSelectable, Qt_ItemIsDropEnabled, Qt_ItemIsEnabled ) ) + qItm:setText( 0, space( 7 ) + aAct[ 2 ] ) + qItm:setBackground( 0, aAct[ 3 ] ) + qItm:setForeground( 0, QBrush( QColor( 255,255,255 ) ) ) + qItm:setFont( 0, oFont ) + qItm:setTooltip( 0, "Drag and drop a source OR select with open icon at the top !" ) + oTree:addTopLevelItem( qItm ) + oTree:setFirstItemColumnSpanned( qItm, .t. ) + qItm:setChildIndicatorPolicy( QTreeWidgetItem_ShowIndicator ) + + aAct[ 6 ] := ::addDropIndicator( oTree, aAct[ 1 ], "qSBtn_clicked", aAct[ 7 ], aAct:__enumIndex() ) + NEXT + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeProjectWizard:loadDefaults() LOCAL cProjPath, cPath, cName, cExt diff --git a/harbour/contrib/hbide/projectwizard.ui b/harbour/contrib/hbide/projectwizard.ui index 6a7867f0c9..3ed90ebe9a 100644 --- a/harbour/contrib/hbide/projectwizard.ui +++ b/harbour/contrib/hbide/projectwizard.ui @@ -784,7 +784,7 @@ 292 - 8 + 56 25 20 @@ -807,7 +807,7 @@ 292 - 32 + 76 25 20 @@ -830,7 +830,7 @@ 292 - 56 + 96 25 20 @@ -853,7 +853,7 @@ 292 - 80 + 112 25 20 @@ -876,7 +876,7 @@ 292 - 100 + 128 25 20 @@ -918,6 +918,46 @@ true + + + + 292 + 8 + 25 + 19 + + + + ... + + + + :/resources/maximize_all.png:/resources/maximize_all.png + + + true + + + + + + 292 + 28 + 25 + 19 + + + + ... + + + + :/resources/minimize_all.png:/resources/minimize_all.png + + + true + + @@ -1283,7 +1323,7 @@ 12 - 11 + 0 449 33 @@ -1294,10 +1334,10 @@ QFrame::Raised - + - 12 + 4 8 25 19 @@ -1317,7 +1357,7 @@ true - + 92 @@ -1326,41 +1366,47 @@ 19 + + Expand all sections + ... - :/resources/go-up.png:/resources/go-up.png + :/resources/maximize_all.png:/resources/maximize_all.png true - + - 128 + 120 8 25 19 + + Collapse all sections + ... - :/resources/go-down.png:/resources/go-down.png + :/resources/minimize_all.png:/resources/minimize_all.png true - + - 204 + 416 8 25 19 @@ -1378,13 +1424,13 @@ - + 12 - 48 + 32 449 - 533 + 549 @@ -1399,7 +1445,7 @@ 8 8 433 - 517 + 533 diff --git a/harbour/contrib/hbide/resources/maximize.png b/harbour/contrib/hbide/resources/maximize.png new file mode 100644 index 0000000000..3d7463f5e7 Binary files /dev/null and b/harbour/contrib/hbide/resources/maximize.png differ diff --git a/harbour/contrib/hbide/resources/maximize_all.png b/harbour/contrib/hbide/resources/maximize_all.png new file mode 100644 index 0000000000..d044f0bbde Binary files /dev/null and b/harbour/contrib/hbide/resources/maximize_all.png differ diff --git a/harbour/contrib/hbide/resources/minimize.png b/harbour/contrib/hbide/resources/minimize.png new file mode 100644 index 0000000000..d293fd6068 Binary files /dev/null and b/harbour/contrib/hbide/resources/minimize.png differ diff --git a/harbour/contrib/hbide/resources/minimize_all.png b/harbour/contrib/hbide/resources/minimize_all.png new file mode 100644 index 0000000000..6fb7e02d2a Binary files /dev/null and b/harbour/contrib/hbide/resources/minimize_all.png differ