Kaydet (Commit) cea72511 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Add the UI bits for showing "rounded edge" property for GL3D chart.

Change-Id: Ia6083c423bf8286a0b562d490283f8e1328a0124
üst e1823a9f
......@@ -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*/ )
{
}
......
......@@ -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;
......
......@@ -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();
......
......@@ -20,6 +20,8 @@ public:
GL3DBarChartDialogController();
virtual ~GL3DBarChartDialogController();
virtual bool shouldShow_GL3DResourceGroup() const;
virtual OUString getName();
virtual Image getImage();
virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const;
......
......@@ -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);
}
}
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment