[Libreoffice-commits] core.git: chart2/inc chart2/IwyuFilter_chart2.yaml chart2/source chart2/uiconfig extras/source include/svx sfx2/uiconfig solenv/bin solenv/gbuild solenv/sanitizers svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sat Jun 8 14:18:42 UTC 2019


 chart2/IwyuFilter_chart2.yaml                                |    2 
 chart2/inc/pch/precompiled_chartcontroller.hxx               |   11 
 chart2/source/controller/dialogs/dlg_View3D.cxx              |   54 
 chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx   |  133 -
 chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx   |   38 
 chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx     |  197 -
 chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx     |   52 
 chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx |  252 +-
 chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx |   79 
 chart2/source/controller/inc/dlg_View3D.hxx                  |   24 
 chart2/source/controller/main/ChartController_Properties.cxx |    4 
 chart2/uiconfig/ui/3dviewdialog.ui                           |    8 
 chart2/uiconfig/ui/tp_3D_SceneGeometry.ui                    |   52 
 chart2/uiconfig/ui/tp_3D_SceneIllumination.ui                |  174 +
 extras/source/glade/libreoffice-catalog.xml.in               |    3 
 include/svx/colorbox.hxx                                     |    1 
 include/svx/dlgctl3d.hxx                                     |  147 +
 sfx2/uiconfig/ui/alienwarndialog.ui                          |    2 
 solenv/bin/native-code.py                                    |    1 
 solenv/gbuild/UIConfig.mk                                    |    2 
 solenv/sanitizers/ui/modules/schart.suppr                    |    4 
 svx/source/dialog/dlgctl3d.cxx                               | 1201 ++++++++++-
 svx/source/tbxctrls/tbcontrl.cxx                             |   13 
 23 files changed, 1868 insertions(+), 586 deletions(-)

New commits:
commit d00a8b05c057d9260c5a44408d9a815121ee6cba
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jun 6 10:37:21 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jun 8 16:17:45 2019 +0200

    weld View3DDialog
    
    Change-Id: Ifd689c54574c08f026f6760efb39b5f927cb2625
    Reviewed-on: https://gerrit.libreoffice.org/73604
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/chart2/IwyuFilter_chart2.yaml b/chart2/IwyuFilter_chart2.yaml
index 68761f242b30..445a9f7d60eb 100644
--- a/chart2/IwyuFilter_chart2.yaml
+++ b/chart2/IwyuFilter_chart2.yaml
@@ -463,7 +463,7 @@ blacklist:
     - namespace chart { class ThreeD_SceneIllumination_TabPage; }
     chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx:
     # Needed for vclptr type
-    - class SvxColorListBox
+    - class ColorListBox
     chart2/source/controller/inc/ItemPropertyMap.hxx:
     # base class has to be a complete type
     - map
diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chartcontroller.hxx
index a72dea77cccc..a6519d6dac8c 100644
--- a/chart2/inc/pch/precompiled_chartcontroller.hxx
+++ b/chart2/inc/pch/precompiled_chartcontroller.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2019-05-12 16:56:57 using:
+ Generated on 2019-06-06 21:24:00 using:
  ./bin/update_pch chart2 chartcontroller --cutoff=6 --exclude:system --include:module --include:local
 
  If after updating build fails, use the following command to locate conflicting headers:
@@ -84,7 +84,6 @@
 #include <vcl/GraphicExternalLink.hxx>
 #include <vcl/GraphicObject.hxx>
 #include <vcl/IContext.hxx>
-#include <vcl/NotebookbarContextControl.hxx>
 #include <vcl/abstdlg.hxx>
 #include <vcl/alpha.hxx>
 #include <vcl/animate/Animation.hxx>
@@ -124,7 +123,6 @@
 #include <vcl/outdev.hxx>
 #include <vcl/outdevmap.hxx>
 #include <vcl/outdevstate.hxx>
-#include <vcl/print.hxx>
 #include <vcl/prntypes.hxx>
 #include <vcl/region.hxx>
 #include <vcl/salgtype.hxx>
@@ -134,12 +132,9 @@
 #include <vcl/spinfld.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/syswin.hxx>
-#include <vcl/tabctrl.hxx>
-#include <vcl/tabdlg.hxx>
 #include <vcl/tabpage.hxx>
 #include <vcl/task.hxx>
 #include <vcl/timer.hxx>
-#include <vcl/toolbox.hxx>
 #include <vcl/vclenum.hxx>
 #include <vcl/vclevent.hxx>
 #include <vcl/vclptr.hxx>
@@ -335,7 +330,6 @@
 #include <svtools/colorcfg.hxx>
 #include <svtools/optionsdrawinglayer.hxx>
 #include <svtools/svtdllapi.h>
-#include <svtools/valueset.hxx>
 #include <svx/ActionDescriptionProvider.hxx>
 #include <svx/XPropertyEntry.hxx>
 #include <svx/chrtitem.hxx>
@@ -345,10 +339,8 @@
 #include <svx/pageitem.hxx>
 #include <svx/sdgcpitm.hxx>
 #include <svx/sdr/animation/scheduler.hxx>
-#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
 #include <svx/sdr/overlay/overlayobject.hxx>
 #include <svx/sdr/overlay/overlayobjectlist.hxx>
-#include <svx/sdrmasterpagedescriptor.hxx>
 #include <svx/sdrobjectuser.hxx>
 #include <svx/sdrpageuser.hxx>
 #include <svx/sdtaditm.hxx>
@@ -382,7 +374,6 @@
 #include <svx/svdtypes.hxx>
 #include <svx/svdundo.hxx>
 #include <svx/svxdllapi.h>
-#include <svx/viewpt3d.hxx>
 #include <svx/xdash.hxx>
 #include <svx/xdef.hxx>
 #include <svx/xenum.hxx>
diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx
index fc329ce6b733..03a5fcc299f5 100644
--- a/chart2/source/controller/dialogs/dlg_View3D.cxx
+++ b/chart2/source/controller/dialogs/dlg_View3D.cxx
@@ -35,52 +35,44 @@ using namespace ::com::sun::star::chart2;
 
 sal_uInt16 View3DDialog::m_nLastPageId = 0;
 
-View3DDialog::View3DDialog(vcl::Window* pParent, const uno::Reference< frame::XModel > & xChartModel)
-    : TabDialog(pParent, "3DViewDialog", "modules/schart/ui/3dviewdialog.ui")
-    , m_pGeometry(nullptr)
-    , m_pAppearance(nullptr)
-    , m_pIllumination(nullptr)
+View3DDialog::View3DDialog(weld::Window* pParent, const uno::Reference< frame::XModel > & xChartModel)
+    : GenericDialogController(pParent, "modules/schart/ui/3dviewdialog.ui", "3DViewDialog")
     , m_aControllerLocker(xChartModel)
+    , m_xTabControl(m_xBuilder->weld_notebook("tabcontrol"))
 {
-    get(m_pTabControl, "tabcontrol");
-
     uno::Reference< beans::XPropertySet > xSceneProperties( ChartModelHelper::findDiagram( xChartModel ), uno::UNO_QUERY );
-    m_pGeometry   = VclPtr<ThreeD_SceneGeometry_TabPage>::Create(m_pTabControl,xSceneProperties,m_aControllerLocker);
-    m_pAppearance = VclPtr<ThreeD_SceneAppearance_TabPage>::Create(m_pTabControl,xChartModel,m_aControllerLocker);
-    m_pIllumination = VclPtr<ThreeD_SceneIllumination_TabPage>::Create(m_pTabControl,xSceneProperties,xChartModel);
 
-    m_pTabControl->InsertPage( TP_3D_SCENEGEOMETRY, SchResId(STR_PAGE_PERSPECTIVE) );
-    m_pTabControl->InsertPage( TP_3D_SCENEAPPEARANCE, SchResId(STR_PAGE_APPEARANCE) );
-    m_pTabControl->InsertPage( TP_3D_SCENEILLUMINATION, SchResId(STR_PAGE_ILLUMINATION) );
+    m_xTabControl->append_page("geometry", SchResId(STR_PAGE_PERSPECTIVE));
+    m_xGeometry.reset(new ThreeD_SceneGeometry_TabPage(m_xTabControl->get_page("geometry"), xSceneProperties, m_aControllerLocker));
+
+    m_xTabControl->append_page("appearance", SchResId(STR_PAGE_APPEARANCE));
+    m_xAppearance.reset(new ThreeD_SceneAppearance_TabPage(m_xTabControl->get_page("appearance"), xChartModel, m_aControllerLocker));
+
+    m_xTabControl->append_page("illumination", SchResId(STR_PAGE_ILLUMINATION));
+    m_xIllumination.reset(new ThreeD_SceneIllumination_TabPage(m_xTabControl->get_page("illumination"), m_xDialog.get(),
+        xSceneProperties, xChartModel));
 
-    m_pTabControl->SetTabPage( TP_3D_SCENEGEOMETRY, m_pGeometry );
-    m_pTabControl->SetTabPage( TP_3D_SCENEAPPEARANCE, m_pAppearance );
-    m_pTabControl->SetTabPage( TP_3D_SCENEILLUMINATION, m_pIllumination );
+    m_xTabControl->connect_enter_page(LINK(this, View3DDialog, ActivatePageHdl));
 
-    m_pTabControl->SelectTabPage( m_nLastPageId );
+    m_xTabControl->set_current_page(m_nLastPageId);
 }
 
-View3DDialog::~View3DDialog()
+IMPL_LINK(View3DDialog, ActivatePageHdl, const OString&, rPage, void)
 {
-    disposeOnce();
+    if (rPage == "appearance")
+        m_xAppearance->ActivatePage();
 }
 
-void View3DDialog::dispose()
+View3DDialog::~View3DDialog()
 {
-    m_pGeometry.disposeAndClear();
-    m_pAppearance.disposeAndClear();
-    m_pIllumination.disposeAndClear();
-    if (m_pTabControl)
-        m_nLastPageId = m_pTabControl->GetCurPageId();
-    m_pTabControl.clear();
-    TabDialog::dispose();
+    m_nLastPageId = m_xTabControl->get_current_page();
 }
 
-short View3DDialog::Execute()
+short View3DDialog::run()
 {
-    short nResult = TabDialog::Execute();
-    if( nResult == RET_OK && m_pGeometry )
-        m_pGeometry->commitPendingChanges();
+    short nResult = GenericDialogController::run();
+    if (nResult == RET_OK && m_xGeometry)
+        m_xGeometry->commitPendingChanges();
     return nResult;
 }
 
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
index 781cd535b47c..1168fe0f18c7 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
@@ -24,6 +24,7 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/drawing/ShadeMode.hpp>
 #include <tools/diagnose_ex.h>
+#include <vcl/svapp.hxx>
 
 using namespace ::com::sun::star;
 
@@ -86,53 +87,34 @@ namespace chart
 #define POS_3DSCHEME_REALISTIC 1
 #define POS_3DSCHEME_CUSTOM 2
 
-ThreeD_SceneAppearance_TabPage::ThreeD_SceneAppearance_TabPage(
-      vcl::Window* pWindow
-    , const uno::Reference< frame::XModel > & xChartModel
-    , ControllerLockHelper & rControllerLockHelper )
-                : TabPage ( pWindow
-                           , "tp_3D_SceneAppearance"
-                           , "modules/schart/ui/tp_3D_SceneAppearance.ui")
-                , m_xChartModel     ( xChartModel )
-                , m_bUpdateOtherControls( true )
-                , m_bCommitToModel( true )
-                , m_rControllerLockHelper( rControllerLockHelper )
+ThreeD_SceneAppearance_TabPage::ThreeD_SceneAppearance_TabPage(weld::Container* pParent,
+        const uno::Reference<frame::XModel>& xChartModel,
+        ControllerLockHelper& rControllerLockHelper)
+    : m_xChartModel(xChartModel)
+    , m_bUpdateOtherControls(true)
+    , m_bCommitToModel(true)
+    , m_rControllerLockHelper(rControllerLockHelper)
+    , m_xBuilder(Application::CreateBuilder(pParent, "modules/schart/ui/tp_3D_SceneAppearance.ui"))
+    , m_xContainer(m_xBuilder->weld_container("tp_3D_SceneAppearance"))
+    , m_xLB_Scheme(m_xBuilder->weld_combo_box("LB_SCHEME"))
+    , m_xCB_Shading(m_xBuilder->weld_check_button("CB_SHADING"))
+    , m_xCB_ObjectLines(m_xBuilder->weld_check_button("CB_OBJECTLINES"))
+    , m_xCB_RoundedEdge(m_xBuilder->weld_check_button("CB_ROUNDEDEDGE"))
 {
+    m_aCustom = m_xLB_Scheme->get_text(POS_3DSCHEME_CUSTOM);
+    m_xLB_Scheme->remove(POS_3DSCHEME_CUSTOM);
 
-    get(m_pLB_Scheme, "LB_SCHEME");
-    get(m_pCB_Shading, "CB_SHADING");
-    get(m_pCB_ObjectLines, "CB_OBJECTLINES");
-    get(m_pCB_RoundedEdge, "CB_ROUNDEDEDGE");
+    m_xLB_Scheme->connect_changed( LINK( this, ThreeD_SceneAppearance_TabPage, SelectSchemeHdl ) );
 
-    m_aCustom = m_pLB_Scheme->GetEntry(POS_3DSCHEME_CUSTOM);
-    m_pLB_Scheme->RemoveEntry(POS_3DSCHEME_CUSTOM);
-    m_pLB_Scheme->SetDropDownLineCount(2);
-
-    m_pLB_Scheme->SetSelectHdl( LINK( this, ThreeD_SceneAppearance_TabPage, SelectSchemeHdl ) );
-
-    m_pCB_RoundedEdge->SetToggleHdl( LINK( this, ThreeD_SceneAppearance_TabPage, SelectRoundedEdgeOrObjectLines ) );
-    m_pCB_Shading->SetToggleHdl( LINK( this, ThreeD_SceneAppearance_TabPage, SelectShading ) );
-    m_pCB_ObjectLines->SetToggleHdl( LINK( this, ThreeD_SceneAppearance_TabPage, SelectRoundedEdgeOrObjectLines ) );
-
-    m_pCB_RoundedEdge->EnableTriState();
-    m_pCB_Shading->EnableTriState();
-    m_pCB_ObjectLines->EnableTriState();
+    m_xCB_RoundedEdge->connect_toggled( LINK( this, ThreeD_SceneAppearance_TabPage, SelectRoundedEdgeOrObjectLines ) );
+    m_xCB_Shading->connect_toggled( LINK( this, ThreeD_SceneAppearance_TabPage, SelectShading ) );
+    m_xCB_ObjectLines->connect_toggled( LINK( this, ThreeD_SceneAppearance_TabPage, SelectRoundedEdgeOrObjectLines ) );
 
     initControlsFromModel();
 }
 
 ThreeD_SceneAppearance_TabPage::~ThreeD_SceneAppearance_TabPage()
 {
-    disposeOnce();
-}
-
-void ThreeD_SceneAppearance_TabPage::dispose()
-{
-    m_pLB_Scheme.clear();
-    m_pCB_Shading.clear();
-    m_pCB_ObjectLines.clear();
-    m_pCB_RoundedEdge.clear();
-    TabPage::dispose();
 }
 
 void ThreeD_SceneAppearance_TabPage::ActivatePage()
@@ -147,7 +129,7 @@ void ThreeD_SceneAppearance_TabPage::applyRoundedEdgeAndObjectLinesToModel()
 
     sal_Int32 nObjectLines = -1;
 
-    switch( m_pCB_ObjectLines->GetState())
+    switch( m_xCB_ObjectLines->get_state())
     {
         case TRISTATE_FALSE:
             nObjectLines = 0;
@@ -161,7 +143,7 @@ void ThreeD_SceneAppearance_TabPage::applyRoundedEdgeAndObjectLinesToModel()
     }
 
     sal_Int32 nCurrentRoundedEdges = -1;
