Kaydet (Commit) 3596e88b authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Convert chart data label dialog to widget UI

Conflicts:
	chart2/AllLangResTarget_chartcontroller.mk

Change-Id: Id9054b3b0c6e7a10a72bc90b05cd7c6bbc5e82a2
Reviewed-on: https://gerrit.libreoffice.org/7205Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 27eb33d7
...@@ -32,7 +32,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\ ...@@ -32,7 +32,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\
chart2/source/controller/dialogs/dlg_ShapeFont.src \ chart2/source/controller/dialogs/dlg_ShapeFont.src \
chart2/source/controller/dialogs/dlg_ShapeParagraph.src \ chart2/source/controller/dialogs/dlg_ShapeParagraph.src \
chart2/source/controller/dialogs/res_BarGeometry.src \ chart2/source/controller/dialogs/res_BarGeometry.src \
chart2/source/controller/dialogs/res_TextSeparator.src \
chart2/source/controller/dialogs/Strings_AdditionalControls.src \ chart2/source/controller/dialogs/Strings_AdditionalControls.src \
chart2/source/controller/dialogs/Strings_ChartTypes.src \ chart2/source/controller/dialogs/Strings_ChartTypes.src \
chart2/source/controller/dialogs/Strings_Scale.src \ chart2/source/controller/dialogs/Strings_Scale.src \
...@@ -47,7 +46,6 @@ $(eval $(call gb_SrsTarget_add_nonlocalizable_files,chart2/res,\ ...@@ -47,7 +46,6 @@ $(eval $(call gb_SrsTarget_add_nonlocalizable_files,chart2/res,\
chart2/source/controller/dialogs/Bitmaps.src \ chart2/source/controller/dialogs/Bitmaps.src \
chart2/source/controller/dialogs/dlg_ChartType.src \ chart2/source/controller/dialogs/dlg_ChartType.src \
chart2/source/controller/dialogs/dlg_CreationWizard.src \ chart2/source/controller/dialogs/dlg_CreationWizard.src \
chart2/source/controller/dialogs/dlg_InsertDataLabel.src \
chart2/source/controller/dialogs/dlg_InsertErrorBars.src \ chart2/source/controller/dialogs/dlg_InsertErrorBars.src \
chart2/source/controller/dialogs/tp_PointGeometry.src \ chart2/source/controller/dialogs/tp_PointGeometry.src \
chart2/source/controller/menus/ShapeContextMenu.src \ chart2/source/controller/menus/ShapeContextMenu.src \
......
...@@ -115,7 +115,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ ...@@ -115,7 +115,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/dialogs/res_DataLabel \ chart2/source/controller/dialogs/res_DataLabel \
chart2/source/controller/dialogs/res_ErrorBar \ chart2/source/controller/dialogs/res_ErrorBar \
chart2/source/controller/dialogs/res_LegendPosition \ chart2/source/controller/dialogs/res_LegendPosition \
chart2/source/controller/dialogs/res_TextSeparator \
chart2/source/controller/dialogs/res_Titles \ chart2/source/controller/dialogs/res_Titles \
chart2/source/controller/dialogs/res_Trendline \ chart2/source/controller/dialogs/res_Trendline \
chart2/source/controller/dialogs/TextDirectionListBox \ chart2/source/controller/dialogs/TextDirectionListBox \
......
...@@ -32,6 +32,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/schart,\ ...@@ -32,6 +32,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/schart,\
$(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/3dviewdialog \ chart2/uiconfig/ui/3dviewdialog \
chart2/uiconfig/ui/attributedialog \ chart2/uiconfig/ui/attributedialog \
chart2/uiconfig/ui/dlg_DataLabel \
chart2/uiconfig/ui/insertaxisdlg \ chart2/uiconfig/ui/insertaxisdlg \
chart2/uiconfig/ui/insertgriddlg \ chart2/uiconfig/ui/insertgriddlg \
chart2/uiconfig/ui/inserttitledlg \ chart2/uiconfig/ui/inserttitledlg \
......
...@@ -33,11 +33,6 @@ String STR_DLG_STEPPED_LINE_PROPERTIES ...@@ -33,11 +33,6 @@ String STR_DLG_STEPPED_LINE_PROPERTIES
Text [ en-US ] = "Stepped Lines" ; Text [ en-US ] = "Stepped Lines" ;
}; };
String STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE
{
Text [ en-US ] = "Number Format for Percentage Value" ;
};
String STR_PAGE_CHARTTYPE String STR_PAGE_CHARTTYPE
{ {
Text [ en-US ] = "Chart Type" ; Text [ en-US ] = "Chart Type" ;
......
...@@ -18,25 +18,18 @@ ...@@ -18,25 +18,18 @@
*/ */
#include "dlg_InsertDataLabel.hxx" #include "dlg_InsertDataLabel.hxx"
#include "dlg_InsertDataLabel.hrc"
#include "ResId.hxx"
#include "ObjectNameProvider.hxx"
#include "res_DataLabel.hxx" #include "res_DataLabel.hxx"
namespace chart namespace chart
{ {
DataLabelsDialog::DataLabelsDialog(Window* pWindow, const SfxItemSet& rInAttrs, SvNumberFormatter* pFormatter) : DataLabelsDialog::DataLabelsDialog(Window* pWindow, const SfxItemSet& rInAttrs, SvNumberFormatter* pFormatter) :
ModalDialog(pWindow, SchResId(DLG_DATA_DESCR)), ModalDialog(pWindow
m_aBtnOK(this, SchResId(BTN_OK)), ,"dlg_DataLabels"
m_aBtnCancel(this, SchResId(BTN_CANCEL)), ,"modules/schart/ui/dlg_DataLabel.ui"),
m_aBtnHelp(this, SchResId(BTN_HELP)), m_apDataLabelResources( new DataLabelResources(this, this, rInAttrs) ),
m_apDataLabelResources( new oldDataLabelResources(this,rInAttrs) ),
m_rInAttrs(rInAttrs) m_rInAttrs(rInAttrs)
{ {
FreeResource();
this->SetText( ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_LABELS ) );
m_apDataLabelResources->SetNumberFormatter( pFormatter ); m_apDataLabelResources->SetNumberFormatter( pFormatter );
Reset(); Reset();
} }
......
/* -*- 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 "ResourceIds.hrc"
#define BTN_OK 1
#define BTN_CANCEL 1
#define BTN_HELP 1
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "dlg_InsertDataLabel.hrc"
#include "CommonResources.hrc"
#include "res_DataLabel.hrc"
ModalDialog DLG_DATA_DESCR
{
HelpID = HID_INSERT_DESCRIPTION ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 316 , 185 ) ;
Moveable = TRUE ;
BUTTONS_OK_CANCEL_HELP_STACKED(260)
RESOURCE_DATALABEL( 6, 7 )
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#define NUMBER_SEPARATORS 4 #define NUMBER_SEPARATORS 4
#include "res_TextSeparator.hxx"
// header for class CheckBox // header for class CheckBox
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <vcl/layout.hxx> #include <vcl/layout.hxx>
...@@ -41,7 +40,7 @@ namespace chart ...@@ -41,7 +40,7 @@ namespace chart
class DataLabelResources class DataLabelResources
{ {
public: public:
DataLabelResources( SfxTabPage* pParent, const SfxItemSet& rInAttrs ); DataLabelResources( VclBuilderContainer* pWindow, Window* pParent, const SfxItemSet& rInAttrs );
virtual ~DataLabelResources(); virtual ~DataLabelResources();
sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const; sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const;
...@@ -54,10 +53,10 @@ private: ...@@ -54,10 +53,10 @@ private:
PushButton* m_pPB_NumberFormatForValue; PushButton* m_pPB_NumberFormatForValue;
CheckBox* m_pCBPercent; CheckBox* m_pCBPercent;
PushButton* m_pPB_NumberFormatForPercent; PushButton* m_pPB_NumberFormatForPercent;
FixedText* m_pFT_NumberFormatForPercent;
CheckBox* m_pCBCategory; CheckBox* m_pCBCategory;
CheckBox* m_pCBSymbol; CheckBox* m_pCBSymbol;
// TextSeparatorResources m_aSeparatorResources;
VclHBox* m_pSeparatorResources; VclHBox* m_pSeparatorResources;
ListBox* m_pLB_Separator; ListBox* m_pLB_Separator;
OUString m_aEntryMap[NUMBER_SEPARATORS]; OUString m_aEntryMap[NUMBER_SEPARATORS];
...@@ -87,61 +86,6 @@ private: ...@@ -87,61 +86,6 @@ private:
bool m_bSourceFormatForValue; bool m_bSourceFormatForValue;
bool m_bSourceFormatForPercent; 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;
PushButton m_aPB_NumberFormatForPercent;
CheckBox m_aCBCategory;
CheckBox m_aCBSymbol;
TextSeparatorResources m_aSeparatorResources;
FixedText m_aFT_LabelPlacement;
ListBox m_aLB_LabelPlacement;
FixedLine m_aFL_Rotate;
svx::DialControl m_aDC_Dial;
FixedText m_aFT_Degrees;
svx::WrapField m_aNF_Degrees;
FixedText m_aFT_TextDirection;
TextDirectionListBox m_aLB_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;
Window* m_pWindow; Window* m_pWindow;
SfxItemPool* m_pPool; SfxItemPool* m_pPool;
...@@ -149,6 +93,7 @@ private: ...@@ -149,6 +93,7 @@ private:
DECL_LINK(CheckHdl, CheckBox* ); DECL_LINK(CheckHdl, CheckBox* );
void EnableControls(); void EnableControls();
}; };
} //namespace chart } //namespace chart
#endif #endif
......
/* -*- 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 .
*/
#define CB_VALUE_AS_NUMBER 1
#define CB_VALUE_AS_PERCENTAGE 2
#define CB_CATEGORY 3
#define CB_SYMBOL 4
#define PB_NUMBERFORMAT 20
#define PB_PERCENT_NUMBERFORMAT 21
#define FT_LABEL_PLACEMENT 2
#define LB_LABEL_PLACEMENT 2
#define FT_LABEL_TEXTDIR 31
#define LB_LABEL_TEXTDIR 32
#define FL_LABEL_ROTATE 40
#define CT_LABEL_DIAL 40
#define FT_LABEL_DEGREES 40
#define NF_LABEL_DEGREES 40
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef _CHART2_RESOURCE_DATALABEL_HXX
#define _CHART2_RESOURCE_DATALABEL_HXX
#include "HelpIds.hrc"
#include "res_DataLabel_IDs.hrc"
#define WORKAROUND \
StringList [ en-US ] = \
{ \
"Best fit" ; \
"Center" ; \
"Above" ; \
"Top left" ; \
"Left" ; \
"Bottom left" ; \
"Below" ; \
"Bottom right" ; \
"Right" ; \
"Top right" ; \
"Inside" ; \
"Outside" ; \
"Near origin" ; \
};
#define RESOURCE_DATALABEL( xpos, ypos ) \
CheckBox CB_VALUE_AS_NUMBER \
{ \
HelpID = HID_SCH_DATALABEL_VALUE; \
Pos = MAP_APPFONT ( xpos , ypos ) ; \
Size = MAP_APPFONT ( 136 , 10 ) ; \
TabStop = TRUE ; \
Text [ en-US ] = "Show value as ~number" ; \
}; \
PushButton PB_NUMBERFORMAT \
{ \
HelpID = HID_SCH_PB_NUMBERFORMAT; \
TabStop = TRUE ; \
Pos = MAP_APPFONT ( xpos+100 , ypos-3 ) ; \
Size = MAP_APPFONT ( 100 , 14 ) ; \
Text [ en-US ] = "Number ~format..." ; \
}; \
CheckBox CB_VALUE_AS_PERCENTAGE \
{ \
HelpID = HID_SCH_DATALABEL_PERCENT; \
Pos = MAP_APPFONT ( xpos , ypos+17 ) ; \
Size = MAP_APPFONT ( 136 , 10 ) ; \
TabStop = TRUE ; \
Text [ en-US ] = "Show value as ~percentage" ; \
}; \
PushButton PB_PERCENT_NUMBERFORMAT \
{ \
HelpID = HID_SCH_PB_PERCENT_NUMBERFORMAT; \
TabStop = TRUE ; \
Pos = MAP_APPFONT ( xpos+100 , ypos+17-3 ) ; \
Size = MAP_APPFONT ( 100 , 14 ) ; \
Text [ en-US ] = "Percentage f~ormat..." ; \
}; \
CheckBox CB_CATEGORY \
{ \
HelpID = HID_SCH_DATALABEL_TEXT; \
Pos = MAP_APPFONT ( xpos , ypos+33 ); \
Size = MAP_APPFONT ( 254 , 10 ); \
TabStop = TRUE; \
Text [ en-US ] = "Show ~category"; \
}; \
CheckBox CB_SYMBOL \
{ \
HelpID = HID_SCH_DATALABEL_SYMBOL; \
Pos = MAP_APPFONT ( xpos , ypos+49 ) ; \
Size = MAP_APPFONT ( 254 , 10 ) ; \
TabStop = TRUE ; \
Text [ en-US ] = "Show ~legend key" ; \
}; \
FixedText FT_LABEL_PLACEMENT \
{ \
Pos = MAP_APPFONT ( xpos , ypos+84 ) ; \
Size = MAP_APPFONT ( 182 , 10 ) ; \
TabStop = FALSE ; \
Text [ en-US ] = "Place~ment"; \
}; \
ListBox LB_LABEL_PLACEMENT \
{ \
HelpID = HID_SCH_DATALABEL_PLACEMENT; \
Border = TRUE ; \
AutoHScroll = TRUE ; \
Pos = MAP_APPFONT ( xpos+100 , ypos+82 ) ; \
Size = MAP_APPFONT ( 89 , 12 ) ; \
TabStop = TRUE ; \
Group = TRUE ; \
DropDown=TRUE; \
DDExtraWidth = TRUE ; \
WORKAROUND \
}; \
FixedLine FL_LABEL_ROTATE \
{ \
Pos = MAP_APPFONT ( xpos, ypos+103 ) ; \
Size = MAP_APPFONT ( 248, 8 ) ; \
Text [ en-US ] = "Rotate Text" ; \
}; \
Control CT_LABEL_DIAL \
{ \
HelpId = HID_SCH_DATALABEL_ROTATION_KNOB ; \
Pos = MAP_APPFONT ( xpos+6 , ypos+116 ) ; \
Size = MAP_APPFONT ( 43 , 43 ) ; \
Text = "ABCD" ; \
}; \
FixedText FT_LABEL_DEGREES \
{ \
Pos = MAP_APPFONT ( xpos+87 , ypos+133 ) ; \
Size = MAP_APPFONT ( 46, 8 ) ; \
Text [ en-US ] = "~Degrees" ; \
}; \
NumericField NF_LABEL_DEGREES \
{ \
HelpId = HID_SCH_DATALABEL_ROTATION_EDIT ; \
Pos = MAP_APPFONT ( xpos+55 , ypos+131 ) ; \
Size = MAP_APPFONT ( 28 , 12 ) ; \
Border = TRUE ; \
TabStop = TRUE ; \
Repeat = TRUE ; \
Spin = TRUE ; \
Minimum = 0 ; \
Maximum = 359 ; \
SpinSize = 5 ; \
}; \
FixedText FT_LABEL_TEXTDIR \
{ \
Pos = MAP_APPFONT ( xpos , ypos+162 ) ; \
Size = MAP_APPFONT ( 64 , 8 ) ; \
Text [ en-US ] = "Te~xt direction" ; \
}; \
ListBox LB_LABEL_TEXTDIR \
{ \
HelpID = HID_SCH_TEXTDIRECTION; \
Pos = MAP_APPFONT ( xpos+66 , ypos+160 ) ; \
Size = MAP_APPFONT ( 170 , 100 ) ; \
Border = TRUE; \
TabStop = TRUE; \
DropDown = TRUE; \
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "res_TextSeparator.hxx"
#include "ResourceIds.hrc"
#include "Strings.hrc"
#include "ResId.hxx"
#include "macros.hxx"
#include <svtools/controldims.hrc>
namespace chart
{
TextSeparatorResources::TextSeparatorResources( Window* pWindow )
: m_aFT_Separator( pWindow, pWindow->GetStyle() )
, m_aLB_Separator( pWindow , SchResId( LB_TEXT_SEPARATOR ) )
, m_aEntryMap()
, m_nDefaultPos(0)
{
m_aFT_Separator.SetText( SCH_RESSTR( STR_TEXT_SEPARATOR ) );
m_aFT_Separator.SetSizePixel( m_aFT_Separator.CalcMinimumSize() );
m_aLB_Separator.SetDropDownLineCount(m_aLB_Separator.GetEntryCount());
m_aLB_Separator.SetSizePixel( m_aLB_Separator.CalcMinimumSize() );
m_aEntryMap[ " " ] = 0;
m_aEntryMap[ ", " ] = 1;
m_aEntryMap[ "; " ] = 2;
m_aEntryMap[ "\n" ] = 3;
m_aLB_Separator.SetAccessibleName(m_aFT_Separator.GetText());
m_aLB_Separator.SetAccessibleRelationLabeledBy(&m_aFT_Separator);
}
TextSeparatorResources::~TextSeparatorResources()
{
}
void TextSeparatorResources::Show( bool bShow )
{
m_aFT_Separator.Show( bShow );
m_aLB_Separator.Show( bShow );
}
void TextSeparatorResources::Enable( bool bEnable )
{
m_aFT_Separator.Enable( bEnable );
m_aLB_Separator.Enable( bEnable );
}
void TextSeparatorResources::PositionBelowControl( const Window& rWindow )
{
Point aPoint( rWindow.GetPosPixel() );
Size aSize( rWindow.GetSizePixel() );
aPoint.Y() += aSize.Height();
Size aBigDistanceSize( rWindow.LogicToPixel( Size(0,RSC_SP_CTRL_Y), MapMode(MAP_APPFONT) ) );
aPoint.Y() += aBigDistanceSize.Height();
Size aDistanceSize( rWindow.LogicToPixel( Size(RSC_SP_CTRL_DESC_X, (RSC_CD_DROPDOWN_HEIGHT-RSC_CD_FIXEDTEXT_HEIGHT)/2), MapMode(MAP_APPFONT) ) );
aPoint.Y() += aDistanceSize.Height();
m_aFT_Separator.SetPosPixel( aPoint );
m_aLB_Separator.SetPosPixel( Point( aPoint.X()+m_aFT_Separator.GetSizePixel().Width()+aDistanceSize.Width(), aPoint.Y()-aDistanceSize.Height()-1) );
}
void TextSeparatorResources::AlignListBoxWidthAndXPos( long nWantedLeftBorder /*use -1 to indicate that this can be automatic*/
, long nWantedRightBorder /*use -1 to indicate that this can be automatic*/
, long nMinimumListBoxWidth /*use -1 to indicate that this can be automatic*/ )
{
long nMinPossibleLeftBorder = m_aFT_Separator.GetPosPixel().X() + m_aFT_Separator.GetSizePixel().Width() + 1 ;
if( nWantedLeftBorder >= 0 && nWantedLeftBorder>nMinPossibleLeftBorder )
{
Point aPos( m_aLB_Separator.GetPosPixel() );
aPos.X() = nWantedLeftBorder;
m_aLB_Separator.SetPosPixel( aPos );
}
long nMinPossibleRightBorder = m_aLB_Separator.GetPosPixel().X() + m_aLB_Separator.CalcMinimumSize().Width() - 1 ;
if( nWantedRightBorder < m_aLB_Separator.GetPosPixel().X() + nMinimumListBoxWidth )
nWantedRightBorder = m_aLB_Separator.GetPosPixel().X() + nMinimumListBoxWidth;
if( nWantedRightBorder >= 0 && nWantedRightBorder > nMinPossibleRightBorder )
{
Size aSize( m_aLB_Separator.GetSizePixel() );
aSize.Width() = nWantedRightBorder-m_aLB_Separator.GetPosPixel().X();
m_aLB_Separator.SetSizePixel(aSize);
}
}
Point TextSeparatorResources::GetCurrentListBoxPosition() const
{
return m_aLB_Separator.GetPosPixel();
}
Size TextSeparatorResources::GetCurrentListBoxSize() const
{
return m_aLB_Separator.GetSizePixel();
}
void TextSeparatorResources::SetValue( const OUString& rSeparator )
{
::std::map< OUString , sal_uInt16 >::iterator aIter( m_aEntryMap.find(rSeparator) );
if( aIter == m_aEntryMap.end() )
m_aLB_Separator.SelectEntryPos( m_nDefaultPos );
else
m_aLB_Separator.SelectEntryPos( aIter->second );
}
void TextSeparatorResources::SetDefault()
{
m_aLB_Separator.SelectEntryPos( m_nDefaultPos );
}
OUString TextSeparatorResources::GetValue() const
{
sal_uInt16 nPos = m_aLB_Separator.GetSelectEntryPos();
::std::map< OUString , sal_uInt16 >::const_iterator aIter( m_aEntryMap.begin() );
while( aIter != m_aEntryMap.end() )
{
if(aIter->second==nPos )
return aIter->first;
++aIter;
}
return OUString( " " );
}
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_TEXTSEPARATOR_HXX
#define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_TEXTSEPARATOR_HXX
// header for class FixedText
#include <vcl/fixed.hxx>
// header for class ListBox
#include <vcl/lstbox.hxx>
#include <map>
namespace chart
{
class TextSeparatorResources
{
public:
TextSeparatorResources( Window* pParent );
virtual ~TextSeparatorResources();
void Show( bool bShow );
void Enable( bool bEnable );
void PositionBelowControl( const Window& rWindow );
void AlignListBoxWidthAndXPos( long nWantedLeftBorder /*use -1 to indicate that this can be automatic*/
, long nWantedRightBorder /*use -1 to indicate that this can be automatic*/
, long nMinimumListBoxWidth /*use -1 to indicate that this can be automatic*/ );
Point GetCurrentListBoxPosition() const;
Size GetCurrentListBoxSize() const;
OUString GetValue() const;
void SetValue( const OUString& rSeparator );
void SetDefault();
private:
FixedText m_aFT_Separator;
ListBox m_aLB_Separator;
::std::map< OUString, sal_uInt16 > m_aEntryMap;
const sal_uInt16 m_nDefaultPos;
};
} //namespace chart
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "ResourceIds.hrc"
#include "HelpIds.hrc"
ListBox LB_TEXT_SEPARATOR
{
HelpID = HID_SCH_DATALABEL_SEPARATOR; \
Border = TRUE ;
AutoHScroll = TRUE ;
Pos = MAP_APPFONT ( 6 , 17 ) ;
Size = MAP_APPFONT ( 89 , 12 ) ;
TabStop = TRUE ;
Group = TRUE ;
DropDown=TRUE;
DDExtraWidth = TRUE ;
StringList [ en-US ] =
{
"Space" ;
"Comma" ;
"Semicolon" ;
"New line" ;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
namespace chart namespace chart
{ {
DataLabelsTabPage::DataLabelsTabPage(Window* pWindow, const SfxItemSet& rInAttrs) : DataLabelsTabPage::DataLabelsTabPage(Window* pWindow, const SfxItemSet& rInAttrs)
SfxTabPage(pWindow : SfxTabPage(pWindow
, "tp_DataLabel" , "tp_DataLabel"
, "modules/schart/ui/tp_DataLabel.ui" , "modules/schart/ui/tp_DataLabel.ui"
, rInAttrs) , rInAttrs)
, m_aDataLabelResources(this, rInAttrs) , m_aDataLabelResources(this, this, rInAttrs)
{ {
} }
......
...@@ -33,10 +33,10 @@ namespace chart ...@@ -33,10 +33,10 @@ namespace chart
class DataLabelsTabPage : public SfxTabPage class DataLabelsTabPage : public SfxTabPage
{ {
public: public:
DataLabelsTabPage(Window* pParent, const SfxItemSet& rInAttrs); DataLabelsTabPage(Window* pWindow, const SfxItemSet& rInAttrs);
virtual ~DataLabelsTabPage(); virtual ~DataLabelsTabPage();
static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs); static SfxTabPage* Create(Window* pWindow, const SfxItemSet& rInAttrs);
void SetNumberFormatter( SvNumberFormatter* pFormatter ); void SetNumberFormatter( SvNumberFormatter* pFormatter );
......
...@@ -57,18 +57,6 @@ ...@@ -57,18 +57,6 @@
#define HID_SCH_STATISTIK_PERCENT "CHART2_HID_SCH_STATISTIK_PERCENT" #define HID_SCH_STATISTIK_PERCENT "CHART2_HID_SCH_STATISTIK_PERCENT"
#define HID_SCH_STATISTIK_CONSTERROR "CHART2_HID_SCH_STATISTIK_CONSTERROR" #define HID_SCH_STATISTIK_CONSTERROR "CHART2_HID_SCH_STATISTIK_CONSTERROR"
#define HID_SCH_DATALABEL_VALUE "CHART2_HID_SCH_DATALABEL_VALUE"
#define HID_SCH_DATALABEL_PERCENT "CHART2_HID_SCH_DATALABEL_PERCENT"
#define HID_SCH_DATALABEL_TEXT "CHART2_HID_SCH_DATALABEL_TEXT"
#define HID_SCH_DATALABEL_SYMBOL "CHART2_HID_SCH_DATALABEL_SYMBOL"
#define HID_SCH_PB_NUMBERFORMAT "CHART2_HID_SCH_PB_NUMBERFORMAT"
#define HID_SCH_PB_PERCENT_NUMBERFORMAT "CHART2_HID_SCH_PB_PERCENT_NUMBERFORMAT"
#define HID_SCH_DATALABEL_SEPARATOR "CHART2_HID_SCH_DATALABEL_SEPARATOR"
#define HID_SCH_DATALABEL_PLACEMENT "CHART2_HID_SCH_DATALABEL_PLACEMENT"
#define HID_SCH_TEXTDIRECTION "CHART2_HID_SCH_TEXTDIRECTION"
#define HID_SCH_DATALABEL_ROTATION_KNOB "CHART2_HID_SCH_DATALABEL_ROTATION_KNOB"
#define HID_SCH_DATALABEL_ROTATION_EDIT "CHART2_HID_SCH_DATALABEL_ROTATION_EDIT"
#define HID_SCH_WIZARD_ROADMAP "CHART2_HID_SCH_WIZARD_ROADMAP" #define HID_SCH_WIZARD_ROADMAP "CHART2_HID_SCH_WIZARD_ROADMAP"
#define HID_SCH_LEGEND_SHOW "CHART2_HID_SCH_LEGEND_SHOW" #define HID_SCH_LEGEND_SHOW "CHART2_HID_SCH_LEGEND_SHOW"
#define HID_SCH_DATA_SERIES_LABEL "CHART2_HID_SCH_DATA_SERIES_LABEL" #define HID_SCH_DATA_SERIES_LABEL "CHART2_HID_SCH_DATA_SERIES_LABEL"
...@@ -90,7 +78,6 @@ ...@@ -90,7 +78,6 @@
#define HID_DIAGRAM_TYPE "CHART2_HID_DIAGRAM_TYPE" #define HID_DIAGRAM_TYPE "CHART2_HID_DIAGRAM_TYPE"
#define HID_DIAGRAM_DATA "CHART2_HID_DIAGRAM_DATA" #define HID_DIAGRAM_DATA "CHART2_HID_DIAGRAM_DATA"
#define HID_INSERT_STATISTICS "CHART2_HID_INSERT_STATISTICS" #define HID_INSERT_STATISTICS "CHART2_HID_INSERT_STATISTICS"
#define HID_INSERT_DESCRIPTION "CHART2_HID_INSERT_DESCRIPTION"
#endif #endif
......
...@@ -25,22 +25,22 @@ ...@@ -25,22 +25,22 @@
#include <vcl/button.hxx> #include <vcl/button.hxx>
// header for class SfxItemSet // header for class SfxItemSet
#include <svl/itemset.hxx> #include <svl/itemset.hxx>
//for auto_ptr #include <boost/scoped_ptr.hpp>
#include <memory>
class SvNumberFormatter; class SvNumberFormatter;
namespace chart namespace chart
{ {
class oldDataLabelResources; class DataLabelResources;
class DataLabelsDialog : public ModalDialog class DataLabelsDialog : public ModalDialog
{ {
private: private:
OKButton m_aBtnOK; // OKButton m_aBtnOK;
CancelButton m_aBtnCancel; // CancelButton m_aBtnCancel;
HelpButton m_aBtnHelp; // HelpButton m_aBtnHelp;
::std::auto_ptr< oldDataLabelResources > m_apDataLabelResources; boost::scoped_ptr < DataLabelResources > m_apDataLabelResources;
const SfxItemSet& m_rInAttrs; const SfxItemSet& m_rInAttrs;
......
...@@ -243,7 +243,6 @@ ...@@ -243,7 +243,6 @@
#define STR_DLG_SMOOTH_LINE_PROPERTIES (RID_APP_START + 239) #define STR_DLG_SMOOTH_LINE_PROPERTIES (RID_APP_START + 239)
#define STR_DLG_STEPPED_LINE_PROPERTIES (RID_APP_START + 270) #define STR_DLG_STEPPED_LINE_PROPERTIES (RID_APP_START + 270)
#define STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE (RID_APP_START + 266)
#define STR_PAGE_POSITIONING (RID_APP_START + 277) #define STR_PAGE_POSITIONING (RID_APP_START + 277)
#define STR_PAGE_ASIAN (RID_APP_START + 281) #define STR_PAGE_ASIAN (RID_APP_START + 281)
......
This diff is collapsed.
...@@ -319,7 +319,16 @@ ...@@ -319,7 +319,16 @@
</packing> </packing>
</child> </child>
<child> <child>
<placeholder/> <object class="GtkLabel" id="STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE">
<property name="can_focus">False</property>
<property name="label" translatable="yes">Number Format for Percentage Value</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</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