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;
SchLegendDlg::SchLegendDlg(Window* pWindow, const uno::Reference< uno::XComponentContext>& xCC )
: ModalDialog(pWindow, SchResId(DLG_LEGEND))
, m_apLegendPositionResources( new LegendPositionResources(this,xCC) )
, m_apLegendPositionResources( new oldLegendPositionResources(this,xCC) )
, aBtnOK(this, SchResId(BTN_OK))
, aBtnCancel(this, SchResId(BTN_CANCEL))
, aBtnHelp(this, SchResId(BTN_HELP))
......
......@@ -19,10 +19,9 @@
#ifndef 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/fixed.hxx>
// header for class SfxItemSet
#include <svl/itemset.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
......@@ -35,9 +34,9 @@ class LegendPositionResources
public:
//constructor without Display checkbox
LegendPositionResources( Window* pParent );
LegendPositionResources(VclBuilderContainer& rParent);
//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 );
virtual ~LegendPositionResources();
......@@ -59,6 +58,50 @@ public:
private:
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:
::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext> m_xCC;
......@@ -73,6 +116,7 @@ private:
Link m_aChangeLink;
};
} //namespace chart
#endif
......
......@@ -34,18 +34,11 @@ SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow, const SfxItemSet& rInA
,"tp_LegendPosition"
,"modules/schart/ui/tp_LegendPosition.ui"
, rInAttrs )
, m_aLegendPositionResources(*this)
{
get(m_pLbTextDirection,"LB_LEGEND_TEXTDIR");
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)
......@@ -55,7 +48,7 @@ SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow, const SfxItemSet& rOutA
sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{
m_pLegendPositionResources->writeToItemSet(rOutAttrs);
m_aLegendPositionResources.writeToItemSet(rOutAttrs);
if( m_pLbTextDirection->GetSelectEntryCount() > 0 )
rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_pLbTextDirection->GetSelectEntryValue() ) );
......@@ -65,7 +58,7 @@ sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs)
void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs)
{
m_pLegendPositionResources->initFromItemSet(rInAttrs);
m_aLegendPositionResources.initFromItemSet(rInAttrs);
const SfxPoolItem* pPoolItem = 0;
if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET )
......
......@@ -19,30 +19,24 @@
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_LEGENDPOSITION_HXX
#define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_LEGENDPOSITION_HXX
// header for SfxTabPage
#include <sfx2/tabdlg.hxx>
// header for FixedText
#include <vcl/fixed.hxx>
#include "res_LegendPosition.hxx"
#include "TextDirectionListBox.hxx"
namespace chart
{
class LegendPositionResources;
class SchLegendPosTabPage : public SfxTabPage
{
private:
// boost::scoped_ptr< LegendPositionResources > m_apLegendPositionResources;
LegendPositionResources* m_pLegendPositionResources;
VclBox* m_pBxPosition;
LegendPositionResources m_aLegendPositionResources;
TextDirectionListBox* m_pLbTextDirection;
public:
SchLegendPosTabPage(Window* pParent, const SfxItemSet& rInAttrs);
virtual ~SchLegendPosTabPage();
static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs);
virtual sal_Bool FillItemSet(SfxItemSet& rOutAttrs);
......
......@@ -42,7 +42,7 @@ TitlesAndObjectsTabPage::TitlesAndObjectsTabPage( svt::OWizardMachine* pParent
, m_aFT_TitleDescription( this, SchResId( FT_TITLEDESCRIPTION ) )
, m_aFL_Vertical( this, SchResId( FL_VERTICAL ) )
, 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_aCB_Grid_X( this, SchResId( CB_X_SECONDARY ) )
, m_aCB_Grid_Y( this, SchResId( CB_Y_SECONDARY ) )
......
......@@ -36,7 +36,7 @@ namespace chart
/**
*/
class TitleResources;
class LegendPositionResources;
class oldLegendPositionResources;
class TitlesAndObjectsTabPage : public svt::OWizardPage
{
public:
......@@ -60,7 +60,7 @@ protected:
FixedLine m_aFL_Vertical;
boost::scoped_ptr< TitleResources > m_apTitleResources;
boost::scoped_ptr< LegendPositionResources > m_apLegendPositionResources;
boost::scoped_ptr< oldLegendPositionResources > m_apLegendPositionResources;
FixedLine m_aFL_Grids;
CheckBox m_aCB_Grid_X;
......
......@@ -31,11 +31,11 @@
namespace chart
{
class LegendPositionResources;
class oldLegendPositionResources;
class SchLegendDlg : public ModalDialog
{
private:
::std::auto_ptr< LegendPositionResources > m_apLegendPositionResources;
::std::auto_ptr< oldLegendPositionResources > m_apLegendPositionResources;
OKButton aBtnOK;
CancelButton aBtnCancel;
......
......@@ -7,7 +7,7 @@
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="spacing">12</property>
<child>
<object class="GtkFrame" id="framePOSITION">
<property name="visible">True</property>
......@@ -21,12 +21,82 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="boxPOSITION">
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="row_spacing">6</property>
<child>
<placeholder/>
<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>
<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>
</object>
</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