diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-14 16:49:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-15 17:07:29 +0200 |
commit | 1c4a99648988ee39ce2c6a79981885e775f0d08c (patch) | |
tree | 293e42d5d3b58c0779a9d805173c23db0f5d3acc | |
parent | a58e2af67af1daedd5b680c0b78ff8416bfdca45 (diff) |
weld InsertErrorBarsDialog and ErrorBarsTabPage
Change-Id: I3fb2fb4d8010e43e59b4de5c488f137960bc6417
Reviewed-on: https://gerrit.libreoffice.org/61760
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx | 22 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/res_ErrorBar.cxx | 436 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_ErrorBars.cxx | 18 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_ErrorBars.hxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/inc/dlg_InsertErrorBars.hxx | 11 | ||||
-rw-r--r-- | chart2/source/controller/inc/res_ErrorBar.hxx | 94 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Insert.cxx | 10 | ||||
-rw-r--r-- | chart2/uiconfig/ui/dlg_InsertErrorBars.ui | 110 | ||||
-rw-r--r-- | chart2/uiconfig/ui/tp_ErrorBars.ui | 116 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 1 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 10 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 5 |
12 files changed, 391 insertions, 444 deletions
diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx index dc93eff7d44b..084ada9c74aa 100644 --- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx @@ -39,19 +39,17 @@ namespace chart { InsertErrorBarsDialog::InsertErrorBarsDialog( - vcl::Window* pParent, const SfxItemSet& rMyAttrs, + weld::Window* pParent, const SfxItemSet& rMyAttrs, const uno::Reference< chart2::XChartDocument > & xChartDocument, - ErrorBarResources::tErrorBarType eType /* = ErrorBarResources::ERROR_BAR_Y */ ) : - ModalDialog( pParent - ,"dlg_InsertErrorBars" - ,"modules/schart/ui/dlg_InsertErrorBars.ui"), - m_apErrorBarResources( new ErrorBarResources( - this, this, rMyAttrs, + ErrorBarResources::tErrorBarType eType /* = ErrorBarResources::ERROR_BAR_Y */ ) + : GenericDialogController(pParent, "modules/schart/ui/dlg_InsertErrorBars.ui", "dlg_InsertErrorBars") + , m_apErrorBarResources( new ErrorBarResources( + m_xBuilder.get(), TabPageParent(m_xDialog.get(), nullptr), rMyAttrs, /* bNoneAvailable = */ true, eType )) { ObjectType objType = eType == ErrorBarResources::ERROR_BAR_Y ? OBJECTTYPE_DATA_ERRORS_Y : OBJECTTYPE_DATA_ERRORS_X; - SetText( ObjectNameProvider::getName_ObjectForAllSeries(objType) ); + m_xDialog->set_title(ObjectNameProvider::getName_ObjectForAllSeries(objType)); m_apErrorBarResources->SetChartDocumentForRangeChoosing( xChartDocument ); } @@ -61,14 +59,6 @@ void InsertErrorBarsDialog::FillItemSet(SfxItemSet& rOutAttrs) m_apErrorBarResources->FillItemSet(rOutAttrs); } -void InsertErrorBarsDialog::DataChanged( const DataChangedEvent& rDCEvt ) -{ - ModalDialog::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) - m_apErrorBarResources->FillValueSets(); -} - void InsertErrorBarsDialog::SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth ) { m_apErrorBarResources->SetAxisMinorStepWidthForErrorBarDecimals( fMinorStepWidth ); diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index 52b2c8401a41..ea7f55413225 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -38,12 +38,17 @@ using namespace ::com::sun::star; namespace { -void lcl_enableRangeChoosing( bool bEnable, Dialog * pDialog ) +void lcl_enableRangeChoosing(bool bEnable, TabPageParent pParent) { - if( pDialog ) + if (weld::Window* pWeldDialog = dynamic_cast<weld::Window*>(pParent.pPage)) { - pDialog->Show( !bEnable ); - pDialog->SetModalInputMode( !bEnable ); + pWeldDialog->set_modal(!bEnable); + pWeldDialog->show(!bEnable); + } + else if (::Dialog* pVCLDialog = pParent.pParent ? pParent.pParent->GetParentDialog() : nullptr) + { + pVCLDialog->Show(!bEnable); + pVCLDialog->SetModalInputMode(!bEnable); } } @@ -79,78 +84,74 @@ sal_uInt16 lcl_getLbEntryPosByErrorKind( SvxChartKindError eErrorKind ) namespace chart { -ErrorBarResources::ErrorBarResources( VclBuilderContainer* pParent, Dialog * pParentDialog, - const SfxItemSet& rInAttrs, bool bNoneAvailable, - tErrorBarType eType /* = ERROR_BAR_Y */ ) : - m_eErrorKind( SvxChartKindError::NONE ), - m_eIndicate( SvxChartIndicate::Both ), - m_bErrorKindUnique( true ), - m_bIndicatorUnique( true ), - m_bRangePosUnique( true ), - m_bRangeNegUnique( true ), - m_eErrorBarType( eType ), - m_nConstDecimalDigits( 1 ), - m_nConstSpinSize( 1 ), - m_fPlusValue(0.0), - m_fMinusValue(0.0), - m_pParentDialog( pParentDialog ), - m_pCurrentRangeChoosingField( nullptr ), - m_bHasInternalDataProvider( true ), - m_bEnableDataTableDialog( true ) +ErrorBarResources::ErrorBarResources(weld::Builder* pParent, TabPageParent pParentDialog, + const SfxItemSet& rInAttrs, bool bNoneAvailable, + tErrorBarType eType /* = ERROR_BAR_Y */ ) + : m_eErrorKind( SvxChartKindError::NONE ) + , m_eIndicate( SvxChartIndicate::Both ) + , m_bErrorKindUnique( true ) + , m_bIndicatorUnique( true ) + , m_bRangePosUnique( true ) + , m_bRangeNegUnique( true ) + , m_eErrorBarType( eType ) + , m_nConstDecimalDigits( 1 ) + , m_nConstSpinSize( 1 ) + , m_fPlusValue(0.0) + , m_fMinusValue(0.0) + , m_pParentDialog( pParentDialog ) + , m_pCurrentRangeChoosingField( nullptr ) + , m_bHasInternalDataProvider( true ) + , m_bEnableDataTableDialog( true ) + , m_xRbNone(pParent->weld_radio_button("RB_NONE")) + , m_xRbConst(pParent->weld_radio_button("RB_CONST")) + , m_xRbPercent(pParent->weld_radio_button("RB_PERCENT")) + , m_xRbFunction(pParent->weld_radio_button("RB_FUNCTION")) + , m_xRbRange(pParent->weld_radio_button("RB_RANGE")) + , m_xLbFunction(pParent->weld_combo_box("LB_FUNCTION")) + , m_xFlParameters(pParent->weld_frame("framePARAMETERS")) + , m_xBxPositive(pParent->weld_widget("boxPOSITIVE")) + , m_xMfPositive(pParent->weld_metric_spin_button("MF_POSITIVE", FUNIT_NONE)) + , m_xEdRangePositive(pParent->weld_entry("ED_RANGE_POSITIVE")) + , m_xIbRangePositive(pParent->weld_button("IB_RANGE_POSITIVE")) + , m_xBxNegative(pParent->weld_widget("boxNEGATIVE")) + , m_xMfNegative(pParent->weld_metric_spin_button("MF_NEGATIVE", FUNIT_NONE)) + , m_xEdRangeNegative(pParent->weld_entry("ED_RANGE_NEGATIVE")) + , m_xIbRangeNegative(pParent->weld_button("IB_RANGE_NEGATIVE")) + , m_xCbSyncPosNeg(pParent->weld_check_button("CB_SYN_POS_NEG")) + , m_xRbBoth(pParent->weld_radio_button("RB_BOTH")) + , m_xRbPositive(pParent->weld_radio_button("RB_POSITIVE")) + , m_xRbNegative(pParent->weld_radio_button("RB_NEGATIVE")) + , m_xFiBoth(pParent->weld_image("FI_BOTH")) + , m_xFiPositive(pParent->weld_image("FI_POSITIVE")) + , m_xFiNegative(pParent->weld_image("FI_NEGATIVE")) + , m_xUIStringPos(pParent->weld_label("STR_DATA_SELECT_RANGE_FOR_POSITIVE_ERRORBARS")) + , m_xUIStringNeg(pParent->weld_label("STR_DATA_SELECT_RANGE_FOR_NEGATIVE_ERRORBARS")) + , m_xUIStringRbRange(pParent->weld_label("STR_CONTROLTEXT_ERROR_BARS_FROM_DATA")) { - pParent->get(m_pRbNone,"RB_NONE"); - pParent->get(m_pRbConst, "RB_CONST"); - pParent->get(m_pRbPercent, "RB_PERCENT"); - pParent->get(m_pRbFunction, "RB_FUNCTION"); - pParent->get(m_pRbRange, "RB_RANGE"); - pParent->get(m_pLbFunction, "LB_FUNCTION"); - - pParent->get(m_pFlParameters, "framePARAMETERS"); - pParent->get(m_pBxPositive, "boxPOSITIVE"); - pParent->get(m_pMfPositive, "MF_POSITIVE"); - pParent->get(m_pEdRangePositive, "ED_RANGE_POSITIVE"); - pParent->get(m_pIbRangePositive, "IB_RANGE_POSITIVE"); - pParent->get(m_pBxNegative, "boxNEGATIVE"); - pParent->get(m_pMfNegative, "MF_NEGATIVE"); - pParent->get(m_pEdRangeNegative, "ED_RANGE_NEGATIVE"); - pParent->get(m_pIbRangeNegative, "IB_RANGE_NEGATIVE"); - pParent->get(m_pCbSyncPosNeg, "CB_SYN_POS_NEG"); - - pParent->get(m_pRbBoth, "RB_BOTH"); - pParent->get(m_pRbPositive, "RB_POSITIVE"); - pParent->get(m_pRbNegative, "RB_NEGATIVE"); - pParent->get(m_pFiBoth, "FI_BOTH"); - pParent->get(m_pFiPositive, "FI_POSITIVE"); - pParent->get(m_pFiNegative, "FI_NEGATIVE"); - - pParent->get(m_pUIStringPos, "STR_DATA_SELECT_RANGE_FOR_POSITIVE_ERRORBARS"); - pParent->get(m_pUIStringNeg, "STR_DATA_SELECT_RANGE_FOR_NEGATIVE_ERRORBARS"); - pParent->get(m_pUIStringRbRange, "STR_CONTROLTEXT_ERROR_BARS_FROM_DATA"); - if( bNoneAvailable ) - m_pRbNone->SetClickHdl( LINK( this, ErrorBarResources, CategoryChosen )); + m_xRbNone->connect_toggled(LINK(this, ErrorBarResources, CategoryChosen)); else - m_pRbNone->Hide(); + m_xRbNone->hide(); - m_pRbConst->SetClickHdl( LINK( this, ErrorBarResources, CategoryChosen )); - m_pRbPercent->SetClickHdl( LINK( this, ErrorBarResources, CategoryChosen )); - m_pRbFunction->SetClickHdl( LINK( this, ErrorBarResources, CategoryChosen )); - m_pRbRange->SetClickHdl( LINK( this, ErrorBarResources, CategoryChosen )); - m_pLbFunction->SetSelectHdl( LINK( this, ErrorBarResources, CategoryChosen2 )); + m_xRbConst->connect_toggled( LINK( this, ErrorBarResources, CategoryChosen )); + m_xRbPercent->connect_toggled( LINK( this, ErrorBarResources, CategoryChosen )); + m_xRbFunction->connect_toggled( LINK( this, ErrorBarResources, CategoryChosen )); + m_xRbRange->connect_toggled( LINK( this, ErrorBarResources, CategoryChosen )); + m_xLbFunction->connect_changed( LINK( this, ErrorBarResources, CategoryChosen2 )); - m_pCbSyncPosNeg->Check( false ); - m_pCbSyncPosNeg->SetToggleHdl( LINK( this, ErrorBarResources, SynchronizePosAndNeg )); + m_xCbSyncPosNeg->set_active( false ); + m_xCbSyncPosNeg->connect_toggled( LINK( this, ErrorBarResources, SynchronizePosAndNeg )); - m_pMfPositive->SetModifyHdl( LINK( this, ErrorBarResources, PosValueChanged )); - m_pEdRangePositive->SetModifyHdl( LINK( this, ErrorBarResources, RangeChanged )); - m_pEdRangeNegative->SetModifyHdl( LINK( this, ErrorBarResources, RangeChanged )); + m_xMfPositive->connect_value_changed( LINK( this, ErrorBarResources, PosValueChanged )); + m_xEdRangePositive->connect_changed( LINK( this, ErrorBarResources, RangeChanged )); + m_xEdRangeNegative->connect_changed( LINK( this, ErrorBarResources, RangeChanged )); - m_pRbPositive->SetClickHdl( LINK( this, ErrorBarResources, IndicatorChanged )); - m_pRbNegative->SetClickHdl( LINK( this, ErrorBarResources, IndicatorChanged )); - m_pRbBoth->SetClickHdl( LINK( this, ErrorBarResources, IndicatorChanged )); + m_xRbPositive->connect_toggled( LINK( this, ErrorBarResources, IndicatorChanged )); + m_xRbNegative->connect_toggled( LINK( this, ErrorBarResources, IndicatorChanged )); + m_xRbBoth->connect_toggled( LINK( this, ErrorBarResources, IndicatorChanged )); - m_pIbRangePositive->SetClickHdl( LINK( this, ErrorBarResources, ChooseRange )); - m_pIbRangeNegative->SetClickHdl( LINK( this, ErrorBarResources, ChooseRange )); + m_xIbRangePositive->connect_clicked( LINK( this, ErrorBarResources, ChooseRange )); + m_xIbRangeNegative->connect_clicked( LINK( this, ErrorBarResources, ChooseRange )); FillValueSets(); Reset( rInAttrs ); @@ -194,14 +195,14 @@ void ErrorBarResources::SetChartDocumentForRangeChoosing( OSL_ASSERT( m_apRangeSelectionHelper.get()); if( m_bHasInternalDataProvider ) { - m_pRbRange->SetText(m_pUIStringRbRange->GetText()); - m_pRbRange->SetHelpId( HID_SCH_ERROR_BARS_FROM_DATA ); + m_xRbRange->set_label(m_xUIStringRbRange->get_label()); + m_xRbRange->set_help_id(HID_SCH_ERROR_BARS_FROM_DATA); } - if( m_pRbRange->IsChecked()) + if( m_xRbRange->get_active()) { - isRangeFieldContentValid( *m_pEdRangePositive ); - isRangeFieldContentValid( *m_pEdRangeNegative ); + isRangeFieldContentValid( *m_xEdRangePositive ); + isRangeFieldContentValid( *m_xEdRangeNegative ); } } @@ -227,64 +228,64 @@ void ErrorBarResources::SetAxisMinorStepWidthForErrorBarDecimals( double fMinorS void ErrorBarResources::UpdateControlStates() { // function - bool bIsFunction = m_pRbFunction->IsChecked(); - m_pLbFunction->Enable( bIsFunction ); + bool bIsFunction = m_xRbFunction->get_active(); + m_xLbFunction->set_sensitive( bIsFunction ); // range buttons - m_pRbRange->Enable( !m_bHasInternalDataProvider || m_bEnableDataTableDialog ); - bool bShowRange = m_pRbRange->IsChecked(); + m_xRbRange->set_sensitive( !m_bHasInternalDataProvider || m_bEnableDataTableDialog ); + bool bShowRange = m_xRbRange->get_active(); bool bCanChooseRange = ( bShowRange && m_apRangeSelectionHelper.get() && m_apRangeSelectionHelper->hasRangeSelection()); - m_pMfPositive->Show( ! bShowRange ); - m_pMfNegative->Show( ! bShowRange ); + m_xMfPositive->show( ! bShowRange ); + m_xMfNegative->show( ! bShowRange ); // use range but without range chooser => hide controls - m_pEdRangePositive->Show( bShowRange && ! m_bHasInternalDataProvider ); - m_pIbRangePositive->Show( bCanChooseRange ); - m_pEdRangeNegative->Show( bShowRange && ! m_bHasInternalDataProvider ); - m_pIbRangeNegative->Show( bCanChooseRange ); + m_xEdRangePositive->show( bShowRange && ! m_bHasInternalDataProvider ); + m_xIbRangePositive->show( bCanChooseRange ); + m_xEdRangeNegative->show( bShowRange && ! m_bHasInternalDataProvider ); + m_xIbRangeNegative->show( bCanChooseRange ); bool bShowPosNegAndSync = ! (bShowRange && m_bHasInternalDataProvider); - m_pFlParameters->Show( bShowPosNegAndSync ); + m_xFlParameters->show( bShowPosNegAndSync ); // unit for metric fields bool bIsErrorMargin( - ( m_pRbFunction->IsChecked()) && - ( m_pLbFunction->GetSelectedEntryPos() == CHART_LB_FUNCTION_ERROR_MARGIN )); - bool bIsPercentage( m_pRbPercent->IsChecked() || bIsErrorMargin ); + ( m_xRbFunction->get_active()) && + ( m_xLbFunction->get_active() == CHART_LB_FUNCTION_ERROR_MARGIN )); + bool bIsPercentage( m_xRbPercent->get_active() || bIsErrorMargin ); FieldUnit eFieldUnit = FUNIT_NONE; if( bIsPercentage ) { eFieldUnit = FUNIT_PERCENT; - m_pMfPositive->SetDecimalDigits( 1 ); - m_pMfPositive->SetSpinSize( 10 ); - m_pMfNegative->SetDecimalDigits( 1 ); - m_pMfNegative->SetSpinSize( 10 ); + m_xMfPositive->set_digits( 1 ); + m_xMfPositive->set_increments(10, 100, FUNIT_NONE); + m_xMfNegative->set_digits( 1 ); + m_xMfNegative->set_increments(10, 100, FUNIT_NONE); } else { - m_pMfPositive->SetDecimalDigits( m_nConstDecimalDigits ); - m_pMfPositive->SetSpinSize( m_nConstSpinSize ); - m_pMfNegative->SetDecimalDigits( m_nConstDecimalDigits ); - m_pMfNegative->SetSpinSize( m_nConstSpinSize ); + m_xMfPositive->set_digits( m_nConstDecimalDigits ); + m_xMfPositive->set_increments(m_nConstSpinSize, m_nConstSpinSize * 10, FUNIT_NONE); + m_xMfNegative->set_digits( m_nConstDecimalDigits ); + m_xMfNegative->set_increments(m_nConstSpinSize, m_nConstSpinSize * 10, FUNIT_NONE); } - sal_Int32 nPlusValue = static_cast< sal_Int32 >( m_fPlusValue * pow(10.0,m_pMfPositive->GetDecimalDigits()) ); - sal_Int32 nMinusValue = static_cast< sal_Int32 >( m_fMinusValue * pow(10.0,m_pMfNegative->GetDecimalDigits()) ); + sal_Int32 nPlusValue = static_cast< sal_Int32 >( m_fPlusValue * pow(10.0,m_xMfPositive->get_digits()) ); + sal_Int32 nMinusValue = static_cast< sal_Int32 >( m_fMinusValue * pow(10.0,m_xMfNegative->get_digits()) ); - m_pMfPositive->SetValue( nPlusValue ); - m_pMfNegative->SetValue( nMinusValue ); + m_xMfPositive->set_value(nPlusValue, FUNIT_NONE); + m_xMfNegative->set_value(nMinusValue, FUNIT_NONE); - m_pMfPositive->SetUnit(eFieldUnit); - m_pMfNegative->SetUnit(eFieldUnit); + m_xMfPositive->set_unit(eFieldUnit); + m_xMfNegative->set_unit(eFieldUnit); // positive and negative value fields - bool bPosEnabled = ( m_pRbPositive->IsChecked() || m_pRbBoth->IsChecked()); - bool bNegEnabled = ( m_pRbNegative->IsChecked() || m_pRbBoth->IsChecked()); + bool bPosEnabled = ( m_xRbPositive->get_active() || m_xRbBoth->get_active()); + bool bNegEnabled = ( m_xRbNegative->get_active() || m_xRbBoth->get_active()); if( !( bPosEnabled || bNegEnabled )) { // all three controls are not checked -> ambiguous state @@ -294,89 +295,84 @@ void ErrorBarResources::UpdateControlStates() // functions with only one parameter bool bOneParameterCategory = - bIsErrorMargin || m_pRbPercent->IsChecked(); + bIsErrorMargin || m_xRbPercent->get_active(); if( bOneParameterCategory ) { - m_pCbSyncPosNeg->Check(); + m_xCbSyncPosNeg->set_active(true); } - if( m_pCbSyncPosNeg->IsChecked()) + if( m_xCbSyncPosNeg->get_active()) { bPosEnabled = true; bNegEnabled = false; } // all functions except error margin take no arguments - if( m_pRbFunction->IsChecked() && ( m_pLbFunction->GetSelectedEntryPos() != CHART_LB_FUNCTION_ERROR_MARGIN )) + if( m_xRbFunction->get_active() && ( m_xLbFunction->get_active() != CHART_LB_FUNCTION_ERROR_MARGIN )) { bPosEnabled = false; bNegEnabled = false; } // enable/disable pos/neg fields - m_pBxPositive->Enable( bPosEnabled ); - m_pBxNegative->Enable( bNegEnabled ); + m_xBxPositive->set_sensitive( bPosEnabled ); + m_xBxNegative->set_sensitive( bNegEnabled ); if( bShowRange ) { - m_pEdRangePositive->Enable( bPosEnabled ); - m_pIbRangePositive->Enable( bPosEnabled ); - m_pEdRangeNegative->Enable( bNegEnabled ); - m_pIbRangeNegative->Enable( bNegEnabled ); + m_xEdRangePositive->set_sensitive( bPosEnabled ); + m_xIbRangePositive->set_sensitive( bPosEnabled ); + m_xEdRangeNegative->set_sensitive( bNegEnabled ); + m_xIbRangeNegative->set_sensitive( bNegEnabled ); } else { - m_pMfPositive->Enable( bPosEnabled ); - m_pMfNegative->Enable( bNegEnabled ); + m_xMfPositive->set_sensitive( bPosEnabled ); + m_xMfNegative->set_sensitive( bNegEnabled ); } - m_pCbSyncPosNeg->Enable( !bOneParameterCategory && ( bPosEnabled || bNegEnabled )); + m_xCbSyncPosNeg->set_sensitive( !bOneParameterCategory && ( bPosEnabled || bNegEnabled )); // mark invalid entries in the range fields if( bShowRange && ! m_bHasInternalDataProvider ) { - isRangeFieldContentValid( *m_pEdRangePositive ); - isRangeFieldContentValid( *m_pEdRangeNegative ); + isRangeFieldContentValid( *m_xEdRangePositive ); + isRangeFieldContentValid( *m_xEdRangeNegative ); } } -IMPL_LINK_NOARG( ErrorBarResources, CategoryChosen2, ListBox&, void ) +IMPL_LINK_NOARG( ErrorBarResources, CategoryChosen2, weld::ComboBox&, void ) { - CategoryChosen(nullptr); + CategoryChosen(*m_xRbConst); } -IMPL_LINK_NOARG( ErrorBarResources, CategoryChosen, Button*, void ) +IMPL_LINK_NOARG( ErrorBarResources, CategoryChosen, weld::ToggleButton&, void ) { m_bErrorKindUnique = true; SvxChartKindError eOldError = m_eErrorKind; - if( m_pRbNone->IsChecked()) + if( m_xRbNone->get_active()) m_eErrorKind = SvxChartKindError::NONE; - else if( m_pRbConst->IsChecked()) + else if( m_xRbConst->get_active()) m_eErrorKind = SvxChartKindError::Const; - else if( m_pRbPercent->IsChecked()) + else if( m_xRbPercent->get_active()) m_eErrorKind = SvxChartKindError::Percent; - else if( m_pRbRange->IsChecked()) + else if( m_xRbRange->get_active()) m_eErrorKind = SvxChartKindError::Range; - else if( m_pRbFunction->IsChecked()) + else if( m_xRbFunction->get_active()) { - if( m_pLbFunction->GetSelectedEntryCount() == 1 ) + switch( m_xLbFunction->get_active()) { - switch( m_pLbFunction->GetSelectedEntryPos()) - { - case CHART_LB_FUNCTION_STD_ERROR: - m_eErrorKind = SvxChartKindError::StdError; break; - case CHART_LB_FUNCTION_STD_DEV: - m_eErrorKind = SvxChartKindError::Sigma; break; - case CHART_LB_FUNCTION_VARIANCE: - m_eErrorKind = SvxChartKindError::Variant; break; - case CHART_LB_FUNCTION_ERROR_MARGIN: - m_eErrorKind = SvxChartKindError::BigError; break; - default: - m_bErrorKindUnique = false; - } + case CHART_LB_FUNCTION_STD_ERROR: + m_eErrorKind = SvxChartKindError::StdError; break; + case CHART_LB_FUNCTION_STD_DEV: + m_eErrorKind = SvxChartKindError::Sigma; break; + case CHART_LB_FUNCTION_VARIANCE: + m_eErrorKind = SvxChartKindError::Variant; break; + case CHART_LB_FUNCTION_ERROR_MARGIN: + m_eErrorKind = SvxChartKindError::BigError; break; + default: + m_bErrorKindUnique = false; } - else - m_bErrorKindUnique = false; } else { @@ -388,48 +384,48 @@ IMPL_LINK_NOARG( ErrorBarResources, CategoryChosen, Button*, void ) if( m_eErrorKind == SvxChartKindError::Range && eOldError != SvxChartKindError::Range ) { - m_pCbSyncPosNeg->Check( - (!m_pEdRangePositive->GetText().isEmpty()) && - m_pEdRangePositive->GetText() == m_pEdRangeNegative->GetText()); + m_xCbSyncPosNeg->set_active( + (!m_xEdRangePositive->get_text().isEmpty()) && + m_xEdRangePositive->get_text() == m_xEdRangeNegative->get_text()); } // changed from range else if( m_eErrorKind != SvxChartKindError::Range && eOldError == SvxChartKindError::Range ) { - m_pCbSyncPosNeg->Check( m_pMfPositive->GetValue() == m_pMfNegative->GetValue()); + m_xCbSyncPosNeg->set_active( m_xMfPositive->get_value(FUNIT_NONE) == m_xMfNegative->get_value(FUNIT_NONE)); } UpdateControlStates(); } -IMPL_LINK_NOARG(ErrorBarResources, SynchronizePosAndNeg, CheckBox&, void) +IMPL_LINK_NOARG(ErrorBarResources, SynchronizePosAndNeg, weld::ToggleButton&, void) { UpdateControlStates(); - PosValueChanged( *m_pMfPositive ); + PosValueChanged( *m_xMfPositive ); } -IMPL_LINK_NOARG(ErrorBarResources, PosValueChanged, Edit&, void) +IMPL_LINK_NOARG(ErrorBarResources, PosValueChanged, weld::MetricSpinButton&, void) { - if( m_pCbSyncPosNeg->IsChecked()) + if( m_xCbSyncPosNeg->get_active()) { - if( m_pRbRange->IsChecked()) + if( m_xRbRange->get_active()) { - m_pEdRangeNegative->SetText( m_pEdRangePositive->GetText()); + m_xEdRangeNegative->set_text( m_xEdRangePositive->get_text()); m_bRangeNegUnique = m_bRangePosUnique; } else - m_pMfNegative->SetValue( m_pMfPositive->GetValue()); + m_xMfNegative->set_value(m_xMfPositive->get_value(FUNIT_NONE), FUNIT_NONE); } } -IMPL_LINK_NOARG(ErrorBarResources, IndicatorChanged, Button*, void) +IMPL_LINK_NOARG(ErrorBarResources, IndicatorChanged, weld::ToggleButton&, void) { m_bIndicatorUnique = true; - if( m_pRbBoth->IsChecked()) + if( m_xRbBoth->get_active()) m_eIndicate = SvxChartIndicate::Both; - else if( m_pRbPositive->IsChecked()) + else if( m_xRbPositive->get_active()) m_eIndicate = SvxChartIndicate::Up; - else if( m_pRbNegative->IsChecked()) + else if( m_xRbNegative->get_active()) m_eIndicate = SvxChartIndicate::Down; else m_bIndicatorUnique = false; @@ -437,7 +433,7 @@ IMPL_LINK_NOARG(ErrorBarResources, IndicatorChanged, Button*, void) UpdateControlStates(); } -IMPL_LINK( ErrorBarResources, ChooseRange, Button*, pButton, void ) +IMPL_LINK(ErrorBarResources, ChooseRange, weld::Button&, rButton, void) { OSL_ASSERT( m_apRangeSelectionHelper.get()); if( ! m_apRangeSelectionHelper.get()) @@ -446,35 +442,29 @@ IMPL_LINK( ErrorBarResources, ChooseRange, Button*, pButton, void ) OUString aUIString; - if( pButton == m_pIbRangePositive ) + if (&rButton == m_xIbRangePositive.get()) { - m_pCurrentRangeChoosingField = m_pEdRangePositive; - aUIString = m_pUIStringPos->GetText(); + m_pCurrentRangeChoosingField = m_xEdRangePositive.get(); + aUIString = m_xUIStringPos->get_label(); } else { - m_pCurrentRangeChoosingField = m_pEdRangeNegative; - aUIString = m_pUIStringNeg->GetText(); + m_pCurrentRangeChoosingField = m_xEdRangeNegative.get(); + aUIString = m_xUIStringNeg->get_label(); } - assert( m_pParentDialog ); - if( m_pParentDialog ) - { - lcl_enableRangeChoosing( true, m_pParentDialog ); - m_apRangeSelectionHelper->chooseRange( - m_pCurrentRangeChoosingField->GetText(), - aUIString, *this ); - } - else - m_pCurrentRangeChoosingField = nullptr; + lcl_enableRangeChoosing( true, m_pParentDialog ); + m_apRangeSelectionHelper->chooseRange( + m_pCurrentRangeChoosingField->get_text(), + aUIString, *this ); } -IMPL_LINK( ErrorBarResources, RangeChanged, Edit&, rEdit, void ) +IMPL_LINK( ErrorBarResources, RangeChanged, weld::Entry&, rEdit, void ) { - if( &rEdit == m_pEdRangePositive ) + if( &rEdit == m_xEdRangePositive.get() ) { m_bRangePosUnique = true; - PosValueChanged( *m_pMfPositive ); + PosValueChanged( *m_xMfPositive ); } else { @@ -496,38 +486,38 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs) if( aState == SfxItemState::SET ) m_eErrorKind = static_cast<const SvxChartKindErrorItem*>(pPoolItem)->GetValue(); - m_pLbFunction->SelectEntryPos( lcl_getLbEntryPosByErrorKind( m_eErrorKind )); + m_xLbFunction->set_active( lcl_getLbEntryPosByErrorKind( m_eErrorKind )); if( m_bErrorKindUnique ) { switch( m_eErrorKind ) { case SvxChartKindError::NONE: - m_pRbNone->Check(); + m_xRbNone->set_active(true); break; case SvxChartKindError::Percent: - m_pRbPercent->Check(); + m_xRbPercent->set_active(true); break; case SvxChartKindError::Const: - m_pRbConst->Check(); + m_xRbConst->set_active(true); break; case SvxChartKindError::StdError: case SvxChartKindError::Variant: case SvxChartKindError::Sigma: case SvxChartKindError::BigError: - m_pRbFunction->Check(); + m_xRbFunction->set_active(true); break; case SvxChartKindError::Range: - m_pRbRange->Check(); + m_xRbRange->set_active(true); break; } } else { - m_pRbNone->Check( false ); - m_pRbConst->Check( false ); - m_pRbPercent->Check( false ); - m_pRbFunction->Check( false ); + m_xRbNone->set_active( false ); + m_xRbConst->set_active( false ); + m_xRbPercent->set_active( false ); + m_xRbFunction->set_active( false ); } // parameters @@ -544,7 +534,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs) if( m_eErrorKind != SvxChartKindError::Range && m_fPlusValue == m_fMinusValue ) - m_pCbSyncPosNeg->Check(); + m_xCbSyncPosNeg->set_active(true); } // indicator @@ -562,18 +552,18 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs) m_eIndicate = SvxChartIndicate::Both; SAL_FALLTHROUGH; // to BOTH case SvxChartIndicate::Both : - m_pRbBoth->Check(); break; + m_xRbBoth->set_active(true); break; case SvxChartIndicate::Up : - m_pRbPositive->Check(); break; + m_xRbPositive->set_active(true); break; case SvxChartIndicate::Down : - m_pRbNegative->Check(); break; + m_xRbNegative->set_active(true); break; } } else { - m_pRbBoth->Check( false ); - m_pRbPositive->Check( false ); - m_pRbNegative->Check( false ); + m_xRbBoth->set_active( false ); + m_xRbPositive->set_active( false ); + m_xRbNegative->set_active( false ); } // ranges @@ -582,7 +572,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs) if( aState == SfxItemState::SET ) { OUString sRangePositive = static_cast< const SfxStringItem * >( pPoolItem )->GetValue(); - m_pEdRangePositive->SetText( sRangePositive ); + m_xEdRangePositive->set_text( sRangePositive ); } aState = rInAttrs.GetItemState( SCHATTR_STAT_RANGE_NEG, true, &pPoolItem ); @@ -590,11 +580,11 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs) if( aState == SfxItemState::SET ) { OUString sRangeNegative = static_cast< const SfxStringItem * >( pPoolItem )->GetValue(); - m_pEdRangeNegative->SetText( sRangeNegative ); + m_xEdRangeNegative->set_text( sRangeNegative ); if( m_eErrorKind == SvxChartKindError::Range && !sRangeNegative.isEmpty() && - sRangeNegative == m_pEdRangePositive->GetText() ) - m_pCbSyncPosNeg->Check(); + sRangeNegative == m_xEdRangePositive->get_text() ) + m_xCbSyncPosNeg->set_active(true); } UpdateControlStates(); @@ -622,11 +612,11 @@ void ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const } else { - aPosRange = m_pEdRangePositive->GetText(); - if( m_pCbSyncPosNeg->IsChecked()) + aPosRange = m_xEdRangePositive->get_text(); + if( m_xCbSyncPosNeg->get_active()) aNegRange = aPosRange; else - aNegRange = m_pEdRangeNegative->GetText(); + aNegRange = m_xEdRangeNegative->get_text(); } if( m_bRangePosUnique ) @@ -638,15 +628,15 @@ void ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const m_eErrorKind == SvxChartKindError::Percent || m_eErrorKind == SvxChartKindError::BigError ) { - double fPosValue = static_cast< double >( m_pMfPositive->GetValue()) / - pow( 10.0, m_pMfPositive->GetDecimalDigits()); + double fPosValue = static_cast< double >( m_xMfPositive->get_value(FUNIT_NONE)) / + pow( 10.0, m_xMfPositive->get_digits()); double fNegValue = 0.0; - if( m_pCbSyncPosNeg->IsChecked()) + if( m_xCbSyncPosNeg->get_active()) fNegValue = fPosValue; else - fNegValue = static_cast< double >( m_pMfNegative->GetValue()) / - pow( 10.0, m_pMfNegative->GetDecimalDigits()); + fNegValue = static_cast< double >( m_xMfNegative->get_value(FUNIT_NONE)) / + pow( 10.0, m_xMfNegative->get_digits()); rOutAttrs.Put( SvxDoubleItem( fPosValue, SCHATTR_STAT_CONSTPLUS )); rOutAttrs.Put( SvxDoubleItem( fNegValue, SCHATTR_STAT_CONSTMINUS )); @@ -660,15 +650,15 @@ void ErrorBarResources::FillValueSets() { if( m_eErrorBarType == ERROR_BAR_Y ) { - m_pFiNegative->SetImage(Image(BitmapEx(BMP_INDICATE_DOWN))); - m_pFiPositive->SetImage(Image(BitmapEx(BMP_INDICATE_UP))); - m_pFiBoth->SetImage(Image(BitmapEx(BMP_INDICATE_BOTH_VERTI))); + m_xFiNegative->set_from_icon_name(BMP_INDICATE_DOWN); + m_xFiPositive->set_from_icon_name(BMP_INDICATE_UP); + m_xFiBoth->set_from_icon_name(BMP_INDICATE_BOTH_VERTI); } else if( m_eErrorBarType == ERROR_BAR_X ) { - m_pFiNegative->SetImage(Image(BitmapEx(BMP_INDICATE_LEFT))); - m_pFiPositive->SetImage(Image(BitmapEx(BMP_INDICATE_RIGHT))); - m_pFiBoth->SetImage(Image(BitmapEx(BMP_INDICATE_BOTH_HORI))); + m_xFiNegative->set_from_icon_name(BMP_INDICATE_LEFT); + m_xFiPositive->set_from_icon_name(BMP_INDICATE_RIGHT); + m_xFiBoth->set_from_icon_name(BMP_INDICATE_BOTH_HORI); } } @@ -689,22 +679,20 @@ void ErrorBarResources::listeningFinished( // if( m_pParentWindow ) // { // m_pParentWindow->ToTop(); -// m_pParentWindow->GrabFocus(); +// m_pParentWindow->grab_focus(); // } if( m_pCurrentRangeChoosingField ) { - m_pCurrentRangeChoosingField->SetText( aRange ); - m_pCurrentRangeChoosingField->GrabFocus(); - PosValueChanged( *m_pMfPositive ); + m_pCurrentRangeChoosingField->set_text( aRange ); + m_pCurrentRangeChoosingField->grab_focus(); + PosValueChanged( *m_xMfPositive ); } m_pCurrentRangeChoosingField = nullptr; UpdateControlStates(); - OSL_ASSERT( m_pParentDialog ); - if( m_pParentDialog ) - lcl_enableRangeChoosing( false, m_pParentDialog ); + lcl_enableRangeChoosing( false, m_pParentDialog ); } void ErrorBarResources::disposingRangeSelection() @@ -714,22 +702,20 @@ void ErrorBarResources::disposingRangeSelection() m_apRangeSelectionHelper->stopRangeListening( false ); } -void ErrorBarResources::isRangeFieldContentValid( Edit & rEdit ) +void ErrorBarResources::isRangeFieldContentValid(weld::Entry& rEdit) { - OUString aRange( rEdit.GetText()); + OUString aRange( rEdit.get_text()); bool bIsValid = ( aRange.isEmpty() ) || ( m_apRangeSelectionHelper.get() && m_apRangeSelectionHelper->verifyCellRange( aRange )); - if( bIsValid || !rEdit.IsEnabled()) + if( bIsValid || !rEdit.get_sensitive()) { - rEdit.SetControlForeground(); - rEdit.SetControlBackground(); + rEdit.set_error(false); } else { - rEdit.SetControlBackground( RANGE_SELECTION_INVALID_RANGE_BACKGROUND_COLOR ); - rEdit.SetControlForeground( RANGE_SELECTION_INVALID_RANGE_FOREGROUND_COLOR ); + rEdit.set_error(true); } } diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.cxx b/chart2/source/controller/dialogs/tp_ErrorBars.cxx index 540df87b209c..5288224f8e6f 100644 --- a/chart2/source/controller/dialogs/tp_ErrorBars.cxx +++ b/chart2/source/controller/dialogs/tp_ErrorBars.cxx @@ -27,23 +27,15 @@ using namespace ::com::sun::star; namespace chart { -ErrorBarsTabPage::ErrorBarsTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ) : - SfxTabPage( pParent - ,"tp_ErrorBars" - ,"modules/schart/ui/tp_ErrorBars.ui" - , &rInAttrs ), - m_aErrorBarResources( - this, - // the parent is the tab control, of which the parent is the dialog - pParent->GetParentDialog(), - rInAttrs, /* bNoneAvailable = */ false ) +ErrorBarsTabPage::ErrorBarsTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs) + : SfxTabPage(pParent, "modules/schart/ui/tp_ErrorBars.ui", "tp_ErrorBars", &rInAttrs) + , m_aErrorBarResources(m_xBuilder.get(), pParent, rInAttrs, /* bNoneAvailable = */ false) { } -VclPtr<SfxTabPage> ErrorBarsTabPage::Create( - TabPageParent pParent, const SfxItemSet* rOutAttrs ) +VclPtr<SfxTabPage> ErrorBarsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs) { - return VclPtr<ErrorBarsTabPage>::Create( pParent.pParent, *rOutAttrs ); + return VclPtr<ErrorBarsTabPage>::Create(pParent, *rOutAttrs); } bool ErrorBarsTabPage::FillItemSet( SfxItemSet* rOutAttrs ) diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.hxx b/chart2/source/controller/dialogs/tp_ErrorBars.hxx index 9c065f7550f7..337b58f4691d 100644 --- a/chart2/source/controller/dialogs/tp_ErrorBars.hxx +++ b/chart2/source/controller/dialogs/tp_ErrorBars.hxx @@ -29,7 +29,7 @@ namespace chart class ErrorBarsTabPage : public SfxTabPage { public: - ErrorBarsTabPage ( vcl::Window* pParent, const SfxItemSet& rInAttrs ); + ErrorBarsTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth ); void SetErrorBarType( ErrorBarResources::tErrorBarType eNewType ); diff --git a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx index 179f0ccec476..ff0de594b247 100644 --- a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx +++ b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx @@ -20,7 +20,7 @@ #define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DLG_INSERTERRORBARS_HXX #include <memory> -#include <vcl/dialog.hxx> +#include <vcl/weld.hxx> #include <svl/itemset.hxx> #include "res_ErrorBar.hxx" @@ -30,12 +30,12 @@ namespace com { namespace sun { namespace star { namespace frame { class XModel; namespace chart { -class InsertErrorBarsDialog : public ModalDialog +class InsertErrorBarsDialog : public weld::GenericDialogController { public: - InsertErrorBarsDialog( vcl::Window* pParent, const SfxItemSet& rMyAttrs, - const css::uno::Reference< css::chart2::XChartDocument > & xChartDocument, - ErrorBarResources::tErrorBarType eType ); + InsertErrorBarsDialog(weld::Window* pParent, const SfxItemSet& rMyAttrs, + const css::uno::Reference< css::chart2::XChartDocument > & xChartDocument, + ErrorBarResources::tErrorBarType eType); void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth ); @@ -45,7 +45,6 @@ public: const OUString& rSelectedObjectCID ); void FillItemSet( SfxItemSet& rOutAttrs ); - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; private: std::unique_ptr< ErrorBarResources > m_apErrorBarResources; diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx b/chart2/source/controller/inc/res_ErrorBar.hxx index 548747ae37bb..db9030f1a1d6 100644 --- a/chart2/source/controller/inc/res_ErrorBar.hxx +++ b/chart2/source/controller/inc/res_ErrorBar.hxx @@ -20,11 +20,8 @@ #define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_RES_ERRORBAR_HXX #include <memory> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> +#include <sfx2/tabdlg.hxx> #include <svl/itemset.hxx> #include <svx/chrtitem.hxx> #include "RangeSelectionListener.hxx" @@ -46,7 +43,7 @@ public: }; ErrorBarResources( - VclBuilderContainer* pParent, Dialog* pParentDialog, const SfxItemSet& rInAttrs, bool bNoneAvailable, chart::ErrorBarResources::tErrorBarType eType = ERROR_BAR_Y ); + weld::Builder* pParent, TabPageParent pParentDialog, const SfxItemSet& rInAttrs, bool bNoneAvailable, chart::ErrorBarResources::tErrorBarType eType = ERROR_BAR_Y ); virtual ~ErrorBarResources(); void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth ); @@ -63,38 +60,6 @@ public: virtual void disposingRangeSelection() override; private: - // category - VclPtr<RadioButton> m_pRbNone; - VclPtr<RadioButton> m_pRbConst; - VclPtr<RadioButton> m_pRbPercent; - VclPtr<RadioButton> m_pRbFunction; - VclPtr<RadioButton> m_pRbRange; - VclPtr<ListBox> m_pLbFunction; - - // parameters - VclPtr<VclFrame> m_pFlParameters; - VclPtr<VclBox> m_pBxPositive; - VclPtr<MetricField> m_pMfPositive; - VclPtr<Edit> m_pEdRangePositive; - VclPtr<PushButton> m_pIbRangePositive; - VclPtr<VclBox> m_pBxNegative; - VclPtr<MetricField> m_pMfNegative; - VclPtr<Edit> m_pEdRangeNegative; - VclPtr<PushButton> m_pIbRangeNegative; - VclPtr<CheckBox> m_pCbSyncPosNeg; - - // indicator - VclPtr<RadioButton> m_pRbBoth; - VclPtr<RadioButton> m_pRbPositive; - VclPtr<RadioButton> m_pRbNegative; - VclPtr<FixedImage> m_pFiBoth; - VclPtr<FixedImage> m_pFiPositive; - VclPtr<FixedImage> m_pFiNegative; - - VclPtr<FixedText> m_pUIStringPos; - VclPtr<FixedText> m_pUIStringNeg; - VclPtr<FixedText> m_pUIStringRbRange; - SvxChartKindError m_eErrorKind; SvxChartIndicate m_eIndicate; @@ -109,22 +74,55 @@ private: double m_fPlusValue; double m_fMinusValue; - VclPtr<Dialog> m_pParentDialog; + TabPageParent m_pParentDialog; std::unique_ptr< RangeSelectionHelper > m_apRangeSelectionHelper; - VclPtr<Edit> m_pCurrentRangeChoosingField; + weld::Entry* m_pCurrentRangeChoosingField; bool m_bHasInternalDataProvider; bool m_bEnableDataTableDialog; - DECL_LINK( CategoryChosen, Button*, void ); - DECL_LINK( CategoryChosen2, ListBox&, void ); - DECL_LINK( SynchronizePosAndNeg, CheckBox&, void ); - DECL_LINK( PosValueChanged, Edit&, void ); - DECL_LINK( IndicatorChanged, Button *, void ); - DECL_LINK( ChooseRange, Button *, void ); - DECL_LINK( RangeChanged, Edit&, void ); + + // category + std::unique_ptr<weld::RadioButton> m_xRbNone; + std::unique_ptr<weld::RadioButton> m_xRbConst; + std::unique_ptr<weld::RadioButton> m_xRbPercent; + std::unique_ptr<weld::RadioButton> m_xRbFunction; + std::unique_ptr<weld::RadioButton> m_xRbRange; + std::unique_ptr<weld::ComboBox> m_xLbFunction; + + // parameters + std::unique_ptr<weld::Frame> m_xFlParameters; + std::unique_ptr<weld::Widget> m_xBxPositive; + std::unique_ptr<weld::MetricSpinButton> m_xMfPositive; + std::unique_ptr<weld::Entry> m_xEdRangePositive; + std::unique_ptr<weld::Button> m_xIbRangePositive; + std::unique_ptr<weld::Widget> m_xBxNegative; + std::unique_ptr<weld::MetricSpinButton> m_xMfNegative; + std::unique_ptr<weld::Entry> m_xEdRangeNegative; + std::unique_ptr<weld::Button> m_xIbRangeNegative; + std::unique_ptr<weld::CheckButton> m_xCbSyncPosNeg; + + // indicator + std::unique_ptr<weld::RadioButton> m_xRbBoth; + std::unique_ptr<weld::RadioButton> m_xRbPositive; + std::unique_ptr<weld::RadioButton> m_xRbNegative; + std::unique_ptr<weld::Image> m_xFiBoth; + std::unique_ptr<weld::Image> m_xFiPositive; + std::unique_ptr<weld::Image> m_xFiNegative; + + std::unique_ptr<weld::Label> m_xUIStringPos; + std::unique_ptr<weld::Label> m_xUIStringNeg; + std::unique_ptr<weld::Label> m_xUIStringRbRange; + + DECL_LINK( CategoryChosen, weld::ToggleButton&, void ); + DECL_LINK( CategoryChosen2, weld::ComboBox&, void ); + DECL_LINK( SynchronizePosAndNeg, weld::ToggleButton&, void ); + DECL_LINK( PosValueChanged, weld::MetricSpinButton&, void ); + DECL_LINK( IndicatorChanged, weld::ToggleButton&, void ); + DECL_LINK( ChooseRange, weld::Button&, void ); + DECL_LINK( RangeChanged, weld::Entry&, void ); void UpdateControlStates(); - void isRangeFieldContentValid( Edit & rEdit ); + void isRangeFieldContentValid(weld::Entry& rEdit); }; } //namespace chart diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index b644e04cb8e9..815227817cad 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -488,18 +488,18 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) //prepare and open dialog SolarMutexGuard aGuard; - ScopedVclPtrInstance<InsertErrorBarsDialog> aDlg( - GetChartWindow(), aItemSet, + InsertErrorBarsDialog aDlg( + GetChartFrame(), aItemSet, uno::Reference< chart2::XChartDocument >( getModel(), uno::UNO_QUERY ), bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X); - aDlg->SetAxisMinorStepWidthForErrorBarDecimals( + aDlg.SetAxisMinorStepWidthForErrorBarDecimals( InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, OUString() ) ); - if( aDlg->Execute() == RET_OK ) + if (aDlg.run() == RET_OK) { SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet(); - aDlg->FillItemSet( aOutItemSet ); + aDlg.FillItemSet( aOutItemSet ); // lock controllers till end of block ControllerLockGuardUNO aCLGuard( getModel() ); diff --git a/chart2/uiconfig/ui/dlg_InsertErrorBars.ui b/chart2/uiconfig/ui/dlg_InsertErrorBars.ui index 12dcc100fcbf..1513129f2b96 100644 --- a/chart2/uiconfig/ui/dlg_InsertErrorBars.ui +++ b/chart2/uiconfig/ui/dlg_InsertErrorBars.ui @@ -1,8 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.22.1 --> <interface domain="chart"> <requires lib="gtk+" version="3.18"/> - <object class="GtkAdjustment" id="adjustmentPOS_NEG"> + <object class="GtkAdjustment" id="adjustmentNEG"> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustmentPOS"> <property name="upper">100</property> <property name="step_increment">1</property> <property name="page_increment">10</property> @@ -10,44 +15,24 @@ <object class="GtkImage" id="imageRANGE_SELECT_NEG"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="pixbuf">chart2/res/selectrange.png</property> + <property name="icon_name">chart2/res/selectrange.png</property> </object> <object class="GtkImage" id="imageRANGE_SELECT_POSITIVE"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="pixbuf">chart2/res/selectrange.png</property> - </object> - <object class="GtkListStore" id="liststoreFUNCTION"> - <columns> - <!-- column-name gchararray1 --> - <column type="gchararray"/> - <!-- column-name guint1 --> - <column type="guint"/> - </columns> - <data> - <row> - <col id="0" translatable="yes" context="dlg_InsertErrorBars|liststoreFUNCTION">Standard Error</col> - <col id="1">0</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_InsertErrorBars|liststoreFUNCTION">Standard Deviation</col> - <col id="1">1</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_InsertErrorBars|liststoreFUNCTION">Variance</col> - <col id="1">2</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_InsertErrorBars|liststoreFUNCTION">Error Margin</col> - <col id="1">3</col> - </row> - </data> + <property name="icon_name">chart2/res/selectrange.png</property> </object> <object class="GtkDialog" id="dlg_InsertErrorBars"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="dlg_InsertErrorBars|dlg_InsertErrorBars">Legend</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -145,12 +130,11 @@ <object class="GtkRadioButton" id="RB_NONE"> <property name="label" translatable="yes" context="dlg_InsertErrorBars|RB_NONE">_None</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">RB_CONST</property> </object> <packing> <property name="expand">False</property> @@ -162,12 +146,12 @@ <object class="GtkRadioButton" id="RB_CONST"> <property name="label" translatable="yes" context="dlg_InsertErrorBars|RB_CONST">_Constant Value</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">RB_PERCENT</property> + <property name="group">RB_NONE</property> </object> <packing> <property name="expand">False</property> @@ -179,12 +163,12 @@ <object class="GtkRadioButton" id="RB_PERCENT"> <property name="label" translatable="yes" context="dlg_InsertErrorBars|RB_PERCENT">_Percentage</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">RB_FUNCTION</property> + <property name="group">RB_NONE</property> </object> <packing> <property name="expand">False</property> @@ -200,12 +184,12 @@ <child> <object class="GtkRadioButton" id="RB_FUNCTION"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">RB_RANGE</property> + <property name="group">RB_NONE</property> </object> <packing> <property name="expand">False</property> @@ -214,10 +198,15 @@ </packing> </child> <child> - <object class="GtkComboBox" id="LB_FUNCTION"> + <object class="GtkComboBoxText" id="LB_FUNCTION"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="model">liststoreFUNCTION</property> + <items> + <item id="0" translatable="yes" context="dlg_InsertErrorBars|liststoreFUNCTION">Standard Error</item> + <item id="1" translatable="yes" context="dlg_InsertErrorBars|liststoreFUNCTION">Standard Deviation</item> + <item id="2" translatable="yes" context="dlg_InsertErrorBars|liststoreFUNCTION">Variance</item> + <item id="3" translatable="yes" context="dlg_InsertErrorBars|liststoreFUNCTION">Error Margin</item> + </items> </object> <packing> <property name="expand">False</property> @@ -236,7 +225,7 @@ <object class="GtkRadioButton" id="RB_RANGE"> <property name="label" translatable="yes" context="dlg_InsertErrorBars|RB_RANGE">Cell _Range</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> @@ -292,12 +281,11 @@ <object class="GtkRadioButton" id="RB_BOTH"> <property name="label" translatable="yes" context="dlg_InsertErrorBars|RB_BOTH">Positive _and Negative</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">RB_POSITIVE</property> </object> <packing> <property name="left_attach">1</property> @@ -308,12 +296,12 @@ <object class="GtkRadioButton" id="RB_POSITIVE"> <property name="label" translatable="yes" context="dlg_InsertErrorBars|RB_POSITIVE">Pos_itive</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">RB_NEGATIVE</property> + <property name="group">RB_BOTH</property> </object> <packing> <property name="left_attach">1</property> @@ -324,7 +312,7 @@ <object class="GtkRadioButton" id="RB_NEGATIVE"> <property name="label" translatable="yes" context="dlg_InsertErrorBars|RB_NEGATIVE">Ne_gative</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> @@ -377,8 +365,8 @@ <object class="GtkLabel" id="label2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="dlg_InsertErrorBars|label2">Error Indicator</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -427,7 +415,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="dlg_InsertErrorBars|FT_POSITIVE">P_ositive (+)</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">MF_POSITIVE:0</property> + <property name="mnemonic_widget">MF_POSITIVE</property> </object> <packing> <property name="expand">False</property> @@ -436,9 +424,10 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="MF_POSITIVE:0"> + <object class="GtkSpinButton" id="MF_POSITIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> + <property name="adjustment">adjustmentPOS</property> <property name="digits">2</property> </object> <packing> @@ -450,8 +439,9 @@ <child> <object class="GtkEntry" id="ED_RANGE_POSITIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> </object> <packing> <property name="expand">False</property> @@ -462,7 +452,7 @@ <child> <object class="GtkButton" id="IB_RANGE_POSITIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes" context="dlg_InsertErrorBars|IB_RANGE_POSITIVE|tooltip_text">Select data range</property> <property name="image">imageRANGE_SELECT_POSITIVE</property> @@ -491,7 +481,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="dlg_InsertErrorBars|FT_NEGATIVE">_Negative (-)</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">MF_NEGATIVE:0</property> + <property name="mnemonic_widget">MF_NEGATIVE</property> </object> <packing> <property name="expand">False</property> @@ -500,9 +490,10 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="MF_NEGATIVE:0"> + <object class="GtkSpinButton" id="MF_NEGATIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> + <property name="adjustment">adjustmentNEG</property> <property name="digits">2</property> </object> <packing> @@ -514,8 +505,9 @@ <child> <object class="GtkEntry" id="ED_RANGE_NEGATIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> </object> <packing> <property name="expand">False</property> @@ -526,7 +518,7 @@ <child> <object class="GtkButton" id="IB_RANGE_NEGATIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="has_tooltip">True</property> <property name="tooltip_text" translatable="yes" context="dlg_InsertErrorBars|IB_RANGE_NEGATIVE|tooltip_text">Select data range</property> @@ -549,7 +541,7 @@ <object class="GtkCheckButton" id="CB_SYN_POS_NEG"> <property name="label" translatable="yes" context="dlg_InsertErrorBars|CB_SYN_POS_NEG">Same value for both</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> @@ -569,8 +561,8 @@ <object class="GtkLabel" id="label3"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="dlg_InsertErrorBars|label3">Parameters</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> diff --git a/chart2/uiconfig/ui/tp_ErrorBars.ui b/chart2/uiconfig/ui/tp_ErrorBars.ui index 2884f10afe01..368bc975ae03 100644 --- a/chart2/uiconfig/ui/tp_ErrorBars.ui +++ b/chart2/uiconfig/ui/tp_ErrorBars.ui @@ -1,7 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> <interface domain="chart"> - <!-- interface-requires gtk+ 3.0 --> - <object class="GtkAdjustment" id="adjustmentPOS_NEG"> + <requires lib="gtk+" version="3.18"/> + <object class="GtkAdjustment" id="adjustmentNEG"> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustmentPOS"> <property name="upper">100</property> <property name="step_increment">1</property> <property name="page_increment">10</property> @@ -9,38 +15,12 @@ <object class="GtkImage" id="imageRANGE_SELECT_NEG"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="pixbuf">chart2/res/selectrange.png</property> + <property name="icon_name">chart2/res/selectrange.png</property> </object> <object class="GtkImage" id="imageRANGE_SELECT_POSITIVE"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="pixbuf">chart2/res/selectrange.png</property> - </object> - <object class="GtkListStore" id="liststoreFUNCTION"> - <columns> - <!-- column-name gchararray1 --> - <column type="gchararray"/> - <!-- column-name guint1 --> - <column type="guint"/> - </columns> - <data> - <row> - <col id="0" translatable="yes" context="tp_ErrorBars|liststoreFUNCTION">Standard Error</col> - <col id="1">0</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_ErrorBars|liststoreFUNCTION">Standard Deviation</col> - <col id="1">1</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_ErrorBars|liststoreFUNCTION">Variance</col> - <col id="1">2</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_ErrorBars|liststoreFUNCTION">Error Margin</col> - <col id="1">3</col> - </row> - </data> + <property name="icon_name">chart2/res/selectrange.png</property> </object> <object class="GtkBox" id="tp_ErrorBars"> <property name="visible">True</property> @@ -76,13 +56,12 @@ <object class="GtkRadioButton" id="RB_NONE"> <property name="label" translatable="yes" context="tp_ErrorBars|RB_NONE">_None</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">RB_CONST</property> </object> <packing> <property name="expand">False</property> @@ -94,13 +73,13 @@ <object class="GtkRadioButton" id="RB_CONST"> <property name="label" translatable="yes" context="tp_ErrorBars|RB_CONST">_Constant Value</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">RB_PERCENT</property> + <property name="group">RB_NONE</property> </object> <packing> <property name="expand">False</property> @@ -112,13 +91,13 @@ <object class="GtkRadioButton" id="RB_PERCENT"> <property name="label" translatable="yes" context="tp_ErrorBars|RB_PERCENT">_Percentage</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">RB_FUNCTION</property> + <property name="group">RB_NONE</property> </object> <packing> <property name="expand">False</property> @@ -134,13 +113,13 @@ <child> <object class="GtkRadioButton" id="RB_FUNCTION"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">RB_RANGE</property> + <property name="group">RB_NONE</property> </object> <packing> <property name="expand">False</property> @@ -149,10 +128,15 @@ </packing> </child> <child> - <object class="GtkComboBox" id="LB_FUNCTION"> + <object class="GtkComboBoxText" id="LB_FUNCTION"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="model">liststoreFUNCTION</property> + <items> + <item id="0" translatable="yes" context="tp_ErrorBars|liststoreFUNCTION">Standard Error</item> + <item id="1" translatable="yes" context="tp_ErrorBars|liststoreFUNCTION">Standard Deviation</item> + <item id="2" translatable="yes" context="tp_ErrorBars|liststoreFUNCTION">Variance</item> + <item id="3" translatable="yes" context="tp_ErrorBars|liststoreFUNCTION">Error Margin</item> + </items> </object> <packing> <property name="expand">False</property> @@ -171,7 +155,7 @@ <object class="GtkRadioButton" id="RB_RANGE"> <property name="label" translatable="yes" context="tp_ErrorBars|RB_RANGE">Cell _Range</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> @@ -228,45 +212,40 @@ <object class="GtkRadioButton" id="RB_BOTH"> <property name="label" translatable="yes" context="tp_ErrorBars|RB_BOTH">Positive _and Negative</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">RB_POSITIVE</property> </object> <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> <object class="GtkRadioButton" id="RB_POSITIVE"> <property name="label" translatable="yes" context="tp_ErrorBars|RB_POSITIVE">Pos_itive</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">RB_NEGATIVE</property> + <property name="group">RB_BOTH</property> </object> <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> <object class="GtkRadioButton" id="RB_NEGATIVE"> <property name="label" translatable="yes" context="tp_ErrorBars|RB_NEGATIVE">Ne_gative</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> @@ -277,8 +256,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -290,8 +267,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -303,8 +278,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -316,8 +289,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> @@ -328,8 +299,8 @@ <object class="GtkLabel" id="label2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="tp_ErrorBars|label2">Error Indicator</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -378,7 +349,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="tp_ErrorBars|FT_POSITIVE">P_ositive (+)</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">MF_POSITIVE:0</property> + <property name="mnemonic_widget">MF_POSITIVE</property> </object> <packing> <property name="expand">False</property> @@ -387,9 +358,10 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="MF_POSITIVE:0"> + <object class="GtkSpinButton" id="MF_POSITIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> + <property name="adjustment">adjustmentPOS</property> <property name="digits">2</property> </object> <packing> @@ -401,8 +373,9 @@ <child> <object class="GtkEntry" id="ED_RANGE_POSITIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> </object> <packing> <property name="expand">False</property> @@ -413,7 +386,7 @@ <child> <object class="GtkButton" id="IB_RANGE_POSITIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes" context="tp_ErrorBars|IB_RANGE_POSITIVE|tooltip_text">Select data range</property> <property name="image">imageRANGE_SELECT_POSITIVE</property> @@ -442,7 +415,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="tp_ErrorBars|FT_NEGATIVE">_Negative (-)</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">MF_NEGATIVE:0</property> + <property name="mnemonic_widget">MF_NEGATIVE</property> </object> <packing> <property name="expand">False</property> @@ -451,9 +424,10 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="MF_NEGATIVE:0"> + <object class="GtkSpinButton" id="MF_NEGATIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> + <property name="adjustment">adjustmentNEG</property> <property name="digits">2</property> </object> <packing> @@ -465,7 +439,7 @@ <child> <object class="GtkEntry" id="ED_RANGE_NEGATIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> </object> <packing> @@ -477,7 +451,7 @@ <child> <object class="GtkButton" id="IB_RANGE_NEGATIVE"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes" context="tp_ErrorBars|IB_RANGE_NEGATIVE|tooltip_text">Select data range</property> <property name="image">imageRANGE_SELECT_NEG</property> @@ -499,7 +473,7 @@ <object class="GtkCheckButton" id="CB_SYN_POS_NEG"> <property name="label" translatable="yes" context="tp_ErrorBars|CB_SYN_POS_NEG">Same value for both</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> @@ -519,8 +493,8 @@ <object class="GtkLabel" id="label3"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="tp_ErrorBars|label3">Parameters</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 19aa23956bee..93e3e6a0c5e6 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -194,6 +194,7 @@ public: virtual OUString get_title() const = 0; virtual void set_busy_cursor(bool bBusy) = 0; virtual void window_move(int x, int y) = 0; + virtual void set_modal(bool bModal) = 0; virtual bool get_extents_relative_to(Window& rRelative, int& x, int& y, int& width, int& height) = 0; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index b5b2519482b0..c0967e15f66a 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -727,6 +727,16 @@ public: assert(false && "must be system or docking window"); } + virtual void set_modal(bool bModal) override + { + if (::Dialog* pDialog = dynamic_cast<::Dialog*>(m_xWindow.get())) + { + pDialog->SetModalInputMode(bModal); + return; + } + m_xWindow->ImplGetFrame()->SetModal(bModal); + } + virtual void window_move(int x, int y) override { m_xWindow->SetPosPixel(Point(x, y)); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 4fa46987cb68..d3b522b5b554 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2052,6 +2052,11 @@ public: g_object_unref(pCursor); } + virtual void set_modal(bool bModal) override + { + gtk_window_set_modal(m_pWindow, bModal); + } + virtual void resize_to_request() override { gtk_window_resize(m_pWindow, 1, 1); |