diff --git a/ApplicationLibCode/Application/RiaPreferences.cpp b/ApplicationLibCode/Application/RiaPreferences.cpp index f45ff3719f..f3bb0a82e0 100644 --- a/ApplicationLibCode/Application/RiaPreferences.cpp +++ b/ApplicationLibCode/Application/RiaPreferences.cpp @@ -337,16 +337,16 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& { caf::PdmUiGroup* colorGroup = uiOrdering.addNewGroup( "Default Colors" ); colorGroup->add( &defaultViewerBackgroundColor ); - colorGroup->add( &defaultGridLineColors, false ); + colorGroup->appendToRow( &defaultGridLineColors ); colorGroup->add( &defaultFaultGridLineColors ); - colorGroup->add( &defaultWellLabelColor, false ); - colorGroup->add( &m_guiTheme, { true, 2 } ); + colorGroup->appendToRow( &defaultWellLabelColor ); + colorGroup->add( &m_guiTheme, { .newRow = true, .totalColumnSpan = 2 } ); caf::PdmUiGroup* fontGroup = uiOrdering.addNewGroup( "Default Font Sizes" ); fontGroup->add( &defaultSceneFontSize ); - fontGroup->add( &defaultAnnotationFontSize, false ); + fontGroup->appendToRow( &defaultAnnotationFontSize ); fontGroup->add( &defaultWellLabelFontSize ); - fontGroup->add( &defaultPlotFontSize, false ); + fontGroup->appendToRow( &defaultPlotFontSize ); caf::PdmUiGroup* viewsGroup = uiOrdering.addNewGroup( "3d Views" ); viewsGroup->add( &m_defaultMeshModeType ); @@ -354,9 +354,9 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& viewsGroup->add( &m_defaultScaleFactorZ ); viewsGroup->add( &m_showLegendBackground ); - viewsGroup->add( &m_enableFaultsByDefault, { false, 1 } ); + viewsGroup->add( &m_enableFaultsByDefault, { .newRow = false, .totalColumnSpan = 1 } ); viewsGroup->add( &m_showInfoBox ); - viewsGroup->add( &m_showGridBox, { false, 1 } ); + viewsGroup->add( &m_showGridBox, { .newRow = false, .totalColumnSpan = 1 } ); caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup( "Other" ); otherGroup->add( &ssihubAddress ); @@ -400,11 +400,11 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& caf::PdmUiGroup* pageSetup = generalGrp->addNewGroup( "Page Setup" ); pageSetup->add( &m_pageSize ); - pageSetup->add( &m_pageOrientation, false ); + pageSetup->appendToRow( &m_pageOrientation ); pageSetup->add( &m_pageLeftMargin ); - pageSetup->add( &m_pageRightMargin, false ); + pageSetup->appendToRow( &m_pageRightMargin ); pageSetup->add( &m_pageTopMargin ); - pageSetup->add( &m_pageBottomMargin, false ); + pageSetup->appendToRow( &m_pageBottomMargin ); generalGrp->add( &m_useQtChartsPlotByDefault ); m_useQtChartsPlotByDefault.uiCapability()->setUiHidden( true ); diff --git a/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelUi.cpp b/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelUi.cpp index b1c67b422e..3a16a078e5 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelUi.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelUi.cpp @@ -314,16 +314,16 @@ void RicExportEclipseSectorModelUi::defineUiOrdering( QString uiConfigName, caf: exportInLocalCoordinates.uiCapability()->setUiReadOnly( !exportGrid() ); caf::PdmUiGroup* gridBoxGroup = uiOrdering.addNewGroup( "Grid Box Selection" ); - gridBoxGroup->add( &exportGridBox, { true, 4, 1 } ); + gridBoxGroup->add( &exportGridBox, { .newRow = true, .totalColumnSpan = 4, .leftLabelColumnSpan = 1 } ); - gridBoxGroup->add( &minI, { true, 2, 1 } ); - gridBoxGroup->add( &minJ, false ); - gridBoxGroup->add( &minK, false ); + gridBoxGroup->add( &minI, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + gridBoxGroup->appendToRow( &minJ ); + gridBoxGroup->appendToRow( &minK ); - gridBoxGroup->add( &maxI, { true, 2, 1 } ); - gridBoxGroup->add( &maxJ, false ); - gridBoxGroup->add( &maxK, false ); - gridBoxGroup->add( &makeInvisibleCellsInactive, { true, 2, 1 } ); + gridBoxGroup->add( &maxI, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + gridBoxGroup->appendToRow( &maxJ ); + gridBoxGroup->appendToRow( &maxK ); + gridBoxGroup->add( &makeInvisibleCellsInactive, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); minI.uiCapability()->setUiReadOnly( exportGridBox() != MANUAL_SELECTION ); minJ.uiCapability()->setUiReadOnly( exportGridBox() != MANUAL_SELECTION ); @@ -333,9 +333,9 @@ void RicExportEclipseSectorModelUi::defineUiOrdering( QString uiConfigName, caf: maxK.uiCapability()->setUiReadOnly( exportGridBox() != MANUAL_SELECTION ); caf::PdmUiGroup* gridRefinement = uiOrdering.addNewGroup( "Grid Refinement" ); - gridRefinement->add( &refinementCountI, { true, 2, 1 } ); - gridRefinement->add( &refinementCountJ, { false } ); - gridRefinement->add( &refinementCountK, { false } ); + gridRefinement->add( &refinementCountI, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + gridRefinement->appendToRow( &refinementCountJ ); + gridRefinement->appendToRow( &refinementCountK ); refinementCountI.uiCapability()->setUiReadOnly( !exportGrid() ); refinementCountJ.uiCapability()->setUiReadOnly( !exportGrid() ); refinementCountK.uiCapability()->setUiReadOnly( !exportGrid() ); diff --git a/ApplicationLibCode/Commands/ExportCommands/RicExportLgrUi.cpp b/ApplicationLibCode/Commands/ExportCommands/RicExportLgrUi.cpp index 3dd7b7ba79..afdbcfe1cb 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicExportLgrUi.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicExportLgrUi.cpp @@ -220,19 +220,19 @@ void RicExportLgrUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField, //-------------------------------------------------------------------------------------------------- void RicExportLgrUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { - caf::PdmUiOrdering::LayoutOptions layout( true, 6, 1 ); + caf::PdmUiOrdering::LayoutOptions layout = { .newRow = true, .totalColumnSpan = 6, .leftLabelColumnSpan = 1 }; uiOrdering.add( &m_caseToApply, layout ); uiOrdering.add( &m_timeStep, layout ); uiOrdering.add( &m_exportFolder, layout ); uiOrdering.add( &m_includeFractures, layout ); uiOrdering.add( &m_includeFishbones, layout ); uiOrdering.add( &m_includePerforations, layout ); - uiOrdering.add( &m_splitType, { true, 6, 1 } ); + uiOrdering.add( &m_splitType, { .newRow = true, .totalColumnSpan = 6, .leftLabelColumnSpan = 1 } ); caf::PdmUiGroup* gridRefinement = uiOrdering.addNewGroup( "Grid Refinement" ); - gridRefinement->add( &m_cellCountI, { true, 2, 1 } ); - gridRefinement->add( &m_cellCountJ, { false } ); - gridRefinement->add( &m_cellCountK, { false } ); + gridRefinement->add( &m_cellCountI, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + gridRefinement->appendToRow( &m_cellCountJ ); + gridRefinement->appendToRow( &m_cellCountK ); // uiOrdering.add(&m_wellPathsInfo); uiOrdering.skipRemainingFields( true ); diff --git a/ApplicationLibCode/Commands/RicGridCalculatorUi.cpp b/ApplicationLibCode/Commands/RicGridCalculatorUi.cpp index a46fc3b83e..b1e9978d91 100644 --- a/ApplicationLibCode/Commands/RicGridCalculatorUi.cpp +++ b/ApplicationLibCode/Commands/RicGridCalculatorUi.cpp @@ -74,11 +74,8 @@ void RicGridCalculatorUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde caf::PdmUiGroup* group = uiOrdering.findGroup( calculationsGroupName() ); if ( group ) { - caf::PdmUiOrdering::LayoutOptions layoutOptions; - layoutOptions.newRow = false; - group->add( &m_importCalculations ); - group->add( &m_exportCalculations, layoutOptions ); + group->appendToRow( &m_exportCalculations ); } } diff --git a/ApplicationLibCode/Commands/RicUserDefinedCalculatorUi.cpp b/ApplicationLibCode/Commands/RicUserDefinedCalculatorUi.cpp index 9b79282fd5..3456ede972 100644 --- a/ApplicationLibCode/Commands/RicUserDefinedCalculatorUi.cpp +++ b/ApplicationLibCode/Commands/RicUserDefinedCalculatorUi.cpp @@ -138,10 +138,7 @@ void RicUserDefinedCalculatorUi::defineUiOrdering( QString uiConfigName, caf::Pd caf::PdmUiGroup* group = uiOrdering.addNewGroupWithKeyword( "Calculations", calculationsGroupName() ); group->add( &m_currentCalculation ); group->add( &m_newCalculation ); - - caf::PdmUiOrdering::LayoutOptions layoutOptions; - layoutOptions.newRow = false; - group->add( &m_deleteCalculation, layoutOptions ); + group->appendToRow( &m_deleteCalculation ); } { diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp index f747a7c4df..e152671799 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp @@ -489,8 +489,8 @@ void RimAnalysisPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering { caf::PdmUiGroup* selVectorsGrp = uiOrdering.addNewGroup( "Selected Vectors" ); selVectorsGrp->add( &m_selectedVarsUiField ); - selVectorsGrp->add( &m_selectVariablesButtonField, { false } ); - selVectorsGrp->add( &m_referenceCase, { true, 3, 2 } ); + selVectorsGrp->appendToRow( &m_selectVariablesButtonField ); + selVectorsGrp->add( &m_referenceCase, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 2 } ); QString vectorNames; if ( updateAndGetCurveAnalyzer() ) @@ -521,22 +521,22 @@ void RimAnalysisPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering caf::PdmUiGroup* titleGrp = uiOrdering.addNewGroup( "Title and Legend" ); titleGrp->add( &m_showPlotTitle ); - titleGrp->add( &m_useAutoPlotTitle, { false } ); - titleGrp->add( &m_description, { false } ); + titleGrp->appendToRow( &m_useAutoPlotTitle ); + titleGrp->appendToRow( &m_description ); m_description.uiCapability()->setUiReadOnly( m_useAutoPlotTitle() ); titleGrp->add( &m_showPlotLegends ); titleGrp->add( &m_legendFontSize ); m_legendFontSize.uiCapability()->setUiReadOnly( !m_showPlotLegends() ); caf::PdmUiGroup* chartSettings = uiOrdering.addNewGroup( "Bar Settings" ); - chartSettings->add( &m_barOrientation, { true, 3, 2 } ); + chartSettings->add( &m_barOrientation, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 2 } ); chartSettings->add( &m_majorGroupType ); chartSettings->add( &m_mediumGroupType ); chartSettings->add( &m_minorGroupType ); chartSettings->add( &m_valueSortOperation ); chartSettings->add( &m_useTopBarsFilter ); - chartSettings->add( &m_maxBarCount, { false } ); + chartSettings->appendToRow( &m_maxBarCount ); m_maxBarCount.uiCapability()->setUiReadOnly( !m_useTopBarsFilter() ); chartSettings->add( &m_sortGroupForColors ); diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.cpp b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.cpp index ace327b647..6cf447df64 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.cpp +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.cpp @@ -336,19 +336,19 @@ void RimPlotDataFilterItem::defineUiOrdering( QString uiConfigName, caf::PdmUiOr updateMaxMinAndDefaultValues( false ); - uiOrdering.add( &m_filterTarget, { true, -1, 1 } ); + uiOrdering.add( &m_filterTarget, { .leftLabelColumnSpan = 1 } ); if ( m_filterTarget() == ENSEMBLE_CASE ) { - uiOrdering.add( &m_filterEnsembleParameter, { true, caf::PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN, 1 } ); + uiOrdering.add( &m_filterEnsembleParameter, { .leftLabelColumnSpan = 1 } ); } else { - uiOrdering.add( &m_filterQuantityUiField, { true, caf::PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN, 1 } ); + uiOrdering.add( &m_filterQuantityUiField, { .leftLabelColumnSpan = 1 } ); // uiOrdering.add( &m_filterQuantitySelectButton, {false, 1, 0} ); } if ( m_filterTarget() != ENSEMBLE_CASE ) { - uiOrdering.add( &m_consideredTimestepsType, { true, caf::PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN, 1 } ); + uiOrdering.add( &m_consideredTimestepsType, { .leftLabelColumnSpan = 1 } ); if ( m_consideredTimestepsType == SELECT_TIMESTEPS || m_consideredTimestepsType == SELECT_TIMESTEP_RANGE ) { uiOrdering.add( &m_explicitlySelectedTimeSteps ); @@ -367,16 +367,16 @@ void RimPlotDataFilterItem::defineUiOrdering( QString uiConfigName, caf::PdmUiOr } else { - uiOrdering.add( &m_filterOperation, { true, 2, 1 } ); + uiOrdering.add( &m_filterOperation, { .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); if ( m_filterOperation() == RANGE ) { - uiOrdering.add( &m_max, { true, caf::PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN, 1 } ); - uiOrdering.add( &m_min, { true, caf::PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN, 1 } ); + uiOrdering.add( &m_max, { .leftLabelColumnSpan = 1 } ); + uiOrdering.add( &m_min, { .leftLabelColumnSpan = 1 } ); } else if ( m_filterOperation == TOP_N || m_filterOperation == BOTTOM_N ) { - uiOrdering.add( &m_topBottomN, { false } ); + uiOrdering.appendToRow( &m_topBottomN ); } } diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.cpp b/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.cpp index c69778426a..3bb69c5eab 100644 --- a/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.cpp +++ b/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.cpp @@ -128,7 +128,7 @@ void RimReachCircleAnnotation::defineUiOrdering( QString uiConfigName, caf::PdmU { uiOrdering.add( &m_name ); uiOrdering.add( &m_centerPointXyd ); - uiOrdering.add( &m_centerPointPickEnabled, false ); + uiOrdering.appendToRow( &m_centerPointPickEnabled ); uiOrdering.add( &m_radius ); auto appearanceGroup = uiOrdering.addNewGroup( "Appearance" ); diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/RimTextAnnotation.cpp b/ApplicationLibCode/ProjectDataModel/Annotations/RimTextAnnotation.cpp index df8fa68b69..4cf8a14fb1 100644 --- a/ApplicationLibCode/ProjectDataModel/Annotations/RimTextAnnotation.cpp +++ b/ApplicationLibCode/ProjectDataModel/Annotations/RimTextAnnotation.cpp @@ -149,9 +149,9 @@ const QString& RimTextAnnotation::text() const void RimTextAnnotation::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { uiOrdering.add( &m_anchorPointXyd ); - uiOrdering.add( &m_anchorPointPickEnabledButtonField, false ); + uiOrdering.appendToRow( &m_anchorPointPickEnabledButtonField ); uiOrdering.add( &m_labelPointXyd ); - uiOrdering.add( &m_labelPointPickEnabledButtonField, false ); + uiOrdering.appendToRow( &m_labelPointPickEnabledButtonField ); uiOrdering.add( &m_text ); diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.cpp index 3a19cb5c80..85911f9f0b 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.cpp @@ -259,9 +259,9 @@ void RimWellPathFracture::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde if ( m_fractureTemplate() ) { - uiOrdering.add( nameField(), caf::PdmUiOrdering::LayoutOptions( true, 3, 1 ) ); - uiOrdering.add( &m_fractureTemplate, { true, 2, 1 } ); - uiOrdering.add( &m_editFractureTemplate, { false, 1, 0 } ); + uiOrdering.add( nameField(), { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); + uiOrdering.add( &m_fractureTemplate, { .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + uiOrdering.add( &m_editFractureTemplate, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); } else { @@ -270,7 +270,7 @@ void RimWellPathFracture::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde if ( RimProject::current()->allFractureTemplates().empty() ) { uiOrdering.add( &m_createEllipseFractureTemplate ); - uiOrdering.add( &m_createStimPlanFractureTemplate, false ); + uiOrdering.appendToRow( &m_createStimPlanFractureTemplate ); } else { diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.cpp index 82965c32a5..f209c73400 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.cpp @@ -510,14 +510,14 @@ void RimWellPathValve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin { uiOrdering.skipRemainingFields( true ); - uiOrdering.add( &m_valveTemplate, { true, 2, 1 } ); + uiOrdering.add( &m_valveTemplate, { .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); { if ( m_valveTemplate() != nullptr ) { - uiOrdering.add( &m_editValveTemplate, false ); + uiOrdering.appendToRow( &m_editValveTemplate ); } - uiOrdering.add( &m_createValveTemplate, false ); + uiOrdering.appendToRow( &m_createValveTemplate ); } if ( uiConfigName != "TemplateOnly" ) @@ -538,7 +538,7 @@ void RimWellPathValve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin m_measuredDepth.uiCapability()->setUiName( "Measured Depth [ft]" ); } } - uiOrdering.add( &m_measuredDepth, { true, 3, 1 } ); + uiOrdering.add( &m_measuredDepth, { .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); } } diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp index bbdf37bb51..1a3013eb7a 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp @@ -748,13 +748,13 @@ void RimAbstractCorrelationPlot::appendDataSourceFields( QString uiConfigName, c m_selectedVarsUiField = selectedVectorNamesText(); curveDataGroup->add( &m_selectedVarsUiField ); - curveDataGroup->add( &m_pushButtonSelectSummaryAddress, { false, 1, 0 } ); + curveDataGroup->add( &m_pushButtonSelectSummaryAddress, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); curveDataGroup->add( &m_timeStepFilter ); curveDataGroup->add( &m_timeStep ); curveDataGroup->add( &m_useCaseFilter ); curveDataGroup->add( &m_curveSetForFiltering ); m_curveSetForFiltering.uiCapability()->setUiHidden( !m_useCaseFilter() ); - curveDataGroup->add( &m_editCaseFilter, { false, 1, 0 } ); + curveDataGroup->add( &m_editCaseFilter, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); m_editCaseFilter.uiCapability()->setUiHidden( !m_useCaseFilter() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellConnectivityTable.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellConnectivityTable.cpp index 3cb1504f7b..b5041f26c0 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellConnectivityTable.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellConnectivityTable.cpp @@ -492,7 +492,7 @@ void RimWellConnectivityTable::defineUiOrdering( QString uiConfigName, caf::PdmU caf::PdmUiGroup* producerGroup = selectionGroup->addNewGroup( "Producers" ); producerGroup->add( &m_selectedProducerTracersUiField ); producerGroup->add( &m_syncSelectedInjectorsFromProducerSelection ); - caf::PdmUiGroup* injectorGroup = selectionGroup->addNewGroup( "Injectors", false ); + caf::PdmUiGroup* injectorGroup = selectionGroup->addNewGroup( "Injectors", { .newRow = false } ); injectorGroup->add( &m_selectedInjectorTracersUiField ); injectorGroup->add( &m_syncSelectedProducersFromInjectorSelection ); diff --git a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.cpp b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.cpp index 4c8b199a79..8d52f7d19a 100644 --- a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.cpp @@ -1006,7 +1006,7 @@ void RimGridCrossPlotDataSet::defineUiOrdering( QString uiConfigName, caf::PdmUi caf::PdmUiGroup* xAxisGroup = invisibleFullWidthGroup->addNewGroup( "X-Axis Property" ); m_xAxisProperty->uiOrdering( uiConfigName, *xAxisGroup ); - caf::PdmUiGroup* yAxisGroup = invisibleFullWidthGroup->addNewGroup( "Y-Axis Property", false ); + caf::PdmUiGroup* yAxisGroup = invisibleFullWidthGroup->addNewGroup( "Y-Axis Property", { .newRow = false } ); m_yAxisProperty->uiOrdering( uiConfigName, *yAxisGroup ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimCustomObjectiveFunctionWeight.cpp b/ApplicationLibCode/ProjectDataModel/RimCustomObjectiveFunctionWeight.cpp index 3316f1a889..f459d88122 100644 --- a/ApplicationLibCode/ProjectDataModel/RimCustomObjectiveFunctionWeight.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimCustomObjectiveFunctionWeight.cpp @@ -192,7 +192,7 @@ void RimCustomObjectiveFunctionWeight::fieldChangedByUi( const caf::PdmFieldHand void RimCustomObjectiveFunctionWeight::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { uiOrdering.add( &m_objectiveValuesSummaryAddressesUiField ); - uiOrdering.add( &m_objectiveValuesSelectSummaryAddressPushButton, { false, 1, 0 } ); + uiOrdering.add( &m_objectiveValuesSelectSummaryAddressPushButton, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); uiOrdering.add( &m_weightValue ); uiOrdering.add( &m_objectiveFunction ); diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinition.cpp index 8d9252cb18..ea63ec6231 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -1485,7 +1485,7 @@ void RimEclipseResultDefinition::defineUiOrdering( QString uiConfigName, caf::Pd injectorGroup->add( &m_selectedInjectorTracersUiField ); injectorGroup->add( &m_syncInjectorToProducerSelection ); - caf::PdmUiGroup* producerGroup = selectionGroup->addNewGroup( "Producers", false ); + caf::PdmUiGroup* producerGroup = selectionGroup->addNewGroup( "Producers", { .newRow = false } ); producerGroup->add( &m_selectedProducerTracersUiField ); producerGroup->add( &m_syncProducerToInjectorSelection ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimRegularLegendConfig.cpp b/ApplicationLibCode/ProjectDataModel/RimRegularLegendConfig.cpp index 05b647fc46..0a038c0a84 100644 --- a/ApplicationLibCode/ProjectDataModel/RimRegularLegendConfig.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimRegularLegendConfig.cpp @@ -1275,8 +1275,8 @@ void RimRegularLegendConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiO formatGr->add( &m_precision ); formatGr->add( &m_tickNumberFormat ); - formatGr->add( &m_colorLegend, { true, 2, 1 } ); - formatGr->add( &m_selectColorLegendButton, { false, 1, 0 } ); + formatGr->add( &m_colorLegend, { .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + formatGr->add( &m_selectColorLegendButton, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); caf::PdmUiOrdering* mappingGr = uiOrdering.addNewGroup( "Mapping" ); mappingGr->add( &m_mappingMode ); @@ -1297,8 +1297,8 @@ void RimRegularLegendConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiO //-------------------------------------------------------------------------------------------------- void RimRegularLegendConfig::defineUiOrderingColorOnly( caf::PdmUiOrdering* colorGroup ) { - colorGroup->add( &m_colorLegend, { true, 2, 1 } ); - colorGroup->add( &m_selectColorLegendButton, { false, 1, 0 } ); + colorGroup->add( &m_colorLegend, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + colorGroup->add( &m_selectColorLegendButton, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp index cbff11281b..84554e9cd3 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp @@ -835,9 +835,9 @@ void RimStimPlanModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin m_barrierTextAnnotation.uiCapability()->setUiHidden( true ); m_azimuthAngle.uiCapability()->setUiHidden( m_fractureOrientation() != RimStimPlanModel::FractureOrientation::AZIMUTH ); - uiOrdering.add( nameField(), caf::PdmUiOrdering::LayoutOptions( true, 3, 1 ) ); - uiOrdering.add( &m_stimPlanModelTemplate, { true, 2, 1 } ); - uiOrdering.add( &m_editStimPlanModelTemplate, { false, 1, 0 } ); + uiOrdering.add( nameField(), { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); + uiOrdering.add( &m_stimPlanModelTemplate, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + uiOrdering.add( &m_editStimPlanModelTemplate, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); uiOrdering.add( &m_staticEclipseCase ); @@ -852,11 +852,11 @@ void RimStimPlanModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin uiOrdering.add( &m_thicknessDirection ); caf::PdmUiOrdering* extractionBoundariesGroup = uiOrdering.addNewGroup( "Extraction Depth Boundaries" ); - extractionBoundariesGroup->add( &m_extractionOffsetTop, caf::PdmUiOrdering::LayoutOptions( true, 3, 1 ) ); - extractionBoundariesGroup->add( &m_extractionDepthTop, { false, 2, 1 } ); + extractionBoundariesGroup->add( &m_extractionOffsetTop, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); + extractionBoundariesGroup->add( &m_extractionDepthTop, { .newRow = false, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); - extractionBoundariesGroup->add( &m_extractionOffsetBottom, caf::PdmUiOrdering::LayoutOptions( true, 3, 1 ) ); - extractionBoundariesGroup->add( &m_extractionDepthBottom, { false, 2, 1 } ); + extractionBoundariesGroup->add( &m_extractionOffsetBottom, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); + extractionBoundariesGroup->add( &m_extractionDepthBottom, { .newRow = false, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); caf::PdmUiOrdering* boundingBoxGroup = uiOrdering.addNewGroup( "Bounding Box" ); boundingBoxGroup->add( &m_boundingBoxHorizontal ); @@ -881,8 +881,8 @@ void RimStimPlanModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin asymmetricGroup->add( &m_barrierDip ); asymmetricGroup->add( &m_barrierFaultName ); - asymmetricGroup->add( &m_showOnlyBarrierFault, caf::PdmUiOrdering::LayoutOptions( true, 2, 1 ) ); - asymmetricGroup->add( &m_showAllFaults, { false, 1, 0 } ); + asymmetricGroup->add( &m_showOnlyBarrierFault, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + asymmetricGroup->add( &m_showAllFaults, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); asymmetricGroup->add( &m_wellPenetrationLayer ); diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPlot.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPlot.cpp index 8fdba73925..23247d2071 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPlot.cpp @@ -85,8 +85,8 @@ RimStimPlanModel* RimStimPlanModelPlot::stimPlanModel() //-------------------------------------------------------------------------------------------------- void RimStimPlanModelPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { - uiOrdering.add( &m_stimPlanModel, { true, 2, 1 } ); - uiOrdering.add( &m_editStimPlanModel, { false, 1, 0 } ); + uiOrdering.add( &m_stimPlanModel, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + uiOrdering.add( &m_editStimPlanModel, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); uiOrdering.add( &m_eclipseCase ); uiOrdering.add( &m_timeStep ); diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp index e197946bd1..d1c966d33a 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp @@ -248,8 +248,8 @@ void RimStimPlanModelTemplate::defineUiOrdering( QString uiConfigName, caf::PdmU pressureDataSourceGroup->add( &m_dynamicEclipseCase ); pressureDataSourceGroup->add( &m_timeStep ); pressureDataSourceGroup->add( &m_initialPressureEclipseCase ); - pressureDataSourceGroup->add( &m_useTableForInitialPressure, { true, 2, 1 } ); - pressureDataSourceGroup->add( &m_editPressureTable, { false, 1, 0 } ); + pressureDataSourceGroup->add( &m_useTableForInitialPressure, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + pressureDataSourceGroup->add( &m_editPressureTable, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); pressureDataSourceGroup->add( &m_useTableForPressure ); pressureDataSourceGroup->add( &m_useEqlnumForPressureInterpolation ); m_initialPressureEclipseCase.uiCapability()->setUiReadOnly( m_useTableForInitialPressure() ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.cpp index 179b3d1fd7..dac5bc9f3d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.cpp @@ -448,7 +448,7 @@ void RimEnsembleCurveFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiO else if ( m_filterMode() == FilterMode::BY_OBJECTIVE_FUNCTION ) { uiOrdering.add( &m_objectiveValuesSummaryAddressesUiField ); - uiOrdering.add( &m_objectiveValuesSelectSummaryAddressPushButton, { false, 1, 0 } ); + uiOrdering.add( &m_objectiveValuesSelectSummaryAddressPushButton, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); { auto equationGroup = uiOrdering.addNewGroup( "Equation" ); m_objectiveFunction->uiOrdering( "", *equationGroup ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 848975320e..2df32a624b 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -1130,7 +1130,7 @@ void RimEnsembleCurveSet::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector" ); curveDataGroup->add( &m_yValuesSummaryCaseCollection ); curveDataGroup->add( &m_yValuesSummaryAddressUiField ); - curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, { false, 1, 0 } ); + curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); if ( !isXAxisSummaryVector() ) { @@ -1327,7 +1327,8 @@ void RimEnsembleCurveSet::appendColorGroup( caf::PdmUiOrdering& uiOrdering ) if ( m_colorMode == ColorMode::BY_OBJECTIVE_FUNCTION ) { colorsGroup->add( &m_objectiveValuesSummaryAddressesUiField ); - colorsGroup->add( &m_objectiveValuesSelectSummaryAddressPushButton, { false, 1, 0 } ); + colorsGroup->add( &m_objectiveValuesSelectSummaryAddressPushButton, + { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); { auto equationGroup = colorsGroup->addNewGroup( "Equation" ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressSelector.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressSelector.cpp index 9d184eeb4c..ffcc9e5464 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressSelector.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressSelector.cpp @@ -350,15 +350,15 @@ void RimSummaryAddressSelector::defineUiOrdering( QString uiConfigName, caf::Pdm // Update the UI field, as this is not serialized to file m_summaryAddressUiField = m_summaryAddress->address(); - uiOrdering.add( &m_summaryAddressUiField, { true, 2, 1 } ); - uiOrdering.add( &m_pushButtonSelectSummaryAddress, { false, 1, 0 } ); + uiOrdering.add( &m_summaryAddressUiField, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + uiOrdering.add( &m_pushButtonSelectSummaryAddress, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); if ( m_showResampling ) { - uiOrdering.add( &m_resamplingPeriod, { true, 3, 1 } ); + uiOrdering.add( &m_resamplingPeriod, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); } - uiOrdering.add( &m_plotAxisProperties, { true, 3, 1 } ); + uiOrdering.add( &m_plotAxisProperties, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); uiOrdering.skipRemainingFields( true ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 0fe172c27e..e86e272ce3 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -902,22 +902,22 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering { QString curveDataGroupName = "Summary Vector"; caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword( curveDataGroupName, "curveDataGroupName" ); - curveDataGroup->add( &m_yValuesSummaryCase, { true, 3, 1 } ); - curveDataGroup->add( &m_yValuesSummaryAddressUiField, { true, 2, 1 } ); - curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, { false, 1, 0 } ); - curveDataGroup->add( &m_yValuesResampling, { true, 3, 1 } ); - curveDataGroup->add( &m_yPlotAxisProperties, { true, 3, 1 } ); + curveDataGroup->add( &m_yValuesSummaryCase, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); + curveDataGroup->add( &m_yValuesSummaryAddressUiField, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); + curveDataGroup->add( &m_yValuesResampling, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); + curveDataGroup->add( &m_yPlotAxisProperties, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); curveDataGroup->add( &m_showErrorBars ); } if ( m_showXAxisGroup ) { caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector X Axis" ); - curveDataGroup->add( &m_xAxisType, { true, 3, 1 } ); - curveDataGroup->add( &m_xValuesSummaryCase, { true, 3, 1 } ); - curveDataGroup->add( &m_xValuesSummaryAddressUiField, { true, 2, 1 } ); - curveDataGroup->add( &m_xPushButtonSelectSummaryAddress, { false, 1, 0 } ); - curveDataGroup->add( &m_xPlotAxisProperties, { true, 3, 1 } ); + curveDataGroup->add( &m_xAxisType, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); + curveDataGroup->add( &m_xValuesSummaryCase, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); + curveDataGroup->add( &m_xValuesSummaryAddressUiField, { .newRow = true, .totalColumnSpan = 2, .leftLabelColumnSpan = 1 } ); + curveDataGroup->add( &m_xPushButtonSelectSummaryAddress, { .newRow = false, .totalColumnSpan = 1, .leftLabelColumnSpan = 0 } ); + curveDataGroup->add( &m_xPlotAxisProperties, { .newRow = true, .totalColumnSpan = 3, .leftLabelColumnSpan = 1 } ); } caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotManager.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotManager.cpp index fd37ef95f0..a3f9be3ff2 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotManager.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotManager.cpp @@ -344,17 +344,17 @@ void RimSummaryPlotManager::defineUiOrdering( QString uiConfigName, caf::PdmUiOr uiOrdering.add( &m_filterText ); uiOrdering.add( &m_addressCandidates ); - uiOrdering.add( &m_selectedDataSources, false ); + uiOrdering.appendToRow( &m_selectedDataSources ); uiOrdering.add( &m_individualPlotPerVector ); - uiOrdering.add( &m_individualPlotPerDataSource, false ); + uiOrdering.appendToRow( &m_individualPlotPerDataSource ); uiOrdering.add( &m_individualPlotPerObject ); - uiOrdering.add( &m_createMultiPlot, false ); + uiOrdering.appendToRow( &m_createMultiPlot ); uiOrdering.add( &m_pushButtonAppend ); - uiOrdering.add( &m_pushButtonReplace, { false } ); - uiOrdering.add( &m_labelB, { false } ); - uiOrdering.add( &m_pushButtonNewPlot, { false } ); + uiOrdering.appendToRow( &m_pushButtonReplace ); + uiOrdering.appendToRow( &m_labelB ); + uiOrdering.appendToRow( &m_pushButtonNewPlot ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp index 0ea047dce7..bc1dd831e3 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp @@ -802,10 +802,10 @@ void RimSummaryTimeAxisProperties::defineUiOrdering( QString uiConfigName, caf:: timeGroup->add( &m_timeMode ); if ( m_timeMode() == DATE ) { - timeGroup->add( &m_visibleDateRangeMax, true ); - timeGroup->add( &m_visibleTimeRangeMax, false ); - timeGroup->add( &m_visibleDateRangeMin, true ); - timeGroup->add( &m_visibleTimeRangeMin, false ); + timeGroup->add( &m_visibleDateRangeMax ); + timeGroup->appendToRow( &m_visibleTimeRangeMax ); + timeGroup->add( &m_visibleDateRangeMin ); + timeGroup->appendToRow( &m_visibleTimeRangeMin ); } else { diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiOrdering.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiOrdering.cpp index baf1518360..74c0b73f95 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiOrdering.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiOrdering.cpp @@ -48,10 +48,10 @@ namespace caf //-------------------------------------------------------------------------------------------------- PdmUiOrdering::~PdmUiOrdering() { - for ( size_t i = 0; i < m_createdGroups.size(); ++i ) + for ( auto& createdGroup : m_createdGroups ) { - delete m_createdGroups[i]; - m_createdGroups[i] = nullptr; + delete createdGroup; + createdGroup = nullptr; } } @@ -60,11 +60,11 @@ PdmUiOrdering::~PdmUiOrdering() //-------------------------------------------------------------------------------------------------- PdmUiGroup* PdmUiOrdering::addNewGroup( const QString& displayName, LayoutOptions layout ) { - PdmUiGroup* group = new PdmUiGroup; + auto* group = new PdmUiGroup; group->setUiName( displayName ); m_createdGroups.push_back( group ); - m_ordering.push_back( std::make_pair( group, layout ) ); + m_ordering.emplace_back( group, layout ); return group; } @@ -93,10 +93,8 @@ bool PdmUiOrdering::insertBeforeGroup( const QString& groupId, const PdmFieldHan pos.parent->insert( pos.indexInParent, field, layout ); return true; } - else - { - return false; - } + + return false; } //-------------------------------------------------------------------------------------------------- @@ -110,10 +108,8 @@ bool PdmUiOrdering::insertBeforeItem( const PdmUiItem* item, const PdmFieldHandl pos.parent->insert( pos.indexInParent, field, layout ); return true; } - else - { - return false; - } + + return false; } //-------------------------------------------------------------------------------------------------- @@ -184,7 +180,7 @@ caf::PdmUiGroup* PdmUiOrdering::insertNewGroupWithKeyword( size_t index, const QString& groupKeyword, LayoutOptions layout ) { - PdmUiGroup* group = new PdmUiGroup; + auto* group = new PdmUiGroup; group->setUiName( displayName ); m_createdGroups.push_back( group ); @@ -248,7 +244,7 @@ void PdmUiOrdering::add( const PdmFieldHandle* field, LayoutOptions layout ) CAF_ASSERT( uiItem ); CAF_ASSERT( !this->contains( uiItem ) ); - m_ordering.push_back( std::make_pair( uiItem, layout ) ); + m_ordering.emplace_back( uiItem, layout ); } //-------------------------------------------------------------------------------------------------- @@ -259,7 +255,15 @@ void PdmUiOrdering::add( const PdmObjectHandle* obj, LayoutOptions layout ) PdmUiObjectHandle* uiItem = uiObj( const_cast( obj ) ); CAF_ASSERT( uiItem ); CAF_ASSERT( !this->contains( uiItem ) ); - m_ordering.push_back( std::make_pair( uiItem, layout ) ); + m_ordering.emplace_back( uiItem, layout ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void PdmUiOrdering::appendToRow( const PdmFieldHandle* field ) +{ + add( field, { .newRow = false } ); } //-------------------------------------------------------------------------------------------------- @@ -325,7 +329,7 @@ PdmUiOrdering::TableLayout PdmUiOrdering::calculateTableLayout( const QString& u if ( m_ordering[i].second.newRow || i == 0u ) { - tableLayout.push_back( RowLayout() ); + tableLayout.emplace_back(); } tableLayout.back().push_back( m_ordering[i] ); } @@ -370,7 +374,7 @@ int PdmUiOrdering::nrOfExpandingItemsInRow( const RowLayout& rowItems ) const int nrOfExpandingItems = 0; for ( const FieldAndLayout& item : rowItems ) { - if ( item.second.totalColumnSpan == LayoutOptions::MAX_COLUMN_SPAN ) nrOfExpandingItems++; + if ( item.second.totalColumnSpan == MAX_COLUMN_SPAN ) nrOfExpandingItems++; } return nrOfExpandingItems; } @@ -401,7 +405,7 @@ void PdmUiOrdering::nrOfColumnsRequiredForItem( const FieldAndLayout& fieldAndLa if ( uiItem->uiLabelPosition() == PdmUiItemInfo::LEFT ) { *labelColumnsRequired = 1; - if ( layoutOption.leftLabelColumnSpan != LayoutOptions::MAX_COLUMN_SPAN ) + if ( layoutOption.leftLabelColumnSpan != MAX_COLUMN_SPAN ) { *labelColumnsRequired = layoutOption.leftLabelColumnSpan; } @@ -409,7 +413,7 @@ void PdmUiOrdering::nrOfColumnsRequiredForItem( const FieldAndLayout& fieldAndLa *totalColumnsRequired = *labelColumnsRequired + *fieldColumnsRequired; } - if ( layoutOption.totalColumnSpan != LayoutOptions::MAX_COLUMN_SPAN ) + if ( layoutOption.totalColumnSpan != MAX_COLUMN_SPAN ) { *totalColumnsRequired = layoutOption.totalColumnSpan; } @@ -424,10 +428,8 @@ caf::PdmUiItem* PdmUiOrdering::PositionFound::item() { return parent->uiItems()[indexInParent]; } - else - { - return nullptr; - } + + return nullptr; } //-------------------------------------------------------------------------------------------------- @@ -440,10 +442,8 @@ caf::PdmUiGroup* PdmUiOrdering::PositionFound::group() { return static_cast( g ); } - else - { - return nullptr; - } + + return nullptr; } } // End of namespace caf diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiOrdering.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiOrdering.h index d6bd5043e3..885c8d78da 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiOrdering.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiOrdering.h @@ -54,23 +54,22 @@ class PdmObjectHandle; class PdmUiOrdering { public: + static const int MAX_COLUMN_SPAN = -1; + struct LayoutOptions { - static const int MAX_COLUMN_SPAN = -1; - LayoutOptions( bool newRow = true, int totalColumnSpan = MAX_COLUMN_SPAN, int leftLabelColumnSpan = MAX_COLUMN_SPAN ) - : newRow( newRow ) - , totalColumnSpan( totalColumnSpan ) - , leftLabelColumnSpan( leftLabelColumnSpan ) - { - } - - bool newRow; - int totalColumnSpan; - int leftLabelColumnSpan; + bool newRow{ true }; + int totalColumnSpan{ MAX_COLUMN_SPAN }; + int leftLabelColumnSpan{ MAX_COLUMN_SPAN }; }; - typedef std::pair FieldAndLayout; - typedef std::vector RowLayout; - typedef std::vector TableLayout; + + // Required to use a static function as workaround instead of using LayoutOptions() + // https://stackoverflow.com/questions/53408962/try-to-understand-compiler-error-message-default-member-initializer-required-be + static LayoutOptions defaultLayoutOptions() { return {}; } + + using FieldAndLayout = std::pair; + using RowLayout = std::vector; + using TableLayout = std::vector; PdmUiOrdering() : m_skipRemainingFields( false ){}; @@ -79,33 +78,38 @@ public: PdmUiOrdering( const PdmUiOrdering& ) = delete; PdmUiOrdering& operator=( const PdmUiOrdering& ) = delete; - void add( const PdmFieldHandle* field, LayoutOptions layout = LayoutOptions() ); - void add( const PdmObjectHandle* obj, LayoutOptions layout = LayoutOptions() ); + void add( const PdmFieldHandle* field, LayoutOptions layout = defaultLayoutOptions() ); + + // Add a field without creating a new row + void appendToRow( const PdmFieldHandle* field ); + + void add( const PdmObjectHandle* obj, LayoutOptions layout = defaultLayoutOptions() ); bool insertBeforeGroup( const QString& groupId, const PdmFieldHandle* fieldToInsert, - LayoutOptions layout = LayoutOptions() ); + LayoutOptions layout = defaultLayoutOptions() ); bool insertBeforeItem( const PdmUiItem* item, const PdmFieldHandle* fieldToInsert, - LayoutOptions layout = LayoutOptions() ); + LayoutOptions layout = defaultLayoutOptions() ); - PdmUiGroup* addNewGroup( const QString& displayName, LayoutOptions layout = LayoutOptions() ); + PdmUiGroup* addNewGroup( const QString& displayName, LayoutOptions layout = defaultLayoutOptions() ); PdmUiGroup* createGroupBeforeGroup( const QString& groupId, const QString& displayName, - LayoutOptions layout = LayoutOptions() ); - PdmUiGroup* - createGroupBeforeItem( const PdmUiItem* item, const QString& displayName, LayoutOptions layout = LayoutOptions() ); + LayoutOptions layout = defaultLayoutOptions() ); + PdmUiGroup* createGroupBeforeItem( const PdmUiItem* item, + const QString& displayName, + LayoutOptions layout = defaultLayoutOptions() ); PdmUiGroup* addNewGroupWithKeyword( const QString& displayName, const QString& groupKeyword, - LayoutOptions layout = LayoutOptions() ); + LayoutOptions layout = defaultLayoutOptions() ); PdmUiGroup* createGroupWithIdBeforeGroup( const QString& groupId, const QString& displayName, const QString& newGroupId, - LayoutOptions layout = LayoutOptions() ); + LayoutOptions layout = defaultLayoutOptions() ); PdmUiGroup* createGroupWithIdBeforeItem( const PdmUiItem* item, const QString& displayName, const QString& newGroupId, - LayoutOptions layout = LayoutOptions() ); + LayoutOptions layout = defaultLayoutOptions() ); PdmUiGroup* findGroup( const QString& groupId ) const; @@ -140,11 +144,11 @@ protected: PositionFound findItemPosition( const PdmUiItem* item ) const; private: - void insert( size_t index, const PdmFieldHandle* field, LayoutOptions layout = LayoutOptions() ); + void insert( size_t index, const PdmFieldHandle* field, LayoutOptions layout = defaultLayoutOptions() ); PdmUiGroup* insertNewGroupWithKeyword( size_t index, const QString& displayName, const QString& groupKeyword, - LayoutOptions layout = LayoutOptions() ); + LayoutOptions layout = defaultLayoutOptions() ); std::vector m_ordering; ///< The order of groups and fields std::vector m_createdGroups; ///< Owned PdmUiGroups, for memory management only @@ -153,4 +157,4 @@ private: } // End of namespace caf -#include "cafPdmUiGroup.h" \ No newline at end of file +#include "cafPdmUiGroup.h" diff --git a/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp b/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp index 741d220360..4d87f66a0c 100644 --- a/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp +++ b/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp @@ -577,53 +577,47 @@ protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override { uiOrdering.add( &m_intFieldStandard ); - uiOrdering.add( &m_intFieldUseFullSpace, - caf::PdmUiOrdering::LayoutOptions( true, - caf::PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN, - caf::PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN ) ); - uiOrdering.add( &m_intFieldUseFullSpaceLabel, - caf::PdmUiOrdering::LayoutOptions( true, 3, caf::PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN ) ); - uiOrdering.add( &m_intFieldUseFullSpaceField, - caf::PdmUiOrdering::LayoutOptions( true, caf::PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN, 1 ) ); - uiOrdering.add( &m_intFieldWideLabel, caf::PdmUiOrdering::LayoutOptions( true, 4, 3 ) ); - uiOrdering.add( &m_intFieldWideField, caf::PdmUiOrdering::LayoutOptions( true, 4, 1 ) ); - uiOrdering.add( &m_intFieldLeft, caf::PdmUiOrdering::LayoutOptions( true ) ); - uiOrdering.add( &m_intFieldRight, caf::PdmUiOrdering::LayoutOptions( false ) ); - uiOrdering.add( &m_intFieldWideBoth, caf::PdmUiOrdering::LayoutOptions( true, 4, 2 ) ); + uiOrdering.add( &m_intFieldUseFullSpace ); + uiOrdering.add( &m_intFieldUseFullSpaceLabel, { .totalColumnSpan = 3 } ); + uiOrdering.add( &m_intFieldUseFullSpaceField, { .leftLabelColumnSpan = 1 } ); + uiOrdering.add( &m_intFieldWideLabel, { .totalColumnSpan = 4, .leftLabelColumnSpan = 3 } ); + uiOrdering.add( &m_intFieldWideField, { .totalColumnSpan = 4, .leftLabelColumnSpan = 1 } ); + uiOrdering.add( &m_intFieldLeft ); + uiOrdering.appendToRow( &m_intFieldRight ); + uiOrdering.add( &m_intFieldWideBoth, { .totalColumnSpan = 4, .leftLabelColumnSpan = 2 } ); QString dynamicGroupName = QString( "Dynamic Group Text (%1)" ).arg( m_intFieldStandard ); - caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Wide Group", { true, 4 } ); - group->add( &m_intFieldWideBoth2, caf::PdmUiOrdering::LayoutOptions( true, 6, 3 ) ); - group->add( &m_intFieldLeft2, caf::PdmUiOrdering::LayoutOptions( true ) ); - group->add( &m_intFieldCenter, caf::PdmUiOrdering::LayoutOptions( false ) ); - group->add( &m_intFieldRight2, caf::PdmUiOrdering::LayoutOptions( false ) ); - group->add( &m_intFieldLabelTop, caf::PdmUiOrdering::LayoutOptions( true, 6 ) ); - group->add( &m_stringFieldLabelHidden, caf::PdmUiOrdering::LayoutOptions( true, 6 ) ); + caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Wide Group", { .totalColumnSpan = 4 } ); + group->add( &m_intFieldWideBoth2, { .totalColumnSpan = 6, .leftLabelColumnSpan = 3 } ); + group->add( &m_intFieldLeft2 ); + group->appendToRow( &m_intFieldCenter ); + group->appendToRow( &m_intFieldRight2 ); + group->add( &m_intFieldLabelTop, { .totalColumnSpan = 6 } ); + group->add( &m_stringFieldLabelHidden, { .totalColumnSpan = 6 } ); - caf::PdmUiGroup* autoGroup = - uiOrdering.addNewGroup( "Automatic Full Width Group", caf::PdmUiOrdering::LayoutOptions( true ) ); - autoGroup->add( &m_intFieldWideBothAuto, caf::PdmUiOrdering::LayoutOptions( true ) ); - autoGroup->add( &m_intFieldLeftAuto, caf::PdmUiOrdering::LayoutOptions( true ) ); - autoGroup->add( &m_intFieldCenterAuto, false ); - autoGroup->add( &m_intFieldRightAuto, caf::PdmUiOrdering::LayoutOptions( false ) ); - autoGroup->add( &m_intFieldLabelTopAuto, true ); - autoGroup->add( &m_stringFieldLabelHiddenAuto, true ); + caf::PdmUiGroup* autoGroup = uiOrdering.addNewGroup( "Automatic Full Width Group" ); + autoGroup->add( &m_intFieldWideBothAuto ); + autoGroup->add( &m_intFieldLeftAuto ); + autoGroup->appendToRow( &m_intFieldCenterAuto ); + autoGroup->appendToRow( &m_intFieldRightAuto ); + autoGroup->add( &m_intFieldLabelTopAuto ); + autoGroup->add( &m_stringFieldLabelHiddenAuto ); uiOrdering.add( &m_intFieldLeftOfGroup ); - caf::PdmUiGroup* group2 = uiOrdering.addNewGroup( "Right Group", caf::PdmUiOrdering::LayoutOptions( false, 2, 0 ) ); + caf::PdmUiGroup* group2 = + uiOrdering.addNewGroup( "Right Group", { .newRow = false, .totalColumnSpan = 2, .leftLabelColumnSpan = 0 } ); group2->setEnableFrame( false ); group2->add( &m_intFieldInsideGroup1 ); - caf::PdmUiGroup* group3 = uiOrdering.addNewGroup( "Narrow L", caf::PdmUiOrdering::LayoutOptions( true, 1 ) ); + caf::PdmUiGroup* group3 = uiOrdering.addNewGroup( "Narrow L", { .totalColumnSpan = 1 } ); group3->add( &m_intFieldInsideGroup2 ); - uiOrdering.add( &m_intFieldRightOfGroup, caf::PdmUiOrdering::LayoutOptions( false, 3, 2 ) ); + uiOrdering.add( &m_intFieldRightOfGroup, { .newRow = false, .totalColumnSpan = 3, .leftLabelColumnSpan = 2 } ); - caf::PdmUiGroup* groupL = uiOrdering.addNewGroup( "Left Group", caf::PdmUiOrdering::LayoutOptions( true, 1 ) ); + caf::PdmUiGroup* groupL = uiOrdering.addNewGroup( "Left Group", { .totalColumnSpan = 1 } ); groupL->add( &m_intFieldInsideGroup3 ); groupL->add( &m_intFieldInsideGroup5 ); - caf::PdmUiGroup* groupR = - uiOrdering.addNewGroup( "Right Wide Group", caf::PdmUiOrdering::LayoutOptions( false, 3 ) ); + caf::PdmUiGroup* groupR = uiOrdering.addNewGroup( "Right Wide Group", { .newRow = false, .totalColumnSpan = 3 } ); groupR->setEnableFrame( false ); groupR->add( &m_intFieldInsideGroup4 ); groupR->add( &m_intFieldInsideGroup6 ); @@ -690,7 +684,8 @@ public: CAF_PDM_InitField( &m_toggleField, "Toggle", false, - "Toggle Field much text much text much much text much text muchmuch text much text muchmuch " + "Toggle Field much text much text much much text much text muchmuch text much text " + "muchmuch " "text much " "text muchmuch text much text muchmuch text much text much", "", diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp index 0e936df77a..67748340a1 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp @@ -139,7 +139,7 @@ int caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingInG &minimumItemColumnSpan, &minimumLabelColumnSpan, &minimumFieldColumnSpan ); - bool isExpandingItem = currentLayout.totalColumnSpan == PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN; + bool isExpandingItem = currentLayout.totalColumnSpan == PdmUiOrdering::MAX_COLUMN_SPAN; int spareColumnsToAssign = 0; if ( isExpandingItem ) @@ -225,13 +225,13 @@ int caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingInG { CAF_ASSERT( labelPos == PdmUiItemInfo::LEFT ); int leftLabelColumnSpan = minimumLabelColumnSpan; - if ( currentLayout.leftLabelColumnSpan == PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN && - currentLayout.totalColumnSpan != PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN ) + if ( currentLayout.leftLabelColumnSpan == PdmUiOrdering::MAX_COLUMN_SPAN && + currentLayout.totalColumnSpan != PdmUiOrdering::MAX_COLUMN_SPAN ) { leftLabelColumnSpan += spareColumnsToAssign; spareColumnsToAssign = 0; } - else if ( currentLayout.leftLabelColumnSpan == PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN ) + else if ( currentLayout.leftLabelColumnSpan == PdmUiOrdering::MAX_COLUMN_SPAN ) { leftLabelColumnSpan += spareColumnsToAssign / 2; spareColumnsToAssign -= spareColumnsToAssign / 2;