Kaydet (Commit) 07a58db4 authored tarafından Caolán McNamara's avatar Caolán McNamara

provide two LegendPositionResources for the interim

LegendPositionResources for .ui based stuff and a legacy
oldLegendPositionResources which can be phased out when
the last .res based user is gone

Change-Id: I02478882e0cb54ee0fe5c2c5d15382f94758a3d2
üst 4f94f16b
...@@ -30,7 +30,7 @@ using namespace ::com::sun::star; ...@@ -30,7 +30,7 @@ using namespace ::com::sun::star;
SchLegendDlg::SchLegendDlg(Window* pWindow, const uno::Reference< uno::XComponentContext>& xCC ) SchLegendDlg::SchLegendDlg(Window* pWindow, const uno::Reference< uno::XComponentContext>& xCC )
: ModalDialog(pWindow, SchResId(DLG_LEGEND)) : ModalDialog(pWindow, SchResId(DLG_LEGEND))
, m_apLegendPositionResources( new LegendPositionResources(this,xCC) ) , m_apLegendPositionResources( new oldLegendPositionResources(this,xCC) )
, aBtnOK(this, SchResId(BTN_OK)) , aBtnOK(this, SchResId(BTN_OK))
, aBtnCancel(this, SchResId(BTN_CANCEL)) , aBtnCancel(this, SchResId(BTN_CANCEL))
, aBtnHelp(this, SchResId(BTN_HELP)) , aBtnHelp(this, SchResId(BTN_HELP))
......
...@@ -42,7 +42,219 @@ namespace chart ...@@ -42,7 +42,219 @@ namespace chart
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2; using namespace ::com::sun::star::chart2;
LegendPositionResources::LegendPositionResources( Window* pWindow ) LegendPositionResources::LegendPositionResources(VclBuilderContainer& rParent)
: m_xCC() //unused in this scenario
, m_pCbxShow( NULL ) //unused in this scenario, assumed to be visible
{
rParent.get(m_pRbtLeft, "left");
rParent.get(m_pRbtRight, "right");
rParent.get(m_pRbtTop, "top");
rParent.get(m_pRbtBottom, "bottom");
impl_setRadioButtonToggleHdl();
}
LegendPositionResources::LegendPositionResources(VclBuilderContainer& rParent,
const uno::Reference< uno::XComponentContext >& xCC)
: m_xCC(xCC)
{
rParent.get(m_pCbxShow, "show");
rParent.get(m_pRbtLeft, "left");
rParent.get(m_pRbtRight, "right");
rParent.get(m_pRbtTop, "top");
rParent.get(m_pRbtBottom, "bottom");
m_pCbxShow->SetToggleHdl( LINK( this, LegendPositionResources, PositionEnableHdl ) );
impl_setRadioButtonToggleHdl();
}
void LegendPositionResources::impl_setRadioButtonToggleHdl()
{
m_pRbtLeft->SetToggleHdl( LINK( this, LegendPositionResources, PositionChangeHdl ) );
m_pRbtTop->SetToggleHdl( LINK( this, LegendPositionResources, PositionChangeHdl ) );
m_pRbtRight->SetToggleHdl( LINK( this, LegendPositionResources, PositionChangeHdl ) );
m_pRbtBottom->SetToggleHdl( LINK( this, LegendPositionResources, PositionChangeHdl ) );
}
LegendPositionResources::~LegendPositionResources()
{
}
void LegendPositionResources::writeToResources( const uno::Reference< frame::XModel >& xChartModel )
{
try
{
uno::Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
uno::Reference< beans::XPropertySet > xProp( xDiagram->getLegend(), uno::UNO_QUERY );
if( xProp.is() )
{
//show
sal_Bool bShowLegend = sal_False;
xProp->getPropertyValue( "Show" ) >>= bShowLegend;
if (m_pCbxShow)
m_pCbxShow->Check( bShowLegend );
PositionEnableHdl(0);
//position
chart2::LegendPosition ePos;
xProp->getPropertyValue( "AnchorPosition" ) >>= ePos;
switch( ePos )
{
case chart2::LegendPosition_LINE_START:
m_pRbtLeft->Check();
break;
case chart2::LegendPosition_LINE_END:
m_pRbtRight->Check();
break;
case chart2::LegendPosition_PAGE_START:
m_pRbtTop->Check();
break;
case chart2::LegendPosition_PAGE_END:
m_pRbtBottom->Check();
break;
case chart2::LegendPosition_CUSTOM:
default:
m_pRbtRight->Check();
break;
}
}
}
catch( const uno::Exception & ex )
{
ASSERT_EXCEPTION( ex );
}
}
void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Reference< frame::XModel >& xChartModel ) const
{
try
{
sal_Bool bShowLegend = m_pCbxShow ? m_pCbxShow->IsChecked() : false;
ChartModel* pModel = dynamic_cast<ChartModel*>(xChartModel.get());
uno::Reference< beans::XPropertySet > xProp( LegendHelper::getLegend( *pModel,m_xCC,bShowLegend ), uno::UNO_QUERY );
if( xProp.is() )
{
//show
xProp->setPropertyValue( "Show" , uno::makeAny( bShowLegend ));
//position
chart2::LegendPosition eNewPos;
::com::sun::star::chart::ChartLegendExpansion eExp = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
if( m_pRbtLeft->IsChecked() )
eNewPos = chart2::LegendPosition_LINE_START;
else if( m_pRbtRight->IsChecked() )
{
eNewPos = chart2::LegendPosition_LINE_END;
}
else if( m_pRbtTop->IsChecked() )
{
eNewPos = chart2::LegendPosition_PAGE_START;
eExp = ::com::sun::star::chart::ChartLegendExpansion_WIDE;
}
else if( m_pRbtBottom->IsChecked() )
{
eNewPos = chart2::LegendPosition_PAGE_END;
eExp = ::com::sun::star::chart::ChartLegendExpansion_WIDE;
}
xProp->setPropertyValue( "AnchorPosition" , uno::makeAny( eNewPos ));
xProp->setPropertyValue( "Expansion" , uno::makeAny( eExp ));
xProp->setPropertyValue( "RelativePosition" , uno::Any());
}
}
catch( const uno::Exception & ex )
{
ASSERT_EXCEPTION( ex );
}
}
IMPL_LINK_NOARG(LegendPositionResources, PositionEnableHdl)
{
bool bEnable = m_pCbxShow ? m_pCbxShow->IsChecked() : true;
m_pRbtLeft->Enable( bEnable );
m_pRbtTop->Enable( bEnable );
m_pRbtRight->Enable( bEnable );
m_pRbtBottom->Enable( bEnable );
m_aChangeLink.Call(NULL);
return 0;
}
void LegendPositionResources::initFromItemSet( const SfxItemSet& rInAttrs )
{
const SfxPoolItem* pPoolItem = NULL;
if( rInAttrs.GetItemState( SCHATTR_LEGEND_POS, sal_True, &pPoolItem ) == SFX_ITEM_SET )
{
sal_Int32 nLegendPosition = ((const SfxInt32Item*)pPoolItem)->GetValue();
switch( nLegendPosition )
{
case chart2::LegendPosition_LINE_START:
m_pRbtLeft->Check(sal_True);
break;
case chart2::LegendPosition_PAGE_START:
m_pRbtTop->Check(sal_True);
break;
case chart2::LegendPosition_LINE_END:
m_pRbtRight->Check(sal_True);
break;
case chart2::LegendPosition_PAGE_END:
m_pRbtBottom->Check(sal_True);
break;
default:
break;
}
}
if( m_pCbxShow && rInAttrs.GetItemState( SCHATTR_LEGEND_SHOW, sal_True, &pPoolItem ) == SFX_ITEM_SET )
{
bool bShow = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
m_pCbxShow->Check(bShow);
}
}
void LegendPositionResources::writeToItemSet( SfxItemSet& rOutAttrs ) const
{
sal_Int32 nLegendPosition = chart2::LegendPosition_CUSTOM;
if( m_pRbtLeft->IsChecked() )
nLegendPosition = chart2::LegendPosition_LINE_START;
else if( m_pRbtTop->IsChecked() )
nLegendPosition = chart2::LegendPosition_PAGE_START;
else if( m_pRbtRight->IsChecked() )
nLegendPosition = chart2::LegendPosition_LINE_END;
else if( m_pRbtBottom->IsChecked() )
nLegendPosition = chart2::LegendPosition_PAGE_END;
rOutAttrs.Put(SfxInt32Item(SCHATTR_LEGEND_POS, nLegendPosition ));
rOutAttrs.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, m_pCbxShow ? m_pCbxShow->IsChecked() : true) );
}
IMPL_LINK( LegendPositionResources, PositionChangeHdl, RadioButton*, pRadio )
{
//for each radio click ther are coming two change events
//first uncheck of previous button -> ignore that call
//the second call gives the check of the new button
if( pRadio && pRadio->IsChecked() )
m_aChangeLink.Call(NULL);
return 0;
}
void LegendPositionResources::SetChangeHdl( const Link& rLink )
{
m_aChangeLink = rLink;
}
void LegendPositionResources::SetAccessibleRelationMemberOf(Window* pMemberOf)
{
m_pRbtLeft->SetAccessibleRelationMemberOf(pMemberOf);
m_pRbtRight->SetAccessibleRelationMemberOf(pMemberOf);
m_pRbtTop->SetAccessibleRelationMemberOf(pMemberOf);
m_pRbtBottom->SetAccessibleRelationMemberOf(pMemberOf);
}
oldLegendPositionResources::oldLegendPositionResources( Window* pWindow )
: m_xCC() //unused in this scenario : m_xCC() //unused in this scenario
, m_aCbxShow( pWindow ) //unused in this scenario , m_aCbxShow( pWindow ) //unused in this scenario
, m_aRbtLeft( pWindow, SchResId(RBT_LEFT) ) , m_aRbtLeft( pWindow, SchResId(RBT_LEFT) )
...@@ -54,7 +266,7 @@ LegendPositionResources::LegendPositionResources( Window* pWindow ) ...@@ -54,7 +266,7 @@ LegendPositionResources::LegendPositionResources( Window* pWindow )
impl_setRadioButtonToggleHdl(); impl_setRadioButtonToggleHdl();
} }
LegendPositionResources::LegendPositionResources( Window* pWindow, const uno::Reference< uno::XComponentContext >& xCC ) oldLegendPositionResources::oldLegendPositionResources( Window* pWindow, const uno::Reference< uno::XComponentContext >& xCC )
: m_xCC( xCC ) : m_xCC( xCC )
, m_aCbxShow( pWindow, SchResId(CBX_SHOWLEGEND) ) , m_aCbxShow( pWindow, SchResId(CBX_SHOWLEGEND) )
, m_aRbtLeft( pWindow, SchResId(RBT_LEFT) ) , m_aRbtLeft( pWindow, SchResId(RBT_LEFT) )
...@@ -62,7 +274,7 @@ LegendPositionResources::LegendPositionResources( Window* pWindow, const uno::Re ...@@ -62,7 +274,7 @@ LegendPositionResources::LegendPositionResources( Window* pWindow, const uno::Re
, m_aRbtTop( pWindow, SchResId(RBT_TOP) ) , m_aRbtTop( pWindow, SchResId(RBT_TOP) )
, m_aRbtBottom( pWindow, SchResId(RBT_BOTTOM) ) , m_aRbtBottom( pWindow, SchResId(RBT_BOTTOM) )
{ {
m_aCbxShow.SetToggleHdl( LINK( this, LegendPositionResources, PositionEnableHdl ) ); m_aCbxShow.SetToggleHdl( LINK( this, oldLegendPositionResources, PositionEnableHdl ) );
impl_setRadioButtonToggleHdl(); impl_setRadioButtonToggleHdl();
m_aCbxShow.SetAccessibleRelationMemberOf(&m_aCbxShow); m_aCbxShow.SetAccessibleRelationMemberOf(&m_aCbxShow);
m_aRbtLeft.SetAccessibleRelationMemberOf(&m_aCbxShow); m_aRbtLeft.SetAccessibleRelationMemberOf(&m_aCbxShow);
...@@ -71,19 +283,19 @@ LegendPositionResources::LegendPositionResources( Window* pWindow, const uno::Re ...@@ -71,19 +283,19 @@ LegendPositionResources::LegendPositionResources( Window* pWindow, const uno::Re
m_aRbtBottom.SetAccessibleRelationMemberOf(&m_aCbxShow); m_aRbtBottom.SetAccessibleRelationMemberOf(&m_aCbxShow);
} }
void LegendPositionResources::impl_setRadioButtonToggleHdl() void oldLegendPositionResources::impl_setRadioButtonToggleHdl()
{ {
m_aRbtLeft.SetToggleHdl( LINK( this, LegendPositionResources, PositionChangeHdl ) ); m_aRbtLeft.SetToggleHdl( LINK( this, oldLegendPositionResources, PositionChangeHdl ) );
m_aRbtTop.SetToggleHdl( LINK( this, LegendPositionResources, PositionChangeHdl ) ); m_aRbtTop.SetToggleHdl( LINK( this, oldLegendPositionResources, PositionChangeHdl ) );
m_aRbtRight.SetToggleHdl( LINK( this, LegendPositionResources, PositionChangeHdl ) ); m_aRbtRight.SetToggleHdl( LINK( this, oldLegendPositionResources, PositionChangeHdl ) );
m_aRbtBottom.SetToggleHdl( LINK( this, LegendPositionResources, PositionChangeHdl ) ); m_aRbtBottom.SetToggleHdl( LINK( this, oldLegendPositionResources, PositionChangeHdl ) );
} }
LegendPositionResources::~LegendPositionResources() oldLegendPositionResources::~oldLegendPositionResources()
{ {
} }
void LegendPositionResources::writeToResources( const uno::Reference< frame::XModel >& xChartModel ) void oldLegendPositionResources::writeToResources( const uno::Reference< frame::XModel >& xChartModel )
{ {
try try
{ {
...@@ -128,7 +340,7 @@ void LegendPositionResources::writeToResources( const uno::Reference< frame::XMo ...@@ -128,7 +340,7 @@ void LegendPositionResources::writeToResources( const uno::Reference< frame::XMo
} }
} }
void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Reference< frame::XModel >& xChartModel ) const void oldLegendPositionResources::writeToModel( const ::com::sun::star::uno::Reference< frame::XModel >& xChartModel ) const
{ {
try try
{ {
...@@ -172,7 +384,7 @@ void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Referen ...@@ -172,7 +384,7 @@ void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Referen
} }
} }
IMPL_LINK_NOARG(LegendPositionResources, PositionEnableHdl) IMPL_LINK_NOARG(oldLegendPositionResources, PositionEnableHdl)
{ {
sal_Bool bEnable = m_aCbxShow.IsChecked(); sal_Bool bEnable = m_aCbxShow.IsChecked();
...@@ -186,7 +398,7 @@ IMPL_LINK_NOARG(LegendPositionResources, PositionEnableHdl) ...@@ -186,7 +398,7 @@ IMPL_LINK_NOARG(LegendPositionResources, PositionEnableHdl)
return 0; return 0;
} }
void LegendPositionResources::initFromItemSet( const SfxItemSet& rInAttrs ) void oldLegendPositionResources::initFromItemSet( const SfxItemSet& rInAttrs )
{ {
const SfxPoolItem* pPoolItem = NULL; const SfxPoolItem* pPoolItem = NULL;
if( rInAttrs.GetItemState( SCHATTR_LEGEND_POS, sal_True, &pPoolItem ) == SFX_ITEM_SET ) if( rInAttrs.GetItemState( SCHATTR_LEGEND_POS, sal_True, &pPoolItem ) == SFX_ITEM_SET )
...@@ -218,7 +430,7 @@ void LegendPositionResources::initFromItemSet( const SfxItemSet& rInAttrs ) ...@@ -218,7 +430,7 @@ void LegendPositionResources::initFromItemSet( const SfxItemSet& rInAttrs )
} }
} }
void LegendPositionResources::writeToItemSet( SfxItemSet& rOutAttrs ) const void oldLegendPositionResources::writeToItemSet( SfxItemSet& rOutAttrs ) const
{ {
sal_Int32 nLegendPosition = chart2::LegendPosition_CUSTOM; sal_Int32 nLegendPosition = chart2::LegendPosition_CUSTOM;
if( m_aRbtLeft.IsChecked() ) if( m_aRbtLeft.IsChecked() )
...@@ -234,7 +446,7 @@ void LegendPositionResources::writeToItemSet( SfxItemSet& rOutAttrs ) const ...@@ -234,7 +446,7 @@ void LegendPositionResources::writeToItemSet( SfxItemSet& rOutAttrs ) const
rOutAttrs.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, m_aCbxShow.IsChecked()) ); rOutAttrs.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, m_aCbxShow.IsChecked()) );
} }
IMPL_LINK( LegendPositionResources, PositionChangeHdl, RadioButton*, pRadio ) IMPL_LINK( oldLegendPositionResources, PositionChangeHdl, RadioButton*, pRadio )
{ {
//for each radio click ther are coming two change events //for each radio click ther are coming two change events
//first uncheck of previous button -> ignore that call //first uncheck of previous button -> ignore that call
...@@ -244,12 +456,12 @@ IMPL_LINK( LegendPositionResources, PositionChangeHdl, RadioButton*, pRadio ) ...@@ -244,12 +456,12 @@ IMPL_LINK( LegendPositionResources, PositionChangeHdl, RadioButton*, pRadio )
return 0; return 0;
} }
void LegendPositionResources::SetChangeHdl( const Link& rLink ) void oldLegendPositionResources::SetChangeHdl( const Link& rLink )
{ {
m_aChangeLink = rLink; m_aChangeLink = rLink;
} }
void LegendPositionResources::SetAccessibleRelationMemberOf(Window* pMemberOf) void oldLegendPositionResources::SetAccessibleRelationMemberOf(Window* pMemberOf)
{ {
m_aRbtLeft.SetAccessibleRelationMemberOf(pMemberOf); m_aRbtLeft.SetAccessibleRelationMemberOf(pMemberOf);
m_aRbtRight.SetAccessibleRelationMemberOf(pMemberOf); m_aRbtRight.SetAccessibleRelationMemberOf(pMemberOf);
...@@ -257,6 +469,7 @@ void LegendPositionResources::SetAccessibleRelationMemberOf(Window* pMemberOf) ...@@ -257,6 +469,7 @@ void LegendPositionResources::SetAccessibleRelationMemberOf(Window* pMemberOf)
m_aRbtBottom.SetAccessibleRelationMemberOf(pMemberOf); m_aRbtBottom.SetAccessibleRelationMemberOf(pMemberOf);
} }
} //namespace chart } //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -19,10 +19,9 @@ ...@@ -19,10 +19,9 @@
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_LEGENDPOSITION_HXX #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_LEGENDPOSITION_HXX
#define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_LEGENDPOSITION_HXX #define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_LEGENDPOSITION_HXX
// header for class CheckBox #include <vcl/builder.hxx>
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <vcl/fixed.hxx> #include <vcl/fixed.hxx>
// header for class SfxItemSet
#include <svl/itemset.hxx> #include <svl/itemset.hxx>
#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
...@@ -35,9 +34,9 @@ class LegendPositionResources ...@@ -35,9 +34,9 @@ class LegendPositionResources
public: public:
//constructor without Display checkbox //constructor without Display checkbox
LegendPositionResources( Window* pParent ); LegendPositionResources(VclBuilderContainer& rParent);
//constructor inclusive Display checkbox //constructor inclusive Display checkbox
LegendPositionResources( Window* pParent, const ::com::sun::star::uno::Reference< LegendPositionResources(VclBuilderContainer& rParent, const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext>& xCC ); ::com::sun::star::uno::XComponentContext>& xCC );
virtual ~LegendPositionResources(); virtual ~LegendPositionResources();
...@@ -59,6 +58,50 @@ public: ...@@ -59,6 +58,50 @@ public:
private: private:
void impl_setRadioButtonToggleHdl(); void impl_setRadioButtonToggleHdl();
private:
::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext> m_xCC;
CheckBox* m_pCbxShow;
RadioButton* m_pRbtLeft;
RadioButton* m_pRbtRight;
RadioButton* m_pRbtTop;
RadioButton* m_pRbtBottom;
Link m_aChangeLink;
};
class oldLegendPositionResources
{
public:
//constructor without Display checkbox
oldLegendPositionResources( Window* pParent );
//constructor inclusive Display checkbox
oldLegendPositionResources( Window* pParent, const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext>& xCC );
virtual ~oldLegendPositionResources();
void writeToResources( const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xChartModel );
void writeToModel( const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xChartModel ) const;
void initFromItemSet( const SfxItemSet& rInAttrs );
void writeToItemSet( SfxItemSet& rOutAttrs ) const;
void SetChangeHdl( const Link& rLink );
DECL_LINK( PositionEnableHdl, void* );
DECL_LINK( PositionChangeHdl, RadioButton* );
void SetAccessibleRelationMemberOf(Window* pMemberOf);
private:
void impl_setRadioButtonToggleHdl();
private: private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext> m_xCC; ::com::sun::star::uno::XComponentContext> m_xCC;
...@@ -73,6 +116,7 @@ private: ...@@ -73,6 +116,7 @@ private:
Link m_aChangeLink; Link m_aChangeLink;
}; };
} //namespace chart } //namespace chart
#endif #endif
......
...@@ -34,18 +34,11 @@ SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow, const SfxItemSet& rInA ...@@ -34,18 +34,11 @@ SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow, const SfxItemSet& rInA
,"tp_LegendPosition" ,"tp_LegendPosition"
,"modules/schart/ui/tp_LegendPosition.ui" ,"modules/schart/ui/tp_LegendPosition.ui"
, rInAttrs ) , rInAttrs )
, m_aLegendPositionResources(*this)
{ {
get(m_pLbTextDirection,"LB_LEGEND_TEXTDIR"); get(m_pLbTextDirection,"LB_LEGEND_TEXTDIR");
m_pLbTextDirection->SetDropDownLineCount(3); m_pLbTextDirection->SetDropDownLineCount(3);
get(m_pBxPosition,"boxPOSITION");
m_pLegendPositionResources = new LegendPositionResources(m_pBxPosition);
}
SchLegendPosTabPage::~SchLegendPosTabPage()
{
delete m_pLegendPositionResources;
} }
SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow, const SfxItemSet& rOutAttrs) SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow, const SfxItemSet& rOutAttrs)
...@@ -55,7 +48,7 @@ SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow, const SfxItemSet& rOutA ...@@ -55,7 +48,7 @@ SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow, const SfxItemSet& rOutA
sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs) sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{ {
m_pLegendPositionResources->writeToItemSet(rOutAttrs); m_aLegendPositionResources.writeToItemSet(rOutAttrs);
if( m_pLbTextDirection->GetSelectEntryCount() > 0 ) if( m_pLbTextDirection->GetSelectEntryCount() > 0 )
rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_pLbTextDirection->GetSelectEntryValue() ) ); rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_pLbTextDirection->GetSelectEntryValue() ) );
...@@ -65,7 +58,7 @@ sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs) ...@@ -65,7 +58,7 @@ sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs)
void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs) void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs)
{ {
m_pLegendPositionResources->initFromItemSet(rInAttrs); m_aLegendPositionResources.initFromItemSet(rInAttrs);
const SfxPoolItem* pPoolItem = 0; const SfxPoolItem* pPoolItem = 0;
if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET ) if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET )
......
...@@ -19,30 +19,24 @@ ...@@ -19,30 +19,24 @@
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_LEGENDPOSITION_HXX #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_LEGENDPOSITION_HXX
#define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_LEGENDPOSITION_HXX #define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_LEGENDPOSITION_HXX
// header for SfxTabPage
#include <sfx2/tabdlg.hxx> #include <sfx2/tabdlg.hxx>
// header for FixedText
#include <vcl/fixed.hxx> #include <vcl/fixed.hxx>
#include "res_LegendPosition.hxx"
#include "TextDirectionListBox.hxx" #include "TextDirectionListBox.hxx"
namespace chart namespace chart
{ {
class LegendPositionResources;
class SchLegendPosTabPage : public SfxTabPage class SchLegendPosTabPage : public SfxTabPage
{ {
private: private:
// boost::scoped_ptr< LegendPositionResources > m_apLegendPositionResources; LegendPositionResources m_aLegendPositionResources;
LegendPositionResources* m_pLegendPositionResources;
VclBox* m_pBxPosition;
TextDirectionListBox* m_pLbTextDirection; TextDirectionListBox* m_pLbTextDirection;
public: public:
SchLegendPosTabPage(Window* pParent, const SfxItemSet& rInAttrs); SchLegendPosTabPage(Window* pParent, const SfxItemSet& rInAttrs);
virtual ~SchLegendPosTabPage();
static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs); static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs);
virtual sal_Bool FillItemSet(SfxItemSet& rOutAttrs); virtual sal_Bool FillItemSet(SfxItemSet& rOutAttrs);
......
...@@ -42,7 +42,7 @@ TitlesAndObjectsTabPage::TitlesAndObjectsTabPage( svt::OWizardMachine* pParent ...@@ -42,7 +42,7 @@ TitlesAndObjectsTabPage::TitlesAndObjectsTabPage( svt::OWizardMachine* pParent
, m_aFT_TitleDescription( this, SchResId( FT_TITLEDESCRIPTION ) ) , m_aFT_TitleDescription( this, SchResId( FT_TITLEDESCRIPTION ) )
, m_aFL_Vertical( this, SchResId( FL_VERTICAL ) ) , m_aFL_Vertical( this, SchResId( FL_VERTICAL ) )
, m_apTitleResources( new TitleResources(this,false) ) , m_apTitleResources( new TitleResources(this,false) )
, m_apLegendPositionResources( new LegendPositionResources(this,xContext) ) , m_apLegendPositionResources( new oldLegendPositionResources(this,xContext) )
, m_aFL_Grids( this, SchResId( FL_GRIDS ) ) , m_aFL_Grids( this, SchResId( FL_GRIDS ) )
, m_aCB_Grid_X( this, SchResId( CB_X_SECONDARY ) ) , m_aCB_Grid_X( this, SchResId( CB_X_SECONDARY ) )
, m_aCB_Grid_Y( this, SchResId( CB_Y_SECONDARY ) ) , m_aCB_Grid_Y( this, SchResId( CB_Y_SECONDARY ) )
......
...@@ -36,7 +36,7 @@ namespace chart ...@@ -36,7 +36,7 @@ namespace chart
/** /**
*/ */
class TitleResources; class TitleResources;
class LegendPositionResources; class oldLegendPositionResources;
class TitlesAndObjectsTabPage : public svt::OWizardPage class TitlesAndObjectsTabPage : public svt::OWizardPage
{ {
public: public:
...@@ -60,7 +60,7 @@ protected: ...@@ -60,7 +60,7 @@ protected:
FixedLine m_aFL_Vertical; FixedLine m_aFL_Vertical;
boost::scoped_ptr< TitleResources > m_apTitleResources; boost::scoped_ptr< TitleResources > m_apTitleResources;
boost::scoped_ptr< LegendPositionResources > m_apLegendPositionResources; boost::scoped_ptr< oldLegendPositionResources > m_apLegendPositionResources;
FixedLine m_aFL_Grids; FixedLine m_aFL_Grids;
CheckBox m_aCB_Grid_X; CheckBox m_aCB_Grid_X;
......
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
namespace chart namespace chart
{ {
class LegendPositionResources; class oldLegendPositionResources;
class SchLegendDlg : public ModalDialog class SchLegendDlg : public ModalDialog
{ {
private: private:
::std::auto_ptr< LegendPositionResources > m_apLegendPositionResources; ::std::auto_ptr< oldLegendPositionResources > m_apLegendPositionResources;
OKButton aBtnOK; OKButton aBtnOK;
CancelButton aBtnCancel; CancelButton aBtnCancel;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">12</property>
<child> <child>
<object class="GtkFrame" id="framePOSITION"> <object class="GtkFrame" id="framePOSITION">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -21,12 +21,82 @@ ...@@ -21,12 +21,82 @@
<property name="top_padding">6</property> <property name="top_padding">6</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<object class="GtkBox" id="boxPOSITION"> <object class="GtkGrid" id="grid1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="row_spacing">6</property>
<child>
<object class="GtkRadioButton" id="left">
<property name="label" translatable="yes">_Left</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">right</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="right">
<property name="label" translatable="yes">_Right</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">top</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="top">
<property name="label" translatable="yes">_Top</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">bottom</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child> <child>
<placeholder/> <object class="GtkRadioButton" id="bottom">
<property name="label" translatable="yes">_Bottom</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">left</property>
</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> </child>
</object> </object>
</child> </child>
......
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