[Libreoffice-commits] core.git: Branch 'private/kohei/new-chart-type-skeleton' - chart2/source chart2/uiconfig

Kohei Yoshida kohei.yoshida at collabora.com
Wed Mar 26 13:22:28 PDT 2014


Rebased ref, commits from common ancestor:
commit 1eb14c264ceba1abab285b0875cb1e6a63ee9623
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Mar 26 15:38:25 2014 -0400

    Add the UI bits for showing "rounded edge" property for GL3D chart.
    
    Change-Id: Ia6083c423bf8286a0b562d490283f8e1328a0124

diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index c3faa74..835de9e6 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -60,6 +60,7 @@ ChartTypeParameter::ChartTypeParameter()
                     , nGeometry3D(DataPointGeometry3D::CUBOID)
                     , eThreeDLookScheme(ThreeDLookScheme_Realistic)
                     , bSortByXValues(false)
+                    , mbGLRoundedEdge(false)
 {
 }
 
@@ -79,6 +80,7 @@ ChartTypeParameter::ChartTypeParameter( sal_Int32 SubTypeIndex, bool HasXAxisWit
                     , nGeometry3D(DataPointGeometry3D::CUBOID)
                     , eThreeDLookScheme(ThreeDLookScheme_Realistic)
                     , bSortByXValues(false)
+                    , mbGLRoundedEdge(false)
 {
 }
 ChartTypeParameter::~ChartTypeParameter()
@@ -212,6 +214,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
                 CurveStyle       eCurveStyle = rParameter.eCurveStyle;
                 sal_Int32        nGeometry3D = rParameter.nGeometry3D;
                 bool             bSortByXValues = rParameter.bSortByXValues;
+                bool bGLRoundedEdge = rParameter.mbGLRoundedEdge;
 
                 rParameter = (*aIter).second;
 
@@ -222,6 +225,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
                 rParameter.eCurveStyle = eCurveStyle;
                 rParameter.nGeometry3D = nGeometry3D;
                 rParameter.bSortByXValues = bSortByXValues;
+                rParameter.mbGLRoundedEdge = bGLRoundedEdge;
 
                 bFoundSomeMatch = true;
                 break;
@@ -372,6 +376,11 @@ bool ChartTypeDialogController::shouldShow_SortByXValuesResourceGroup() const
     return false;
 }
 
+bool ChartTypeDialogController::shouldShow_GL3DResourceGroup() const
+{
+    return false;
+}
+
 void ChartTypeDialogController::showExtraControls( VclBuilderContainer* /*pParent*/ )
 {
 }
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
index 4d450b0..991c806 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
@@ -79,6 +79,8 @@ public:
 
     ThreeDLookScheme    eThreeDLookScheme;
     bool                bSortByXValues;
+
+    bool mbGLRoundedEdge;
 };
 
 typedef ::comphelper::MakeMap< OUString, ChartTypeParameter > tTemplateServiceChartTypeParameterMap;
@@ -100,6 +102,7 @@ public:
     virtual bool    shouldShow_SplineControl() const;
     virtual bool    shouldShow_GeometryControl() const;
     virtual bool    shouldShow_SortByXValuesResourceGroup() const;
+    virtual bool    shouldShow_GL3DResourceGroup() const;
 
     virtual void    showExtraControls(VclBuilderContainer* pParent);
     virtual void    hideExtraControls() const;
diff --git a/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx b/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
index 1b3bfdc..08cb2ec 100644
--- a/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
+++ b/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
@@ -20,6 +20,11 @@ GL3DBarChartDialogController::GL3DBarChartDialogController() {}
 
 GL3DBarChartDialogController::~GL3DBarChartDialogController() {}
 
+bool GL3DBarChartDialogController::shouldShow_GL3DResourceGroup() const
+{
+    return true;
+}
+
 OUString GL3DBarChartDialogController::getName()
 {
     return SchResId(STR_TYPE_GL3D_BAR).toString();
diff --git a/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx b/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx
index e2f31e2..0adba32 100644
--- a/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx
+++ b/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx
@@ -20,6 +20,8 @@ public:
     GL3DBarChartDialogController();
     virtual ~GL3DBarChartDialogController();
 
+    virtual bool shouldShow_GL3DResourceGroup() const;
+
     virtual OUString getName();
     virtual Image getImage();
     virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const;
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 3a880ec..b0c5c1f 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -285,6 +285,40 @@ IMPL_LINK_NOARG(StackingResourceGroup, StackingEnableHdl)
         m_pChangeListener->stateChanged(this);
     return 0;
 }
+
+class GL3DResourceGroup : public ChangingResource
+{
+public:
+    GL3DResourceGroup( VclBuilderContainer* pWindow );
+
+    void showControls( bool bShow );
+    void fillControls( const ChartTypeParameter& rParam );
+    void fillParameter( ChartTypeParameter& rParam );
+
+private:
+    CheckBox* m_pCB_RoundedEdge;
+};
+
+GL3DResourceGroup::GL3DResourceGroup( VclBuilderContainer* pWindow )
+{
+    pWindow->get(m_pCB_RoundedEdge, "rounded-edge");
+}
+
+void GL3DResourceGroup::showControls( bool bShow )
+{
+    m_pCB_RoundedEdge->Show(bShow);
+}
+
+void GL3DResourceGroup::fillControls( const ChartTypeParameter& rParam )
+{
+    m_pCB_RoundedEdge->Check(rParam.mbGLRoundedEdge);
+}
+
+void GL3DResourceGroup::fillParameter( ChartTypeParameter& rParam )
+{
+    rParam.mbGLRoundedEdge = m_pCB_RoundedEdge->IsChecked();
+}
+
 class SplinePropertiesDialog : public ModalDialog
 {
 public:
@@ -662,6 +696,7 @@ ChartTypeTabPage::ChartTypeTabPage(Window* pParent
         , m_pSplineResourceGroup( new SplineResourceGroup(this) )
         , m_pGeometryResourceGroup( new GeometryResourceGroup( this ) )
         , m_pSortByXValuesResourceGroup( new SortByXValuesResourceGroup( this ) )
+        , m_pGL3DResourceGroup(new GL3DResourceGroup(this))
         , m_xChartModel( xChartModel )
         , m_xCC( xContext )
         , m_aChartTypeDialogControllerList(0)
@@ -744,6 +779,7 @@ ChartTypeTabPage::ChartTypeTabPage(Window* pParent
     m_pSplineResourceGroup->setChangeListener( this );
     m_pGeometryResourceGroup->setChangeListener( this );
     m_pSortByXValuesResourceGroup->setChangeListener( this );
+    m_pGL3DResourceGroup->setChangeListener(this);
 }
 
 ChartTypeTabPage::~ChartTypeTabPage()
@@ -763,6 +799,7 @@ ChartTypeTabPage::~ChartTypeTabPage()
     delete m_pSplineResourceGroup;
     delete m_pGeometryResourceGroup;
     delete m_pSortByXValuesResourceGroup;
+    delete m_pGL3DResourceGroup;
 }
 ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const
 {
@@ -773,6 +810,7 @@ ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const
     m_pSplineResourceGroup->fillParameter( aParameter );
     m_pGeometryResourceGroup->fillParameter( aParameter );
     m_pSortByXValuesResourceGroup->fillParameter( aParameter );
+    m_pGL3DResourceGroup->fillParameter(aParameter);
     return aParameter;
 }
 void ChartTypeTabPage::commitToModel( const ChartTypeParameter& rParameter )
@@ -879,6 +917,8 @@ void ChartTypeTabPage::showAllControls( ChartTypeDialogController& rTypeControll
     m_pGeometryResourceGroup->showControls( bShow );
     bShow = rTypeController.shouldShow_SortByXValuesResourceGroup();
     m_pSortByXValuesResourceGroup->showControls( bShow );
+    bShow = rTypeController.shouldShow_GL3DResourceGroup();
+    m_pGL3DResourceGroup->showControls(bShow);
     rTypeController.showExtraControls(this);
 }
 
@@ -895,6 +935,7 @@ void ChartTypeTabPage::fillAllControls( const ChartTypeParameter& rParameter, bo
     m_pSplineResourceGroup->fillControls( rParameter );
     m_pGeometryResourceGroup->fillControls( rParameter );
     m_pSortByXValuesResourceGroup->fillControls( rParameter );
+    m_pGL3DResourceGroup->fillControls(rParameter);
     m_nChangingCalls--;
 }
 
@@ -947,6 +988,7 @@ void ChartTypeTabPage::initializePage()
         m_pSplineResourceGroup->showControls( false );
         m_pGeometryResourceGroup->showControls( false );
         m_pSortByXValuesResourceGroup->showControls( false );
+        m_pGL3DResourceGroup->showControls(false);
     }
 }
 
diff --git a/chart2/source/controller/dialogs/tp_ChartType.hxx b/chart2/source/controller/dialogs/tp_ChartType.hxx
index ea46e2bb..87c59c2 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.hxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.hxx
@@ -45,6 +45,7 @@ class SplineResourceGroup;
 class GeometryResourceGroup;
 class ChartTypeParameter;
 class SortByXValuesResourceGroup;
+class GL3DResourceGroup;
 
 class ChartTypeTabPage : public ResourceChangeListener, public svt::OWizardPage, public ChartTypeTemplateProvider
 {
@@ -87,6 +88,7 @@ protected:
     SplineResourceGroup*        m_pSplineResourceGroup;
     GeometryResourceGroup*      m_pGeometryResourceGroup;
     SortByXValuesResourceGroup* m_pSortByXValuesResourceGroup;
+    GL3DResourceGroup* m_pGL3DResourceGroup;
 
     ::com::sun::star::uno::Reference<
                        ::com::sun::star::chart2::XChartDocument >   m_xChartModel;
diff --git a/chart2/source/model/template/GL3DBarChartType.cxx b/chart2/source/model/template/GL3DBarChartType.cxx
index 7b94095..b2a13cb 100644
--- a/chart2/source/model/template/GL3DBarChartType.cxx
+++ b/chart2/source/model/template/GL3DBarChartType.cxx
@@ -104,9 +104,10 @@ APPHELPER_XSERVICEINFO_IMPL(
 
 uno::Sequence<OUString> GL3DBarChartType::getSupportedServiceNames_Static()
 {
-    uno::Sequence<OUString> aServices(2);
+    uno::Sequence<OUString> aServices(3);
     aServices[0] = CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR;
     aServices[1] = "com.sun.star.chart2.ChartType";
+    aServices[2] = "com.sun.star.beans.PropertySet";
     return aServices;
 }
 
diff --git a/chart2/uiconfig/ui/tp_ChartType.ui b/chart2/uiconfig/ui/tp_ChartType.ui
index 27067d0..cc4452b 100644
--- a/chart2/uiconfig/ui/tp_ChartType.ui
+++ b/chart2/uiconfig/ui/tp_ChartType.ui
@@ -412,6 +412,31 @@
                     <property name="height">1</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkGrid" id="gl3dblock">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkCheckButton" id="rounded-edge">
+                        <property name="label" translatable="yes">Rounded edge</property>
+                        <property name="can_focus">True</property>
+                        <property name="no_show_all">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>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">3</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="left_attach">1</property>


More information about the Libreoffice-commits mailing list