-    switch( m_pCB_RoundedEdge->GetState() )
+    switch( m_xCB_RoundedEdge->get_state() )
     {
         case TRISTATE_FALSE:
             nCurrentRoundedEdges = 0;
@@ -187,7 +169,7 @@ void ThreeD_SceneAppearance_TabPage::applyShadeModeToModel()
 
     drawing::ShadeMode aShadeMode = drawing::ShadeMode_PHONG;
 
-    switch( m_pCB_Shading->GetState())
+    switch( m_xCB_Shading->get_state())
     {
         case TRISTATE_FALSE:
             aShadeMode = drawing::ShadeMode_FLAT;
@@ -212,52 +194,43 @@ void ThreeD_SceneAppearance_TabPage::initControlsFromModel()
 
     if(aProps.m_aShadeMode == drawing::ShadeMode_FLAT)
     {
-        m_pCB_Shading->EnableTriState( false );
-        m_pCB_Shading->Check(false);
+        m_xCB_Shading->set_active(false);
     }
     else if(aProps.m_aShadeMode == drawing::ShadeMode_SMOOTH)
     {
-        m_pCB_Shading->EnableTriState( false );
-        m_pCB_Shading->Check();
+        m_xCB_Shading->set_active(true);
     }
     else
     {
-        m_pCB_Shading->EnableTriState();
-        m_pCB_Shading->SetState( TRISTATE_INDET );
+        m_xCB_Shading->set_state(TRISTATE_INDET);
     }
 
     if(aProps.m_nObjectLines == 0)
     {
-        m_pCB_ObjectLines->EnableTriState( false );
-        m_pCB_ObjectLines->Check(false);
+        m_xCB_ObjectLines->set_active(false);
     }
     else if(aProps.m_nObjectLines==1)
     {
-        m_pCB_ObjectLines->EnableTriState( false );
-        m_pCB_ObjectLines->Check();
+        m_xCB_ObjectLines->set_active(true);
     }
     else
     {
-        m_pCB_ObjectLines->EnableTriState();
-        m_pCB_ObjectLines->SetState( TRISTATE_INDET );
+        m_xCB_ObjectLines->set_state(TRISTATE_INDET);
     }
 
     if(aProps.m_nRoundedEdges >= 5)
     {
-        m_pCB_RoundedEdge->EnableTriState( false );
-        m_pCB_RoundedEdge->Check();
+        m_xCB_RoundedEdge->set_active(true);
     }
     else if(aProps.m_nRoundedEdges<0)
     {
-        m_pCB_RoundedEdge->EnableTriState( false );
-        m_pCB_RoundedEdge->SetState( TRISTATE_INDET );
+        m_xCB_RoundedEdge->set_state(TRISTATE_INDET);
     }
     else
     {
-        m_pCB_RoundedEdge->EnableTriState();
-        m_pCB_RoundedEdge->Check(false);
+        m_xCB_RoundedEdge->set_active(false);
     }
-    m_pCB_RoundedEdge->Enable( !m_pCB_ObjectLines->IsChecked() );
+    m_xCB_RoundedEdge->set_sensitive( !m_xCB_ObjectLines->get_active() );
 
     updateScheme();
 
@@ -269,30 +242,26 @@ void ThreeD_SceneAppearance_TabPage::updateScheme()
 {
     lcl_ModelProperties aProps( lcl_getPropertiesFromModel( m_xChartModel ));
 
-    if( m_pLB_Scheme->GetEntryCount() == (POS_3DSCHEME_CUSTOM+1) )
-    {
-        m_pLB_Scheme->RemoveEntry(POS_3DSCHEME_CUSTOM);
-        m_pLB_Scheme->SetDropDownLineCount(2);
-    }
+    if (m_xLB_Scheme->get_count() == (POS_3DSCHEME_CUSTOM+1))
+        m_xLB_Scheme->remove(POS_3DSCHEME_CUSTOM);
     switch( aProps.m_eScheme )
     {
         case ThreeDLookScheme_Simple:
-            m_pLB_Scheme->SelectEntryPos( POS_3DSCHEME_SIMPLE );
+            m_xLB_Scheme->set_active( POS_3DSCHEME_SIMPLE );
             break;
         case ThreeDLookScheme_Realistic:
-            m_pLB_Scheme->SelectEntryPos( POS_3DSCHEME_REALISTIC );
+            m_xLB_Scheme->set_active( POS_3DSCHEME_REALISTIC );
             break;
         case ThreeDLookScheme_Unknown:
             {
-                m_pLB_Scheme->InsertEntry(m_aCustom,POS_3DSCHEME_CUSTOM);
-                m_pLB_Scheme->SelectEntryPos( POS_3DSCHEME_CUSTOM );
-                m_pLB_Scheme->SetDropDownLineCount(3);
+                m_xLB_Scheme->insert_text(POS_3DSCHEME_CUSTOM, m_aCustom);
+                m_xLB_Scheme->set_active(POS_3DSCHEME_CUSTOM);
             }
             break;
     }
 }
 
-IMPL_LINK_NOARG(ThreeD_SceneAppearance_TabPage, SelectSchemeHdl, ListBox&, void)
+IMPL_LINK_NOARG(ThreeD_SceneAppearance_TabPage, SelectSchemeHdl, weld::ComboBox&, void)
 {
     if( !m_bUpdateOtherControls )
         return;
@@ -303,9 +272,9 @@ IMPL_LINK_NOARG(ThreeD_SceneAppearance_TabPage, SelectSchemeHdl, ListBox&, void)
 
         uno::Reference< chart2::XDiagram > xDiagram( ::chart::ChartModelHelper::findDiagram( m_xChartModel ) );
 
-        if( m_pLB_Scheme->GetSelectedEntryPos() == POS_3DSCHEME_REALISTIC )
+        if( m_xLB_Scheme->get_active() == POS_3DSCHEME_REALISTIC )
             ThreeDHelper::setScheme( xDiagram, ThreeDLookScheme_Realistic );
-        else if( m_pLB_Scheme->GetSelectedEntryPos() == POS_3DSCHEME_SIMPLE )
+        else if( m_xLB_Scheme->get_active() == POS_3DSCHEME_SIMPLE )
             ThreeDHelper::setScheme( xDiagram, ThreeDLookScheme_Simple );
         else
         {
@@ -317,31 +286,29 @@ IMPL_LINK_NOARG(ThreeD_SceneAppearance_TabPage, SelectSchemeHdl, ListBox&, void)
     initControlsFromModel();
 }
 
-IMPL_LINK_NOARG(ThreeD_SceneAppearance_TabPage, SelectShading, CheckBox&, void)
+IMPL_LINK_NOARG(ThreeD_SceneAppearance_TabPage, SelectShading, weld::ToggleButton&, void)
 {
     if( !m_bUpdateOtherControls )
         return;
 
-    m_pCB_Shading->EnableTriState( false );
     applyShadeModeToModel();
     updateScheme();
 }
-IMPL_LINK( ThreeD_SceneAppearance_TabPage, SelectRoundedEdgeOrObjectLines, CheckBox&, rCheckBox, void )
+
+IMPL_LINK(ThreeD_SceneAppearance_TabPage, SelectRoundedEdgeOrObjectLines, weld::ToggleButton&, rCheckBox, void)
 {
     if( !m_bUpdateOtherControls )
         return;
 
-    if( &rCheckBox == m_pCB_ObjectLines )
+    if (&rCheckBox == m_xCB_ObjectLines.get())
     {
-        m_pCB_ObjectLines->EnableTriState( false );
         m_bUpdateOtherControls = false;
-        m_pCB_RoundedEdge->Enable( !m_pCB_ObjectLines->IsChecked() );
-        if(!m_pCB_RoundedEdge->IsEnabled())
-            m_pCB_RoundedEdge->Check(false);
+        m_xCB_RoundedEdge->set_sensitive( !m_xCB_ObjectLines->get_active() );
+        if(!m_xCB_RoundedEdge->get_sensitive())
+            m_xCB_RoundedEdge->set_active(false);
         m_bUpdateOtherControls = true;
     }
-    else
-        m_pCB_RoundedEdge->EnableTriState( false );
+
     applyRoundedEdgeAndObjectLinesToModel();
     updateScheme();
 }
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
index f85d33290c67..6a00d3fb71be 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
@@ -19,9 +19,7 @@
 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_3D_SCENEAPPEARANCE_HXX
 #define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_3D_SCENEAPPEARANCE_HXX
 
-#include <vcl/tabpage.hxx>
-#include <vcl/button.hxx>
-#include <vcl/lstbox.hxx>
+#include <vcl/weld.hxx>
 
 namespace chart { class ControllerLockHelper; }
 namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } }
@@ -29,22 +27,20 @@ namespace com { namespace sun { namespace star { namespace frame { class XModel;
 namespace chart
 {
 
-class ThreeD_SceneAppearance_TabPage : public TabPage
+class ThreeD_SceneAppearance_TabPage
 {
 public:
     ThreeD_SceneAppearance_TabPage(
-        vcl::Window* pWindow,
+        weld::Container* pParent,
         const css::uno::Reference< css::frame::XModel > & xChartModel,
         ControllerLockHelper & rControllerLockHelper );
-    virtual ~ThreeD_SceneAppearance_TabPage() override;
-    virtual void dispose() override;
-
-    virtual void ActivatePage() override;
+    void ActivatePage();
+    ~ThreeD_SceneAppearance_TabPage();
 
 private:
-    DECL_LINK( SelectSchemeHdl, ListBox&, void );
-    DECL_LINK( SelectShading, CheckBox&, void );
-    DECL_LINK( SelectRoundedEdgeOrObjectLines, CheckBox&, void );
+    DECL_LINK( SelectSchemeHdl, weld::ComboBox&, void );
+    DECL_LINK( SelectShading, weld::ToggleButton&, void );
+    DECL_LINK( SelectRoundedEdgeOrObjectLines, weld::ToggleButton&, void );
 
     void initControlsFromModel();
     void applyShadeModeToModel();
@@ -52,20 +48,20 @@ private:
     void updateScheme();
 
 private:
-    css::uno::Reference< css::frame::XModel >
-        m_xChartModel;
-
-    VclPtr<ListBox>         m_pLB_Scheme;
-
-    VclPtr<CheckBox>        m_pCB_Shading;
-    VclPtr<CheckBox>        m_pCB_ObjectLines;
-    VclPtr<CheckBox>        m_pCB_RoundedEdge;
+    css::uno::Reference<css::frame::XModel> m_xChartModel;
 
     bool            m_bUpdateOtherControls;
     bool            m_bCommitToModel;
     OUString        m_aCustom;
 
-    ControllerLockHelper & m_rControllerLockHelper;
+    ControllerLockHelper& m_rControllerLockHelper;
+
+    std::unique_ptr<weld::Builder> m_xBuilder;
+    std::unique_ptr<weld::Container> m_xContainer;
+    std::unique_ptr<weld::ComboBox> m_xLB_Scheme;
+    std::unique_ptr<weld::CheckButton> m_xCB_Shading;
+    std::unique_ptr<weld::CheckButton> m_xCB_ObjectLines;
+    std::unique_ptr<weld::CheckButton> m_xCB_RoundedEdge;
 };
 
 } //namespace chart
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
index 729f9606033e..af08b2e1751c 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
@@ -26,6 +26,8 @@
 #include <com/sun/star/drawing/ProjectionMode.hpp>
 #include <tools/diagnose_ex.h>
 #include <tools/helpers.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/svapp.hxx>
 
 namespace chart
 {
@@ -35,37 +37,33 @@ using namespace ::com::sun::star;
 namespace
 {
 
-void lcl_SetMetricFieldLimits( MetricField& rField, sal_Int64 nLimit )
+void lcl_SetMetricFieldLimits(weld::MetricSpinButton& rField, sal_Int64 nLimit)
 {
-    rField.SetMin(-1*nLimit);
-    rField.SetFirst(-1*nLimit);
-    rField.SetMax(nLimit);
-    rField.SetLast(nLimit);
+    rField.set_range(-1*nLimit, nLimit, FieldUnit::DEGREE);
 }
 
 }
-ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage( vcl::Window* pWindow
-                , const uno::Reference< beans::XPropertySet > & xSceneProperties
-                , ControllerLockHelper & rControllerLockHelper )
-                : TabPage ( pWindow
-                          , "tp_3DSceneGeometry"
-                          , "modules/schart/ui/tp_3D_SceneGeometry.ui")
-                , m_xSceneProperties( xSceneProperties )
-                , m_nXRotation(0)
-                , m_nYRotation(0)
-                , m_nZRotation(0)
-                , m_bAngleChangePending( false )
-                , m_bPerspectiveChangePending( false )
-                , m_rControllerLockHelper( rControllerLockHelper )
-{
-    get(m_pCbxRightAngledAxes,"CBX_RIGHT_ANGLED_AXES");
-    get(m_pMFXRotation, "MTR_FLD_X_ROTATION");
-    get(m_pMFYRotation, "MTR_FLD_Y_ROTATION");
-    get(m_pFtZRotation, "FT_Z_ROTATION");
-    get(m_pMFZRotation, "MTR_FLD_Z_ROTATION");
-    get(m_pCbxPerspective,"CBX_PERSPECTIVE");
-    get(m_pMFPerspective, "MTR_FLD_PERSPECTIVE");
 
+ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage(weld::Container* pParent,
+        const uno::Reference< beans::XPropertySet > & xSceneProperties,
+        ControllerLockHelper & rControllerLockHelper)
+    : m_xSceneProperties( xSceneProperties )
+    , m_nXRotation(0)
+    , m_nYRotation(0)
+    , m_nZRotation(0)
+    , m_bAngleChangePending( false )
+    , m_bPerspectiveChangePending( false )
+    , m_rControllerLockHelper( rControllerLockHelper )
+    , m_xBuilder(Application::CreateBuilder(pParent, "modules/schart/ui/tp_3D_SceneGeometry.ui"))
+    , m_xContainer(m_xBuilder->weld_container("tp_3DSceneGeometry"))
+    , m_xCbxRightAngledAxes(m_xBuilder->weld_check_button("CBX_RIGHT_ANGLED_AXES"))
+    , m_xMFXRotation(m_xBuilder->weld_metric_spin_button("MTR_FLD_X_ROTATION", FieldUnit::DEGREE))
+    , m_xMFYRotation(m_xBuilder->weld_metric_spin_button("MTR_FLD_Y_ROTATION", FieldUnit::DEGREE))
+    , m_xFtZRotation(m_xBuilder->weld_label("FT_Z_ROTATION"))
+    , m_xMFZRotation(m_xBuilder->weld_metric_spin_button("MTR_FLD_Z_ROTATION", FieldUnit::DEGREE))
+    , m_xCbxPerspective(m_xBuilder->weld_check_button("CBX_PERSPECTIVE"))
+    , m_xMFPerspective(m_xBuilder->weld_metric_spin_button("MTR_FLD_PERSPECTIVE", FieldUnit::PERCENT))
+{
     double fXAngle, fYAngle, fZAngle;
     ThreeDHelper::getRotationAngleFromDiagram( m_xSceneProperties, fXAngle, fYAngle, fZAngle );
 
@@ -75,83 +73,62 @@ ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage( vcl::Window* pWindow
 
     OSL_ENSURE( fZAngle>=-90 && fZAngle<=90, "z angle is out of valid range" );
 
-    lcl_SetMetricFieldLimits( *m_pMFZRotation, 90 );
+    lcl_SetMetricFieldLimits( *m_xMFZRotation, 90 );
 
     m_nXRotation = NormAngle180(
-        ::basegfx::fround(fXAngle * pow(10.0, m_pMFXRotation->GetDecimalDigits())));
+        ::basegfx::fround(fXAngle * pow(10.0, m_xMFXRotation->get_digits())));
     m_nYRotation = NormAngle180(
-        ::basegfx::fround(-1.0 * fYAngle * pow(10.0, m_pMFYRotation->GetDecimalDigits())));
+        ::basegfx::fround(-1.0 * fYAngle * pow(10.0, m_xMFYRotation->get_digits())));
     m_nZRotation = NormAngle180(
-        ::basegfx::fround(-1.0 * fZAngle * pow(10.0, m_pMFZRotation->GetDecimalDigits())));
-
-    m_pMFXRotation->SetValue(m_nXRotation);
-    m_pMFYRotation->SetValue(m_nYRotation);
-    m_pMFZRotation->SetValue(m_nZRotation);
+        ::basegfx::fround(-1.0 * fZAngle * pow(10.0, m_xMFZRotation->get_digits())));
 
-    const sal_uLong nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT;
-    Link<Edit&,void> aAngleChangedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleChanged ));
-    Link<Edit&,void> aAngleEditedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleEdited ));
+    m_xMFXRotation->set_value(m_nXRotation, FieldUnit::DEGREE);
+    m_xMFYRotation->set_value(m_nYRotation, FieldUnit::DEGREE);
+    m_xMFZRotation->set_value(m_nZRotation, FieldUnit::DEGREE);
 
-    m_pMFXRotation->EnableUpdateData( nTimeout );
-    m_pMFXRotation->SetUpdateDataHdl( aAngleChangedLink );
-    m_pMFXRotation->SetModifyHdl( aAngleEditedLink );
+    const int nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT;
+    m_aAngleTimer.SetTimeout(nTimeout);
+    m_aAngleTimer.SetInvokeHandler( LINK( this, ThreeD_SceneGeometry_TabPage, AngleChanged ) );
 
-    m_pMFYRotation->EnableUpdateData( nTimeout );
-    m_pMFYRotation->SetUpdateDataHdl( aAngleChangedLink );
-    m_pMFYRotation->SetModifyHdl( aAngleEditedLink );
-
-    m_pMFZRotation->EnableUpdateData( nTimeout );
-    m_pMFZRotation->SetUpdateDataHdl( aAngleChangedLink );
-    m_pMFZRotation->SetModifyHdl( aAngleEditedLink );
+    Link<weld::MetricSpinButton&,void> aAngleEditedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleEdited ));
+    m_xMFXRotation->connect_value_changed( aAngleEditedLink );
+    m_xMFYRotation->connect_value_changed( aAngleEditedLink );
+    m_xMFZRotation->connect_value_changed( aAngleEditedLink );
 
     drawing::ProjectionMode aProjectionMode = drawing::ProjectionMode_PERSPECTIVE;
     m_xSceneProperties->getPropertyValue( "D3DScenePerspective" ) >>= aProjectionMode;
-    m_pCbxPerspective->Check( aProjectionMode == drawing::ProjectionMode_PERSPECTIVE );
-    m_pCbxPerspective->SetToggleHdl( LINK( this, ThreeD_SceneGeometry_TabPage, PerspectiveToggled ));
+    m_xCbxPerspective->set_active( aProjectionMode == drawing::ProjectionMode_PERSPECTIVE );
+    m_xCbxPerspective->connect_toggled( LINK( this, ThreeD_SceneGeometry_TabPage, PerspectiveToggled ));
 
     sal_Int32 nPerspectivePercentage = 20;
     m_xSceneProperties->getPropertyValue( "Perspective" ) >>= nPerspectivePercentage;
-    m_pMFPerspective->SetValue( nPerspectivePercentage );
+    m_xMFPerspective->set_value(nPerspectivePercentage, FieldUnit::PERCENT);
 
-    m_pMFPerspective->EnableUpdateData( nTimeout );
-    m_pMFPerspective->SetUpdateDataHdl( LINK( this, ThreeD_SceneGeometry_TabPage, PerspectiveChanged ) );
-    m_pMFPerspective->SetModifyHdl( LINK( this, ThreeD_SceneGeometry_TabPage, PerspectiveEdited ) );
-    m_pMFPerspective->Enable( m_pCbxPerspective->IsChecked() );
+    m_aPerspectiveTimer.SetTimeout(nTimeout);
+    m_aPerspectiveTimer.SetInvokeHandler( LINK( this, ThreeD_SceneGeometry_TabPage, PerspectiveChanged ) );
+    m_xMFPerspective->connect_value_changed( LINK( this, ThreeD_SceneGeometry_TabPage, PerspectiveEdited ) );
+    m_xMFPerspective->set_sensitive( m_xCbxPerspective->get_active() );
 
     //RightAngledAxes
     uno::Reference< chart2::XDiagram > xDiagram( m_xSceneProperties, uno::UNO_QUERY );
-    if( ChartTypeHelper::isSupportingRightAngledAxes(
-            DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ) )
+    if (ChartTypeHelper::isSupportingRightAngledAxes(DiagramHelper::getChartTypeByIndex(xDiagram, 0)))
     {
         bool bRightAngledAxes = false;
         m_xSceneProperties->getPropertyValue( "RightAngledAxes" ) >>= bRightAngledAxes;
-        m_pCbxRightAngledAxes->SetToggleHdl( LINK( this, ThreeD_SceneGeometry_TabPage, RightAngledAxesToggled ));
-        m_pCbxRightAngledAxes->Check( bRightAngledAxes );
+        m_xCbxRightAngledAxes->connect_toggled( LINK( this, ThreeD_SceneGeometry_TabPage, RightAngledAxesToggled ));
+        m_xCbxRightAngledAxes->set_active( bRightAngledAxes );
+        RightAngledAxesToggled(*m_xCbxRightAngledAxes);
     }
     else
     {
-        m_pCbxRightAngledAxes->Enable(false);
+        m_xCbxRightAngledAxes->set_sensitive(false);
     }
 }
 
 ThreeD_SceneGeometry_TabPage::~ThreeD_SceneGeometry_TabPage()
 {
-    disposeOnce();
 }
 
-void ThreeD_SceneGeometry_TabPage::dispose()
-{
-    m_pCbxRightAngledAxes.clear();
-    m_pMFXRotation.clear();
-    m_pMFYRotation.clear();
-    m_pFtZRotation.clear();
-    m_pMFZRotation.clear();
-    m_pCbxPerspective.clear();
-    m_pMFPerspective.clear();
-    TabPage::dispose();
-}
-
-
 void ThreeD_SceneGeometry_TabPage::commitPendingChanges()
 {
     ControllerLockHelperGuard aGuard( m_rControllerLockHelper );
@@ -168,12 +145,12 @@ void ThreeD_SceneGeometry_TabPage::applyAnglesToModel()
 
     double fXAngle = 0.0, fYAngle = 0.0, fZAngle = 0.0;
 
-    if( !m_pMFZRotation->IsEmptyFieldValue() )
-        m_nZRotation = m_pMFZRotation->GetValue();
+    if (m_xMFZRotation->get_sensitive())
+        m_nZRotation = m_xMFZRotation->get_value(FieldUnit::DEGREE);
 
-    fXAngle = double(m_nXRotation)/pow(10.0,m_pMFXRotation->GetDecimalDigits());
-    fYAngle = double(-1.0*m_nYRotation)/pow(10.0,m_pMFYRotation->GetDecimalDigits());
-    fZAngle = double(-1.0*m_nZRotation)/pow(10.0,m_pMFZRotation->GetDecimalDigits());
+    fXAngle = double(m_nXRotation)/pow(10.0,m_xMFXRotation->get_digits());
+    fYAngle = double(-1.0*m_nYRotation)/pow(10.0,m_xMFYRotation->get_digits());
+    fZAngle = double(-1.0*m_nZRotation)/pow(10.0,m_xMFZRotation->get_digits());
 
     fXAngle = basegfx::deg2rad(fXAngle);
     fYAngle = basegfx::deg2rad(fYAngle);
@@ -182,17 +159,20 @@ void ThreeD_SceneGeometry_TabPage::applyAnglesToModel()
     ThreeDHelper::setRotationAngleToDiagram( m_xSceneProperties, fXAngle, fYAngle, fZAngle );
 
     m_bAngleChangePending = false;
+    m_aAngleTimer.Stop();
 }
 
-IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, AngleEdited, Edit&, void)
+IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, AngleEdited, weld::MetricSpinButton&, void)
 {
-    m_nXRotation = m_pMFXRotation->GetValue();
-    m_nYRotation = m_pMFYRotation->GetValue();
+    m_nXRotation = m_xMFXRotation->get_value(FieldUnit::DEGREE);
+    m_nYRotation = m_xMFYRotation->get_value(FieldUnit::DEGREE);
 
     m_bAngleChangePending = true;
+
+    m_aAngleTimer.Start();
 }
 
-IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, AngleChanged, Edit&, void)
+IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, AngleChanged, Timer *, void)
 {
     applyAnglesToModel();
 }
@@ -201,14 +181,14 @@ void ThreeD_SceneGeometry_TabPage::applyPerspectiveToModel()
 {
     ControllerLockHelperGuard aGuard( m_rControllerLockHelper );
 
-    drawing::ProjectionMode aMode = m_pCbxPerspective->IsChecked()
+    drawing::ProjectionMode aMode = m_xCbxPerspective->get_active()
         ? drawing::ProjectionMode_PERSPECTIVE
         : drawing::ProjectionMode_PARALLEL;
 
     try
     {
         m_xSceneProperties->setPropertyValue( "D3DScenePerspective" , uno::Any( aMode ));
-        m_xSceneProperties->setPropertyValue( "Perspective" , uno::Any( static_cast<sal_Int32>(m_pMFPerspective->GetValue()) ));
+        m_xSceneProperties->setPropertyValue( "Perspective" , uno::Any( static_cast<sal_Int32>(m_xMFPerspective->get_value(FieldUnit::PERCENT)) ));
     }
     catch( const uno::Exception & )
     {
@@ -216,56 +196,57 @@ void ThreeD_SceneGeometry_TabPage::applyPerspectiveToModel()
     }
 
     m_bPerspectiveChangePending = false;
+    m_aPerspectiveTimer.Stop();
 }
 
-IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, PerspectiveEdited, Edit&, void)
+IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, PerspectiveEdited, weld::MetricSpinButton&, void)
 {
     m_bPerspectiveChangePending = true;
+    m_aPerspectiveTimer.Start();
 }
 
-IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, PerspectiveChanged, Edit&, void)
+IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, PerspectiveChanged, Timer *, void)
 {
     applyPerspectiveToModel();
 }
 
-IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, PerspectiveToggled, CheckBox&, void)
+IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, PerspectiveToggled, weld::ToggleButton&, void)
 {
-    m_pMFPerspective->Enable( m_pCbxPerspective->IsChecked() );
+    m_xMFPerspective->set_sensitive(m_xCbxPerspective->get_active());
     applyPerspectiveToModel();
 }
 
-IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, RightAngledAxesToggled, CheckBox&, void)
+IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, RightAngledAxesToggled, weld::ToggleButton&, void)
 {
     ControllerLockHelperGuard aGuard( m_rControllerLockHelper );
 
-    bool bEnableZ = !m_pCbxRightAngledAxes->IsChecked();
-    m_pFtZRotation->Enable( bEnableZ );
-    m_pMFZRotation->Enable( bEnableZ );
-    m_pMFZRotation->EnableEmptyFieldValue( !bEnableZ );
-    if( !bEnableZ )
+    bool bEnableZ = !m_xCbxRightAngledAxes->get_active();
+    m_xFtZRotation->set_sensitive( bEnableZ );
+    m_xMFZRotation->set_sensitive( bEnableZ );
+    if (!bEnableZ)
     {
-        m_nXRotation = m_pMFXRotation->GetValue();
-        m_nYRotation = m_pMFYRotation->GetValue();
-        m_nZRotation = m_pMFZRotation->GetValue();
+        m_nXRotation = m_xMFXRotation->get_value(FieldUnit::DEGREE);
+        m_nYRotation = m_xMFYRotation->get_value(FieldUnit::DEGREE);
+        m_nZRotation = m_xMFZRotation->get_value(FieldUnit::DEGREE);
 
-        m_pMFXRotation->SetValue(static_cast<sal_Int64>(ThreeDHelper::getValueClippedToRange(static_cast<double>(m_nXRotation), ThreeDHelper::getXDegreeAngleLimitForRightAngledAxes())));
-        m_pMFYRotation->SetValue(static_cast<sal_Int64>(ThreeDHelper::getValueClippedToRange(static_cast<double>(m_nYRotation), ThreeDHelper::getYDegreeAngleLimitForRightAngledAxes())));
-        m_pMFZRotation->SetEmptyFieldValue();
+        m_xMFXRotation->set_value(static_cast<sal_Int64>(ThreeDHelper::getValueClippedToRange(static_cast<double>(m_nXRotation), ThreeDHelper::getXDegreeAngleLimitForRightAngledAxes())), FieldUnit::DEGREE);
+        m_xMFYRotation->set_value(static_cast<sal_Int64>(ThreeDHelper::getValueClippedToRange(static_cast<double>(m_nYRotation), ThreeDHelper::getYDegreeAngleLimitForRightAngledAxes())), FieldUnit::DEGREE);
+        m_xMFZRotation->set_text("");
 
-        lcl_SetMetricFieldLimits( *m_pMFXRotation, static_cast<sal_Int64>(ThreeDHelper::getXDegreeAngleLimitForRightAngledAxes()));
-        lcl_SetMetricFieldLimits( *m_pMFYRotation, static_cast<sal_Int64>(ThreeDHelper::getYDegreeAngleLimitForRightAngledAxes()));
+        lcl_SetMetricFieldLimits( *m_xMFXRotation, static_cast<sal_Int64>(ThreeDHelper::getXDegreeAngleLimitForRightAngledAxes()));
+        lcl_SetMetricFieldLimits( *m_xMFYRotation, static_cast<sal_Int64>(ThreeDHelper::getYDegreeAngleLimitForRightAngledAxes()));
     }
     else
     {
-        lcl_SetMetricFieldLimits( *m_pMFXRotation, 180 );
-        lcl_SetMetricFieldLimits( *m_pMFYRotation, 180 );
+        lcl_SetMetricFieldLimits( *m_xMFXRotation, 180 );
+        lcl_SetMetricFieldLimits( *m_xMFYRotation, 180 );
 
-        m_pMFXRotation->SetValue(m_nXRotation);
-        m_pMFYRotation->SetValue(m_nYRotation);
-        m_pMFZRotation->SetValue(m_nZRotation);
+        m_xMFXRotation->set_value(m_nXRotation, FieldUnit::DEGREE);
+        m_xMFYRotation->set_value(m_nYRotation, FieldUnit::DEGREE);
+        m_xMFZRotation->set_value(m_nZRotation, FieldUnit::DEGREE);
     }
 
-    ThreeDHelper::switchRightAngledAxes( m_xSceneProperties, m_pCbxRightAngledAxes->IsChecked() );
+    ThreeDHelper::switchRightAngledAxes( m_xSceneProperties, m_xCbxRightAngledAxes->get_active() );
 }
 
 } //namespace chart
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx
index 5ce39c0c18ca..22c5651d8995 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx
@@ -19,10 +19,8 @@
 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_3D_SCENEGEOMETRY_HXX
 #define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_3D_SCENEGEOMETRY_HXX
 
-#include <vcl/tabpage.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/button.hxx>
+#include <vcl/timer.hxx>
+#include <vcl/weld.hxx>
 
 namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } }
 namespace chart { class ControllerLockHelper; }
