summaryrefslogtreecommitdiff
path: root/chart2/source/controller/dialogs
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@edx.srv.br>2013-12-18 00:45:32 -0200
committerCaolán McNamara <caolanm@redhat.com>2013-12-19 13:30:41 +0000
commit9dccff429db197a92ed2af957fb6d3d75b3f2154 (patch)
tree7b2cd494d9ec1023c3568e221f60f74f51ac5580 /chart2/source/controller/dialogs
parent6c5c79e2032ecc980e6774656a67ca67ce45b108 (diff)
Convert chart data labels tabpage to .ui
Change-Id: I6ffd992fe8a2cb290c8f8992922f0e54276e6ae1 Reviewed-on: https://gerrit.libreoffice.org/7124 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2/source/controller/dialogs')
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx2
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.cxx310
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.hxx65
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.cxx11
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.src32
5 files changed, 366 insertions, 54 deletions
diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
index 9a1663821544..4047644b5b87 100644
--- a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
@@ -31,7 +31,7 @@ DataLabelsDialog::DataLabelsDialog(Window* pWindow, const SfxItemSet& rInAttrs,
m_aBtnOK(this, SchResId(BTN_OK)),
m_aBtnCancel(this, SchResId(BTN_CANCEL)),
m_aBtnHelp(this, SchResId(BTN_HELP)),
- m_apDataLabelResources( new DataLabelResources(this,rInAttrs) ),
+ m_apDataLabelResources( new oldDataLabelResources(this,rInAttrs) ),
m_rInAttrs(rInAttrs)
{
FreeResource();
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index b69a9e36d5ae..c0caf79bd688 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -94,7 +94,289 @@ void lcl_setBoolItemToCheckBox( const SfxItemSet& rInAttrs, sal_uInt16 nWhichId,
}//end anonymous namespace
-DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAttrs )
+DataLabelResources::DataLabelResources(SfxTabPage* pWindow, const SfxItemSet& rInAttrs )
+ :
+ m_pNumberFormatter(0),
+ m_bNumberFormatMixedState(true),
+ m_bPercentFormatMixedState(true),
+ m_nNumberFormatForValue(0),
+ m_nNumberFormatForPercent(11),
+ m_bSourceFormatMixedState(true),
+ m_bPercentSourceMixedState(true),
+ m_bSourceFormatForValue(true),
+ m_bSourceFormatForPercent(true),
+ m_pWindow(pWindow),
+ m_pPool(rInAttrs.GetPool())
+{
+ pWindow->get(m_pCBNumber, "CB_VALUE_AS_NUMBER");
+ pWindow->get(m_pPB_NumberFormatForValue, "PB_NUMBERFORMAT");
+ pWindow->get(m_pCBPercent, "CB_VALUE_AS_PERCENTAGE");
+ pWindow->get(m_pPB_NumberFormatForPercent, "PB_PERCENT_NUMBERFORMAT");
+ pWindow->get(m_pCBCategory, "CB_CATEGORY");
+ pWindow->get(m_pCBSymbol, "CB_SYMBOL");
+
+ pWindow->get(m_pBxLabelPlacement, "boxPLACEMENT");
+ pWindow->get(m_pLB_LabelPlacement, "LB_LABEL_PLACEMENT");
+
+ pWindow->get(m_pDC_Dial, "CT_DIAL");
+ pWindow->get(m_pFT_Dial, "CT_LABEL_DIAL");
+
+ m_pDC_Dial->SetText(m_pFT_Dial->GetText());
+
+ pWindow->get(m_pNF_Degrees, "NF_LABEL_DEGREES");
+ pWindow->get(m_pLB_TextDirection, "LB_LABEL_TEXTDIR");
+ pWindow->get(m_pBxTextDirection, "boxTXT_DIRECTION");
+ pWindow->get(m_pBxOrientation, "boxORIENTATION");
+
+ pWindow->get(m_pSeparatorResources, "boxSEPARATOR");
+ pWindow->get(m_pLB_Separator, "LB_TEXT_SEPARATOR");
+
+ m_aEntryMap[0] = " ";
+ m_aEntryMap[1] = ", ";
+ m_aEntryMap[2] = "; ";
+ m_aEntryMap[3] = "\n" ;
+
+ //fill label placement list
+ std::map< sal_Int32, OUString > aPlacementToStringMap;
+ for( sal_Int32 nEnum=0; nEnum<m_pLB_LabelPlacement->GetEntryCount(); ++nEnum )
+ aPlacementToStringMap[nEnum] = m_pLB_LabelPlacement->GetEntry(static_cast<sal_uInt16>(nEnum));
+
+ ::com::sun::star::uno::Sequence < sal_Int32 > aAvailabelPlacementList;
+ const SfxPoolItem *pPoolItem = NULL;
+ if( rInAttrs.GetItemState(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, sal_True, &pPoolItem) == SFX_ITEM_SET )
+ aAvailabelPlacementList =((const SfxIntegerListItem*)pPoolItem)->GetConstSequence();
+
+ m_pLB_LabelPlacement->Clear();
+ for( sal_Int32 nN=0; nN<aAvailabelPlacementList.getLength(); ++nN )
+ {
+ sal_uInt16 nListBoxPos = static_cast<sal_uInt16>( nN );
+ sal_Int32 nPlacement = aAvailabelPlacementList[nN];
+ m_aPlacementToListBoxMap[nPlacement]=nListBoxPos;
+ m_aListBoxToPlacementMap[nListBoxPos]=nPlacement;
+ m_pLB_LabelPlacement->InsertEntry( aPlacementToStringMap[nPlacement] );
+ }
+ m_pLB_LabelPlacement->SetDropDownLineCount(m_pLB_LabelPlacement->GetEntryCount());
+
+ //some click handler
+ m_pPB_NumberFormatForValue->SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) );
+ m_pPB_NumberFormatForPercent->SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) );
+ m_pCBNumber->SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
+ m_pCBPercent->SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
+ m_pCBCategory->SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
+ m_pCBSymbol->SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
+
+ m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState );
+ m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState);
+
+ if( rInAttrs.GetItemState(SCHATTR_DATADESCR_NO_PERCENTVALUE, sal_True, &pPoolItem) == SFX_ITEM_SET )
+ {
+ bool bForbidPercentValue = (static_cast< const SfxBoolItem & >( rInAttrs.Get( SCHATTR_DATADESCR_NO_PERCENTVALUE )).GetValue() );
+ if( bForbidPercentValue )
+ m_pCBPercent->Enable(false);
+ }
+
+ m_pDC_Dial->SetLinkedField( m_pNF_Degrees );
+}
+
+DataLabelResources::~DataLabelResources()
+{
+}
+
+void DataLabelResources::SetNumberFormatter( SvNumberFormatter* pFormatter )
+{
+ m_pNumberFormatter = pFormatter;
+}
+
+IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
+{
+ if( !m_pPool || !m_pNumberFormatter )
+ {
+ OSL_FAIL("Missing item pool or number formatter");
+ return 1;
+ }
+
+ if( pButton == m_pPB_NumberFormatForValue && !m_pCBNumber->IsChecked())
+ m_pCBNumber->Check();
+ else if( pButton == m_pPB_NumberFormatForPercent && !m_pCBPercent->IsChecked())
+ m_pCBPercent->Check();
+
+ SfxItemSet aNumberSet = NumberFormatDialog::CreateEmptyItemSetForNumberFormatDialog( *m_pPool );
+ aNumberSet.Put (SvxNumberInfoItem( m_pNumberFormatter, (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO));
+
+ bool bPercent = ( pButton == m_pPB_NumberFormatForPercent );
+
+ sal_uLong& rnFormatKey = bPercent ? m_nNumberFormatForPercent : m_nNumberFormatForValue;
+ bool& rUseSourceFormat = bPercent ? m_bSourceFormatForPercent : m_bSourceFormatForValue;
+ bool& rbMixedState = bPercent ? m_bPercentFormatMixedState : m_bNumberFormatMixedState;
+ bool& rbSourceMixedState = bPercent ? m_bPercentSourceMixedState : m_bSourceFormatMixedState;
+
+ if(!rbMixedState)
+ aNumberSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, rnFormatKey ));
+ aNumberSet.Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, rUseSourceFormat ));
+
+ NumberFormatDialog aDlg(m_pWindow, aNumberSet);
+ if( bPercent )
+ aDlg.SetText( SCH_RESSTR( STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE ) );
+ if( RET_OK == aDlg.Execute() )
+ {
+ const SfxItemSet* pResult = aDlg.GetOutputItemSet();
+ if( pResult )
+ {
+ bool bOldSource = rUseSourceFormat;
+ sal_uLong nOldFormat = rnFormatKey;
+ bool bOldMixedState = rbMixedState || rbSourceMixedState;
+
+ rbMixedState = !lcl_ReadNumberFormatFromItemSet( *pResult, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, rnFormatKey, rUseSourceFormat, rbSourceMixedState );
+
+ //todo this maybe can be removed when the numberformatter dialog does handle mixed state for source format correctly
+ if( bOldMixedState && bOldSource == rUseSourceFormat && nOldFormat == rnFormatKey )
+ rbMixedState = rbSourceMixedState = true;
+ }
+ }
+ return 0;
+}
+
+IMPL_LINK( DataLabelResources, CheckHdl, CheckBox*, pBox )
+{
+ if( pBox )
+ pBox->EnableTriState( sal_False );
+ EnableControls();
+ return 0;
+}
+
+void DataLabelResources::EnableControls()
+{
+ m_pCBSymbol->Enable( m_pCBNumber->IsChecked() || (m_pCBPercent->IsChecked() && m_pCBPercent->IsEnabled())
+ || m_pCBCategory->IsChecked() );
+
+ // Enable or disable separator, placement and direction based on the check
+ // box states. Note that the check boxes are tri-state.
+ {
+ long nNumberOfCheckedLabelParts = 0;
+ if (m_pCBNumber->GetState() != STATE_NOCHECK)
+ ++nNumberOfCheckedLabelParts;
+ if (m_pCBPercent->GetState() != STATE_NOCHECK && m_pCBPercent->IsEnabled())
+ ++nNumberOfCheckedLabelParts;
+ if (m_pCBCategory->GetState() != STATE_NOCHECK)
+ ++nNumberOfCheckedLabelParts;
+
+ m_pSeparatorResources->Enable( nNumberOfCheckedLabelParts > 1 );
+
+ bool bEnableTextDir = nNumberOfCheckedLabelParts > 0;
+ m_pBxTextDirection->Enable( bEnableTextDir );
+ bool bEnablePlacement = nNumberOfCheckedLabelParts > 0 && m_pLB_LabelPlacement->GetEntryCount()>1;
+ m_pBxLabelPlacement->Enable( bEnablePlacement );
+ }
+
+ m_pPB_NumberFormatForValue->Enable( m_pNumberFormatter && m_pCBNumber->IsChecked() );
+ m_pPB_NumberFormatForPercent->Enable( m_pNumberFormatter && m_pCBPercent->IsChecked() && m_pCBPercent->IsEnabled() );
+
+ bool bEnableRotation = ( m_pCBNumber->IsChecked() || m_pCBPercent->IsChecked() || m_pCBCategory->IsChecked() );
+ m_pBxOrientation->Enable( bEnableRotation );
+}
+
+sal_Bool DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
+{
+ if( m_pCBNumber->IsChecked() )
+ {
+ if( !m_bNumberFormatMixedState )
+ rOutAttrs.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, m_nNumberFormatForValue ));
+ if( !m_bSourceFormatMixedState )
+ rOutAttrs.Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, m_bSourceFormatForValue ));
+ }
+ if( m_pCBPercent->IsChecked() )
+ {
+ if( !m_bPercentFormatMixedState )
+ rOutAttrs.Put( SfxUInt32Item( SCHATTR_PERCENT_NUMBERFORMAT_VALUE, m_nNumberFormatForPercent ));
+ if( !m_bPercentSourceMixedState )
+ rOutAttrs.Put( SfxBoolItem( SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_bSourceFormatForPercent ));
+ }
+
+ if( m_pCBNumber->GetState()!= STATE_DONTKNOW )
+ rOutAttrs.Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_NUMBER, m_pCBNumber->IsChecked() ) );
+ if( m_pCBPercent->GetState()!= STATE_DONTKNOW )
+ rOutAttrs.Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_PERCENTAGE, m_pCBPercent->IsChecked() ) );
+ if( m_pCBCategory->GetState()!= STATE_DONTKNOW )
+ rOutAttrs.Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_CATEGORY, m_pCBCategory->IsChecked() ) );
+ if( m_pCBSymbol->GetState()!= STATE_DONTKNOW )
+ rOutAttrs.Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYMBOL, m_pCBSymbol->IsChecked()) );
+
+ OUString aSep = m_aEntryMap[m_pLB_Separator->GetSelectEntryPos()];
+ rOutAttrs.Put( SfxStringItem( SCHATTR_DATADESCR_SEPARATOR, aSep) );
+
+ ::std::map< sal_uInt16, sal_Int32 >::const_iterator aIt( m_aListBoxToPlacementMap.find(m_pLB_LabelPlacement->GetSelectEntryPos()) );
+ if(aIt!=m_aListBoxToPlacementMap.end())
+ {
+ sal_Int32 nValue = aIt->second;
+ rOutAttrs.Put( SfxInt32Item( SCHATTR_DATADESCR_PLACEMENT, nValue ) );
+ }
+
+ if( m_pLB_TextDirection->GetSelectEntryCount() > 0 )
+ rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_pLB_TextDirection->GetSelectEntryValue() ) );
+
+ if( m_pDC_Dial->IsVisible() )
+ {
+ sal_Int32 nDegrees = m_pDC_Dial->GetRotation();
+ rOutAttrs.Put(SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) );
+ }
+
+ return sal_True;
+}
+
+void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
+{
+ // default state
+ m_pCBSymbol->Enable( sal_False );
+
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_NUMBER, *m_pCBNumber );
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_PERCENTAGE, *m_pCBPercent );
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_CATEGORY, *m_pCBCategory );
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_SYMBOL, *m_pCBSymbol );
+
+ m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState );
+ m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState);
+
+ const SfxPoolItem *pPoolItem = NULL;
+ if( rInAttrs.GetItemState(SCHATTR_DATADESCR_SEPARATOR, sal_True, &pPoolItem) == SFX_ITEM_SET )
+ for(sal_Int32 i=0; i < NUMBER_SEPARATORS; ++i )
+ {
+ if( m_aEntryMap[i] == ((const SfxStringItem*)pPoolItem)->GetValue())
+ m_pLB_Separator->SelectEntryPos( i );
+ }
+ else
+ m_pLB_Separator->SelectEntryPos( 0 );
+
+
+ if( rInAttrs.GetItemState(SCHATTR_DATADESCR_PLACEMENT, sal_True, &pPoolItem) == SFX_ITEM_SET )
+ {
+ sal_Int32 nPlacement = ((const SfxInt32Item*)pPoolItem)->GetValue();
+ ::std::map< sal_Int32, sal_uInt16 >::const_iterator aIt( m_aPlacementToListBoxMap.find(nPlacement) );
+ if(aIt!=m_aPlacementToListBoxMap.end())
+ {
+ sal_uInt16 nPos = aIt->second;
+ m_pLB_LabelPlacement->SelectEntryPos( nPos );
+ }
+ else
+ m_pLB_LabelPlacement->SetNoSelection();
+ }
+ else
+ m_pLB_LabelPlacement->SetNoSelection();
+
+ if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET )
+ m_pLB_TextDirection->SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) );
+
+ if( rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, sal_True, &pPoolItem ) == SFX_ITEM_SET )
+ {
+ sal_Int32 nDegrees = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ m_pDC_Dial->SetRotation( nDegrees );
+ }
+ else
+ m_pDC_Dial->SetRotation( 0 );
+
+ EnableControls();
+}
+
+oldDataLabelResources::oldDataLabelResources( Window* pWindow, const SfxItemSet& rInAttrs )
: m_aCBNumber(pWindow, SchResId(CB_VALUE_AS_NUMBER)),
m_aPB_NumberFormatForValue(pWindow, SchResId(PB_NUMBERFORMAT)),
m_aCBPercent(pWindow, SchResId(CB_VALUE_AS_PERCENTAGE)),
@@ -187,12 +469,12 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt
m_aLB_LabelPlacement.SetPosPixel( Point( m_aSeparatorResources.GetCurrentListBoxPosition().X(), m_aLB_LabelPlacement.GetPosPixel().Y() ) );
//some click handler
- m_aPB_NumberFormatForValue.SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) );
- m_aPB_NumberFormatForPercent.SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) );
- m_aCBNumber.SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
- m_aCBPercent.SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
- m_aCBCategory.SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
- m_aCBSymbol.SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
+ m_aPB_NumberFormatForValue.SetClickHdl( LINK( this, oldDataLabelResources, NumberFormatDialogHdl ) );
+ m_aPB_NumberFormatForPercent.SetClickHdl( LINK( this, oldDataLabelResources, NumberFormatDialogHdl ) );
+ m_aCBNumber.SetClickHdl( LINK( this, oldDataLabelResources, CheckHdl ));
+ m_aCBPercent.SetClickHdl( LINK( this, oldDataLabelResources, CheckHdl ));
+ m_aCBCategory.SetClickHdl( LINK( this, oldDataLabelResources, CheckHdl ));
+ m_aCBSymbol.SetClickHdl( LINK( this, oldDataLabelResources, CheckHdl ));
m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState );
m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState);
@@ -207,16 +489,16 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt
m_aDC_Dial.SetLinkedField( &m_aNF_Degrees );
}
-DataLabelResources::~DataLabelResources()
+oldDataLabelResources::~oldDataLabelResources()
{
}
-void DataLabelResources::SetNumberFormatter( SvNumberFormatter* pFormatter )
+void oldDataLabelResources::SetNumberFormatter( SvNumberFormatter* pFormatter )
{
m_pNumberFormatter = pFormatter;
}
-IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
+IMPL_LINK( oldDataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
{
if( !m_pPool || !m_pNumberFormatter )
{
@@ -265,7 +547,7 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
return 0;
}
-IMPL_LINK( DataLabelResources, CheckHdl, CheckBox*, pBox )
+IMPL_LINK( oldDataLabelResources, CheckHdl, CheckBox*, pBox )
{
if( pBox )
pBox->EnableTriState( sal_False );
@@ -273,7 +555,7 @@ IMPL_LINK( DataLabelResources, CheckHdl, CheckBox*, pBox )
return 0;
}
-void DataLabelResources::EnableControls()
+void oldDataLabelResources::EnableControls()
{
m_aCBSymbol.Enable( m_aCBNumber.IsChecked() || (m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled()) || m_aCBCategory.IsChecked() );
@@ -306,7 +588,7 @@ void DataLabelResources::EnableControls()
m_aNF_Degrees.Enable( bEnableRotation );
}
-sal_Bool DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
+sal_Bool oldDataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
{
if( m_aCBNumber.IsChecked() )
{
@@ -352,7 +634,7 @@ sal_Bool DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
return sal_True;
}
-void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
+void oldDataLabelResources::Reset(const SfxItemSet& rInAttrs)
{
// default state
m_aCBSymbol.Enable( sal_False );
diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx
index 515dc3d542b8..4e0daf48a706 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.hxx
@@ -19,15 +19,19 @@
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_DATALABEL_HXX
#define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_DATALABEL_HXX
+#define NUMBER_SEPARATORS 4
+
#include "res_TextSeparator.hxx"
// header for class CheckBox
#include <vcl/button.hxx>
+#include <vcl/layout.hxx>
// header for class SfxItemSet
#include <svl/itemset.hxx>
#include "TextDirectionListBox.hxx"
#include <svx/dialcontrol.hxx>
#include <svx/wrapfield.hxx>
+#include <sfx2/tabdlg.hxx>
class SvNumberFormatter;
@@ -37,7 +41,7 @@ namespace chart
class DataLabelResources
{
public:
- DataLabelResources( Window* pParent, const SfxItemSet& rInAttrs );
+ DataLabelResources( SfxTabPage* pParent, const SfxItemSet& rInAttrs );
virtual ~DataLabelResources();
sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const;
@@ -46,6 +50,64 @@ public:
void SetNumberFormatter( SvNumberFormatter* pFormatter );
private:
+ CheckBox* m_pCBNumber;
+ PushButton* m_pPB_NumberFormatForValue;
+ CheckBox* m_pCBPercent;
+ PushButton* m_pPB_NumberFormatForPercent;
+ CheckBox* m_pCBCategory;
+ CheckBox* m_pCBSymbol;
+
+// TextSeparatorResources m_aSeparatorResources;
+ VclHBox* m_pSeparatorResources;
+ ListBox* m_pLB_Separator;
+ OUString m_aEntryMap[NUMBER_SEPARATORS];
+
+ VclHBox* m_pBxLabelPlacement;
+ ListBox* m_pLB_LabelPlacement;
+
+ VclHBox* m_pBxOrientation;
+ svx::DialControl* m_pDC_Dial;
+ FixedText* m_pFT_Dial;
+ svx::WrapField* m_pNF_Degrees;
+
+ VclHBox* m_pBxTextDirection;
+ TextDirectionListBox* m_pLB_TextDirection;
+
+ ::std::map< sal_Int32, sal_uInt16 > m_aPlacementToListBoxMap;
+ ::std::map< sal_uInt16, sal_Int32 > m_aListBoxToPlacementMap;
+
+ SvNumberFormatter* m_pNumberFormatter;
+ bool m_bNumberFormatMixedState;
+ bool m_bPercentFormatMixedState;
+ sal_uLong m_nNumberFormatForValue;
+ sal_uLong m_nNumberFormatForPercent;
+
+ bool m_bSourceFormatMixedState;
+ bool m_bPercentSourceMixedState;
+ bool m_bSourceFormatForValue;
+ bool m_bSourceFormatForPercent;
+
+ SfxTabPage* m_pWindow;
+ SfxItemPool* m_pPool;
+
+ DECL_LINK(NumberFormatDialogHdl, PushButton * );
+ DECL_LINK(CheckHdl, CheckBox* );
+ void EnableControls();
+};
+
+class oldDataLabelResources
+{
+public:
+ oldDataLabelResources( Window* pParent, const SfxItemSet& rInAttrs );
+
+ virtual ~oldDataLabelResources();
+
+ sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const;
+ void Reset(const SfxItemSet& rInAttrs);
+
+ void SetNumberFormatter( SvNumberFormatter* pFormatter );
+
+private:
CheckBox m_aCBNumber;
PushButton m_aPB_NumberFormatForValue;
CheckBox m_aCBPercent;
@@ -87,7 +149,6 @@ private:
DECL_LINK(CheckHdl, CheckBox* );
void EnableControls();
};
-
} //namespace chart
#endif
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx
index 53bcebfaca51..3a0d6e71f4ad 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx
@@ -26,18 +26,19 @@ namespace chart
{
DataLabelsTabPage::DataLabelsTabPage(Window* pWindow, const SfxItemSet& rInAttrs) :
- SfxTabPage(pWindow, SchResId(TP_DATA_DESCR), rInAttrs),
- m_aDataLabelResources(this, rInAttrs)
+ SfxTabPage(pWindow
+ , "tp_DataLabel"
+ , "modules/schart/ui/tp_DataLabel.ui"
+ , rInAttrs)
+ , m_aDataLabelResources(this, rInAttrs)
{
- FreeResource();
}
DataLabelsTabPage::~DataLabelsTabPage()
{
}
-SfxTabPage* DataLabelsTabPage::Create(Window* pWindow,
- const SfxItemSet& rOutAttrs)
+SfxTabPage* DataLabelsTabPage::Create(Window* pWindow, const SfxItemSet& rOutAttrs)
{
return new DataLabelsTabPage(pWindow, rOutAttrs);
}
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.src b/chart2/source/controller/dialogs/tp_DataLabel.src
deleted file mode 100644
index d861eebc3dae..000000000000
--- a/chart2/source/controller/dialogs/tp_DataLabel.src
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include "HelpIds.hrc"
-#include "TabPages.hrc"
-#include "res_DataLabel.hrc"
-
-TabPage TP_DATA_DESCR
-{
- Hide = TRUE ;
- HelpID = HID_SCH_DATA_DESCR ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
- RESOURCE_DATALABEL( 6, 8 )
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */