diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-12 16:39:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-13 00:51:26 +0200 |
commit | f7a2e12cb582bda905a75fc547ad632c9b371d06 (patch) | |
tree | a5eb81cc9a58997e286adce3ea30673a30e04f4f /chart2 | |
parent | c0bf396a566f94b0999357dcdca10cf2eb03b5bc (diff) |
weld DataLabelsDialog and DataLabelsTabPage
Change-Id: I509d58b2677b5e8f0db476e2650661cb128a5279
Reviewed-on: https://gerrit.libreoffice.org/61723
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/dialogs/TextDirectionListBox.cxx | 13 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx | 8 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/res_DataLabel.cxx | 220 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/res_DataLabel.hxx | 55 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_DataLabel.cxx | 13 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_DataLabel.hxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/inc/TextDirectionListBox.hxx | 7 | ||||
-rw-r--r-- | chart2/source/controller/inc/dlg_InsertDataLabel.hxx | 11 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Insert.cxx | 6 | ||||
-rw-r--r-- | chart2/uiconfig/ui/dlg_DataLabel.ui | 172 | ||||
-rw-r--r-- | chart2/uiconfig/ui/tp_DataLabel.ui | 189 |
11 files changed, 291 insertions, 405 deletions
diff --git a/chart2/source/controller/dialogs/TextDirectionListBox.cxx b/chart2/source/controller/dialogs/TextDirectionListBox.cxx index 1fd5b7604c10..a622e2b651d2 100644 --- a/chart2/source/controller/dialogs/TextDirectionListBox.cxx +++ b/chart2/source/controller/dialogs/TextDirectionListBox.cxx @@ -42,6 +42,19 @@ TextDirectionListBox::TextDirectionListBox( vcl::Window* pParent ) : VCL_BUILDER_FACTORY(TextDirectionListBox) +SchTextDirectionListBox::SchTextDirectionListBox(std::unique_ptr<weld::ComboBox> pControl) + : svx::SvxFrameDirectionListBox(std::move(pControl)) +{ + append(SvxFrameDirection::Horizontal_LR_TB, SchResId(STR_TEXT_DIRECTION_LTR)); + append(SvxFrameDirection::Horizontal_RL_TB, SchResId(STR_TEXT_DIRECTION_RTL)); + append(SvxFrameDirection::Environment, SchResId(STR_TEXT_DIRECTION_SUPER)); + + if (!SvtLanguageOptions().IsCTLFontEnabled()) + { + hide(); + } +} + } //namespace chart /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx index 4bfb943fddc9..57817d883d66 100644 --- a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx @@ -23,11 +23,9 @@ namespace chart { -DataLabelsDialog::DataLabelsDialog(vcl::Window* pWindow, const SfxItemSet& rInAttrs, SvNumberFormatter* pFormatter) : - ModalDialog(pWindow - ,"dlg_DataLabels" - ,"modules/schart/ui/dlg_DataLabel.ui"), - m_apDataLabelResources( new DataLabelResources(this, GetFrameWeld(), rInAttrs) ) +DataLabelsDialog::DataLabelsDialog(weld::Window* pWindow, const SfxItemSet& rInAttrs, SvNumberFormatter* pFormatter) + : GenericDialogController(pWindow, "modules/schart/ui/dlg_DataLabel.ui", "dlg_DataLabels") + , m_apDataLabelResources(new DataLabelResources(m_xBuilder.get(), pWindow, rInAttrs)) { m_apDataLabelResources->SetNumberFormatter( pFormatter ); m_apDataLabelResources->Reset(rInAttrs); diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx index 95094b4b8d8a..e44a346a0a46 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.cxx +++ b/chart2/source/controller/dialogs/res_DataLabel.cxx @@ -69,65 +69,54 @@ bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, sal_uInt16 nValueW return bSet; } -void lcl_setBoolItemToCheckBox( const SfxItemSet& rInAttrs, sal_uInt16 nWhichId, CheckBox& rCheckbox ) +void lcl_setBoolItemToCheckBox(const SfxItemSet& rInAttrs, sal_uInt16 nWhichId, weld::CheckButton& rCheckbox) { - rCheckbox.EnableTriState( false ); - const SfxPoolItem *pPoolItem = nullptr; if( rInAttrs.GetItemState(nWhichId, true, &pPoolItem) == SfxItemState::SET ) - rCheckbox.Check( static_cast<const SfxBoolItem*>(pPoolItem)->GetValue() ); + rCheckbox.set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue()); else - { - rCheckbox.EnableTriState(); - rCheckbox.SetState( TRISTATE_INDET ); - } + rCheckbox.set_state(TRISTATE_INDET); } }//end anonymous namespace -DataLabelResources::DataLabelResources(VclBuilderContainer* pWindow, weld::Window* pParent, const SfxItemSet& rInAttrs ) - : - m_pNumberFormatter(nullptr), - m_bNumberFormatMixedState(true), - m_bPercentFormatMixedState(true), - m_nNumberFormatForValue(0), - m_nNumberFormatForPercent(11), - m_bSourceFormatMixedState(true), - m_bPercentSourceMixedState(true), - m_bSourceFormatForValue(true), - m_bSourceFormatForPercent(true), - m_pWindow(pParent), - m_pPool(rInAttrs.GetPool()) +DataLabelResources::DataLabelResources(weld::Builder* pBuilder, weld::Window* pParent, const SfxItemSet& rInAttrs) + : m_pNumberFormatter(nullptr) + , m_bNumberFormatMixedState(true) + , m_bPercentFormatMixedState(true) + , m_nNumberFormatForValue(0) + , m_nNumberFormatForPercent(11) + , m_bSourceFormatMixedState(true) + , m_bPercentSourceMixedState(true) + , m_bSourceFormatForValue(true) + , m_bSourceFormatForPercent(true) + , m_pWindow(pParent) + , m_pPool(rInAttrs.GetPool()) + , m_xCBNumber(pBuilder->weld_check_button("CB_VALUE_AS_NUMBER")) + , m_xPB_NumberFormatForValue(pBuilder->weld_button("PB_NUMBERFORMAT")) + , m_xCBPercent(pBuilder->weld_check_button("CB_VALUE_AS_PERCENTAGE")) + , m_xPB_NumberFormatForPercent(pBuilder->weld_button("PB_PERCENT_NUMBERFORMAT")) + , m_xFT_NumberFormatForPercent(pBuilder->weld_label("STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE")) + , m_xCBCategory(pBuilder->weld_check_button("CB_CATEGORY")) + , m_xCBSymbol(pBuilder->weld_check_button("CB_SYMBOL")) + , m_xCBWrapText(pBuilder->weld_check_button("CB_WRAP_TEXT")) + , m_xSeparatorResources(pBuilder->weld_widget("boxSEPARATOR")) + , m_xLB_Separator(pBuilder->weld_combo_box("LB_TEXT_SEPARATOR")) + , m_xBxLabelPlacement(pBuilder->weld_widget("boxPLACEMENT")) + , m_xLB_LabelPlacement(pBuilder->weld_combo_box("LB_LABEL_PLACEMENT")) + , m_xBxOrientation(pBuilder->weld_widget("boxORIENTATION")) + , m_xFT_Dial(pBuilder->weld_label("CT_LABEL_DIAL")) + , m_xNF_Degrees(pBuilder->weld_spin_button("NF_LABEL_DEGREES")) + , m_xBxTextDirection(pBuilder->weld_widget("boxTXT_DIRECTION")) + , m_xLB_TextDirection(new SchTextDirectionListBox(pBuilder->weld_combo_box("LB_LABEL_TEXTDIR"))) + , m_xDC_Dial(new weld::CustomWeld(*pBuilder, "CT_DIAL", m_aDC_Dial)) { - pWindow->get(m_pCBNumber, "CB_VALUE_AS_NUMBER"); - pWindow->get(m_pPB_NumberFormatForValue, "PB_NUMBERFORMAT"); - pWindow->get(m_pCBPercent, "CB_VALUE_AS_PERCENTAGE"); - pWindow->get(m_pPB_NumberFormatForPercent, "PB_PERCENT_NUMBERFORMAT"); - pWindow->get(m_pFT_NumberFormatForPercent,"STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE"); - pWindow->get(m_pCBCategory, "CB_CATEGORY"); - pWindow->get(m_pCBSymbol, "CB_SYMBOL"); - pWindow->get(m_pCBWrapText, "CB_WRAP_TEXT"); - - pWindow->get(m_pBxLabelPlacement, "boxPLACEMENT"); - pWindow->get(m_pLB_LabelPlacement, "LB_LABEL_PLACEMENT"); - - pWindow->get(m_pDC_Dial, "CT_DIAL"); - pWindow->get(m_pFT_Dial, "CT_LABEL_DIAL"); - - m_pDC_Dial->SetText(m_pFT_Dial->GetText()); - - pWindow->get(m_pNF_Degrees, "NF_LABEL_DEGREES"); - pWindow->get(m_pLB_TextDirection, "LB_LABEL_TEXTDIR"); - pWindow->get(m_pBxTextDirection, "boxTXT_DIRECTION"); - pWindow->get(m_pBxOrientation, "boxORIENTATION"); - - pWindow->get(m_pSeparatorResources, "boxSEPARATOR"); - pWindow->get(m_pLB_Separator, "LB_TEXT_SEPARATOR"); + m_aDC_Dial.SetText(m_xFT_Dial->get_label()); //fill label placement list std::map< sal_Int32, OUString > aPlacementToStringMap; - for( sal_Int32 nEnum=0; nEnum<m_pLB_LabelPlacement->GetEntryCount(); ++nEnum ) - aPlacementToStringMap[nEnum] = m_pLB_LabelPlacement->GetEntry(static_cast<sal_uInt16>(nEnum)); + for( sal_Int32 nEnum=0; nEnum<m_xLB_LabelPlacement->get_count(); ++nEnum ) + aPlacementToStringMap[nEnum] = m_xLB_LabelPlacement->get_text(static_cast<sal_uInt16>(nEnum)); std::vector< sal_Int32 > aAvailablePlacementList; @@ -135,25 +124,24 @@ DataLabelResources::DataLabelResources(VclBuilderContainer* pWindow, weld::Windo if( rInAttrs.GetItemState(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, true, &pPoolItem) == SfxItemState::SET ) aAvailablePlacementList = static_cast<const SfxIntegerListItem*>(pPoolItem)->GetList(); - m_pLB_LabelPlacement->Clear(); + m_xLB_LabelPlacement->clear(); for( size_t nN=0; nN<aAvailablePlacementList.size(); ++nN ) { sal_uInt16 nListBoxPos = static_cast<sal_uInt16>( nN ); sal_Int32 nPlacement = aAvailablePlacementList[nN]; m_aPlacementToListBoxMap[nPlacement]=nListBoxPos; m_aListBoxToPlacementMap[nListBoxPos]=nPlacement; - m_pLB_LabelPlacement->InsertEntry( aPlacementToStringMap[nPlacement] ); + m_xLB_LabelPlacement->append_text( aPlacementToStringMap[nPlacement] ); } - m_pLB_LabelPlacement->SetDropDownLineCount(m_pLB_LabelPlacement->GetEntryCount()); //some click handler - m_pPB_NumberFormatForValue->SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) ); - m_pPB_NumberFormatForPercent->SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) ); - m_pCBNumber->SetClickHdl( LINK( this, DataLabelResources, CheckHdl )); - m_pCBPercent->SetClickHdl( LINK( this, DataLabelResources, CheckHdl )); - m_pCBCategory->SetClickHdl( LINK( this, DataLabelResources, CheckHdl )); - m_pCBSymbol->SetClickHdl( LINK( this, DataLabelResources, CheckHdl )); - m_pCBWrapText->SetClickHdl( LINK( this, DataLabelResources, CheckHdl )); + m_xPB_NumberFormatForValue->connect_clicked( LINK( this, DataLabelResources, NumberFormatDialogHdl ) ); + m_xPB_NumberFormatForPercent->connect_clicked( LINK( this, DataLabelResources, NumberFormatDialogHdl ) ); + m_xCBNumber->connect_toggled( LINK( this, DataLabelResources, CheckHdl )); + m_xCBPercent->connect_toggled( LINK( this, DataLabelResources, CheckHdl )); + m_xCBCategory->connect_toggled( LINK( this, DataLabelResources, CheckHdl )); + m_xCBSymbol->connect_toggled( LINK( this, DataLabelResources, CheckHdl )); + m_xCBWrapText->connect_toggled( LINK( this, DataLabelResources, CheckHdl )); m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState ); m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState); @@ -162,10 +150,10 @@ DataLabelResources::DataLabelResources(VclBuilderContainer* pWindow, weld::Windo { bool bForbidPercentValue = rInAttrs.Get( SCHATTR_DATADESCR_NO_PERCENTVALUE ).GetValue(); if( bForbidPercentValue ) - m_pCBPercent->Enable(false); + m_xCBPercent->set_sensitive(false); } - m_pDC_Dial->SetLinkedField( m_pNF_Degrees ); + m_aDC_Dial.SetLinkedField(m_xNF_Degrees.get()); } DataLabelResources::~DataLabelResources() @@ -177,7 +165,7 @@ void DataLabelResources::SetNumberFormatter( SvNumberFormatter* pFormatter ) m_pNumberFormatter = pFormatter; } -IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, Button *, pButton, void ) +IMPL_LINK(DataLabelResources, NumberFormatDialogHdl, weld::Button&, rButton, void) { if( !m_pPool || !m_pNumberFormatter ) { @@ -185,15 +173,15 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, Button *, pButton, void ) return; } - if( pButton == m_pPB_NumberFormatForValue && !m_pCBNumber->IsChecked()) - m_pCBNumber->Check(); - else if( pButton == m_pPB_NumberFormatForPercent && !m_pCBPercent->IsChecked()) - m_pCBPercent->Check(); + if (&rButton == m_xPB_NumberFormatForValue.get() && !m_xCBNumber->get_active()) + m_xCBNumber->set_active(true); + else if (&rButton == m_xPB_NumberFormatForPercent.get() && !m_xCBPercent->get_active()) + m_xCBPercent->set_active(true); SfxItemSet aNumberSet = NumberFormatDialog::CreateEmptyItemSetForNumberFormatDialog( *m_pPool ); aNumberSet.Put (SvxNumberInfoItem( m_pNumberFormatter, static_cast<sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO))); - bool bPercent = ( pButton == m_pPB_NumberFormatForPercent ); + bool bPercent = (&rButton == m_xPB_NumberFormatForPercent.get()); sal_uLong& rnFormatKey = bPercent ? m_nNumberFormatForPercent : m_nNumberFormatForValue; bool& rUseSourceFormat = bPercent ? m_bSourceFormatForPercent : m_bSourceFormatForValue; @@ -206,7 +194,7 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, Button *, pButton, void ) NumberFormatDialog aDlg(m_pWindow, aNumberSet); if( bPercent ) - aDlg.set_title(m_pFT_NumberFormatForPercent->GetText()); + aDlg.set_title(m_xFT_NumberFormatForPercent->get_label()); if (aDlg.run() == RET_OK) { const SfxItemSet* pResult = aDlg.GetOutputItemSet(); @@ -225,57 +213,55 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, Button *, pButton, void ) } } -IMPL_LINK( DataLabelResources, CheckHdl, Button*, pBox, void ) +IMPL_LINK_NOARG(DataLabelResources, CheckHdl, weld::ToggleButton&, void) { - if( pBox ) - static_cast<CheckBox*>(pBox)->EnableTriState( false ); EnableControls(); } void DataLabelResources::EnableControls() { - m_pCBSymbol->Enable( m_pCBNumber->IsChecked() || (m_pCBPercent->IsChecked() && m_pCBPercent->IsEnabled()) - || m_pCBCategory->IsChecked() ); + m_xCBSymbol->set_sensitive( m_xCBNumber->get_active() || (m_xCBPercent->get_active() && m_xCBPercent->get_sensitive()) + || m_xCBCategory->get_active() ); - m_pCBWrapText->Enable( m_pCBNumber->IsChecked() || (m_pCBPercent->IsChecked() && m_pCBPercent->IsEnabled()) - || m_pCBCategory->IsChecked() ); + m_xCBWrapText->set_sensitive( m_xCBNumber->get_active() || (m_xCBPercent->get_active() && m_xCBPercent->get_sensitive()) + || m_xCBCategory->get_active() ); // Enable or disable separator, placement and direction based on the check // box states. Note that the check boxes are tri-state. { long nNumberOfCheckedLabelParts = 0; - if (m_pCBNumber->GetState() != TRISTATE_FALSE) + if (m_xCBNumber->get_state() != TRISTATE_FALSE) ++nNumberOfCheckedLabelParts; - if (m_pCBPercent->GetState() != TRISTATE_FALSE && m_pCBPercent->IsEnabled()) + if (m_xCBPercent->get_state() != TRISTATE_FALSE && m_xCBPercent->get_sensitive()) ++nNumberOfCheckedLabelParts; - if (m_pCBCategory->GetState() != TRISTATE_FALSE) + if (m_xCBCategory->get_state() != TRISTATE_FALSE) ++nNumberOfCheckedLabelParts; - m_pSeparatorResources->Enable( nNumberOfCheckedLabelParts > 1 ); + m_xSeparatorResources->set_sensitive( nNumberOfCheckedLabelParts > 1 ); bool bEnableTextDir = nNumberOfCheckedLabelParts > 0; - m_pBxTextDirection->Enable( bEnableTextDir ); - bool bEnablePlacement = nNumberOfCheckedLabelParts > 0 && m_pLB_LabelPlacement->GetEntryCount()>1; - m_pBxLabelPlacement->Enable( bEnablePlacement ); + m_xBxTextDirection->set_sensitive( bEnableTextDir ); + bool bEnablePlacement = nNumberOfCheckedLabelParts > 0 && m_xLB_LabelPlacement->get_count()>1; + m_xBxLabelPlacement->set_sensitive( bEnablePlacement ); } - m_pPB_NumberFormatForValue->Enable( m_pNumberFormatter && m_pCBNumber->IsChecked() ); - m_pPB_NumberFormatForPercent->Enable( m_pNumberFormatter && m_pCBPercent->IsChecked() && m_pCBPercent->IsEnabled() ); + m_xPB_NumberFormatForValue->set_sensitive( m_pNumberFormatter && m_xCBNumber->get_active() ); + m_xPB_NumberFormatForPercent->set_sensitive( m_pNumberFormatter && m_xCBPercent->get_active() && m_xCBPercent->get_sensitive() ); - bool bEnableRotation = ( m_pCBNumber->IsChecked() || m_pCBPercent->IsChecked() || m_pCBCategory->IsChecked() ); - m_pBxOrientation->Enable( bEnableRotation ); + bool bEnableRotation = ( m_xCBNumber->get_active() || m_xCBPercent->get_active() || m_xCBCategory->get_active() ); + m_xBxOrientation->set_sensitive( bEnableRotation ); } void DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const { - if( m_pCBNumber->IsChecked() ) + if( m_xCBNumber->get_active() ) { if( !m_bNumberFormatMixedState ) rOutAttrs->Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, m_nNumberFormatForValue )); if( !m_bSourceFormatMixedState ) rOutAttrs->Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, m_bSourceFormatForValue )); } - if( m_pCBPercent->IsChecked() ) + if( m_xCBPercent->get_active() ) { if( !m_bPercentFormatMixedState ) rOutAttrs->Put( SfxUInt32Item( SCHATTR_PERCENT_NUMBERFORMAT_VALUE, m_nNumberFormatForPercent )); @@ -283,33 +269,33 @@ void DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const rOutAttrs->Put( SfxBoolItem( SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_bSourceFormatForPercent )); } - if( m_pCBNumber->GetState()!= TRISTATE_INDET ) - rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_NUMBER, m_pCBNumber->IsChecked() ) ); - if( m_pCBPercent->GetState()!= TRISTATE_INDET ) - rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_PERCENTAGE, m_pCBPercent->IsChecked() ) ); - if( m_pCBCategory->GetState()!= TRISTATE_INDET ) - rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_CATEGORY, m_pCBCategory->IsChecked() ) ); - if( m_pCBSymbol->GetState()!= TRISTATE_INDET ) - rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYMBOL, m_pCBSymbol->IsChecked()) ); - if( m_pCBWrapText->GetState()!= TRISTATE_INDET ) - rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_WRAP_TEXT, m_pCBWrapText->IsChecked()) ); - - OUString aSep = our_aLBEntryMap[m_pLB_Separator->GetSelectedEntryPos()]; + if( m_xCBNumber->get_state()!= TRISTATE_INDET ) + rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_NUMBER, m_xCBNumber->get_active() ) ); + if( m_xCBPercent->get_state()!= TRISTATE_INDET ) + rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_PERCENTAGE, m_xCBPercent->get_active() ) ); + if( m_xCBCategory->get_state()!= TRISTATE_INDET ) + rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_CATEGORY, m_xCBCategory->get_active() ) ); + if( m_xCBSymbol->get_state()!= TRISTATE_INDET ) + rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYMBOL, m_xCBSymbol->get_active()) ); + if( m_xCBWrapText->get_state()!= TRISTATE_INDET ) + rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_WRAP_TEXT, m_xCBWrapText->get_active()) ); + + OUString aSep = our_aLBEntryMap[m_xLB_Separator->get_active()]; rOutAttrs->Put( SfxStringItem( SCHATTR_DATADESCR_SEPARATOR, aSep) ); - std::map< sal_uInt16, sal_Int32 >::const_iterator aIt( m_aListBoxToPlacementMap.find(m_pLB_LabelPlacement->GetSelectedEntryPos()) ); + std::map< sal_uInt16, sal_Int32 >::const_iterator aIt( m_aListBoxToPlacementMap.find(m_xLB_LabelPlacement->get_active()) ); if(aIt!=m_aListBoxToPlacementMap.end()) { sal_Int32 nValue = aIt->second; rOutAttrs->Put( SfxInt32Item( SCHATTR_DATADESCR_PLACEMENT, nValue ) ); } - if( m_pLB_TextDirection->GetSelectedEntryCount() > 0 ) - rOutAttrs->Put( SvxFrameDirectionItem( m_pLB_TextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR ) ); + if (m_xLB_TextDirection->get_active() != -1) + rOutAttrs->Put( SvxFrameDirectionItem( m_xLB_TextDirection->get_active_id(), EE_PARA_WRITINGDIR ) ); - if( m_pDC_Dial->IsVisible() ) + if( m_aDC_Dial.IsVisible() ) { - sal_Int32 nDegrees = m_pDC_Dial->GetRotation(); + sal_Int32 nDegrees = m_aDC_Dial.GetRotation(); rOutAttrs->Put(SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) ); } } @@ -317,13 +303,13 @@ void DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const void DataLabelResources::Reset(const SfxItemSet& rInAttrs) { // default state - m_pCBSymbol->Enable( false ); + m_xCBSymbol->set_sensitive( false ); - lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_NUMBER, *m_pCBNumber ); - lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_PERCENTAGE, *m_pCBPercent ); - lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_CATEGORY, *m_pCBCategory ); - lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_SYMBOL, *m_pCBSymbol ); - lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_WRAP_TEXT, *m_pCBWrapText ); + lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_NUMBER, *m_xCBNumber ); + lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_PERCENTAGE, *m_xCBPercent ); + lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_CATEGORY, *m_xCBCategory ); + lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_SYMBOL, *m_xCBSymbol ); + lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_WRAP_TEXT, *m_xCBWrapText ); m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState ); m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState); @@ -333,10 +319,10 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs) for(sal_uInt32 i=0; i < SAL_N_ELEMENTS(our_aLBEntryMap); ++i ) { if( our_aLBEntryMap[i] == static_cast<const SfxStringItem*>(pPoolItem)->GetValue()) - m_pLB_Separator->SelectEntryPos( i ); + m_xLB_Separator->set_active( i ); } else - m_pLB_Separator->SelectEntryPos( 0 ); + m_xLB_Separator->set_active( 0 ); if( rInAttrs.GetItemState(SCHATTR_DATADESCR_PLACEMENT, true, &pPoolItem) == SfxItemState::SET ) { @@ -345,24 +331,24 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs) if(aIt!=m_aPlacementToListBoxMap.end()) { sal_uInt16 nPos = aIt->second; - m_pLB_LabelPlacement->SelectEntryPos( nPos ); + m_xLB_LabelPlacement->set_active( nPos ); } else - m_pLB_LabelPlacement->SetNoSelection(); + m_xLB_LabelPlacement->set_active(-1); } else - m_pLB_LabelPlacement->SetNoSelection(); + m_xLB_LabelPlacement->set_active(-1); if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, true, &pPoolItem ) == SfxItemState::SET ) - m_pLB_TextDirection->SelectEntryValue( static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue() ); + m_xLB_TextDirection->set_active_id( static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue() ); if( rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, true, &pPoolItem ) == SfxItemState::SET ) { sal_Int32 nDegrees = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue(); - m_pDC_Dial->SetRotation( nDegrees ); + m_aDC_Dial.SetRotation( nDegrees ); } else - m_pDC_Dial->SetRotation( 0 ); + m_aDC_Dial.SetRotation( 0 ); EnableControls(); } diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx index 807c3fc70dc1..036441266cf6 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.hxx +++ b/chart2/source/controller/dialogs/res_DataLabel.hxx @@ -34,7 +34,7 @@ namespace chart class DataLabelResources final { public: - DataLabelResources( VclBuilderContainer* pWindow, weld::Window* pParent, const SfxItemSet& rInAttrs ); + DataLabelResources(weld::Builder* pBuilder, weld::Window* pParent, const SfxItemSet& rInAttrs); ~DataLabelResources(); void FillItemSet(SfxItemSet* rOutAttrs) const; @@ -43,29 +43,6 @@ public: void SetNumberFormatter( SvNumberFormatter* pFormatter ); private: - VclPtr<CheckBox> m_pCBNumber; - VclPtr<PushButton> m_pPB_NumberFormatForValue; - VclPtr<CheckBox> m_pCBPercent; - VclPtr<PushButton> m_pPB_NumberFormatForPercent; - VclPtr<FixedText> m_pFT_NumberFormatForPercent; - VclPtr<CheckBox> m_pCBCategory; - VclPtr<CheckBox> m_pCBSymbol; - VclPtr<CheckBox> m_pCBWrapText; - - VclPtr<VclHBox> m_pSeparatorResources; - VclPtr<ListBox> m_pLB_Separator; - - VclPtr<VclHBox> m_pBxLabelPlacement; - VclPtr<ListBox> m_pLB_LabelPlacement; - - VclPtr<VclHBox> m_pBxOrientation; - VclPtr<svx::DialControl> m_pDC_Dial; - VclPtr<FixedText> m_pFT_Dial; - VclPtr<NumericField> m_pNF_Degrees; - - VclPtr<VclHBox> m_pBxTextDirection; - VclPtr<TextDirectionListBox> m_pLB_TextDirection; - std::map< sal_Int32, sal_uInt16 > m_aPlacementToListBoxMap; std::map< sal_uInt16, sal_Int32 > m_aListBoxToPlacementMap; @@ -83,8 +60,34 @@ private: weld::Window* m_pWindow; SfxItemPool* m_pPool; - DECL_LINK(NumberFormatDialogHdl, Button *, void ); - DECL_LINK(CheckHdl, Button*, void ); + svx::SvxDialControl m_aDC_Dial; + + std::unique_ptr<weld::CheckButton> m_xCBNumber; + std::unique_ptr<weld::Button> m_xPB_NumberFormatForValue; + std::unique_ptr<weld::CheckButton> m_xCBPercent; + std::unique_ptr<weld::Button> m_xPB_NumberFormatForPercent; + std::unique_ptr<weld::Label> m_xFT_NumberFormatForPercent; + std::unique_ptr<weld::CheckButton> m_xCBCategory; + std::unique_ptr<weld::CheckButton> m_xCBSymbol; + std::unique_ptr<weld::CheckButton> m_xCBWrapText; + + std::unique_ptr<weld::Widget> m_xSeparatorResources; + std::unique_ptr<weld::ComboBox> m_xLB_Separator; + + std::unique_ptr<weld::Widget> m_xBxLabelPlacement; + std::unique_ptr<weld::ComboBox> m_xLB_LabelPlacement; + + std::unique_ptr<weld::Widget> m_xBxOrientation; + std::unique_ptr<weld::Label> m_xFT_Dial; + std::unique_ptr<weld::SpinButton> m_xNF_Degrees; + + std::unique_ptr<weld::Widget> m_xBxTextDirection; + + std::unique_ptr<SchTextDirectionListBox> m_xLB_TextDirection; + std::unique_ptr<weld::CustomWeld> m_xDC_Dial; + + DECL_LINK(NumberFormatDialogHdl, weld::Button&, void ); + DECL_LINK(CheckHdl, weld::ToggleButton&, void ); void EnableControls(); }; diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx index 30d35707789b..7d189fad49ca 100644 --- a/chart2/source/controller/dialogs/tp_DataLabel.cxx +++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx @@ -24,18 +24,15 @@ namespace chart { -DataLabelsTabPage::DataLabelsTabPage(vcl::Window* pWindow, const SfxItemSet& rInAttrs) - : SfxTabPage(pWindow - , "tp_DataLabel" - , "modules/schart/ui/tp_DataLabel.ui" - , &rInAttrs) - , m_aDataLabelResources(this, GetFrameWeld(), rInAttrs) +DataLabelsTabPage::DataLabelsTabPage(TabPageParent pWindow, const SfxItemSet& rInAttrs) + : SfxTabPage(pWindow , "modules/schart/ui/tp_DataLabel.ui", "tp_DataLabel", &rInAttrs) + , m_aDataLabelResources(m_xBuilder.get(), pWindow.GetFrameWeld(), rInAttrs) { } -VclPtr<SfxTabPage> DataLabelsTabPage::Create(TabPageParent pWindow, const SfxItemSet* rOutAttrs) +VclPtr<SfxTabPage> DataLabelsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs) { - return VclPtr<DataLabelsTabPage>::Create(pWindow.pParent, *rOutAttrs); + return VclPtr<DataLabelsTabPage>::Create(pParent, *rOutAttrs); } bool DataLabelsTabPage::FillItemSet(SfxItemSet* rOutAttrs) diff --git a/chart2/source/controller/dialogs/tp_DataLabel.hxx b/chart2/source/controller/dialogs/tp_DataLabel.hxx index 3abb43900c4d..48a7fbcaeeec 100644 --- a/chart2/source/controller/dialogs/tp_DataLabel.hxx +++ b/chart2/source/controller/dialogs/tp_DataLabel.hxx @@ -30,7 +30,7 @@ namespace chart class DataLabelsTabPage : public SfxTabPage { public: - DataLabelsTabPage(vcl::Window* pWindow, const SfxItemSet& rInAttrs); + DataLabelsTabPage(TabPageParent pWindow, const SfxItemSet& rInAttrs); static VclPtr<SfxTabPage> Create(TabPageParent pWindow, const SfxItemSet* rInAttrs); diff --git a/chart2/source/controller/inc/TextDirectionListBox.hxx b/chart2/source/controller/inc/TextDirectionListBox.hxx index c3054072f1d3..e04fcca15718 100644 --- a/chart2/source/controller/inc/TextDirectionListBox.hxx +++ b/chart2/source/controller/inc/TextDirectionListBox.hxx @@ -33,6 +33,13 @@ public: explicit TextDirectionListBox( vcl::Window* pParent ); }; +class SchTextDirectionListBox : public svx::SvxFrameDirectionListBox +{ +public: + explicit SchTextDirectionListBox(std::unique_ptr<weld::ComboBox> pControl); +}; + + } //namespace chart #endif diff --git a/chart2/source/controller/inc/dlg_InsertDataLabel.hxx b/chart2/source/controller/inc/dlg_InsertDataLabel.hxx index 30040f03409d..a16815b7a379 100644 --- a/chart2/source/controller/inc/dlg_InsertDataLabel.hxx +++ b/chart2/source/controller/inc/dlg_InsertDataLabel.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DLG_INSERTDATALABEL_HXX #define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DLG_INSERTDATALABEL_HXX -#include <vcl/dialog.hxx> +#include <vcl/weld.hxx> #include <svl/itemset.hxx> #include <memory> @@ -29,16 +29,13 @@ namespace chart { class DataLabelResources; -class DataLabelsDialog : public ModalDialog +class DataLabelsDialog : public weld::GenericDialogController { private: -// OKButton m_aBtnOK; -// CancelButton m_aBtnCancel; -// HelpButton m_aBtnHelp; - std::unique_ptr < DataLabelResources > m_apDataLabelResources; + std::unique_ptr<DataLabelResources> m_apDataLabelResources; public: - DataLabelsDialog(vcl::Window* pParent, const SfxItemSet& rInAttrs, SvNumberFormatter* pFormatter); + DataLabelsDialog(weld::Window* pParent, const SfxItemSet& rInAttrs, SvNumberFormatter* pFormatter); virtual ~DataLabelsDialog() override; void FillItemSet(SfxItemSet& rOutAttrs); diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index a998d18453d1..b644e04cb8e9 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -284,12 +284,12 @@ void ChartController::executeDispatch_InsertMenu_DataLabels() NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier ); SvNumberFormatter* pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter(); - ScopedVclPtrInstance< DataLabelsDialog > aDlg( GetChartWindow(), aItemSet, pNumberFormatter); + DataLabelsDialog aDlg(GetChartFrame(), aItemSet, pNumberFormatter); - 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() ); bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now diff --git a/chart2/uiconfig/ui/dlg_DataLabel.ui b/chart2/uiconfig/ui/dlg_DataLabel.ui index 3cf3618e0aff..ad6424771569 100644 --- a/chart2/uiconfig/ui/dlg_DataLabel.ui +++ b/chart2/uiconfig/ui/dlg_DataLabel.ui @@ -1,106 +1,20 @@ <?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"/> - <requires lib="LibreOffice" version="1.0"/> <object class="GtkAdjustment" id="adjustmentDEGREE"> <property name="upper">359</property> <property name="step_increment">1</property> <property name="page_increment">10</property> </object> - <object class="GtkListStore" id="liststorePLACEMENT"> - <columns> - <!-- column-name gchararray1 --> - <column type="gchararray"/> - <!-- column-name guint1 --> - <column type="guint"/> - </columns> - <data> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Best fit</col> - <col id="1">0</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Center</col> - <col id="1">1</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Above</col> - <col id="1">2</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Top left</col> - <col id="1">3</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Left</col> - <col id="1">4</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Bottom left</col> - <col id="1">5</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Below</col> - <col id="1">6</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Bottom right</col> - <col id="1">7</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Right</col> - <col id="1">8</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Top right</col> - <col id="1">9</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Inside</col> - <col id="1">10</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Outside</col> - <col id="1">11</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Near origin</col> - <col id="1">12</col> - </row> - </data> - </object> - <object class="GtkListStore" id="liststoreSEPARATOR"> - <columns> - <!-- column-name gchararray1 --> - <column type="gchararray"/> - <!-- column-name guint1 --> - <column type="guint"/> - </columns> - <data> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststoreSEPARATOR">Space</col> - <col id="1">0</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststoreSEPARATOR">Comma</col> - <col id="1">1</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststoreSEPARATOR">Semicolon</col> - <col id="1">2</col> - </row> - <row> - <col id="0" translatable="yes" context="dlg_DataLabel|liststoreSEPARATOR">New line</col> - <col id="1">3</col> - </row> - </data> - </object> <object class="GtkDialog" id="dlg_DataLabels"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="dlg_DataLabel|dlg_DataLabels">Data Labels for all Data Series</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> @@ -193,7 +107,7 @@ <object class="GtkCheckButton" id="CB_VALUE_AS_NUMBER"> <property name="label" translatable="yes" context="dlg_DataLabel|CB_VALUE_AS_NUMBER">Show value as _number</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> @@ -208,7 +122,7 @@ <object class="GtkCheckButton" id="CB_VALUE_AS_PERCENTAGE"> <property name="label" translatable="yes" context="dlg_DataLabel|CB_VALUE_AS_PERCENTAGE">Show value as _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> @@ -223,7 +137,7 @@ <object class="GtkCheckButton" id="CB_CATEGORY"> <property name="label" translatable="yes" context="dlg_DataLabel|CB_CATEGORY">Show _category</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> @@ -238,7 +152,7 @@ <object class="GtkCheckButton" id="CB_SYMBOL"> <property name="label" translatable="yes" context="dlg_DataLabel|CB_SYMBOL">Show _legend key</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> @@ -253,7 +167,7 @@ <object class="GtkCheckButton" id="CB_WRAP_TEXT"> <property name="label" translatable="yes" context="dlg_DataLabel|CB_WRAP_TEXT">Auto text _wrap</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> @@ -268,7 +182,7 @@ <object class="GtkButton" id="PB_NUMBERFORMAT"> <property name="label" translatable="yes" context="dlg_DataLabel|PB_NUMBERFORMAT">Number _format...</property> <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="valign">center</property> <property name="use_underline">True</property> @@ -282,7 +196,7 @@ <object class="GtkButton" id="PB_PERCENT_NUMBERFORMAT"> <property name="label" translatable="yes" context="dlg_DataLabel|PB_PERCENT_NUMBERFORMAT">Percentage f_ormat...</property> <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="valign">center</property> <property name="use_underline">True</property> @@ -315,10 +229,10 @@ <object class="GtkLabel" id="FT_TEXT_SEPARATOR"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="dlg_DataLabel|FT_TEXT_SEPARATOR">_Separator</property> <property name="use_underline">True</property> <property name="mnemonic_widget">LB_TEXT_SEPARATOR</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -327,11 +241,16 @@ </packing> </child> <child> - <object class="GtkComboBox" id="LB_TEXT_SEPARATOR"> + <object class="GtkComboBoxText" id="LB_TEXT_SEPARATOR"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">center</property> - <property name="model">liststoreSEPARATOR</property> + <items> + <item id="0" translatable="yes" context="dlg_DataLabel|liststoreSEPARATOR">Space</item> + <item id="1" translatable="yes" context="dlg_DataLabel|liststoreSEPARATOR">Comma</item> + <item id="2" translatable="yes" context="dlg_DataLabel|liststoreSEPARATOR">Semicolon</item> + <item id="3" translatable="yes" context="dlg_DataLabel|liststoreSEPARATOR">New line</item> + </items> </object> <packing> <property name="expand">False</property> @@ -355,10 +274,10 @@ <object class="GtkLabel" id="FT_LABEL_PLACEMENT"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="dlg_DataLabel|FT_LABEL_PLACEMENT">Place_ment</property> <property name="use_underline">True</property> <property name="mnemonic_widget">LB_LABEL_PLACEMENT</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -367,11 +286,25 @@ </packing> </child> <child> - <object class="GtkComboBox" id="LB_LABEL_PLACEMENT"> + <object class="GtkComboBoxText" id="LB_LABEL_PLACEMENT"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">center</property> - <property name="model">liststorePLACEMENT</property> + <items> + <item id="0" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Best fit</item> + <item id="1" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Center</item> + <item id="2" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Above</item> + <item id="3" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Top left</item> + <item id="4" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Left</item> + <item id="5" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Bottom left</item> + <item id="6" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Below</item> + <item id="7" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Bottom right</item> + <item id="8" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Right</item> + <item id="9" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Top right</item> + <item id="10" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Inside</item> + <item id="11" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Outside</item> + <item id="12" translatable="yes" context="dlg_DataLabel|liststorePLACEMENT">Near origin</item> + </items> </object> <packing> <property name="expand">False</property> @@ -396,6 +329,9 @@ <property name="top_attach">2</property> </packing> </child> + <child> + <placeholder/> + </child> </object> </child> </object> @@ -404,8 +340,8 @@ <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="dlg_DataLabel|label1">Text Attributes</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -442,9 +378,25 @@ <property name="can_focus">False</property> <property name="spacing">12</property> <child> - <object class="svxlo-DialControl" id="CT_DIAL"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="CT_DIAL"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property> + </object> + </child> + </object> + </child> </object> <packing> <property name="expand">False</property> @@ -455,8 +407,9 @@ <child> <object class="GtkSpinButton" id="NF_LABEL_DEGREES"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="valign">center</property> + <property name="activates_default">True</property> <property name="adjustment">adjustmentDEGREE</property> <property name="wrap">True</property> </object> @@ -506,9 +459,10 @@ </packing> </child> <child> - <object class="chartcontrollerlo-TextDirectionListBox" id="LB_LABEL_TEXTDIR"> + <object class="GtkComboBoxText" id="LB_LABEL_TEXTDIR"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="no_show_all">True</property> </object> <packing> <property name="expand">False</property> @@ -531,8 +485,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_DataLabel|label2">Rotate Text</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> diff --git a/chart2/uiconfig/ui/tp_DataLabel.ui b/chart2/uiconfig/ui/tp_DataLabel.ui index bc884d204f2d..f5de4af731a1 100644 --- a/chart2/uiconfig/ui/tp_DataLabel.ui +++ b/chart2/uiconfig/ui/tp_DataLabel.ui @@ -1,101 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.22.1 --> <interface domain="chart"> <requires lib="gtk+" version="3.18"/> - <!-- interface-requires LibreOffice 1.0 --> <object class="GtkAdjustment" id="adjustmentDEGREE"> <property name="upper">359</property> <property name="step_increment">1</property> <property name="page_increment">10</property> </object> - <object class="GtkListStore" id="liststorePLACEMENT"> - <columns> - <!-- column-name gchararray1 --> - <column type="gchararray"/> - <!-- column-name guint1 --> - <column type="guint"/> - </columns> - <data> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Best fit</col> - <col id="1">0</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Center</col> - <col id="1">1</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Above</col> - <col id="1">2</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Top left</col> - <col id="1">3</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Left</col> - <col id="1">4</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Bottom left</col> - <col id="1">5</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Below</col> - <col id="1">6</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Bottom right</col> - <col id="1">7</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Right</col> - <col id="1">8</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Top right</col> - <col id="1">9</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Inside</col> - <col id="1">10</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Outside</col> - <col id="1">11</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Near origin</col> - <col id="1">12</col> - </row> - </data> - </object> - <object class="GtkListStore" id="liststoreSEPARATOR"> - <columns> - <!-- column-name gchararray1 --> - <column type="gchararray"/> - <!-- column-name guint1 --> - <column type="guint"/> - </columns> - <data> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststoreSEPARATOR">Space</col> - <col id="1">0</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststoreSEPARATOR">Comma</col> - <col id="1">1</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststoreSEPARATOR">Semicolon</col> - <col id="1">2</col> - </row> - <row> - <col id="0" translatable="yes" context="tp_DataLabel|liststoreSEPARATOR">New line</col> - <col id="1">3</col> - </row> - </data> - </object> <object class="GtkBox" id="tp_DataLabel"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -125,7 +36,7 @@ <object class="GtkCheckButton" id="CB_VALUE_AS_NUMBER"> <property name="label" translatable="yes" context="tp_DataLabel|CB_VALUE_AS_NUMBER">Show value as _number</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> @@ -134,15 +45,13 @@ <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> <object class="GtkCheckButton" id="CB_VALUE_AS_PERCENTAGE"> <property name="label" translatable="yes" context="tp_DataLabel|CB_VALUE_AS_PERCENTAGE">Show value as _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> @@ -151,15 +60,13 @@ <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> <object class="GtkCheckButton" id="CB_CATEGORY"> <property name="label" translatable="yes" context="tp_DataLabel|CB_CATEGORY">Show _category</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> @@ -168,15 +75,13 @@ <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> <child> <object class="GtkCheckButton" id="CB_SYMBOL"> <property name="label" translatable="yes" context="tp_DataLabel|CB_SYMBOL">Show _legend key</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> @@ -185,15 +90,13 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> <object class="GtkCheckButton" id="CB_WRAP_TEXT"> <property name="label" translatable="yes" context="tp_DataLabel|CB_WRAP_TEXT">Auto text _wrap</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> @@ -202,15 +105,13 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> <object class="GtkButton" id="PB_NUMBERFORMAT"> <property name="label" translatable="yes" context="tp_DataLabel|PB_NUMBERFORMAT">Number _format...</property> <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="valign">center</property> <property name="use_underline">True</property> @@ -218,15 +119,13 @@ <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="GtkButton" id="PB_PERCENT_NUMBERFORMAT"> <property name="label" translatable="yes" context="tp_DataLabel|PB_PERCENT_NUMBERFORMAT">Percentage f_ormat...</property> <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="valign">center</property> <property name="use_underline">True</property> @@ -234,8 +133,6 @@ <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> @@ -250,8 +147,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -263,10 +158,10 @@ <object class="GtkLabel" id="FT_TEXT_SEPARATOR"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="tp_DataLabel|FT_TEXT_SEPARATOR">_Separator</property> <property name="use_underline">True</property> <property name="mnemonic_widget">LB_TEXT_SEPARATOR</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -275,11 +170,16 @@ </packing> </child> <child> - <object class="GtkComboBox" id="LB_TEXT_SEPARATOR"> + <object class="GtkComboBoxText" id="LB_TEXT_SEPARATOR"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">center</property> - <property name="model">liststoreSEPARATOR</property> + <items> + <item id="0" translatable="yes" context="tp_DataLabel|liststoreSEPARATOR">Space</item> + <item id="1" translatable="yes" context="tp_DataLabel|liststoreSEPARATOR">Comma</item> + <item id="2" translatable="yes" context="tp_DataLabel|liststoreSEPARATOR">Semicolon</item> + <item id="3" translatable="yes" context="tp_DataLabel|liststoreSEPARATOR">New line</item> + </items> </object> <packing> <property name="expand">False</property> @@ -292,7 +192,6 @@ <property name="left_attach">0</property> <property name="top_attach">5</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -304,10 +203,10 @@ <object class="GtkLabel" id="FT_LABEL_PLACEMENT"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="tp_DataLabel|FT_LABEL_PLACEMENT">Place_ment</property> <property name="use_underline">True</property> <property name="mnemonic_widget">LB_LABEL_PLACEMENT</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -316,11 +215,25 @@ </packing> </child> <child> - <object class="GtkComboBox" id="LB_LABEL_PLACEMENT"> + <object class="GtkComboBoxText" id="LB_LABEL_PLACEMENT"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">center</property> - <property name="model">liststorePLACEMENT</property> + <items> + <item id="0" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Best fit</item> + <item id="1" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Center</item> + <item id="2" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Above</item> + <item id="3" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Top left</item> + <item id="4" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Left</item> + <item id="5" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Bottom left</item> + <item id="6" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Below</item> + <item id="7" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Bottom right</item> + <item id="8" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Right</item> + <item id="9" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Top right</item> + <item id="10" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Inside</item> + <item id="11" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Outside</item> + <item id="12" translatable="yes" context="tp_DataLabel|liststorePLACEMENT">Near origin</item> + </items> </object> <packing> <property name="expand">False</property> @@ -333,7 +246,6 @@ <property name="left_attach">0</property> <property name="top_attach">6</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -344,10 +256,11 @@ <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> + <placeholder/> + </child> </object> </child> </object> @@ -356,8 +269,8 @@ <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="tp_DataLabel|label1">Text Attributes</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -394,9 +307,25 @@ <property name="can_focus">False</property> <property name="spacing">12</property> <child> - <object class="svxlo-DialControl" id="CT_DIAL"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="CT_DIAL"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property> + </object> + </child> + </object> + </child> </object> <packing> <property name="expand">False</property> @@ -407,8 +336,9 @@ <child> <object class="GtkSpinButton" id="NF_LABEL_DEGREES"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="valign">center</property> + <property name="activates_default">True</property> <property name="adjustment">adjustmentDEGREE</property> <property name="wrap">True</property> </object> @@ -458,9 +388,10 @@ </packing> </child> <child> - <object class="chartcontrollerlo-TextDirectionListBox" id="LB_LABEL_TEXTDIR"> + <object class="GtkComboBoxText" id="LB_LABEL_TEXTDIR"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="no_show_all">True</property> </object> <packing> <property name="expand">False</property> @@ -483,8 +414,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_DataLabel|label2">Rotate Text</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> |