@@ -30,29 +28,28 @@ namespace chart { class ControllerLockHelper; }
 namespace chart
 {
 
-class ThreeD_SceneGeometry_TabPage : public TabPage
+class ThreeD_SceneGeometry_TabPage
 {
 public:
-    ThreeD_SceneGeometry_TabPage( vcl::Window* pWindow,
-                                  const css::uno::Reference< css::beans::XPropertySet > & xSceneProperties,
-                                  ControllerLockHelper & rControllerLockHelper );
-    virtual ~ThreeD_SceneGeometry_TabPage() override;
-    virtual void dispose() override;
+    ThreeD_SceneGeometry_TabPage(weld::Container* pWindow,
+                                 const css::uno::Reference< css::beans::XPropertySet > & xSceneProperties,
+                                 ControllerLockHelper & rControllerLockHelper);
+    ~ThreeD_SceneGeometry_TabPage();
 
     // has to be called in case the dialog was closed with OK
     void commitPendingChanges();
 
     // is called by timer to apply changes to model
-    DECL_LINK( AngleChanged, Edit&, void );
+    DECL_LINK( AngleChanged, Timer *, void);
     // is called immediately when a field changes
-    DECL_LINK( AngleEdited, Edit&, void );
+    DECL_LINK( AngleEdited, weld::MetricSpinButton&, void );
 
     // is called by timer to apply changes to model
-    DECL_LINK( PerspectiveChanged, Edit&, void );
+    DECL_LINK( PerspectiveChanged, Timer *, void);
     // is called immediately when a field changes
-    DECL_LINK( PerspectiveEdited, Edit&, void );
-    DECL_LINK( PerspectiveToggled, CheckBox&, void );
-    DECL_LINK( RightAngledAxesToggled, CheckBox&, void );
+    DECL_LINK( PerspectiveEdited, weld::MetricSpinButton&, void );
+    DECL_LINK( PerspectiveToggled, weld::ToggleButton&, void );
+    DECL_LINK( RightAngledAxesToggled, weld::ToggleButton&, void );
 
 private:
     void applyAnglesToModel();
@@ -60,17 +57,8 @@ private:
 
     css::uno::Reference< css::beans::XPropertySet > m_xSceneProperties;
 
-    VclPtr<CheckBox>        m_pCbxRightAngledAxes;
-
-    VclPtr<MetricField>     m_pMFXRotation;
-
-    VclPtr<MetricField>     m_pMFYRotation;
-
-    VclPtr<FixedText>       m_pFtZRotation;
-    VclPtr<MetricField>     m_pMFZRotation;
-
-    VclPtr<CheckBox>        m_pCbxPerspective;
-    VclPtr<MetricField>     m_pMFPerspective;
+    Timer           m_aAngleTimer;
+    Timer           m_aPerspectiveTimer;
 
     //to keep old values when switching to right angled axes
     sal_Int64       m_nXRotation;
@@ -81,6 +69,16 @@ private:
     bool            m_bPerspectiveChangePending;
 
     ControllerLockHelper & m_rControllerLockHelper;
+
+    std::unique_ptr<weld::Builder> m_xBuilder;
+    std::unique_ptr<weld::Container> m_xContainer;
+    std::unique_ptr<weld::CheckButton> m_xCbxRightAngledAxes;
+    std::unique_ptr<weld::MetricSpinButton> m_xMFXRotation;
+    std::unique_ptr<weld::MetricSpinButton> m_xMFYRotation;
+    std::unique_ptr<weld::Label> m_xFtZRotation;
+    std::unique_ptr<weld::MetricSpinButton> m_xMFZRotation;
+    std::unique_ptr<weld::CheckButton> m_xCbxPerspective;
+    std::unique_ptr<weld::MetricSpinButton> m_xMFPerspective;
 };
 
 } //namespace chart
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 78b203321c80..b52cbfb0d774 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -28,7 +28,7 @@
 #include <svtools/colrdlg.hxx>
 #include <svx/svx3ditems.hxx>
 #include <svx/svddef.hxx>
-#include <vcl/builderfactory.hxx>
+#include <vcl/svapp.hxx>
 #include <tools/diagnose_ex.h>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
@@ -39,28 +39,22 @@ namespace chart
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::chart2;
 
-LightButton::LightButton( vcl::Window* pParent)
-            : ImageButton( pParent)
-            , m_bLightOn(false)
+LightButton::LightButton(std::unique_ptr<weld::ToggleButton> xButton)
+    : m_xButton(std::move(xButton))
+    , m_bLightOn(false)
 {
-    SetModeImage(Image(StockImage::Yes, RID_SVXBMP_LAMP_OFF));
+    m_xButton->set_from_icon_name(RID_SVXBMP_LAMP_OFF);
 }
 
-VCL_BUILDER_FACTORY(LightButton)
-
 void LightButton::switchLightOn(bool bOn)
 {
-    if( m_bLightOn==bOn )
+    if (m_bLightOn == bOn)
         return;
     m_bLightOn = bOn;
-    if(m_bLightOn)
-    {
-        SetModeImage(Image(StockImage::Yes, RID_SVXBMP_LAMP_ON));
-    }
+    if (m_bLightOn)
+        m_xButton->set_from_icon_name(RID_SVXBMP_LAMP_ON);
     else
-    {
-        SetModeImage(Image(StockImage::Yes, RID_SVXBMP_LAMP_OFF));
-    }
+        m_xButton->set_from_icon_name(RID_SVXBMP_LAMP_OFF);
 }
 
 struct LightSource
@@ -78,8 +72,9 @@ struct LightSource
 
 struct LightSourceInfo
 {
-    VclPtr<LightButton> pButton;
-    LightSource  aLightSource;
+    LightButton* pButton;
+    bool bButtonActive;
+    LightSource aLightSource;
 
     LightSourceInfo();
     void initButtonFromSource();
@@ -87,6 +82,7 @@ struct LightSourceInfo
 
 LightSourceInfo::LightSourceInfo()
     : pButton(nullptr)
+    , bButtonActive(false)
     , aLightSource()
 {
     aLightSource.nDiffuseColor = Color(0xffffff); // white
@@ -96,11 +92,9 @@ LightSourceInfo::LightSourceInfo()
 
 void LightSourceInfo::initButtonFromSource()
 {
-    if(!pButton)
+    if (!pButton)
         return;
-    pButton->SetModeImage(Image(StockImage::Yes,
-        aLightSource.bIsEnabled ? OUString(RID_SVXBMP_LAMP_ON) : OUString(RID_SVXBMP_LAMP_OFF)
-    ) );
+    pButton->switchLightOn(aLightSource.bIsEnabled);
 }
 
 namespace
@@ -118,7 +112,7 @@ namespace
         return aStr;
     }
 
-    void lcl_selectColor(SvxColorListBox& rListBox, const Color& rColor)
+    void lcl_selectColor(ColorListBox& rListBox, const Color& rColor)
     {
         rListBox.SetNoSelection();
         rListBox.SelectEntry(std::make_pair(rColor, lcl_makeColorName(rColor)));
@@ -203,88 +197,71 @@ namespace
     }
 }
 
-ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( vcl::Window* pWindow
-                , const uno::Reference< beans::XPropertySet > & xSceneProperties
-                , const uno::Reference< frame::XModel >& xChartModel )
-                : TabPage ( pWindow
-                          ,"tp_3D_SceneIllumination"
-                          ,"modules/schart/ui/tp_3D_SceneIllumination.ui")
-                , m_xSceneProperties( xSceneProperties )
-                , m_aTimerTriggeredControllerLock( xChartModel )
-                , m_bInCommitToModel( false )
-                , m_xChartModel( xChartModel )
+ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage(weld::Container* pParent,
+    weld::Window* pTopLevel,
+    const uno::Reference< beans::XPropertySet > & xSceneProperties,
+    const uno::Reference< frame::XModel >& xChartModel)
+    : m_xSceneProperties( xSceneProperties )
+    , m_aTimerTriggeredControllerLock( xChartModel )
+    , m_bInCommitToModel( false )
+    , m_xChartModel( xChartModel )
+    , m_pTopLevel(pTopLevel)
+    , m_xBuilder(Application::CreateBuilder(pParent, "modules/schart/ui/tp_3D_SceneIllumination.ui"))
+    , m_xContainer(m_xBuilder->weld_container("tp_3D_SceneIllumination"))
+    , m_xBtn_Light1(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_1")))
+    , m_xBtn_Light2(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_2")))
+    , m_xBtn_Light3(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_3")))
+    , m_xBtn_Light4(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_4")))
+    , m_xBtn_Light5(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_5")))
+    , m_xBtn_Light6(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_6")))
+    , m_xBtn_Light7(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_7")))
+    , m_xBtn_Light8(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_8")))
+    , m_xLB_LightSource(new ColorListBox(m_xBuilder->weld_menu_button("LB_LIGHTSOURCE"), pTopLevel))
+    , m_xBtn_LightSource_Color(m_xBuilder->weld_button("BTN_LIGHTSOURCE_COLOR"))
+    , m_xLB_AmbientLight(new ColorListBox(m_xBuilder->weld_menu_button("LB_AMBIENTLIGHT"), pTopLevel))
+    , m_xBtn_AmbientLight_Color(m_xBuilder->weld_button("BTN_AMBIENT_COLOR"))
+    , m_xHoriScale(m_xBuilder->weld_scale("hori"))
+    , m_xVertScale(m_xBuilder->weld_scale("vert"))
+    , m_xBtn_Corner(m_xBuilder->weld_button("corner"))
+    , m_xPreview(new LightControl3D)
+    , m_xPreviewWnd(new weld::CustomWeld(*m_xBuilder, "CTL_LIGHT_PREVIEW", *m_xPreview))
+    , m_xCtl_Preview(new LightCtl3D(*m_xPreview, *m_xHoriScale, *m_xVertScale, *m_xBtn_Corner))
 {
-    get(m_pBtn_Light1, "BTN_LIGHT_1");
-    get(m_pBtn_Light2, "BTN_LIGHT_2");
-    get(m_pBtn_Light3, "BTN_LIGHT_3");
-    get(m_pBtn_Light4, "BTN_LIGHT_4");
-    get(m_pBtn_Light5, "BTN_LIGHT_5");
-    get(m_pBtn_Light6, "BTN_LIGHT_6");
-    get(m_pBtn_Light7, "BTN_LIGHT_7");
-    get(m_pBtn_Light8, "BTN_LIGHT_8");
-
-    get(m_pLB_LightSource, "LB_LIGHTSOURCE");
-    get(m_pLB_AmbientLight, "LB_AMBIENTLIGHT");
-    get(m_pBtn_LightSource_Color, "BTN_LIGHTSOURCE_COLOR");
-    get(m_pBtn_AmbientLight_Color, "BTN_AMBIENT_COLOR");
-
-    get(m_pCtl_Preview, "CTL_LIGHT_PREVIEW");
-
     m_pLightSourceInfoList.reset(new LightSourceInfo[8]);
-    m_pLightSourceInfoList[0].pButton = m_pBtn_Light1;
-    m_pLightSourceInfoList[1].pButton = m_pBtn_Light2;
-    m_pLightSourceInfoList[2].pButton = m_pBtn_Light3;
-    m_pLightSourceInfoList[3].pButton = m_pBtn_Light4;
-    m_pLightSourceInfoList[4].pButton = m_pBtn_Light5;
-    m_pLightSourceInfoList[5].pButton = m_pBtn_Light6;
-    m_pLightSourceInfoList[6].pButton = m_pBtn_Light7;
-    m_pLightSourceInfoList[7].pButton = m_pBtn_Light8;
+    m_pLightSourceInfoList[0].pButton = m_xBtn_Light1.get();
+    m_pLightSourceInfoList[1].pButton = m_xBtn_Light2.get();
+    m_pLightSourceInfoList[2].pButton = m_xBtn_Light3.get();
+    m_pLightSourceInfoList[3].pButton = m_xBtn_Light4.get();
+    m_pLightSourceInfoList[4].pButton = m_xBtn_Light5.get();
+    m_pLightSourceInfoList[5].pButton = m_xBtn_Light6.get();
+    m_pLightSourceInfoList[6].pButton = m_xBtn_Light7.get();
+    m_pLightSourceInfoList[7].pButton = m_xBtn_Light8.get();
 
     fillControlsFromModel(nullptr);
 
-    m_pBtn_Light1->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
-    m_pBtn_Light2->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
-    m_pBtn_Light3->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
-    m_pBtn_Light4->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
-    m_pBtn_Light5->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
-    m_pBtn_Light6->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
-    m_pBtn_Light7->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
-    m_pBtn_Light8->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+    m_xBtn_Light1->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+    m_xBtn_Light2->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+    m_xBtn_Light3->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+    m_xBtn_Light4->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+    m_xBtn_Light5->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+    m_xBtn_Light6->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+    m_xBtn_Light7->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+    m_xBtn_Light8->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
 
-    m_pLB_AmbientLight->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) );
-    m_pLB_LightSource->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) );
+    m_xLB_AmbientLight->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) );
+    m_xLB_LightSource->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) );
 
-    m_pBtn_AmbientLight_Color->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) );
-    m_pBtn_LightSource_Color->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) );
+    m_xBtn_AmbientLight_Color->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) );
+    m_xBtn_LightSource_Color->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) );
 
-    m_pCtl_Preview->SetUserInteractiveChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewChangeHdl ) );
-    m_pCtl_Preview->SetUserSelectionChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewSelectHdl ) );
+    m_xCtl_Preview->SetUserInteractiveChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewChangeHdl ) );
+    m_xCtl_Preview->SetUserSelectionChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewSelectHdl ) );
 
-    ClickLightSourceButtonHdl(m_pBtn_Light2);
+    ClickLightSourceButtonHdl(*m_xBtn_Light2->get_widget());
 }
 
 ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage()
 {
-    disposeOnce();
-}
-
-void ThreeD_SceneIllumination_TabPage::dispose()
-{
-    m_pLightSourceInfoList.reset();
-    m_pBtn_Light1.clear();
-    m_pBtn_Light2.clear();
-    m_pBtn_Light3.clear();
-    m_pBtn_Light4.clear();
-    m_pBtn_Light5.clear();
-    m_pBtn_Light6.clear();
-    m_pBtn_Light7.clear();
-    m_pBtn_Light8.clear();
-    m_pLB_LightSource.clear();
-    m_pBtn_LightSource_Color.clear();
-    m_pLB_AmbientLight.clear();
-    m_pBtn_AmbientLight_Color.clear();
-    m_pCtl_Preview.clear();
-    TabPage::dispose();
 }
 
 IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel, void*, void)
@@ -298,7 +275,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel, void*,
     for( nL=0; nL<8; nL++)
         m_pLightSourceInfoList[nL].initButtonFromSource();
 
-    lcl_selectColor( *m_pLB_AmbientLight, lcl_getAmbientColor( m_xSceneProperties ));
+    lcl_selectColor( *m_xLB_AmbientLight, lcl_getAmbientColor( m_xSceneProperties ));
 
     updatePreview();
 }
@@ -321,12 +298,12 @@ void ThreeD_SceneIllumination_TabPage::applyLightSourcesToModel()
     m_aTimerTriggeredControllerLock.startTimer();
 }
 
-IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewChangeHdl, SvxLightCtl3D*, void)
+IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewChangeHdl, LightCtl3D*, void)
 {
     m_aTimerTriggeredControllerLock.startTimer();
 
     //update m_pLightSourceInfoList from preview
-    const SfxItemSet a3DLightAttributes(m_pCtl_Preview->GetSvx3DLightControl().Get3DAttributes());
+    const SfxItemSet a3DLightAttributes(m_xCtl_Preview->GetSvx3DLightControl().Get3DAttributes());
     LightSourceInfo* pInfo = &m_pLightSourceInfoList[0];
 
     pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1).GetValue();
@@ -371,27 +348,27 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewChangeHdl, SvxLightCtl3
     applyLightSourcesToModel();
 }
 
-IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewSelectHdl, SvxLightCtl3D*, void)
+IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewSelectHdl, LightCtl3D*, void)
 {
-    sal_uInt32 nLightNumber = m_pCtl_Preview->GetSvx3DLightControl().GetSelectedLight();
+    sal_uInt32 nLightNumber = m_xCtl_Preview->GetSvx3DLightControl().GetSelectedLight();
     if(nLightNumber<8)
     {
         LightButton* pButton = m_pLightSourceInfoList[nLightNumber].pButton;
-        if(!pButton->IsChecked())
-            ClickLightSourceButtonHdl(pButton);
+        if(!pButton->get_active())
+            ClickLightSourceButtonHdl(*pButton->get_widget());
 
         applyLightSourcesToModel();
     }
 }
 
-IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton, void )
+IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, weld::Button&, rButton, void )
 {
-    bool bIsAmbientLight = (pButton==m_pBtn_AmbientLight_Color);
-    SvxColorListBox* pListBox = bIsAmbientLight ? m_pLB_AmbientLight.get() : m_pLB_LightSource.get();
+    bool bIsAmbientLight = (&rButton == m_xBtn_AmbientLight_Color.get());
+    ColorListBox* pListBox = bIsAmbientLight ? m_xLB_AmbientLight.get() : m_xLB_LightSource.get();
 
     SvColorDialog aColorDlg;
     aColorDlg.SetColor( pListBox->GetSelectEntryColor() );
-    if( aColorDlg.Execute(GetFrameWeld()) == RET_OK )
+    if( aColorDlg.Execute(m_pTopLevel) == RET_OK )
     {
         Color aColor( aColorDlg.GetColor());
         lcl_selectColor( *pListBox, aColor );
@@ -409,7 +386,7 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton, v
             for( nL=0; nL<8; nL++)
             {
                 pInfo = &m_pLightSourceInfoList[nL];
-                if(pInfo->pButton->IsChecked())
+                if(pInfo->pButton->get_active())
                     break;
                 pInfo = nullptr;
             }
@@ -420,16 +397,16 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton, v
     }
 }
 
-IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, SvxColorListBox&, rBox, void )
+IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, ColorListBox&, rBox, void )
 {
-    SvxColorListBox* pListBox = &rBox;
-    if(pListBox==m_pLB_AmbientLight)
+    ColorListBox* pListBox = &rBox;
+    if (pListBox == m_xLB_AmbientLight.get())
     {
         m_bInCommitToModel = true;
         lcl_setAmbientColor( m_xSceneProperties, pListBox->GetSelectEntryColor());
         m_bInCommitToModel = false;
     }
-    else if(pListBox==m_pLB_LightSource)
+    else if (pListBox == m_xLB_LightSource.get())
     {
         //get active lightsource:
         LightSourceInfo* pInfo = nullptr;
@@ -437,7 +414,7 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, SvxColorListBox&, r
         for( nL=0; nL<8; nL++)
         {
             pInfo = &m_pLightSourceInfoList[nL];
-            if(pInfo->pButton->IsChecked())
+            if (pInfo->pButton->get_active())
                 break;
             pInfo = nullptr;
         }
@@ -450,59 +427,64 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, SvxColorListBox&, r
     updatePreview();
 }
 
-IMPL_LINK( ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, Button*, pBtn, void )
+IMPL_LINK(ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, weld::Button&, rBtn, void)
 {
-    LightButton* pButton = static_cast<LightButton*>(pBtn);
-    if( !pButton )
-        return;
-
+    LightButton* pButton = nullptr;
     LightSourceInfo* pInfo = nullptr;
     sal_Int32 nL=0;
     for( nL=0; nL<8; nL++)
     {
-        if( m_pLightSourceInfoList[nL].pButton == pButton )
+        if (m_pLightSourceInfoList[nL].pButton->get_widget() == &rBtn)
         {
+            pButton = m_pLightSourceInfoList[nL].pButton;
             pInfo = &m_pLightSourceInfoList[nL];
             break;
         }
     }
 
-    //update light button
-    bool bIsChecked = pButton->IsChecked();
-    if(bIsChecked)
+    bool bIsChecked = pInfo->bButtonActive;
+
+    ControllerLockGuardUNO aGuard( m_xChartModel );
+    for( nL=0; nL<8; nL++)
     {
-        pButton->switchLightOn(!pButton->isLightOn());
-        if(pInfo)
+        LightButton* pLightButton = m_pLightSourceInfoList[nL].pButton;
+        if (pLightButton == pButton)
         {
-            pInfo->aLightSource.bIsEnabled=pButton->isLightOn();
-            applyLightSourceToModel( nL );
+            pLightButton->set_active(true);
+            if (!pLightButton->get_widget()->has_focus())
+                pLightButton->get_widget()->grab_focus();
+            m_pLightSourceInfoList[nL].bButtonActive = true;
         }
-    }
-    else
-    {
-        ControllerLockGuardUNO aGuard( m_xChartModel );
-        for( nL=0; nL<8; nL++)
+        else
         {
-            LightButton* pLightButton = m_pLightSourceInfoList[nL].pButton;
-            pLightButton->Check( pLightButton == pButton );
+            pLightButton->set_active(false);
+            m_pLightSourceInfoList[nL].bButtonActive = false;
         }
     }
 
+    //update light button
+    if (bIsChecked)
+    {
+        pButton->switchLightOn(!pButton->isLightOn());
+        pInfo->aLightSource.bIsEnabled=pButton->isLightOn();
+        applyLightSourceToModel( nL );
+    }
+
     //update color list box
     if(pInfo)
     {
-        lcl_selectColor( *m_pLB_LightSource, pInfo->aLightSource.nDiffuseColor );
+        lcl_selectColor( *m_xLB_LightSource, pInfo->aLightSource.nDiffuseColor );
     }
     updatePreview();
 }
 
 void ThreeD_SceneIllumination_TabPage::updatePreview()
 {
-    SfxItemSet aItemSet(m_pCtl_Preview->GetSvx3DLightControl().Get3DAttributes());
+    SfxItemSet aItemSet(m_xCtl_Preview->GetSvx3DLightControl().Get3DAttributes());
     LightSourceInfo* pInfo = &m_pLightSourceInfoList[0];
 
     // AmbientColor
-    aItemSet.Put(makeSvx3DAmbientcolorItem(m_pLB_AmbientLight->GetSelectEntryColor()));
+    aItemSet.Put(makeSvx3DAmbientcolorItem(m_xLB_AmbientLight->GetSelectEntryColor()));
 
     aItemSet.Put(makeSvx3DLightcolor1Item(pInfo->aLightSource.nDiffuseColor));
     aItemSet.Put(makeSvx3DLightOnOff1Item(pInfo->aLightSource.bIsEnabled));
@@ -544,15 +526,15 @@ void ThreeD_SceneIllumination_TabPage::updatePreview()
     aItemSet.Put(makeSvx3DLightDirection8Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
 
     // set lights and ambient light
-    m_pCtl_Preview->GetSvx3DLightControl().Set3DAttributes(aItemSet);
+    m_xCtl_Preview->GetSvx3DLightControl().Set3DAttributes(aItemSet);
 
     // select light
     for(sal_uInt32 a(0); a < 8; a++)
     {
-        if(m_pLightSourceInfoList[a].pButton->IsChecked())
+        if (m_pLightSourceInfoList[a].pButton->get_active())
         {
-            m_pCtl_Preview->GetSvx3DLightControl().SelectLight(a);
-            m_pCtl_Preview->CheckSelection();
+            m_xCtl_Preview->GetSvx3DLightControl().SelectLight(a);
+            m_xCtl_Preview->CheckSelection();
             break;
         }
     }
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
index 72e39d673539..81bb278e28eb 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
@@ -20,48 +20,56 @@
 #define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_3D_SCENEILLUMINATION_HXX
 
 #include <TimerTriggeredControllerLock.hxx>
-
-#include <vcl/tabpage.hxx>
-#include <vcl/button.hxx>
+#include <vcl/weld.hxx>
 #include <svx/dlgctl3d.hxx>
 
 namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } }
 
-class SvxColorListBox;
+class ColorListBox;
 
 namespace chart
 {
 
-class LightButton : public ImageButton
+class LightButton
 {
 public:
-    explicit LightButton( vcl::Window* pParent);
+    explicit LightButton(std::unique_ptr<weld::ToggleButton> xButton);
 
     void switchLightOn(bool bOn);
     bool isLightOn() const { return m_bLightOn;}
 
+    bool get_active() const { return m_xButton->get_active(); }
+    void set_active(bool bActive) { m_xButton->set_active(bActive); }
+
+    weld::ToggleButton* get_widget() const { return m_xButton.get(); }
+
+    void connect_clicked(const Link<weld::Button&, void>& rLink)
+    {
+        m_xButton->connect_clicked(rLink);
+    }
+
 private:
+    std::unique_ptr<weld::ToggleButton> m_xButton;
     bool m_bLightOn;
 };
 
 struct LightSourceInfo;
 
-class ThreeD_SceneIllumination_TabPage : public TabPage
+class ThreeD_SceneIllumination_TabPage
 {
 public:
     ThreeD_SceneIllumination_TabPage(
-        vcl::Window* pWindow,
+        weld::Container* pParent, weld::Window* pTopLevel,
         const css::uno::Reference< css::beans::XPropertySet > & xSceneProperties,
         const css::uno::Reference< css::frame::XModel >& xChartModel );
-    virtual ~ThreeD_SceneIllumination_TabPage() override;
-    virtual void dispose() override;
+    ~ThreeD_SceneIllumination_TabPage();
 
 private:
-    DECL_LINK( ClickLightSourceButtonHdl, Button*, void );
-    DECL_LINK( SelectColorHdl, SvxColorListBox&, void );
-    DECL_LINK( ColorDialogHdl, Button*, void );
-    DECL_LINK( PreviewChangeHdl, SvxLightCtl3D*, void );
-    DECL_LINK( PreviewSelectHdl, SvxLightCtl3D*, void );
+    DECL_LINK( ClickLightSourceButtonHdl, weld::Button&, void );
+    DECL_LINK( SelectColorHdl, ColorListBox&, void );
+    DECL_LINK( ColorDialogHdl, weld::Button&, void );
+    DECL_LINK( PreviewChangeHdl, LightCtl3D*, void );
+    DECL_LINK( PreviewSelectHdl, LightCtl3D*, void );
 
     void updatePreview();
 
@@ -71,23 +79,6 @@ private:
     void applyLightSourceToModel( sal_uInt32 nLightNumber );
     void applyLightSourcesToModel();
 
-    VclPtr<LightButton> m_pBtn_Light1;
-    VclPtr<LightButton> m_pBtn_Light2;
-    VclPtr<LightButton> m_pBtn_Light3;
-    VclPtr<LightButton> m_pBtn_Light4;
-    VclPtr<LightButton> m_pBtn_Light5;
-    VclPtr<LightButton> m_pBtn_Light6;
-    VclPtr<LightButton> m_pBtn_Light7;
-    VclPtr<LightButton> m_pBtn_Light8;
-
-    VclPtr<SvxColorListBox> m_pLB_LightSource;
-    VclPtr<PushButton>  m_pBtn_LightSource_Color;
-
-    VclPtr<SvxColorListBox> m_pLB_AmbientLight;
-    VclPtr<PushButton>  m_pBtn_AmbientLight_Color;
-
-    VclPtr<SvxLightCtl3D>   m_pCtl_Preview;
-
     std::unique_ptr<LightSourceInfo[]> m_pLightSourceInfoList;
 
     css::uno::Reference< css::beans::XPropertySet > m_xSceneProperties;
@@ -96,7 +87,29 @@ private:
 
     bool            m_bInCommitToModel;
 
-    css::uno::Reference< css::frame::XModel >       m_xChartModel;
+    css::uno::Reference<css::frame::XModel> m_xChartModel;
+
+    weld::Window* m_pTopLevel;
+    std::unique_ptr<weld::Builder> m_xBuilder;
+    std::unique_ptr<weld::Container> m_xContainer;
+    std::unique_ptr<LightButton> m_xBtn_Light1;
+    std::unique_ptr<LightButton> m_xBtn_Light2;
+    std::unique_ptr<LightButton> m_xBtn_Light3;
+    std::unique_ptr<LightButton> m_xBtn_Light4;
+    std::unique_ptr<LightButton> m_xBtn_Light5;
+    std::unique_ptr<LightButton> m_xBtn_Light6;
+    std::unique_ptr<LightButton> m_xBtn_Light7;
+    std::unique_ptr<LightButton> m_xBtn_Light8;
+    std::unique_ptr<ColorListBox> m_xLB_LightSource;
+    std::unique_ptr<weld::Button> m_xBtn_LightSource_Color;
+    std::unique_ptr<ColorListBox> m_xLB_AmbientLight;
+    std::unique_ptr<weld::Button> m_xBtn_AmbientLight_Color;
+    std::unique_ptr<weld::Scale> m_xHoriScale;
+    std::unique_ptr<weld::Scale> m_xVertScale;
+    std::unique_ptr<weld::Button> m_xBtn_Corner;
+    std::unique_ptr<LightControl3D> m_xPreview;
+    std::unique_ptr<weld::CustomWeld> m_xPreviewWnd;
+    std::unique_ptr<LightCtl3D> m_xCtl_Preview;
 };
 
 } //namespace chart
diff --git a/chart2/source/controller/inc/dlg_View3D.hxx b/chart2/source/controller/inc/dlg_View3D.hxx
index 300b4cb1d989..d386a9f33b94 100644
--- a/chart2/source/controller/inc/dlg_View3D.hxx
+++ b/chart2/source/controller/inc/dlg_View3D.hxx
@@ -19,9 +19,7 @@
 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DLG_VIEW3D_HXX
 #define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DLG_VIEW3D_HXX
 
-#include <vcl/tabdlg.hxx>
-#include <vcl/tabctrl.hxx>
-
+#include <vcl/weld.hxx>
 #include <ControllerLockGuard.hxx>
 
 namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } }
@@ -32,27 +30,25 @@ class ThreeD_SceneGeometry_TabPage;
 class ThreeD_SceneAppearance_TabPage;
 class ThreeD_SceneIllumination_TabPage;
 
-class View3DDialog : public TabDialog
+class View3DDialog : public weld::GenericDialogController
 {
 public:
-    View3DDialog( vcl::Window* pWindow,
-                  const css::uno::Reference< css::frame::XModel > & xChartModel );
+    View3DDialog(weld::Window* pWindow, const css::uno::Reference<css::frame::XModel> & xChartModel);
     virtual ~View3DDialog() override;
-    virtual void dispose() override;
 
-    // from Dialog (base of TabDialog)
-    virtual short Execute() override;
+    virtual short run() override;
 
 private:
-    VclPtr<TabControl>     m_pTabControl;
-
-    VclPtr<ThreeD_SceneGeometry_TabPage>       m_pGeometry;
-    VclPtr<ThreeD_SceneAppearance_TabPage>     m_pAppearance;
-    VclPtr<ThreeD_SceneIllumination_TabPage>   m_pIllumination;
+    DECL_LINK(ActivatePageHdl, const OString&, void);
 
     ControllerLockHelper                m_aControllerLocker;
 
     static sal_uInt16 m_nLastPageId;
+
+    std::unique_ptr<weld::Notebook> m_xTabControl;
+    std::unique_ptr<ThreeD_SceneGeometry_TabPage> m_xGeometry;
+    std::unique_ptr<ThreeD_SceneAppearance_TabPage> m_xAppearance;
+    std::unique_ptr<ThreeD_SceneIllumination_TabPage> m_xIllumination;
 };
 
 } //namespace chart
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index 9ba3f1f712e4..69fc84fdda90 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -820,8 +820,8 @@ void ChartController::executeDispatch_View3D()
 
         //open dialog
         SolarMutexGuard aSolarGuard;
-        ScopedVclPtrInstance< View3DDialog > aDlg(GetChartWindow(), getModel());
-        if( aDlg->Execute() == RET_OK )
+        View3DDialog aDlg(GetChartFrame(), getModel());
+        if (aDlg.run() == RET_OK)
             aUndoGuard.commit();
     }
     catch(const uno::RuntimeException& e)
diff --git a/chart2/uiconfig/ui/3dviewdialog.ui b/chart2/uiconfig/ui/3dviewdialog.ui
index a6c138b645c2..1b6e51f674b6 100644
--- a/chart2/uiconfig/ui/3dviewdialog.ui
+++ b/chart2/uiconfig/ui/3dviewdialog.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="3DViewDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="3dviewdialog|3DViewDialog">3D View</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_3D_SceneGeometry.ui b/chart2/uiconfig/ui/tp_3D_SceneGeometry.ui
index a09bb40eec32..462ffa67713e 100644
--- a/chart2/uiconfig/ui/tp_3D_SceneGeometry.ui
+++ b/chart2/uiconfig/ui/tp_3D_SceneGeometry.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="chart">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkAdjustment" id="adjustmentPERSPECTIVE">
@@ -7,7 +7,19 @@
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkAdjustment" id="adjustmentROTATION">
+  <object class="GtkAdjustment" id="adjustmentROTATION1">
+    <property name="lower">-180</property>
+    <property name="upper">180</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustmentROTATION2">
+    <property name="lower">-180</property>
+    <property name="upper">180</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustmentROTATION3">
     <property name="lower">-180</property>
     <property name="upper">180</property>
     <property name="step_increment">1</property>
@@ -41,7 +53,7 @@
         <property name="can_focus">False</property>
         <property name="label" translatable="yes" context="tp_3D_SceneGeometry|FT_X_ROTATION">_X rotation</property>
         <property name="use_underline">True</property>
-        <property name="mnemonic_widget">MTR_FLD_X_ROTATION:0degrees</property>
+        <property name="mnemonic_widget">MTR_FLD_X_ROTATION</property>
         <property name="xalign">0</property>
       </object>
       <packing>
@@ -55,7 +67,7 @@
         <property name="can_focus">False</property>
         <property name="label" translatable="yes" context="tp_3D_SceneGeometry|FT_Y_ROTATION">_Y rotation</property>
         <property name="use_underline">True</property>
-        <property name="mnemonic_widget">MTR_FLD_Y_ROTATION:0degrees</property>
+        <property name="mnemonic_widget">MTR_FLD_Y_ROTATION</property>
         <property name="xalign">0</property>
       </object>
       <packing>
@@ -69,7 +81,7 @@
         <property name="can_focus">False</property>
         <property name="label" translatable="yes" context="tp_3D_SceneGeometry|FT_Z_ROTATION">_Z rotation</property>
         <property name="use_underline">True</property>
-        <property name="mnemonic_widget">MTR_FLD_Z_ROTATION:0degrees</property>
+        <property name="mnemonic_widget">MTR_FLD_Z_ROTATION</property>
         <property name="xalign">0</property>
       </object>
       <packing>
@@ -87,7 +99,7 @@
         <property name="xalign">0</property>
         <property name="draw_indicator">True</property>
         <accessibility>
-          <relation type="label-for" target="MTR_FLD_PERSPECTIVE:0%"/>
+          <relation type="label-for" target="MTR_FLD_PERSPECTIVE"/>
         </accessibility>
       </object>
       <packing>
@@ -96,15 +108,16 @@
       </packing>
     </child>
     <child>
-      <object class="GtkSpinButton" id="MTR_FLD_PERSPECTIVE:0%">
+      <object class="GtkSpinButton" id="MTR_FLD_PERSPECTIVE">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
+        <property name="can_focus">True</property>
+        <property name="activates_default">True</property>
         <property name="adjustment">adjustmentPERSPECTIVE</property>
         <accessibility>
           <relation type="labelled-by" target="CBX_PERSPECTIVE"/>
         </accessibility>
         <child internal-child="accessible">
-          <object class="AtkObject" id="MTR_FLD_PERSPECTIVE:0%-atkobject">
+          <object class="AtkObject" id="MTR_FLD_PERSPECTIVE-atkobject">
             <property name="AtkObject::accessible-name" translatable="yes" context="tp_3D_SceneGeometry|MTR_FLD_PERSPECTIVE-atkobject">Perspective</property>
           </object>
         </child>
@@ -115,11 +128,12 @@
       </packing>
     </child>
     <child>
-      <object class="GtkSpinButton" id="MTR_FLD_Z_ROTATION:0degrees">
+      <object class="GtkSpinButton" id="MTR_FLD_Z_ROTATION">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
+        <property name="can_focus">True</property>
+        <property name="activates_default">True</property>
         <property name="input_purpose">alpha</property>
-        <property name="adjustment">adjustmentROTATION</property>
+        <property name="adjustment">adjustmentROTATION3</property>
         <property name="update_policy">if-valid</property>
       </object>
       <packing>
@@ -128,10 +142,11 @@
       </packing>
     </child>
     <child>
