diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-15 11:14:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-15 21:02:23 +0200 |
commit | ec548bce309d965a25e807ae79432114926e06f3 (patch) | |
tree | 525284db036785ff1e606e65edcc75a66ede4d3d | |
parent | ff643eb3c5b1a50aab5e544ea689e227eecc751d (diff) |
weld ChartTypeDialog and SchLayoutTabPage
Change-Id: I101c56b855d0bdc43559ca4561d298fa4ad92572
Reviewed-on: https://gerrit.libreoffice.org/61797
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
21 files changed, 544 insertions, 474 deletions
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index 6e330aa3d45b..db42744007aa 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -117,10 +117,7 @@ ChartTypeDialogController::ChartTypeDialogController() ChartTypeDialogController::~ChartTypeDialogController() { } -Image ChartTypeDialogController::getImage() -{ - return Image(); -} + bool ChartTypeDialogController::isSubType( const OUString& rServiceName ) { const tTemplateServiceChartTypeParameterMap& rTemplateMap = getTemplateMap(); @@ -337,7 +334,7 @@ void ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParame } } } -void ChartTypeDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) +void ChartTypeDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) { rSubTypeList.Clear(); } @@ -366,7 +363,7 @@ bool ChartTypeDialogController::shouldShow_SortByXValuesResourceGroup() const return false; } -void ChartTypeDialogController::showExtraControls( VclBuilderContainer* /*pParent*/ ) +void ChartTypeDialogController::showExtraControls(weld::Builder* /*pBuilder*/) { } void ChartTypeDialogController::hideExtraControls() const @@ -411,12 +408,12 @@ ColumnChartDialogController::~ColumnChartDialogController() } OUString ColumnChartDialogController::getName() { - return SchResId( STR_TYPE_COLUMN ); + return SchResId(STR_TYPE_COLUMN); } -Image ColumnChartDialogController::getImage() +OUString ColumnChartDialogController::getImage() { - return Image(BitmapEx(BMP_TYPE_COLUMN)); + return OUStringLiteral(BMP_TYPE_COLUMN); } const tTemplateServiceChartTypeParameterMap& ColumnChartDialogController::getTemplateMap() const @@ -431,7 +428,7 @@ const tTemplateServiceChartTypeParameterMap& ColumnChartDialogController::getTem {"com.sun.star.chart2.template.ThreeDColumnDeep" , ChartTypeParameter(4,false,true,GlobalStackMode_STACK_Z)}}; return s_aTemplateMap; } -void ColumnChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) +void ColumnChartDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) { rSubTypeList.Clear(); @@ -488,12 +485,12 @@ BarChartDialogController::~BarChartDialogController() OUString BarChartDialogController::getName() { - return SchResId( STR_TYPE_BAR ); + return SchResId(STR_TYPE_BAR); } -Image BarChartDialogController::getImage() +OUString BarChartDialogController::getImage() { - return Image(BitmapEx(BMP_TYPE_BAR)); + return OUStringLiteral(BMP_TYPE_BAR); } const tTemplateServiceChartTypeParameterMap& BarChartDialogController::getTemplateMap() const @@ -508,7 +505,7 @@ const tTemplateServiceChartTypeParameterMap& BarChartDialogController::getTempla {"com.sun.star.chart2.template.ThreeDBarDeep" , ChartTypeParameter(4,false,true,GlobalStackMode_STACK_Z)}}; return s_aTemplateMap; } -void BarChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) +void BarChartDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) { rSubTypeList.Clear(); @@ -557,17 +554,21 @@ void BarChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const Ch PieChartDialogController::PieChartDialogController() { } + PieChartDialogController::~PieChartDialogController() { } + OUString PieChartDialogController::getName() { - return SchResId( STR_TYPE_PIE ); + return SchResId(STR_TYPE_PIE); } -Image PieChartDialogController::getImage() + +OUString PieChartDialogController::getImage() { - return Image(BitmapEx(BMP_TYPE_PIE)); + return OUStringLiteral(BMP_TYPE_PIE); } + const tTemplateServiceChartTypeParameterMap& PieChartDialogController::getTemplateMap() const { static tTemplateServiceChartTypeParameterMap s_aTemplateMap{ @@ -581,7 +582,7 @@ const tTemplateServiceChartTypeParameterMap& PieChartDialogController::getTempla {"com.sun.star.chart2.template.ThreeDDonutAllExploded" , ChartTypeParameter(4,false,true)}}; return s_aTemplateMap; } -void PieChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) +void PieChartDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) { rSubTypeList.Clear(); @@ -609,25 +610,29 @@ bool PieChartDialogController::shouldShow_3DLookControl() const { return true; } + void PieChartDialogController::adjustParameterToSubType( ChartTypeParameter& rParameter ) { if(rParameter.eStackMode==GlobalStackMode_STACK_Z) rParameter.eStackMode = GlobalStackMode_NONE; } + LineChartDialogController::LineChartDialogController() { } + LineChartDialogController::~LineChartDialogController() { } + OUString LineChartDialogController::getName() { - return SchResId( STR_TYPE_LINE ); + return SchResId(STR_TYPE_LINE); } -Image LineChartDialogController::getImage() +OUString LineChartDialogController::getImage() { - return Image(BitmapEx(BMP_TYPE_LINE)); + return OUStringLiteral(BMP_TYPE_LINE); } const tTemplateServiceChartTypeParameterMap& LineChartDialogController::getTemplateMap() const @@ -647,7 +652,7 @@ const tTemplateServiceChartTypeParameterMap& LineChartDialogController::getTempl {"com.sun.star.chart2.template.ThreeDLineDeep" , ChartTypeParameter(4,false,true,GlobalStackMode_STACK_Z,false,true)}}; return s_aTemplateMap; } -void LineChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) +void LineChartDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) { rSubTypeList.Clear(); @@ -773,12 +778,12 @@ XYChartDialogController::~XYChartDialogController() OUString XYChartDialogController::getName() { - return SchResId( STR_TYPE_XY ); + return SchResId(STR_TYPE_XY); } -Image XYChartDialogController::getImage() +OUString XYChartDialogController::getImage() { - return Image(BitmapEx(BMP_TYPE_XY)); + return OUStringLiteral(BMP_TYPE_XY); } const tTemplateServiceChartTypeParameterMap& XYChartDialogController::getTemplateMap() const @@ -791,7 +796,7 @@ const tTemplateServiceChartTypeParameterMap& XYChartDialogController::getTemplat return s_aTemplateMap; } -void XYChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) +void XYChartDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) { rSubTypeList.Clear(); @@ -879,9 +884,9 @@ OUString AreaChartDialogController::getName() return SchResId(STR_TYPE_AREA); } -Image AreaChartDialogController::getImage() +OUString AreaChartDialogController::getImage() { - return Image(BitmapEx(BMP_TYPE_AREA)); + return OUStringLiteral(BMP_TYPE_AREA); } bool AreaChartDialogController::shouldShow_3DLookControl() const @@ -901,7 +906,7 @@ const tTemplateServiceChartTypeParameterMap& AreaChartDialogController::getTempl return s_aTemplateMap; } -void AreaChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) +void AreaChartDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) { rSubTypeList.Clear(); @@ -966,9 +971,9 @@ OUString NetChartDialogController::getName() return SchResId(STR_TYPE_NET); } -Image NetChartDialogController::getImage() +OUString NetChartDialogController::getImage() { - return Image(BitmapEx(BMP_TYPE_NET)); + return OUStringLiteral(BMP_TYPE_NET); } bool NetChartDialogController::shouldShow_StackingControl() const @@ -997,7 +1002,7 @@ const tTemplateServiceChartTypeParameterMap& NetChartDialogController::getTempla {"com.sun.star.chart2.template.PercentStackedFilledNet" ,ChartTypeParameter(4,false,false,GlobalStackMode_STACK_Y_PERCENT,false,false)}}; return s_aTemplateMap; } -void NetChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) +void NetChartDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) { rSubTypeList.Clear(); @@ -1061,9 +1066,9 @@ OUString StockChartDialogController::getName() return SchResId(STR_TYPE_STOCK); } -Image StockChartDialogController::getImage() +OUString StockChartDialogController::getImage() { - return Image(BitmapEx(BMP_TYPE_STOCK)); + return OUStringLiteral(BMP_TYPE_STOCK); } const tTemplateServiceChartTypeParameterMap& StockChartDialogController::getTemplateMap() const @@ -1076,7 +1081,7 @@ const tTemplateServiceChartTypeParameterMap& StockChartDialogController::getTemp return s_aTemplateMap; } -void StockChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) +void StockChartDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) { rSubTypeList.Clear(); rSubTypeList.InsertItem(1, Image(BitmapEx(BMP_STOCK_1))); @@ -1097,8 +1102,6 @@ void StockChartDialogController::adjustParameterToSubType( ChartTypeParameter& r } CombiColumnLineChartDialogController::CombiColumnLineChartDialogController() - : m_pFT_NumberOfLines(nullptr) - , m_pMF_NumberOfLines(nullptr) { bSupports3D = false; } @@ -1108,9 +1111,9 @@ OUString CombiColumnLineChartDialogController::getName() return SchResId(STR_TYPE_COMBI_COLUMN_LINE); } -Image CombiColumnLineChartDialogController::getImage( ) +OUString CombiColumnLineChartDialogController::getImage() { - return Image(BitmapEx(BMP_TYPE_COLUMN_LINE)); + return OUStringLiteral(BMP_TYPE_COLUMN_LINE); } const tTemplateServiceChartTypeParameterMap& CombiColumnLineChartDialogController::getTemplateMap() const @@ -1121,7 +1124,7 @@ const tTemplateServiceChartTypeParameterMap& CombiColumnLineChartDialogControlle return s_aTemplateMap; } -void CombiColumnLineChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) +void CombiColumnLineChartDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) { rSubTypeList.Clear(); rSubTypeList.InsertItem(1, Image(BitmapEx(BMP_COLUMN_LINE))); @@ -1131,42 +1134,39 @@ void CombiColumnLineChartDialogController::fillSubTypeList( ValueSet& rSubTypeLi rSubTypeList.SetItemText(2, SchResId(STR_LINE_STACKEDCOLUMN)); } -void CombiColumnLineChartDialogController::showExtraControls( VclBuilderContainer* pParent ) +void CombiColumnLineChartDialogController::showExtraControls(weld::Builder* pBuilder) { - if (!m_pFT_NumberOfLines) + if (!m_xFT_NumberOfLines) { - pParent->get(m_pFT_NumberOfLines, "nolinesft"); + m_xFT_NumberOfLines = pBuilder->weld_label("nolinesft"); } - if (!m_pMF_NumberOfLines) + if (!m_xMF_NumberOfLines) { - pParent->get(m_pMF_NumberOfLines, "nolines"); + m_xMF_NumberOfLines = pBuilder->weld_spin_button("nolines"); - m_pMF_NumberOfLines->SetSpinSize(1); - m_pMF_NumberOfLines->SetFirst( 1 ); - m_pMF_NumberOfLines->SetLast( 100 ); - m_pMF_NumberOfLines->SetMin( 1 ); - m_pMF_NumberOfLines->SetMax( 100 ); + m_xMF_NumberOfLines->set_increments(1, 10); + m_xMF_NumberOfLines->set_range(1, 100); - m_pMF_NumberOfLines->SetModifyHdl( LINK( this, CombiColumnLineChartDialogController, ChangeLineCountHdl ) ); + m_xMF_NumberOfLines->connect_value_changed( LINK( this, CombiColumnLineChartDialogController, ChangeLineCountHdl ) ); } - m_pFT_NumberOfLines->Show(); - m_pMF_NumberOfLines->Show(); + m_xFT_NumberOfLines->show(); + m_xMF_NumberOfLines->show(); } void CombiColumnLineChartDialogController::hideExtraControls() const { - if(m_pFT_NumberOfLines) - m_pFT_NumberOfLines->Hide(); - if(m_pMF_NumberOfLines) - m_pMF_NumberOfLines->Hide(); + if (m_xFT_NumberOfLines) + m_xFT_NumberOfLines->hide(); + if (m_xMF_NumberOfLines) + m_xMF_NumberOfLines->hide(); } void CombiColumnLineChartDialogController::fillExtraControls( const ChartTypeParameter& /*rParameter*/ , const uno::Reference< XChartDocument >& xChartModel , const uno::Reference< beans::XPropertySet >& xTemplateProps ) const { - if(!m_pMF_NumberOfLines) + if (!m_xMF_NumberOfLines) return; uno::Reference< frame::XModel > xModel( xChartModel, uno::UNO_QUERY ); @@ -1190,24 +1190,23 @@ void CombiColumnLineChartDialogController::fillExtraControls( const ChartTypePar } if( nNumLines < 0 ) nNumLines = 0; - m_pMF_NumberOfLines->SetValue( nNumLines ); + m_xMF_NumberOfLines->set_value(nNumLines); sal_Int32 nMaxLines = ChartModelHelper::getDataSeries( xModel ).size() - 1; if( nMaxLines < 0 ) nMaxLines = 0; - m_pMF_NumberOfLines->SetLast( nMaxLines ); - m_pMF_NumberOfLines->SetMax( nMaxLines ); + m_xMF_NumberOfLines->set_max(nMaxLines); } void CombiColumnLineChartDialogController::setTemplateProperties( const uno::Reference< beans::XPropertySet >& xTemplateProps ) const { if( xTemplateProps.is() ) { - sal_Int32 nNumLines = static_cast< sal_Int32 >( m_pMF_NumberOfLines->GetValue()); + sal_Int32 nNumLines = m_xMF_NumberOfLines->get_value(); xTemplateProps->setPropertyValue( "NumberOfLines" , uno::Any(nNumLines) ); } } -IMPL_LINK_NOARG(CombiColumnLineChartDialogController, ChangeLineCountHdl, Edit&, void) +IMPL_LINK_NOARG(CombiColumnLineChartDialogController, ChangeLineCountHdl, weld::SpinButton&, void) { if( m_pChangeListener ) m_pChangeListener->stateChanged(this); @@ -1242,9 +1241,9 @@ OUString BubbleChartDialogController::getName() return SchResId(STR_TYPE_BUBBLE); } -Image BubbleChartDialogController::getImage() +OUString BubbleChartDialogController::getImage() { - return Image(BitmapEx(BMP_TYPE_BUBBLE)); + return OUStringLiteral(BMP_TYPE_BUBBLE); } const tTemplateServiceChartTypeParameterMap& BubbleChartDialogController::getTemplateMap() const @@ -1253,7 +1252,7 @@ const tTemplateServiceChartTypeParameterMap& BubbleChartDialogController::getTem {"com.sun.star.chart2.template.Bubble" , ChartTypeParameter(1,true)}}; return s_aTemplateMap; } -void BubbleChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) +void BubbleChartDialogController::fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) { rSubTypeList.Clear(); rSubTypeList.InsertItem(1, Image(BitmapEx(BMP_BUBBLE_1))); diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx index af880d115a53..9946845e16ee 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx @@ -30,13 +30,10 @@ #include <com/sun/star/chart2/CurveStyle.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/XChartTypeTemplate.hpp> -#include <vcl/builder.hxx> -#include <vcl/button.hxx> -#include <vcl/field.hxx> -#include <vcl/fixed.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <vcl/weld.hxx> -class ValueSet; +class SvtValueSet; namespace chart { @@ -90,10 +87,10 @@ public: ChartTypeDialogController(); virtual ~ChartTypeDialogController() override; - virtual OUString getName()=0; - virtual Image getImage(); + virtual OUString getName()=0; + virtual OUString getImage()=0; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const = 0; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ); + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ); virtual bool shouldShow_3DLookControl() const; virtual bool shouldShow_StackingControl() const; @@ -102,7 +99,7 @@ public: virtual bool shouldShow_GeometryControl() const; virtual bool shouldShow_SortByXValuesResourceGroup() const; - virtual void showExtraControls(VclBuilderContainer* pParent); + virtual void showExtraControls(weld::Builder* pBuilder); virtual void hideExtraControls() const; virtual void fillExtraControls( const ChartTypeParameter& rParameter , const css::uno::Reference< css::chart2::XChartDocument >& xChartModel @@ -146,10 +143,10 @@ public: ColumnChartDialogController(); virtual ~ColumnChartDialogController() override; - virtual OUString getName() override; - virtual Image getImage() override; + virtual OUString getName() override; + virtual OUString getImage() override; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; }; class BarChartDialogController : public ColumnOrBarChartDialogController_Base @@ -158,10 +155,10 @@ public: BarChartDialogController(); virtual ~BarChartDialogController() override; - virtual OUString getName() override; - virtual Image getImage() override; + virtual OUString getName() override; + virtual OUString getImage() override; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; }; class PieChartDialogController : public ChartTypeDialogController @@ -170,10 +167,10 @@ public: PieChartDialogController(); virtual ~PieChartDialogController() override; - virtual OUString getName() override; - virtual Image getImage() override; + virtual OUString getName() override; + virtual OUString getImage() override; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; virtual void adjustParameterToSubType( ChartTypeParameter& rParameter ) override; virtual bool shouldShow_3DLookControl() const override; @@ -185,10 +182,10 @@ public: LineChartDialogController(); virtual ~LineChartDialogController() override; - virtual OUString getName() override; - virtual Image getImage() override; + virtual OUString getName() override; + virtual OUString getImage() override; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; virtual void adjustParameterToSubType( ChartTypeParameter& rParameter ) override; virtual void adjustParameterToMainType( ChartTypeParameter& rParameter ) override; @@ -203,10 +200,10 @@ public: XYChartDialogController(); virtual ~XYChartDialogController() override; - virtual OUString getName() override; - virtual Image getImage() override; + virtual OUString getName() override; + virtual OUString getImage() override; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; virtual void adjustParameterToSubType( ChartTypeParameter& rParameter ) override; virtual bool shouldShow_SplineControl() const override; @@ -219,10 +216,10 @@ public: AreaChartDialogController(); virtual ~AreaChartDialogController() override; - virtual OUString getName() override; - virtual Image getImage() override; + virtual OUString getName() override; + virtual OUString getImage() override; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; virtual void adjustParameterToSubType( ChartTypeParameter& rParameter ) override; virtual void adjustParameterToMainType( ChartTypeParameter& rParameter ) override; @@ -235,10 +232,10 @@ public: NetChartDialogController(); virtual ~NetChartDialogController() override; - virtual OUString getName() override; - virtual Image getImage() override; + virtual OUString getName() override; + virtual OUString getImage() override; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; virtual void adjustParameterToSubType( ChartTypeParameter& rParameter ) override; virtual bool shouldShow_StackingControl() const override; @@ -250,10 +247,10 @@ public: StockChartDialogController(); virtual ~StockChartDialogController() override; - virtual OUString getName() override; - virtual Image getImage() override; + virtual OUString getName() override; + virtual OUString getImage() override; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; virtual void adjustParameterToSubType( ChartTypeParameter& rParameter ) override; }; @@ -262,13 +259,13 @@ class CombiColumnLineChartDialogController : public ChartTypeDialogController public: CombiColumnLineChartDialogController(); - virtual OUString getName() override; - virtual Image getImage() override; + virtual OUString getName() override; + virtual OUString getImage() override; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; virtual void adjustParameterToSubType( ChartTypeParameter& rParameter ) override; - virtual void showExtraControls(VclBuilderContainer* pParent) override; + virtual void showExtraControls(weld::Builder* pBuilder) override; virtual void hideExtraControls() const override; virtual void fillExtraControls( const ChartTypeParameter& rParameter , const css::uno::Reference< css::chart2::XChartDocument >& xChartModel @@ -277,11 +274,11 @@ public: virtual void setTemplateProperties( const css::uno::Reference< css::beans::XPropertySet >& xTemplateProps ) const override; private: - DECL_LINK( ChangeLineCountHdl, Edit&, void ); + DECL_LINK(ChangeLineCountHdl, weld::SpinButton&, void); private: - VclPtr<FixedText> m_pFT_NumberOfLines; - VclPtr<NumericField> m_pMF_NumberOfLines; + std::unique_ptr<weld::Label> m_xFT_NumberOfLines; + std::unique_ptr<weld::SpinButton> m_xMF_NumberOfLines; }; class BubbleChartDialogController : public ChartTypeDialogController @@ -290,10 +287,10 @@ public: BubbleChartDialogController(); virtual ~BubbleChartDialogController() override; - virtual OUString getName() override; - virtual Image getImage() override; + virtual OUString getName() override; + virtual OUString getImage() override; virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override; - virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; + virtual void fillSubTypeList( SvtValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override; virtual void adjustParameterToSubType( ChartTypeParameter& rParameter ) override; }; diff --git a/chart2/source/controller/dialogs/dlg_ChartType.cxx b/chart2/source/controller/dialogs/dlg_ChartType.cxx index 55dfe5b482f1..44c6b06bf098 100644 --- a/chart2/source/controller/dialogs/dlg_ChartType.cxx +++ b/chart2/source/controller/dialogs/dlg_ChartType.cxx @@ -29,31 +29,25 @@ namespace chart using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; -ChartTypeDialog::ChartTypeDialog( vcl::Window* pParent - , const uno::Reference< frame::XModel >& xChartModel ) - : ModalDialog( pParent, "ChartTypeDialog", - "modules/schart/ui/charttypedialog.ui") - , m_pChartTypeTabPage(nullptr) +ChartTypeDialog::ChartTypeDialog(weld::Window* pParent, + const uno::Reference< frame::XModel >& xChartModel) + : GenericDialogController(pParent, "modules/schart/ui/charttypedialog.ui", "ChartTypeDialog") , m_xChartModel(xChartModel) + , m_xContentArea(m_xDialog->weld_content_area()) { - m_pChartTypeTabPage = VclPtr<ChartTypeTabPage>::Create( - get_content_area(), + TabPageParent aParent(m_xContentArea.get(), this); + m_xChartTypeTabPage = VclPtr<ChartTypeTabPage>::Create( + aParent, uno::Reference<XChartDocument>::query(m_xChartModel), false/*don't show title description*/); - m_pChartTypeTabPage->initializePage(); - m_pChartTypeTabPage->Show(); + m_xChartTypeTabPage->initializePage(); + m_xChartTypeTabPage->Show(); } ChartTypeDialog::~ChartTypeDialog() { - disposeOnce(); -} - -void ChartTypeDialog::dispose() -{ - m_pChartTypeTabPage.disposeAndClear(); - ModalDialog::dispose(); + m_xChartTypeTabPage.disposeAndClear(); } } //namespace chart diff --git a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx index c9f3c57565e7..39c4e8f75be9 100644 --- a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx +++ b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx @@ -22,6 +22,7 @@ #include <servicenames.hxx> #include <osl/mutex.hxx> #include <toolkit/helper/vclunohelper.hxx> +#include <vcl/svapp.hxx> namespace chart { @@ -70,7 +71,7 @@ void ChartTypeUnoDlg::implInitialize(const uno::Any& _rValue) } svt::OGenericUnoDialog::Dialog ChartTypeUnoDlg::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) { - return svt::OGenericUnoDialog::Dialog(VclPtr<ChartTypeDialog>::Create(VCLUnoHelper::GetWindow(rParent), m_xChartModel)); + return svt::OGenericUnoDialog::Dialog(o3tl::make_unique<ChartTypeDialog>(Application::GetFrameWeld(rParent), m_xChartModel)); } uno::Reference<beans::XPropertySetInfo> SAL_CALL ChartTypeUnoDlg::getPropertySetInfo() { diff --git a/chart2/source/controller/dialogs/res_BarGeometry.cxx b/chart2/source/controller/dialogs/res_BarGeometry.cxx index 3e3fd52be485..25ab3ac063c5 100644 --- a/chart2/source/controller/dialogs/res_BarGeometry.cxx +++ b/chart2/source/controller/dialogs/res_BarGeometry.cxx @@ -22,42 +22,39 @@ namespace chart { -BarGeometryResources::BarGeometryResources(VclBuilderContainer* pWindow) +BarGeometryResources::BarGeometryResources(weld::Builder* pBuilder) + : m_xFT_Geometry(pBuilder->weld_label("shapeft")) + , m_xLB_Geometry(pBuilder->weld_tree_view("shape")) { - pWindow->get(m_pFT_Geometry, "shapeft"); - pWindow->get(m_pLB_Geometry, "shape"); + m_xLB_Geometry->set_size_request(-1, m_xLB_Geometry->get_height_rows(4)); } -void BarGeometryResources::SetSelectHdl( const Link<ListBox&,void>& rLink ) +void BarGeometryResources::connect_changed(const Link<weld::TreeView&,void>& rLink) { - m_pLB_Geometry->SetSelectHdl( rLink ); + m_xLB_Geometry->connect_changed(rLink); } -void BarGeometryResources::Show( bool bShow ) +void BarGeometryResources::show( bool bShow ) { - m_pFT_Geometry->Show( bShow ); - m_pLB_Geometry->Show( bShow ); -} -void BarGeometryResources::Enable( bool bEnable ) -{ - m_pFT_Geometry->Enable( bEnable ); - m_pLB_Geometry->Enable( bEnable ); + m_xFT_Geometry->show( bShow ); + m_xLB_Geometry->show( bShow ); } -sal_Int32 BarGeometryResources::GetSelectedEntryCount() const +void BarGeometryResources::set_sensitive( bool bEnable ) { - return m_pLB_Geometry->GetSelectedEntryCount(); + m_xFT_Geometry->set_sensitive( bEnable ); + m_xLB_Geometry->set_sensitive( bEnable ); } -sal_Int32 BarGeometryResources::GetSelectedEntryPos() const +sal_Int32 BarGeometryResources::get_selected_index() const { - return m_pLB_Geometry->GetSelectedEntryPos(); + return m_xLB_Geometry->get_selected_index(); } -void BarGeometryResources::SelectEntryPos(sal_Int32 nPos) +void BarGeometryResources::select(sal_Int32 nPos) { - if( nPos < m_pLB_Geometry->GetEntryCount() ) - m_pLB_Geometry->SelectEntryPos( nPos ); + if (nPos < m_xLB_Geometry->n_children()) + m_xLB_Geometry->select(nPos); } } //namespace chart diff --git a/chart2/source/controller/dialogs/res_BarGeometry.hxx b/chart2/source/controller/dialogs/res_BarGeometry.hxx index 1edf1a5d1472..e63bf9160ee2 100644 --- a/chart2/source/controller/dialogs/res_BarGeometry.hxx +++ b/chart2/source/controller/dialogs/res_BarGeometry.hxx @@ -19,9 +19,7 @@ #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_BARGEOMETRY_HXX #define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_BARGEOMETRY_HXX -#include <vcl/builder.hxx> -#include <vcl/fixed.hxx> -#include <vcl/lstbox.hxx> +#include <vcl/weld.hxx> namespace chart { @@ -29,20 +27,19 @@ namespace chart class BarGeometryResources { public: - explicit BarGeometryResources(VclBuilderContainer* pParent); + explicit BarGeometryResources(weld::Builder* pParent); - void Show( bool bShow ); - void Enable( bool bEnable ); + void show( bool bShow ); + void set_sensitive( bool bEnable ); - sal_Int32 GetSelectedEntryCount() const; - sal_Int32 GetSelectedEntryPos() const; - void SelectEntryPos(sal_Int32 nPos); + sal_Int32 get_selected_index() const; + void select(sal_Int32 nPos); - void SetSelectHdl( const Link<ListBox&,void>& rLink ); + void connect_changed(const Link<weld::TreeView&,void>& rLink); private: - VclPtr<FixedText> m_pFT_Geometry; - VclPtr<ListBox> m_pLB_Geometry; + std::unique_ptr<weld::Label> m_xFT_Geometry; + std::unique_ptr<weld::TreeView> m_xLB_Geometry; }; } //namespace chart diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index e58052600b0d..268c46dd5cf8 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -45,7 +45,7 @@ enum { class Dim3DLookResourceGroup : public ChangingResource { public: - explicit Dim3DLookResourceGroup(VclBuilderContainer* pWindow); + explicit Dim3DLookResourceGroup(weld::Builder* pBuilder); void showControls( bool bShow ); @@ -53,47 +53,46 @@ public: void fillParameter( ChartTypeParameter& rParameter ); private: - DECL_LINK( Dim3DLookCheckHdl, CheckBox&, void ); - DECL_LINK( SelectSchemeHdl, ListBox&, void ); + DECL_LINK( Dim3DLookCheckHdl, weld::ToggleButton&, void ); + DECL_LINK( SelectSchemeHdl, weld::ComboBox&, void ); private: - VclPtr<CheckBox> m_pCB_3DLook; - VclPtr<ListBox> m_pLB_Scheme; + std::unique_ptr<weld::CheckButton> m_xCB_3DLook; + std::unique_ptr<weld::ComboBox> m_xLB_Scheme; }; -Dim3DLookResourceGroup::Dim3DLookResourceGroup(VclBuilderContainer* pWindow) +Dim3DLookResourceGroup::Dim3DLookResourceGroup(weld::Builder* pBuilder) : ChangingResource() + , m_xCB_3DLook(pBuilder->weld_check_button("3dlook")) + , m_xLB_Scheme(pBuilder->weld_combo_box("3dscheme")) { - pWindow->get(m_pCB_3DLook, "3dlook"); - pWindow->get(m_pLB_Scheme, "3dscheme"); - - m_pCB_3DLook->SetToggleHdl( LINK( this, Dim3DLookResourceGroup, Dim3DLookCheckHdl ) ); - m_pLB_Scheme->SetSelectHdl( LINK( this, Dim3DLookResourceGroup, SelectSchemeHdl ) ); + m_xCB_3DLook->connect_toggled( LINK( this, Dim3DLookResourceGroup, Dim3DLookCheckHdl ) ); + m_xLB_Scheme->connect_changed( LINK( this, Dim3DLookResourceGroup, SelectSchemeHdl ) ); } void Dim3DLookResourceGroup::showControls( bool bShow ) { - m_pCB_3DLook->Show(bShow); - m_pLB_Scheme->Show(bShow); + m_xCB_3DLook->show(bShow); + m_xLB_Scheme->show(bShow); } void Dim3DLookResourceGroup::fillControls( const ChartTypeParameter& rParameter ) { - m_pCB_3DLook->Check(rParameter.b3DLook); - m_pLB_Scheme->Enable(rParameter.b3DLook); + m_xCB_3DLook->set_active(rParameter.b3DLook); + m_xLB_Scheme->set_sensitive(rParameter.b3DLook); if( rParameter.eThreeDLookScheme == ThreeDLookScheme_Simple ) - m_pLB_Scheme->SelectEntryPos(POS_3DSCHEME_SIMPLE); + m_xLB_Scheme->set_active(POS_3DSCHEME_SIMPLE); else if( rParameter.eThreeDLookScheme == ThreeDLookScheme_Realistic ) - m_pLB_Scheme->SelectEntryPos(POS_3DSCHEME_REALISTIC); + m_xLB_Scheme->set_active(POS_3DSCHEME_REALISTIC); else - m_pLB_Scheme->SetNoSelection(); + m_xLB_Scheme->set_active(-1); } void Dim3DLookResourceGroup::fillParameter( ChartTypeParameter& rParameter ) { - rParameter.b3DLook = m_pCB_3DLook->IsChecked(); - const sal_Int32 nPos = m_pLB_Scheme->GetSelectedEntryPos(); + rParameter.b3DLook = m_xCB_3DLook->get_active(); + const int nPos = m_xLB_Scheme->get_active(); if( nPos == POS_3DSCHEME_SIMPLE ) rParameter.eThreeDLookScheme = ThreeDLookScheme_Simple; else if( nPos == POS_3DSCHEME_REALISTIC ) @@ -102,13 +101,13 @@ void Dim3DLookResourceGroup::fillParameter( ChartTypeParameter& rParameter ) rParameter.eThreeDLookScheme = ThreeDLookScheme_Unknown; } -IMPL_LINK_NOARG(Dim3DLookResourceGroup, Dim3DLookCheckHdl, CheckBox&, void) +IMPL_LINK_NOARG(Dim3DLookResourceGroup, Dim3DLookCheckHdl, weld::ToggleButton&, void) { if(m_pChangeListener) m_pChangeListener->stateChanged(this); } -IMPL_LINK_NOARG(Dim3DLookResourceGroup, SelectSchemeHdl, ListBox&, void) +IMPL_LINK_NOARG(Dim3DLookResourceGroup, SelectSchemeHdl, weld::ComboBox&, void) { if(m_pChangeListener) m_pChangeListener->stateChanged(this); @@ -117,7 +116,7 @@ IMPL_LINK_NOARG(Dim3DLookResourceGroup, SelectSchemeHdl, ListBox&, void) class SortByXValuesResourceGroup : public ChangingResource { public: - explicit SortByXValuesResourceGroup(VclBuilderContainer* pWindow); + explicit SortByXValuesResourceGroup(weld::Builder* pBuilder); void showControls( bool bShow ); @@ -125,35 +124,35 @@ public: void fillParameter( ChartTypeParameter& rParameter ); private: - DECL_LINK( SortByXValuesCheckHdl, CheckBox&, void ); + DECL_LINK(SortByXValuesCheckHdl, weld::ToggleButton&, void); private: - VclPtr<CheckBox> m_pCB_XValueSorting; + std::unique_ptr<weld::CheckButton> m_xCB_XValueSorting; }; -SortByXValuesResourceGroup::SortByXValuesResourceGroup(VclBuilderContainer* pWindow ) +SortByXValuesResourceGroup::SortByXValuesResourceGroup(weld::Builder* pBuilder) : ChangingResource() + , m_xCB_XValueSorting(pBuilder->weld_check_button("sort")) { - pWindow->get(m_pCB_XValueSorting, "sort"); - m_pCB_XValueSorting->SetToggleHdl( LINK( this, SortByXValuesResourceGroup, SortByXValuesCheckHdl ) ); + m_xCB_XValueSorting->connect_toggled(LINK(this, SortByXValuesResourceGroup, SortByXValuesCheckHdl)); } void SortByXValuesResourceGroup::showControls( bool bShow ) { - m_pCB_XValueSorting->Show(bShow); + m_xCB_XValueSorting->show(bShow); } void SortByXValuesResourceGroup::fillControls( const ChartTypeParameter& rParameter ) { - m_pCB_XValueSorting->Check( rParameter.bSortByXValues ); + m_xCB_XValueSorting->set_active(rParameter.bSortByXValues); } void SortByXValuesResourceGroup::fillParameter( ChartTypeParameter& rParameter ) { - rParameter.bSortByXValues = m_pCB_XValueSorting->IsChecked(); + rParameter.bSortByXValues = m_xCB_XValueSorting->get_active(); } -IMPL_LINK_NOARG(SortByXValuesResourceGroup, SortByXValuesCheckHdl, CheckBox&, void) +IMPL_LINK_NOARG(SortByXValuesResourceGroup, SortByXValuesCheckHdl, weld::ToggleButton&, void) { if(m_pChangeListener) m_pChangeListener->stateChanged(this); @@ -162,7 +161,7 @@ IMPL_LINK_NOARG(SortByXValuesResourceGroup, SortByXValuesCheckHdl, CheckBox&, vo class StackingResourceGroup : public ChangingResource { public: - explicit StackingResourceGroup(VclBuilderContainer* pWindow); + explicit StackingResourceGroup(weld::Builder* pBuilder); void showControls( bool bShow, bool bShowDeepStacking ); @@ -170,89 +169,91 @@ public: void fillParameter( ChartTypeParameter& rParameter ); private: - DECL_LINK( StackingChangeHdl, RadioButton&, void ); - DECL_LINK( StackingEnableHdl, CheckBox&, void ); + DECL_LINK( StackingChangeHdl, weld::ToggleButton&, void ); + DECL_LINK( StackingEnableHdl, weld::ToggleButton&, void ); private: - VclPtr<CheckBox> m_pCB_Stacked; - VclPtr<RadioButton> m_pRB_Stack_Y; - VclPtr<RadioButton> m_pRB_Stack_Y_Percent; - VclPtr<RadioButton> m_pRB_Stack_Z; + std::unique_ptr<weld::CheckButton> m_xCB_Stacked; + std::unique_ptr<weld::RadioButton> m_xRB_Stack_Y; + std::unique_ptr<weld::RadioButton> m_xRB_Stack_Y_Percent; + std::unique_ptr<weld::RadioButton> m_xRB_Stack_Z; }; -StackingResourceGroup::StackingResourceGroup(VclBuilderContainer* pWindow) - : ChangingResource() +StackingResourceGroup::StackingResourceGroup(weld::Builder* pBuilder) + : ChangingResource() + , m_xCB_Stacked(pBuilder->weld_check_button("stack")) + , m_xRB_Stack_Y(pBuilder->weld_radio_button("ontop")) + , m_xRB_Stack_Y_Percent(pBuilder->weld_radio_button("percent")) + , m_xRB_Stack_Z(pBuilder->weld_radio_button("deep")) { - pWindow->get(m_pCB_Stacked, "stack"); - pWindow->get(m_pRB_Stack_Y, "ontop"); - pWindow->get(m_pRB_Stack_Y_Percent, "percent"); - pWindow->get(m_pRB_Stack_Z, "deep"); - - m_pCB_Stacked->SetToggleHdl( LINK( this, StackingResourceGroup, StackingEnableHdl ) ); - m_pRB_Stack_Y->SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) ); - m_pRB_Stack_Y_Percent->SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) ); - m_pRB_Stack_Z->SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) ); + m_xCB_Stacked->connect_toggled( LINK( this, StackingResourceGroup, StackingEnableHdl ) ); + m_xRB_Stack_Y->connect_toggled( LINK( this, StackingResourceGroup, StackingChangeHdl ) ); + m_xRB_Stack_Y_Percent->connect_toggled( LINK( this, StackingResourceGroup, StackingChangeHdl ) ); + m_xRB_Stack_Z->connect_toggled( LINK( this, StackingResourceGroup, StackingChangeHdl ) ); } void StackingResourceGroup::showControls( bool bShow, bool bShowDeepStacking ) { - m_pCB_Stacked->Show(bShow); - m_pRB_Stack_Y->Show(bShow); - m_pRB_Stack_Y_Percent->Show(bShow); - m_pRB_Stack_Z->Show(bShow&&bShowDeepStacking); + m_xCB_Stacked->show(bShow); + m_xRB_Stack_Y->show(bShow); + m_xRB_Stack_Y_Percent->show(bShow); + m_xRB_Stack_Z->show(bShow&&bShowDeepStacking); } void StackingResourceGroup::fillControls( const ChartTypeParameter& rParameter ) { - m_pCB_Stacked->Check( rParameter.eStackMode!=GlobalStackMode_NONE + m_xCB_Stacked->set_active( rParameter.eStackMode!=GlobalStackMode_NONE && rParameter.eStackMode!=GlobalStackMode_STACK_Z ); //todo remove this condition if z stacking radio button is really used switch( rParameter.eStackMode ) { case GlobalStackMode_STACK_Y: - m_pRB_Stack_Y->Check(); + m_xRB_Stack_Y->set_active(true); break; case GlobalStackMode_STACK_Y_PERCENT: - m_pRB_Stack_Y_Percent->Check(); + m_xRB_Stack_Y_Percent->set_active(true); break; case GlobalStackMode_STACK_Z: //todo uncomment this condition if z stacking radio button is really used /* if( rParameter.b3DLook ) - m_pRB_Stack_Z->Check(); + m_xRB_Stack_Z->set_active(true); else */ - m_pRB_Stack_Y->Check(); + m_xRB_Stack_Y->set_active(true); break; default: - m_pRB_Stack_Y->Check(); + m_xRB_Stack_Y->set_active(true); break; } //dis/enabling - m_pCB_Stacked->Enable( !rParameter.bXAxisWithValues ); - m_pRB_Stack_Y->Enable( m_pCB_Stacked->IsChecked() && !rParameter.bXAxisWithValues ); - m_pRB_Stack_Y_Percent->Enable( m_pCB_Stacked->IsChecked() && !rParameter.bXAxisWithValues ); - m_pRB_Stack_Z->Enable( m_pCB_Stacked->IsChecked() && rParameter.b3DLook ); + m_xCB_Stacked->set_sensitive( !rParameter.bXAxisWithValues ); + m_xRB_Stack_Y->set_sensitive( m_xCB_Stacked->get_active() && !rParameter.bXAxisWithValues ); + m_xRB_Stack_Y_Percent->set_sensitive( m_xCB_Stacked->get_active() && !rParameter.bXAxisWithValues ); + m_xRB_Stack_Z->set_sensitive( m_xCB_Stacked->get_active() && rParameter.b3DLook ); } + void StackingResourceGroup::fillParameter( ChartTypeParameter& rParameter ) { - if(!m_pCB_Stacked->IsChecked()) + if(!m_xCB_Stacked->get_active()) rParameter.eStackMode = GlobalStackMode_NONE; - else if(m_pRB_Stack_Y->IsChecked()) + else if(m_xRB_Stack_Y->get_active()) rParameter.eStackMode = GlobalStackMode_STACK_Y; - else if(m_pRB_Stack_Y_Percent->IsChecked()) + else if(m_xRB_Stack_Y_Percent->get_active()) rParameter.eStackMode = GlobalStackMode_STACK_Y_PERCENT; - else if(m_pRB_Stack_Z->IsChecked()) + else if(m_xRB_Stack_Z->get_active()) rParameter.eStackMode = GlobalStackMode_STACK_Z; } -IMPL_LINK( StackingResourceGroup, StackingChangeHdl, RadioButton&, rRadio, void ) + +IMPL_LINK( StackingResourceGroup, StackingChangeHdl, weld::ToggleButton&, rRadio, void ) { //for each radio click there are coming two change events //first uncheck of previous button -> ignore that call //the second call gives the check of the new button - if( m_pChangeListener && rRadio.IsChecked() ) + if (m_pChangeListener && rRadio.get_active()) m_pChangeListener->stateChanged(this); } -IMPL_LINK_NOARG(StackingResourceGroup, StackingEnableHdl, CheckBox&, void) + +IMPL_LINK_NOARG(StackingResourceGroup, StackingEnableHdl, weld::ToggleButton&, void) { if( m_pChangeListener ) m_pChangeListener->stateChanged(this); @@ -396,7 +397,7 @@ void SteppedPropertiesDialog::fillParameter( ChartTypeParameter& rParameter, boo class SplineResourceGroup : public ChangingResource { public: - explicit SplineResourceGroup(VclBuilderContainer* pWindow); + explicit SplineResourceGroup(weld::Builder* pBuilder, TabPageParent pParent); void showControls( bool bShow ); @@ -404,36 +405,36 @@ public: void fillParameter( ChartTypeParameter& rParameter ); private: - DECL_LINK( LineTypeChangeHdl, ListBox&, void ); - DECL_LINK( SplineDetailsDialogHdl, Button*, void ); - DECL_LINK( SteppedDetailsDialogHdl, Button*, void ); + DECL_LINK( LineTypeChangeHdl, weld::ComboBox&, void ); + DECL_LINK( SplineDetailsDialogHdl, weld::Button&, void ); + DECL_LINK( SteppedDetailsDialogHdl, weld::Button&, void ); SplinePropertiesDialog& getSplinePropertiesDialog(); SteppedPropertiesDialog& getSteppedPropertiesDialog(); private: - VclPtr<FixedText> m_pFT_LineType; - VclPtr<ListBox> m_pLB_LineType; - VclPtr<PushButton> m_pPB_DetailsDialog; + TabPageParent m_pParent; + std::unique_ptr<weld::Label> m_xFT_LineType; + std::unique_ptr<weld::ComboBox> m_xLB_LineType; + std::unique_ptr<weld::Button> m_xPB_DetailsDialog; std::unique_ptr<SplinePropertiesDialog> m_xSplinePropertiesDialog; std::unique_ptr<SteppedPropertiesDialog> m_xSteppedPropertiesDialog; }; -SplineResourceGroup::SplineResourceGroup(VclBuilderContainer* pWindow) +SplineResourceGroup::SplineResourceGroup(weld::Builder* pBuilder, TabPageParent pParent) : ChangingResource() + , m_pParent(pParent) + , m_xFT_LineType(pBuilder->weld_label("linetypeft")) + , m_xLB_LineType(pBuilder->weld_combo_box("linetype")) + , m_xPB_DetailsDialog(pBuilder->weld_button("properties")) { - pWindow->get(m_pFT_LineType, "linetypeft"); - pWindow->get(m_pLB_LineType, "linetype"); - pWindow->get(m_pPB_DetailsDialog, "properties"); - - m_pLB_LineType->SetSelectHdl( LINK( this, SplineResourceGroup, LineTypeChangeHdl ) ); + m_xLB_LineType->connect_changed(LINK(this, SplineResourceGroup, LineTypeChangeHdl)); } SplinePropertiesDialog& SplineResourceGroup::getSplinePropertiesDialog() { if( !m_xSplinePropertiesDialog.get() ) { - Dialog* pDialog = m_pPB_DetailsDialog->GetParentDialog(); - m_xSplinePropertiesDialog.reset(new SplinePropertiesDialog(pDialog ? pDialog->GetFrameWeld() : nullptr)); + m_xSplinePropertiesDialog.reset(new SplinePropertiesDialog(m_pParent.GetFrameWeld())); } return *m_xSplinePropertiesDialog; } @@ -442,16 +443,16 @@ SteppedPropertiesDialog& SplineResourceGroup::getSteppedPropertiesDialog() { if (!m_xSteppedPropertiesDialog) { - m_xSteppedPropertiesDialog.reset(new SteppedPropertiesDialog(m_pPB_DetailsDialog->GetFrameWeld())); + m_xSteppedPropertiesDialog.reset(new SteppedPropertiesDialog(m_pParent.GetFrameWeld())); } return *m_xSteppedPropertiesDialog; } void SplineResourceGroup::showControls( bool bShow ) { - m_pFT_LineType->Show(bShow); - m_pLB_LineType->Show(bShow); - m_pPB_DetailsDialog->Show(bShow); + m_xFT_LineType->show(bShow); + m_xLB_LineType->show(bShow); + m_xPB_DetailsDialog->show(bShow); } void SplineResourceGroup::fillControls( const ChartTypeParameter& rParameter ) @@ -459,35 +460,35 @@ void SplineResourceGroup::fillControls( const ChartTypeParameter& rParameter ) switch (rParameter.eCurveStyle) { case CurveStyle_LINES: - m_pLB_LineType->SelectEntryPos(POS_LINETYPE_STRAIGHT); - m_pPB_DetailsDialog->Enable(false); + m_xLB_LineType->set_active(POS_LINETYPE_STRAIGHT); + m_xPB_DetailsDialog->set_sensitive(false); break; case CurveStyle_CUBIC_SPLINES: case CurveStyle_B_SPLINES: - m_pLB_LineType->SelectEntryPos(POS_LINETYPE_SMOOTH); - m_pPB_DetailsDialog->Enable(); - m_pPB_DetailsDialog->SetClickHdl( LINK( this, SplineResourceGroup, SplineDetailsDialogHdl ) ); - m_pPB_DetailsDialog->SetQuickHelpText( SchResId(STR_DLG_SMOOTH_LINE_PROPERTIES) ); + m_xLB_LineType->set_active(POS_LINETYPE_SMOOTH); + m_xPB_DetailsDialog->set_sensitive(true); + m_xPB_DetailsDialog->connect_clicked( LINK( this, SplineResourceGroup, SplineDetailsDialogHdl ) ); + m_xPB_DetailsDialog->set_tooltip_text(SchResId(STR_DLG_SMOOTH_LINE_PROPERTIES)); getSplinePropertiesDialog().fillControls( rParameter ); break; case CurveStyle_STEP_START: case CurveStyle_STEP_END: case CurveStyle_STEP_CENTER_X: case CurveStyle_STEP_CENTER_Y: - m_pLB_LineType->SelectEntryPos(POS_LINETYPE_STEPPED); - m_pPB_DetailsDialog->Enable(); - m_pPB_DetailsDialog->SetClickHdl( LINK( this, SplineResourceGroup, SteppedDetailsDialogHdl ) ); - m_pPB_DetailsDialog->SetQuickHelpText( SchResId(STR_DLG_STEPPED_LINE_PROPERTIES) ); + m_xLB_LineType->set_active(POS_LINETYPE_STEPPED); + m_xPB_DetailsDialog->set_sensitive(true); + m_xPB_DetailsDialog->connect_clicked( LINK( this, SplineResourceGroup, SteppedDetailsDialogHdl ) ); + m_xPB_DetailsDialog->set_tooltip_text( SchResId(STR_DLG_STEPPED_LINE_PROPERTIES) ); getSteppedPropertiesDialog().fillControls( rParameter ); break; default: - m_pLB_LineType->SetNoSelection(); - m_pPB_DetailsDialog->Enable(false); + m_xLB_LineType->set_active(-1); + m_xPB_DetailsDialog->set_sensitive(false); } } void SplineResourceGroup::fillParameter( ChartTypeParameter& rParameter ) { - switch (m_pLB_LineType->GetSelectedEntryPos()) + switch (m_xLB_LineType->get_active()) { case POS_LINETYPE_SMOOTH: getSplinePropertiesDialog().fillParameter( rParameter, true ); @@ -500,19 +501,21 @@ void SplineResourceGroup::fillParameter( ChartTypeParameter& rParameter ) break; } } -IMPL_LINK_NOARG(SplineResourceGroup, LineTypeChangeHdl, ListBox&, void) + +IMPL_LINK_NOARG(SplineResourceGroup, LineTypeChangeHdl, weld::ComboBox&, void) { if( m_pChangeListener ) m_pChangeListener->stateChanged(this); } -IMPL_LINK_NOARG(SplineResourceGroup, SplineDetailsDialogHdl, Button*, void) + +IMPL_LINK_NOARG(SplineResourceGroup, SplineDetailsDialogHdl, weld::Button&, void) { ChartTypeParameter aOldParameter; - getSplinePropertiesDialog().fillParameter( aOldParameter, m_pLB_LineType->GetSelectedEntryPos() == POS_LINETYPE_SMOOTH ); + getSplinePropertiesDialog().fillParameter( aOldParameter, m_xLB_LineType->get_active() == POS_LINETYPE_SMOOTH ); - const sal_Int32 iOldLineTypePos = m_pLB_LineType->GetSelectedEntryPos(); - m_pLB_LineType->SelectEntryPos(POS_LINETYPE_SMOOTH); + const sal_Int32 iOldLineTypePos = m_xLB_LineType->get_active(); + m_xLB_LineType->set_active(POS_LINETYPE_SMOOTH); if (getSplinePropertiesDialog().run() == RET_OK) { if( m_pChangeListener ) @@ -521,18 +524,19 @@ IMPL_LINK_NOARG(SplineResourceGroup, SplineDetailsDialogHdl, Button*, void) else { //restore old state: - m_pLB_LineType->SelectEntryPos( iOldLineTypePos ); + m_xLB_LineType->set_active( iOldLineTypePos ); getSplinePropertiesDialog().fillControls( aOldParameter ); } } -IMPL_LINK_NOARG(SplineResourceGroup, SteppedDetailsDialogHdl, Button*, void) + +IMPL_LINK_NOARG(SplineResourceGroup, SteppedDetailsDialogHdl, weld::Button&, void) { ChartTypeParameter aOldParameter; - getSteppedPropertiesDialog().fillParameter( aOldParameter, m_pLB_LineType->GetSelectedEntryPos() == POS_LINETYPE_STEPPED ); + getSteppedPropertiesDialog().fillParameter( aOldParameter, m_xLB_LineType->get_active() == POS_LINETYPE_STEPPED ); - const sal_Int32 iOldLineTypePos = m_pLB_LineType->GetSelectedEntryPos(); - m_pLB_LineType->SelectEntryPos(POS_LINETYPE_STEPPED); + const sal_Int32 iOldLineTypePos = m_xLB_LineType->get_active(); + m_xLB_LineType->set_active(POS_LINETYPE_STEPPED); if (getSteppedPropertiesDialog().run() == RET_OK) { if( m_pChangeListener ) @@ -541,7 +545,7 @@ IMPL_LINK_NOARG(SplineResourceGroup, SteppedDetailsDialogHdl, Button*, void) else { //restore old state: - m_pLB_LineType->SelectEntryPos( iOldLineTypePos ); + m_xLB_LineType->set_active(iOldLineTypePos); getSteppedPropertiesDialog().fillControls( aOldParameter ); } } @@ -549,7 +553,7 @@ IMPL_LINK_NOARG(SplineResourceGroup, SteppedDetailsDialogHdl, Button*, void) class GeometryResourceGroup : public ChangingResource { public: - explicit GeometryResourceGroup(VclBuilderContainer* pWindow); + explicit GeometryResourceGroup(weld::Builder* pBuilder); void showControls( bool bShow ); @@ -557,86 +561,84 @@ public: void fillParameter( ChartTypeParameter& rParameter ); private: - DECL_LINK( GeometryChangeHdl, ListBox&, void ); + DECL_LINK( GeometryChangeHdl, weld::TreeView&, void ); private: BarGeometryResources m_aGeometryResources; }; -GeometryResourceGroup::GeometryResourceGroup(VclBuilderContainer* pWindow ) +GeometryResourceGroup::GeometryResourceGroup(weld::Builder* pBuilder) : ChangingResource() - , m_aGeometryResources( pWindow ) + , m_aGeometryResources(pBuilder) { - m_aGeometryResources.SetSelectHdl( LINK( this, GeometryResourceGroup, GeometryChangeHdl ) ); + m_aGeometryResources.connect_changed( LINK( this, GeometryResourceGroup, GeometryChangeHdl ) ); } -void GeometryResourceGroup::showControls( bool bShow ) +void GeometryResourceGroup::showControls(bool bShow) { - m_aGeometryResources.Show(bShow); + m_aGeometryResources.show(bShow); } -void GeometryResourceGroup::fillControls( const ChartTypeParameter& rParameter ) +void GeometryResourceGroup::fillControls(const ChartTypeParameter& rParameter) { sal_uInt16 nGeometry3D = static_cast<sal_uInt16>(rParameter.nGeometry3D); - m_aGeometryResources.SelectEntryPos(nGeometry3D); - m_aGeometryResources.Enable(rParameter.b3DLook); + m_aGeometryResources.select(nGeometry3D); + m_aGeometryResources.set_sensitive(rParameter.b3DLook); } -void GeometryResourceGroup::fillParameter( ChartTypeParameter& rParameter ) +void GeometryResourceGroup::fillParameter(ChartTypeParameter& rParameter) { rParameter.nGeometry3D = 1; - if( m_aGeometryResources.GetSelectedEntryCount() ) - rParameter.nGeometry3D = m_aGeometryResources.GetSelectedEntryPos(); + int nSelected = m_aGeometryResources.get_selected_index(); + if (nSelected != -1) + rParameter.nGeometry3D = nSelected; } -IMPL_LINK_NOARG(GeometryResourceGroup, GeometryChangeHdl, ListBox&, void) +IMPL_LINK_NOARG(GeometryResourceGroup, GeometryChangeHdl, weld::TreeView&, void) { if( m_pChangeListener ) m_pChangeListener->stateChanged(this); } -ChartTypeTabPage::ChartTypeTabPage(vcl::Window* pParent - , const uno::Reference< XChartDocument >& xChartModel - , bool bShowDescription) - : OWizardPage(pParent, "tp_ChartType", - "modules/schart/ui/tp_ChartType.ui") - , m_pDim3DLookResourceGroup( new Dim3DLookResourceGroup(this) ) - , m_pStackingResourceGroup( new StackingResourceGroup(this) ) - , m_pSplineResourceGroup( new SplineResourceGroup(this) ) - , m_pGeometryResourceGroup( new GeometryResourceGroup( this ) ) - , m_pSortByXValuesResourceGroup( new SortByXValuesResourceGroup( this ) ) - , m_xChartModel( xChartModel ) - , m_aChartTypeDialogControllerList(0) - , m_pCurrentMainType(nullptr) - , m_nChangingCalls(0) - , m_aTimerTriggeredControllerLock( uno::Reference< frame::XModel >( m_xChartModel, uno::UNO_QUERY ) ) -{ - get(m_pFT_ChooseType, "FT_CAPTION_FOR_WIZARD"); - get(m_pMainTypeList, "charttype"); - get(m_pSubTypeList, "subtype"); - Size aSize(m_pSubTypeList->LogicToPixel(Size(150, 50), MapMode(MapUnit::MapAppFont))); - m_pSubTypeList->set_width_request(aSize.Width()); - m_pSubTypeList->set_height_request(aSize.Height()); - - if( bShowDescription ) +ChartTypeTabPage::ChartTypeTabPage(TabPageParent pParent , const uno::Reference< XChartDocument >& xChartModel, + bool bShowDescription) + : OWizardPage(pParent, "modules/schart/ui/tp_ChartType.ui", "tp_ChartType") + , m_pDim3DLookResourceGroup( new Dim3DLookResourceGroup(m_xBuilder.get()) ) + , m_pStackingResourceGroup( new StackingResourceGroup(m_xBuilder.get()) ) + , m_pSplineResourceGroup( new SplineResourceGroup(m_xBuilder.get(), pParent) ) + , m_pGeometryResourceGroup( new GeometryResourceGroup(m_xBuilder.get()) ) + , m_pSortByXValuesResourceGroup( new SortByXValuesResourceGroup(m_xBuilder.get()) ) + , m_xChartModel( xChartModel ) + , m_aChartTypeDialogControllerList(0) + , m_pCurrentMainType(nullptr) + , m_nChangingCalls(0) + , m_aTimerTriggeredControllerLock( uno::Reference< frame::XModel >( m_xChartModel, uno::UNO_QUERY ) ) + , m_xFT_ChooseType(m_xBuilder->weld_label("FT_CAPTION_FOR_WIZARD")) + , m_xMainTypeList(m_xBuilder->weld_tree_view("charttype")) + , m_xSubTypeList(new SvtValueSet(m_xBuilder->weld_scrolled_window("subtypewin"))) + , m_xSubTypeListWin(new weld::CustomWeld(*m_xBuilder, "subtype", *m_xSubTypeList)) +{ + Size aSize(m_xSubTypeList->GetDrawingArea()->get_ref_device().LogicToPixel(Size(150, 50), MapMode(MapUnit::MapAppFont))); + m_xSubTypeListWin->set_size_request(aSize.Width(), aSize.Height()); + + if (bShowDescription) { - m_pFT_ChooseType->Show(); + m_xFT_ChooseType->show(); } else { - m_pFT_ChooseType->SetStyle(m_pFT_ChooseType->GetStyle() | WB_NOLABEL); + m_xFT_ChooseType->hide(); } SetText( SchResId(STR_PAGE_CHARTTYPE) ); - m_pMainTypeList->SetStyle(m_pMainTypeList->GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_FLATVALUESET | WB_3DLOOK ); - m_pMainTypeList->SetSelectHdl( LINK( this, ChartTypeTabPage, SelectMainTypeHdl ) ); - m_pSubTypeList->SetSelectHdl( LINK( this, ChartTypeTabPage, SelectSubTypeHdl ) ); + m_xMainTypeList->connect_changed(LINK(this, ChartTypeTabPage, SelectMainTypeHdl)); + m_xSubTypeList->SetSelectHdl( LINK( this, ChartTypeTabPage, SelectSubTypeHdl ) ); - m_pSubTypeList->SetStyle(m_pSubTypeList->GetStyle() | + m_xSubTypeList->SetStyle(m_xSubTypeList->GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD | WB_FLATVALUESET | WB_3DLOOK ); - m_pSubTypeList->SetColCount(4); - m_pSubTypeList->SetLineCount(1); + m_xSubTypeList->SetColCount(4); + m_xSubTypeList->SetLineCount(1); bool bEnableComplexChartTypes = true; uno::Reference< beans::XPropertySet > xProps( m_xChartModel, uno::UNO_QUERY ); @@ -671,10 +673,12 @@ ChartTypeTabPage::ChartTypeTabPage(vcl::Window* pParent for (auto const& elem : m_aChartTypeDialogControllerList) { - m_pMainTypeList->InsertEntry( elem->getName(), elem->getImage() ); + m_xMainTypeList->append("", elem->getName(), elem->getImage()); elem->setChangeListener( this ); } + m_xMainTypeList->set_size_request(m_xMainTypeList->get_preferred_size().Width(), -1); + m_pDim3DLookResourceGroup->setChangeListener( this ); m_pStackingResourceGroup->setChangeListener( this ); m_pSplineResourceGroup->setChangeListener( this ); @@ -698,16 +702,15 @@ void ChartTypeTabPage::dispose() m_pSplineResourceGroup.reset(); m_pGeometryResourceGroup.reset(); m_pSortByXValuesResourceGroup.reset(); - m_pFT_ChooseType.clear(); - m_pMainTypeList.clear(); - m_pSubTypeList.clear(); + m_xSubTypeListWin.reset(); + m_xSubTypeList.reset(); svt::OWizardPage::dispose(); } ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const { ChartTypeParameter aParameter; - aParameter.nSubTypeIndex = static_cast<sal_Int32>( m_pSubTypeList->GetSelectedItemId() ); + aParameter.nSubTypeIndex = static_cast<sal_Int32>(m_xSubTypeList->GetSelectedItemId()); m_pDim3DLookResourceGroup->fillParameter( aParameter ); m_pStackingResourceGroup->fillParameter( aParameter ); m_pSplineResourceGroup->fillParameter( aParameter ); @@ -761,13 +764,13 @@ ChartTypeDialogController* ChartTypeTabPage::getSelectedMainType() { ChartTypeDialogController* pTypeController = nullptr; auto nM = static_cast< std::vector< ChartTypeDialogController* >::size_type >( - m_pMainTypeList->GetSelectedEntryPos() ); + m_xMainTypeList->get_selected_index() ); if( nM<m_aChartTypeDialogControllerList.size() ) pTypeController = m_aChartTypeDialogControllerList[nM].get(); return pTypeController; } -IMPL_LINK_NOARG(ChartTypeTabPage, SelectSubTypeHdl, ValueSet*, void) +IMPL_LINK_NOARG(ChartTypeTabPage, SelectSubTypeHdl, SvtValueSet*, void) { if( m_pCurrentMainType ) { @@ -778,7 +781,7 @@ IMPL_LINK_NOARG(ChartTypeTabPage, SelectSubTypeHdl, ValueSet*, void) } } -IMPL_LINK_NOARG(ChartTypeTabPage, SelectMainTypeHdl, ListBox&, void) +IMPL_LINK_NOARG(ChartTypeTabPage, SelectMainTypeHdl, weld::TreeView&, void) { selectMainType(); } @@ -824,8 +827,8 @@ void ChartTypeTabPage::selectMainType() void ChartTypeTabPage::showAllControls( ChartTypeDialogController& rTypeController ) { - m_pMainTypeList->Show(); - m_pSubTypeList->Show(); + m_xMainTypeList->show(); + m_xSubTypeList->Show(); bool bShow = rTypeController.shouldShow_3DLookControl(); m_pDim3DLookResourceGroup->showControls( bShow ); @@ -837,7 +840,7 @@ void ChartTypeTabPage::showAllControls( ChartTypeDialogController& rTypeControll m_pGeometryResourceGroup->showControls( bShow ); bShow = rTypeController.shouldShow_SortByXValuesResourceGroup(); m_pSortByXValuesResourceGroup->showControls( bShow ); - rTypeController.showExtraControls(this); + rTypeController.showExtraControls(m_xBuilder.get()); } void ChartTypeTabPage::fillAllControls( const ChartTypeParameter& rParameter, bool bAlsoResetSubTypeList ) @@ -845,9 +848,9 @@ void ChartTypeTabPage::fillAllControls( const ChartTypeParameter& rParameter, bo m_nChangingCalls++; if( m_pCurrentMainType && bAlsoResetSubTypeList ) { - m_pCurrentMainType->fillSubTypeList(*m_pSubTypeList, rParameter); + m_pCurrentMainType->fillSubTypeList(*m_xSubTypeList, rParameter); } - m_pSubTypeList->SelectItem( static_cast<sal_uInt16>( rParameter.nSubTypeIndex) ); + m_xSubTypeList->SelectItem( static_cast<sal_uInt16>( rParameter.nSubTypeIndex) ); m_pDim3DLookResourceGroup->fillControls( rParameter ); m_pStackingResourceGroup->fillControls( rParameter ); m_pSplineResourceGroup->fillControls( rParameter ); @@ -876,7 +879,7 @@ void ChartTypeTabPage::initializePage() { bFound = true; - m_pMainTypeList->SelectEntryPos( nM ); + m_xMainTypeList->select(nM); showAllControls(*elem); uno::Reference< beans::XPropertySet > xTemplateProps( aTemplate.first, uno::UNO_QUERY ); ChartTypeParameter aParameter = elem->getChartTypeParameterForService( aServiceName, xTemplateProps ); @@ -907,7 +910,7 @@ void ChartTypeTabPage::initializePage() if( !bFound ) { - m_pSubTypeList->Hide(); + m_xSubTypeList->Hide(); m_pDim3DLookResourceGroup->showControls( false ); m_pStackingResourceGroup->showControls( false, false ); m_pSplineResourceGroup->showControls( false ); diff --git a/chart2/source/controller/dialogs/tp_ChartType.hxx b/chart2/source/controller/dialogs/tp_ChartType.hxx index 8da17cb9781e..09cb16c3ce87 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.hxx +++ b/chart2/source/controller/dialogs/tp_ChartType.hxx @@ -47,7 +47,7 @@ class SortByXValuesResourceGroup; class ChartTypeTabPage final : public ResourceChangeListener, public svt::OWizardPage, public ChartTypeTemplateProvider { public: - ChartTypeTabPage( vcl::Window* pParent + ChartTypeTabPage( TabPageParent pParent , const css::uno::Reference< css::chart2::XChartDocument >& xChartModel , bool bShowDescription = true ); virtual ~ChartTypeTabPage() override; @@ -69,12 +69,8 @@ private: void commitToModel( const ChartTypeParameter& rParameter ); void selectMainType(); - DECL_LINK( SelectMainTypeHdl, ListBox&, void ); - DECL_LINK( SelectSubTypeHdl, ValueSet*, void ); - - VclPtr<FixedText> m_pFT_ChooseType; - VclPtr<ListBox> m_pMainTypeList; - VclPtr<ValueSet> m_pSubTypeList; + DECL_LINK(SelectMainTypeHdl, weld::TreeView&, void); + DECL_LINK(SelectSubTypeHdl, SvtValueSet*, void ); std::unique_ptr<Dim3DLookResourceGroup> m_pDim3DLookResourceGroup; std::unique_ptr<StackingResourceGroup> m_pStackingResourceGroup; @@ -90,6 +86,11 @@ private: sal_Int32 m_nChangingCalls; TimerTriggeredControllerLock m_aTimerTriggeredControllerLock; + + std::unique_ptr<weld::Label> m_xFT_ChooseType; + std::unique_ptr<weld::TreeView> m_xMainTypeList; + std::unique_ptr<SvtValueSet> m_xSubTypeList; + std::unique_ptr<weld::CustomWeld> m_xSubTypeListWin; }; } //namespace chart diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.cxx b/chart2/source/controller/dialogs/tp_PointGeometry.cxx index 38a4dc9a68ea..a3717c81f729 100644 --- a/chart2/source/controller/dialogs/tp_PointGeometry.cxx +++ b/chart2/source/controller/dialogs/tp_PointGeometry.cxx @@ -29,10 +29,10 @@ namespace chart { -SchLayoutTabPage::SchLayoutTabPage(vcl::Window* pWindow,const SfxItemSet& rInAttrs) - : SfxTabPage(pWindow, "tp_ChartType", "modules/schart/ui/tp_ChartType.ui", &rInAttrs) +SchLayoutTabPage::SchLayoutTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs) + : SfxTabPage(pParent, "modules/schart/ui/tp_ChartType.ui", "tp_ChartType", &rInAttrs) { - m_pGeometryResources.reset(new BarGeometryResources( this )); + m_pGeometryResources.reset(new BarGeometryResources(m_xBuilder.get())); } SchLayoutTabPage::~SchLayoutTabPage() @@ -46,21 +46,19 @@ void SchLayoutTabPage::dispose() SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SchLayoutTabPage::Create(TabPageParent pWindow, - const SfxItemSet* rOutAttrs) +VclPtr<SfxTabPage> SchLayoutTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs) { - return VclPtr<SchLayoutTabPage>::Create(pWindow.pParent, *rOutAttrs); + return VclPtr<SchLayoutTabPage>::Create(pParent, *rOutAttrs); } bool SchLayoutTabPage::FillItemSet(SfxItemSet* rOutAttrs) { - - if(m_pGeometryResources && m_pGeometryResources->GetSelectedEntryCount()) + int nShape = m_pGeometryResources ? m_pGeometryResources->get_selected_index() : -1; + if (nShape != -1) { long nSegs=32; - long nShape = m_pGeometryResources->GetSelectedEntryPos(); - if(nShape==CHART_SHAPE3D_PYRAMID) + if (nShape==CHART_SHAPE3D_PYRAMID) nSegs=4; rOutAttrs->Put(SfxInt32Item(SCHATTR_STYLE_SHAPE,nShape)); @@ -78,8 +76,8 @@ void SchLayoutTabPage::Reset(const SfxItemSet* rInAttrs) long nVal = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue(); if(m_pGeometryResources) { - m_pGeometryResources->SelectEntryPos(static_cast<sal_uInt16>(nVal)); - m_pGeometryResources->Show( true ); + m_pGeometryResources->select(static_cast<sal_uInt16>(nVal)); + m_pGeometryResources->show(true); } } } diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.hxx b/chart2/source/controller/dialogs/tp_PointGeometry.hxx index f9cfad788f33..4690a1fd1c31 100644 --- a/chart2/source/controller/dialogs/tp_PointGeometry.hxx +++ b/chart2/source/controller/dialogs/tp_PointGeometry.hxx @@ -28,7 +28,7 @@ class BarGeometryResources; class SchLayoutTabPage : public SfxTabPage { public: - SchLayoutTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs); + SchLayoutTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SchLayoutTabPage() override; virtual void dispose() override; diff --git a/chart2/source/controller/inc/dlg_ChartType.hxx b/chart2/source/controller/inc/dlg_ChartType.hxx index 3d3f196775fd..7483dcd84118 100644 --- a/chart2/source/controller/inc/dlg_ChartType.hxx +++ b/chart2/source/controller/inc/dlg_ChartType.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DLG_CHARTTYPE_HXX #define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DLG_CHARTTYPE_HXX -#include <vcl/dialog.hxx> +#include <vcl/weld.hxx> namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } } @@ -27,18 +27,17 @@ namespace chart { class ChartTypeTabPage; -class ChartTypeDialog : public ModalDialog +class ChartTypeDialog : public weld::GenericDialogController { public: - ChartTypeDialog( vcl::Window* pWindow - , const css::uno::Reference< css::frame::XModel >& xChartModel ); + ChartTypeDialog(weld::Window* pWindow, + const css::uno::Reference< css::frame::XModel >& xChartModel); virtual ~ChartTypeDialog() override; - virtual void dispose() override; private: - VclPtr<ChartTypeTabPage> m_pChartTypeTabPage; - - css::uno::Reference< css::frame::XModel > m_xChartModel; + css::uno::Reference<css::frame::XModel> m_xChartModel; + std::unique_ptr<weld::Container> m_xContentArea; + VclPtr<ChartTypeTabPage> m_xChartTypeTabPage; }; } //namespace chart diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 17a0f12bb6c7..b694d02648aa 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1310,8 +1310,8 @@ void ChartController::executeDispatch_ChartType() SolarMutexGuard aSolarGuard; //prepare and open dialog - ScopedVclPtrInstance< ChartTypeDialog > aDlg( GetChartWindow(), getModel() ); - if( aDlg->Execute() == RET_OK ) + ChartTypeDialog aDlg(GetChartFrame(), getModel()); + if (aDlg.run() == RET_OK) { impl_adaptDataSeriesAutoResize(); aUndoGuard.commit(); diff --git a/chart2/uiconfig/ui/charttypedialog.ui b/chart2/uiconfig/ui/charttypedialog.ui index 5823f293f9fd..def049f9b774 100644 --- a/chart2/uiconfig/ui/charttypedialog.ui +++ b/chart2/uiconfig/ui/charttypedialog.ui @@ -1,12 +1,18 @@ <?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="GtkDialog" id="ChartTypeDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="charttypedialog|ChartTypeDialog">Chart Type</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> diff --git a/chart2/uiconfig/ui/tp_ChartType.ui b/chart2/uiconfig/ui/tp_ChartType.ui index a38a30daae4b..987a7097d9e7 100644 --- a/chart2/uiconfig/ui/tp_ChartType.ui +++ b/chart2/uiconfig/ui/tp_ChartType.ui @@ -1,8 +1,7 @@ <?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="adjustment1"> <property name="lower">1</property> <property name="upper">100</property> @@ -12,7 +11,9 @@ </object> <object class="GtkListStore" id="liststore1"> <columns> - <!-- column-name gchararray1 --> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name id --> <column type="gchararray"/> </columns> <data> @@ -30,6 +31,16 @@ </row> </data> </object> + <object class="GtkListStore" id="liststore2"> + <columns> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name id --> + <column type="gchararray"/> + <!-- column-name image --> + <column type="GdkPixbuf"/> + </columns> + </object> <object class="GtkBox" id="tp_ChartType"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -47,10 +58,9 @@ <property name="spacing">6</property> <child> <object class="GtkLabel" id="FT_CAPTION_FOR_WIZARD"> - <property name="visible">False</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="tp_ChartType|FT_CAPTION_FOR_WIZARD">Choose a Chart Type</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -75,16 +85,31 @@ <property name="hexpand">True</property> <property name="row_spacing">6</property> <child> - <object class="svtlo-ValueSet" id="subtype:border"> - <property name="visible">False</property> - <property name="can_focus">False</property> + <object class="GtkScrolledWindow" id="subtypewin"> + <property name="visible">True</property> + <property name="can_focus">True</property> <property name="hexpand">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">True</property> + <child> + <object class="GtkDrawingArea" id="subtype"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property> + <property name="hexpand">True</property> + </object> + </child> + </object> + </child> </object> <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> @@ -100,7 +125,6 @@ <child> <object class="GtkCheckButton" id="3dlook"> <property name="label" translatable="yes" context="tp_ChartType|3dlook">_3D Look</property> - <property name="visible">False</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> @@ -113,13 +137,10 @@ <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="GtkComboBoxText" id="3dscheme"> - <property name="visible">False</property> <property name="can_focus">False</property> <items> <item translatable="yes" context="tp_ChartType|3dscheme">Simple</item> @@ -132,57 +153,70 @@ <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> </object> <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="GtkLabel" id="shapeft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="tp_ChartType|shapeft">Sh_ape</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">shape:border</property> + <property name="mnemonic_widget">shape</property> <property name="angle">0.02</property> + <property name="xalign">0</property> </object> <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="GtkTreeView" id="shape:border"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="model">liststore1</property> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection"/> + <property name="can_focus">False</property> + <property name="vexpand">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="shape"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="vexpand">True</property> + <property name="model">liststore1</property> + <property name="headers_visible">False</property> + <property name="headers_clickable">False</property> + <property name="search_column">0</property> + <property name="show_expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection1"/> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn1"> + <child> + <object class="GtkCellRendererText" id="cellrenderertext1"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + </child> + </object> </child> </object> <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> <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> @@ -193,7 +227,6 @@ <child> <object class="GtkCheckButton" id="stack"> <property name="label" translatable="yes" context="tp_ChartType|stack">_Stack series</property> - <property name="visible">False</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> @@ -203,8 +236,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> @@ -220,44 +251,36 @@ <child> <object class="GtkRadioButton" id="ontop"> <property name="label" translatable="yes" context="tp_ChartType|ontop">On top</property> - <property name="visible">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">percent</property> </object> <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="GtkRadioButton" id="percent"> <property name="label" translatable="yes" context="tp_ChartType|percent">Percent</property> - <property name="visible">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">deep</property> + <property name="group">ontop</property> </object> <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="GtkRadioButton" id="deep"> <property name="label" translatable="yes" context="tp_ChartType|deep">Deep</property> - <property name="visible">False</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> @@ -268,8 +291,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> @@ -278,8 +299,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> @@ -289,24 +308,19 @@ <property name="column_spacing">12</property> <child> <object class="GtkLabel" id="linetypeft"> - <property name="visible">False</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="tp_ChartType|linetypeft">_Line type</property> <property name="use_underline">True</property> <property name="mnemonic_widget">linetype</property> - <property name="ellipsize">end</property> + <property name="xalign">0</property> </object> <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="GtkComboBoxText" id="linetype"> - <property name="visible">False</property> <property name="can_focus">False</property> <items> <item translatable="yes" context="tp_ChartType|linetype">Straight</item> @@ -317,14 +331,11 @@ <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="properties"> <property name="label" translatable="yes" context="tp_ChartType|properties">Properties...</property> - <property name="visible">False</property> <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="use_underline">True</property> @@ -332,22 +343,17 @@ <packing> <property name="left_attach">2</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> <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="sort"> <property name="label" translatable="yes" context="tp_ChartType|sort">_Sort by X values</property> - <property name="visible">False</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> @@ -357,8 +363,6 @@ <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> @@ -370,70 +374,92 @@ <object class="GtkLabel" id="nolinesft"> <property name="can_focus">False</property> <property name="no_show_all">True</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="tp_ChartType|nolinesft">_Number of lines</property> <property name="use_underline">True</property> <property name="mnemonic_widget">nolines</property> <property name="ellipsize">end</property> + <property name="xalign">0</property> </object> <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="GtkSpinButton" id="nolines"> <property name="can_focus">True</property> <property name="no_show_all">True</property> + <property name="activates_default">True</property> <property name="adjustment">adjustment1</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> </object> <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> </object> <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> <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="GtkTreeView" id="charttype:border"> - <property name="visible">False</property> - <property name="can_focus">True</property> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can_focus">False</property> <property name="vexpand">True</property> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection1"/> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="charttype"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="vexpand">True</property> + <property name="model">liststore2</property> + <property name="headers_visible">False</property> + <property name="headers_clickable">False</property> + <property name="search_column">0</property> + <property name="show_expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection2"/> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn3"> + <child> + <object class="GtkCellRendererPixbuf" id="cellrenderertext3"/> + <attributes> + <attribute name="pixbuf">2</attribute> + </attributes> + </child> + </object> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn2"> + <child> + <object class="GtkCellRendererText" id="cellrenderertext2"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + </child> + </object> </child> </object> <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> </object> diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx index 3c5b26ef7144..79748b30afe9 100644 --- a/include/sfx2/tabdlg.hxx +++ b/include/sfx2/tabdlg.hxx @@ -41,31 +41,6 @@ class SfxViewFrame; class SfxTabPage; class SfxBindings; -struct TabPageParent -{ - TabPageParent(vcl::Window* _pParent) - : pParent(_pParent) - , pPage(nullptr) - , pController(nullptr) - { - } - TabPageParent(weld::Container* _pPage, weld::DialogController* _pController) - : pParent(nullptr) - , pPage(_pPage) - , pController(_pController) - { - } - weld::Window* GetFrameWeld() const - { - if (pController) - return pController->getDialog(); - return pParent->GetFrameWeld(); - } - VclPtr<vcl::Window> pParent; - weld::Container* const pPage; - weld::DialogController* pController; -}; - typedef VclPtr<SfxTabPage> (*CreateTabPage)(TabPageParent pParent, const SfxItemSet *rAttrSet); typedef const sal_uInt16* (*GetTabPageRanges)(); // provides international Which-value struct TabPageImpl; diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx index fef9fd2f4d71..a67518f5c6e0 100644 --- a/include/svtools/valueset.hxx +++ b/include/svtools/valueset.hxx @@ -502,6 +502,8 @@ public: void SetOptimalSize(); + /// Insert @rImage item. + void InsertItem(sal_uInt16 nItemId, const Image& rImage); /// Insert @rImage item with @rStr as a tooltip void InsertItem(sal_uInt16 nItemId, const Image& rImage, const OUString& rStr, size_t nPos = VALUESET_APPEND); diff --git a/include/svtools/wizardmachine.hxx b/include/svtools/wizardmachine.hxx index 68ad14a134bf..748afebbb712 100644 --- a/include/svtools/wizardmachine.hxx +++ b/include/svtools/wizardmachine.hxx @@ -24,6 +24,7 @@ #include <svtools/wizdlg.hxx> #include <vcl/button.hxx> #include <vcl/tabpage.hxx> +#include <vcl/weld.hxx> #include <o3tl/typed_flags_set.hxx> class Bitmap; @@ -104,6 +105,8 @@ namespace svt must be the OWizardMachine (which is derived from Window) */ OWizardPage(vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription); + OWizardPage(TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rID); + virtual void dispose() override; virtual ~OWizardPage() override; // IWizardPageController overridables @@ -112,6 +115,9 @@ namespace svt virtual bool canAdvance() const override; protected: + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Container> m_xContainer; + // TabPage overridables virtual void ActivatePage() override; diff --git a/include/vcl/tabpage.hxx b/include/vcl/tabpage.hxx index 3845da4fffed..bd8475d81591 100644 --- a/include/vcl/tabpage.hxx +++ b/include/vcl/tabpage.hxx @@ -23,9 +23,34 @@ #include <tools/solar.h> #include <vcl/dllapi.h> #include <vcl/builder.hxx> +#include <vcl/weld.hxx> #include <vcl/window.hxx> #include <vcl/IContext.hxx> +struct TabPageParent +{ + TabPageParent(vcl::Window* _pParent) + : pParent(_pParent) + , pPage(nullptr) + , pController(nullptr) + { + } + TabPageParent(weld::Container* _pPage, weld::DialogController* _pController) + : pParent(nullptr) + , pPage(_pPage) + , pController(_pController) + { + } + weld::Window* GetFrameWeld() const + { + if (pController) + return pController->getDialog(); + return pParent->GetFrameWeld(); + } + VclPtr<vcl::Window> pParent; + weld::Container* const pPage; + weld::DialogController* pController; +}; class VCL_DLLPUBLIC TabPage : public vcl::Window diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 730b2a87aea7..963fc1bb8249 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -3711,6 +3711,15 @@ Size SvtValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesire return aSize; } +void SvtValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage ) +{ + std::unique_ptr<SvtValueSetItem> pItem(new SvtValueSetItem( *this )); + pItem->mnId = nItemId; + pItem->meType = VALUESETITEM_IMAGE; + pItem->maImage = rImage; + ImplInsertItem( std::move(pItem), VALUESET_APPEND ); +} + void SvtValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, const OUString& rText, size_t nPos ) { diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx index b1bbb41155a5..e76aa4266214 100644 --- a/svtools/source/dialogs/wizardmachine.cxx +++ b/svtools/source/dialogs/wizardmachine.cxx @@ -23,25 +23,36 @@ #include <tools/diagnose_ex.h> #include <svtools/svtresid.hxx> #include <svtools/strings.hrc> - +#include <vcl/svapp.hxx> namespace svt { - - //= WizardPageImplData - OWizardPage::OWizardPage(vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription) : TabPage(pParent, rID, rUIXMLDescription) { } + OWizardPage::OWizardPage(TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rID) + : TabPage(pParent.pPage ? Application::GetDefDialogParent() : pParent.pParent.get()) //just drag this along hidden in this scenario + , m_xBuilder(pParent.pPage ? Application::CreateBuilder(pParent.pPage, rUIXMLDescription) + : Application::CreateInterimBuilder(this, rUIXMLDescription)) + , m_xContainer(m_xBuilder->weld_container(rID)) + { + } + OWizardPage::~OWizardPage() { disposeOnce(); } + void OWizardPage::dispose() + { + m_xBuilder.reset(); + TabPage::dispose(); + } + void OWizardPage::initializePage() { } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index d3b522b5b554..1141e408be4e 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -4152,6 +4152,30 @@ public: gtk_widget_set_size_request(m_pWidget, nWidth, nHeight); } + virtual void set_visible(bool visible) override + { + GtkWidget* pParent = gtk_widget_get_parent(m_pWidget); + if (GTK_IS_SCROLLED_WINDOW(pParent)) + gtk_widget_set_visible(pParent, visible); + gtk_widget_set_visible(m_pWidget, visible); + } + + virtual void show() override + { + GtkWidget* pParent = gtk_widget_get_parent(m_pWidget); + if (GTK_IS_SCROLLED_WINDOW(pParent)) + gtk_widget_show(pParent); + gtk_widget_show(m_pWidget); + } + + virtual void hide() override + { + GtkWidget* pParent = gtk_widget_get_parent(m_pWidget); + if (GTK_IS_SCROLLED_WINDOW(pParent)) + gtk_widget_hide(pParent); + gtk_widget_hide(m_pWidget); + } + virtual void set_selection_mode(bool bMultiple) override { disable_notify_events(); |