-      <object class="GtkSpinButton" id="MTR_FLD_Y_ROTATION:0degrees">
+      <object class="GtkSpinButton" id="MTR_FLD_Y_ROTATION">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="adjustment">adjustmentROTATION</property>
+        <property name="can_focus">True</property>
+        <property name="activates_default">True</property>
+        <property name="adjustment">adjustmentROTATION2</property>
       </object>
       <packing>
         <property name="left_attach">1</property>
@@ -139,10 +154,11 @@
       </packing>
     </child>
     <child>
-      <object class="GtkSpinButton" id="MTR_FLD_X_ROTATION:0degrees">
+      <object class="GtkSpinButton" id="MTR_FLD_X_ROTATION">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="adjustment">adjustmentROTATION</property>
+        <property name="can_focus">True</property>
+        <property name="activates_default">True</property>
+        <property name="adjustment">adjustmentROTATION1</property>
       </object>
       <packing>
         <property name="left_attach">1</property>
diff --git a/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui b/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui
index e5496795c4b9..8e9cc07afee4 100644
--- a/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui
+++ b/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui
@@ -1,64 +1,56 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
 <interface domain="chart">
   <requires lib="gtk+" version="3.18"/>
-  <requires lib="LibreOffice" version="1.0"/>
   <object class="GtkImage" id="IMG_AMBIENT_COLOR">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="pixbuf">svx/res/colordlg.png</property>
+    <property name="icon_name">svx/res/colordlg.png</property>
   </object>
   <object class="GtkImage" id="IMG_LIGHTSOURCE_COLOR">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="pixbuf">svx/res/colordlg.png</property>
+    <property name="icon_name">svx/res/colordlg.png</property>
   </object>
   <object class="GtkImage" id="IMG_LIGHT_1">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="pixbuf">svx/res/lighton.png</property>
+    <property name="icon_name">svx/res/lighton.png</property>
   </object>
   <object class="GtkImage" id="IMG_LIGHT_2">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="pixbuf">svx/res/lighton.png</property>
+    <property name="icon_name">svx/res/lighton.png</property>
   </object>
   <object class="GtkImage" id="IMG_LIGHT_3">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="yalign">0.44999998807907104</property>
-    <property name="pixbuf">svx/res/lighton.png</property>
+    <property name="icon_name">svx/res/lighton.png</property>
   </object>
   <object class="GtkImage" id="IMG_LIGHT_4">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="yalign">0.50999999046325684</property>
-    <property name="ypad">1</property>
-    <property name="pixbuf">svx/res/lighton.png</property>
+    <property name="icon_name">svx/res/lighton.png</property>
   </object>
   <object class="GtkImage" id="IMG_LIGHT_5">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="yalign">0.49000000953674316</property>
-    <property name="pixbuf">svx/res/lighton.png</property>
+    <property name="icon_name">svx/res/lighton.png</property>
   </object>
   <object class="GtkImage" id="IMG_LIGHT_6">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="yalign">0.50999999046325684</property>
-    <property name="pixbuf">svx/res/lighton.png</property>
+    <property name="icon_name">svx/res/lighton.png</property>
   </object>
   <object class="GtkImage" id="IMG_LIGHT_7">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="xalign">0.50999999046325684</property>
-    <property name="yalign">0.49000000953674316</property>
-    <property name="xpad">1</property>
-    <property name="pixbuf">svx/res/lighton.png</property>
+    <property name="icon_name">svx/res/lighton.png</property>
   </object>
   <object class="GtkImage" id="IMG_LIGHT_8">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="pixbuf">svx/res/lighton.png</property>
+    <property name="icon_name">svx/res/lighton.png</property>
   </object>
   <object class="GtkBox" id="tp_3D_SceneIllumination">
     <property name="visible">True</property>
@@ -96,131 +88,123 @@
                         <property name="row_spacing">6</property>
                         <property name="column_spacing">12</property>
                         <child>
-                          <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_1">
+                          <object class="GtkToggleButton" id="BTN_LIGHT_1">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_LIGHT_1|tooltip_text">Light source 1</property>
                             <property name="image">IMG_LIGHT_1</property>
+                            <property name="always_show_image">True</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="chartcontrollerlo-LightButton" id="BTN_LIGHT_2">
+                          <object class="GtkToggleButton" id="BTN_LIGHT_2">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_LIGHT_2|tooltip_text">Light source 2</property>
                             <property name="image">IMG_LIGHT_2</property>
+                            <property name="always_show_image">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="top_attach">0</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_3">
+                          <object class="GtkToggleButton" id="BTN_LIGHT_3">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_LIGHT_3|tooltip_text">Light source 3</property>
                             <property name="image">IMG_LIGHT_3</property>
+                            <property name="always_show_image">True</property>
                           </object>
                           <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>
                         <child>
-                          <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_4">
+                          <object class="GtkToggleButton" id="BTN_LIGHT_4">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_LIGHT_4|tooltip_text">Light source 4</property>
                             <property name="image">IMG_LIGHT_4</property>
+                            <property name="always_show_image">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">3</property>
                             <property name="top_attach">0</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_5">
+                          <object class="GtkToggleButton" id="BTN_LIGHT_5">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_LIGHT_5|tooltip_text">Light source 5</property>
                             <property name="image">IMG_LIGHT_5</property>
+                            <property name="always_show_image">True</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="chartcontrollerlo-LightButton" id="BTN_LIGHT_6">
+                          <object class="GtkToggleButton" id="BTN_LIGHT_6">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_LIGHT_6|tooltip_text">Light source 6</property>
                             <property name="image">IMG_LIGHT_6</property>
+                            <property name="always_show_image">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="top_attach">1</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_7">
+                          <object class="GtkToggleButton" id="BTN_LIGHT_7">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_LIGHT_7|tooltip_text">Light source 7</property>
                             <property name="image">IMG_LIGHT_7</property>
+                            <property name="always_show_image">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">2</property>
                             <property name="top_attach">1</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_8">
+                          <object class="GtkToggleButton" id="BTN_LIGHT_8">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_LIGHT_8|tooltip_text">Light source 8</property>
                             <property name="image">IMG_LIGHT_8</property>
+                            <property name="always_show_image">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">3</property>
                             <property name="top_attach">1</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
                           </packing>
                         </child>
                       </object>
@@ -236,9 +220,16 @@
                         <property name="can_focus">False</property>
                         <property name="spacing">12</property>
                         <child>
-                          <object class="svxcorelo-SvxColorListBox" id="LB_LIGHTSOURCE">
+                          <object class="GtkMenuButton" id="LB_LIGHTSOURCE">
                             <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="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="label" translatable="no"></property>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -247,7 +238,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkButton" id="BTN_LIGHTSOURCE_COLOR">
+                          <object class="GtkToggleButton" id="BTN_LIGHTSOURCE_COLOR">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
@@ -276,10 +267,10 @@
               <object class="GtkLabel" id="FT_LIGHTSOURCE">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="xalign">0</property>
                 <property name="label" translatable="yes" context="tp_3D_SceneIllumination|FT_LIGHTSOURCE">_Light source</property>
                 <property name="use_underline">True</property>
                 <property name="mnemonic_widget">BTN_LIGHT_1</property>
+                <property name="xalign">0</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
                 </attributes>
@@ -310,9 +301,16 @@
                     <property name="can_focus">False</property>
                     <property name="spacing">12</property>
                     <child>
-                      <object class="svxcorelo-SvxColorListBox" id="LB_AMBIENTLIGHT">
+                      <object class="GtkMenuButton" id="LB_AMBIENTLIGHT">
                         <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="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                        <property name="label" translatable="no"></property>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -321,7 +319,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="BTN_AMBIENT_COLOR">
+                      <object class="GtkToggleButton" id="BTN_AMBIENT_COLOR">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
@@ -343,10 +341,10 @@
               <object class="GtkLabel" id="FT_AMBIENTLIGHT">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="xalign">0</property>
                 <property name="label" translatable="yes" context="tp_3D_SceneIllumination|FT_AMBIENTLIGHT">_Ambient light</property>
                 <property name="use_underline">True</property>
                 <property name="mnemonic_widget">LB_AMBIENTLIGHT</property>
+                <property name="xalign">0</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
                 </attributes>
@@ -367,15 +365,77 @@
       </packing>
     </child>
     <child>
-      <object class="svxlo-SvxLightCtl3D" id="CTL_LIGHT_PREVIEW">
+      <object class="GtkScrolledWindow" id="scrolledwindow">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|CTL_LIGHT_PREVIEW|tooltip_text">Light Preview</property>
-        <property name="hexpand">True</property>
-        <property name="vexpand">True</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="GtkGrid">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkDrawingArea" id="CTL_LIGHT_PREVIEW">
+                    <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_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
+                    <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|CTL_LIGHT_PREVIEW|tooltip_text">Light Preview</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="corner">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScale" id="hori">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="round_digits">1</property>
+                    <property name="draw_value">False</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScale" id="vert">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="orientation">vertical</property>
+                    <property name="round_digits">1</property>
+                    <property name="draw_value">False</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
       </object>
       <packing>
-        <property name="expand">False</property>
+        <property name="expand">True</property>
         <property name="fill">True</property>
         <property name="position">1</property>
       </packing>
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 894734b0b13b..5063da3a2b15 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -191,9 +191,6 @@
     <glade-widget-class title="Address Preview" name="swlo-SwAddressPreview"
                         generic-name="Address Preview" parent="GtkDrawingArea"
                         icon-name="widget-gtk-drawingarea"/>
-    <glade-widget-class title="Chart Light Button" name="chartcontrollerlo-LightButton"
-                        generic-name="ChartLightButton" parent="GtkButton"
-                        icon-name="widget-gtk-button"/>
     <glade-widget-class title="Extended Macro Library" name="basctllo-ExtTreeListBox"
                         generic-name="Extended Macro Library List" parent="GtkTreeView"
                         icon-name="widget-gtk-treeview"/>
diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx
index a9b38b7612ba..ed4241fc3ad7 100644
--- a/include/svx/colorbox.hxx
+++ b/include/svx/colorbox.hxx
@@ -123,6 +123,7 @@ public:
     Color const & GetSelectEntryColor() const { return m_aSelectedColor.first; }
     NamedColor const & GetSelectedEntry() const { return m_aSelectedColor; }
 
+    void SelectEntry(const NamedColor& rColor);
     void SelectEntry(const Color& rColor);
 
     void SetNoSelection() { getColorWindow()->SetNoSelection(); }
diff --git a/include/svx/dlgctl3d.hxx b/include/svx/dlgctl3d.hxx
index 82f544031a55..bc105f18ed89 100644
--- a/include/svx/dlgctl3d.hxx
+++ b/include/svx/dlgctl3d.hxx
@@ -23,6 +23,8 @@
 #include <vcl/ctrl.hxx>
 #include <vcl/scrbar.hxx>
 #include <vcl/button.hxx>
+#include <vcl/customweld.hxx>
+#include <vcl/weld.hxx>
 #include <svl/itemset.hxx>
 #include <svx/svxdllapi.h>
 #include <basegfx/vector/b3dvector.hxx>
@@ -64,6 +66,34 @@ public:
     virtual void Set3DAttributes(const SfxItemSet& rAttr);
 };
 
+class SAL_WARN_UNUSED SVX_DLLPUBLIC PreviewControl3D : public weld::CustomWidgetController
+{
+protected:
+    std::unique_ptr<FmFormModel> mpModel;
+    FmFormPage*             mpFmPage;
+    std::unique_ptr<E3dView> mp3DView;
+    E3dScene*               mpScene;
+    E3dObject*              mp3DObj;
+    SvxPreviewObjectType    mnObjectType;
+
+    void Construct();
+
+public:
+    PreviewControl3D();
+    virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+    virtual ~PreviewControl3D() override;
+
+    virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
+    virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override;
+    virtual void Resize() override;
+
+    virtual void SetObjectType(SvxPreviewObjectType nType);
+    SvxPreviewObjectType GetObjectType() const { return mnObjectType; }
+    SfxItemSet const & Get3DAttributes() const;
+    virtual void Set3DAttributes(const SfxItemSet& rAttr);
+};
+
+

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list