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

Convert chart error bars tab page to widget UI

Change-Id: I9f3cb1fb3186e77b5c5ee57ff3e6086022c80bfd
Note: kept old resouce to allow dialog to be called by dlg_InsertErrorBars, util we find a way to have a dialog to call a tab page and access the resources. Once a solution is found, old- resources can be deleted, RangeEdit and RangeSelectionHelper can be nuked too.
Reviewed-on: https://gerrit.libreoffice.org/7198Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6a59fbef
......@@ -45,6 +45,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/tp_axisLabel \
chart2/uiconfig/ui/tp_AxisPositions \
chart2/uiconfig/ui/tp_DataLabel \
chart2/uiconfig/ui/tp_ErrorBars \
chart2/uiconfig/ui/tp_LegendPosition \
chart2/uiconfig/ui/tp_PolarOptions \
chart2/uiconfig/ui/tp_SeriesToAxis \
......
......@@ -591,10 +591,12 @@ String STR_DATA_SELECT_RANGE_FOR_DATALABELS
{
Text [ en-US ] = "Select Range for data labels" ;
};
//TODO: ohallot: String inserted into tp_ErrorBars.ui
String STR_DATA_SELECT_RANGE_FOR_POSITIVE_ERRORBARS
{
Text [ en-US ] = "Select Range for Positive Error Bars" ;
};
//TODO: ohallot: String inserted into tp_ErrorBars.ui
String STR_DATA_SELECT_RANGE_FOR_NEGATIVE_ERRORBARS
{
Text [ en-US ] = "Select Range for Negative Error Bars" ;
......
......@@ -33,6 +33,7 @@ String STR_INDICATE_UP
};
// used for own data in error bar dialog
//TODO: ohallot: String inserted into tp_ErrorBars.ui
String STR_CONTROLTEXT_ERROR_BARS_FROM_DATA
{
Text [ en-US ] = "From Data Table" ;
......
......@@ -43,18 +43,18 @@ namespace chart
InsertErrorBarsDialog::InsertErrorBarsDialog(
Window* pParent, const SfxItemSet& rMyAttrs,
const uno::Reference< chart2::XChartDocument > & xChartDocument,
ErrorBarResources::tErrorBarType eType /* = ErrorBarResources::ERROR_BAR_Y */ ) :
oldErrorBarResources::tErrorBarType eType /* = ErrorBarResources::ERROR_BAR_Y */ ) :
ModalDialog( pParent, SchResId( DLG_DATA_YERRORBAR )),
rInAttrs( rMyAttrs ),
aBtnOK( this, SchResId( BTN_OK )),
aBtnCancel( this, SchResId( BTN_CANCEL )),
aBtnHelp( this, SchResId( BTN_HELP )),
m_apErrorBarResources( new ErrorBarResources(
m_apErrorBarResources( new oldErrorBarResources(
this, this, rInAttrs,
/* bNoneAvailable = */ true, eType ))
{
FreeResource();
ObjectType objType = eType == ErrorBarResources::ERROR_BAR_Y ? OBJECTTYPE_DATA_ERRORS_Y : OBJECTTYPE_DATA_ERRORS_X;
ObjectType objType = eType == oldErrorBarResources::ERROR_BAR_Y ? OBJECTTYPE_DATA_ERRORS_Y : OBJECTTYPE_DATA_ERRORS_X;
this->SetText( ObjectNameProvider::getName_ObjectForAllSeries(objType) );
......
......@@ -28,14 +28,17 @@ namespace chart
{
ErrorBarsTabPage::ErrorBarsTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
SfxTabPage( pParent, SchResId( TP_YERRORBAR ), rInAttrs ),
SfxTabPage( pParent
,"tp_ErrorBars"
,"modules/schart/ui/tp_ErrorBars.ui"
, rInAttrs ),
m_aErrorBarResources(
this,
// the parent is the tab control, of which the parent is the dialog
pParent->GetParentDialog(),
rInAttrs, /* bNoneAvailable = */ false )
{
FreeResource();
// FreeResource();
}
ErrorBarsTabPage::~ErrorBarsTabPage()
......
......@@ -36,7 +36,7 @@ public:
InsertErrorBarsDialog( Window* pParent, const SfxItemSet& rMyAttrs,
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDocument,
ErrorBarResources::tErrorBarType eType );
oldErrorBarResources::tErrorBarType eType );
virtual ~InsertErrorBarsDialog();
void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
......@@ -58,7 +58,7 @@ private:
CancelButton aBtnCancel;
HelpButton aBtnHelp;
::std::auto_ptr< ErrorBarResources > m_apErrorBarResources;
boost::scoped_ptr< oldErrorBarResources > m_apErrorBarResources;
};
} //namespace chart
......
......@@ -20,6 +20,8 @@
#define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_RES_ERRORBAR_HXX
#include <vcl/button.hxx>
// #include <vcl/dialog.hxx>
#include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
#include <vcl/field.hxx>
#include <vcl/lstbox.hxx>
......@@ -51,10 +53,106 @@ public:
};
ErrorBarResources(
SfxTabPage* pParent, Dialog* pParentDialog, const SfxItemSet& rInAttrs, bool bNoneAvailable, chart::ErrorBarResources::tErrorBarType eType = ERROR_BAR_Y );
virtual ~ErrorBarResources();
void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
void SetErrorBarType( tErrorBarType eNewType );
void SetChartDocumentForRangeChoosing(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDocument );
void Reset(const SfxItemSet& rInAttrs);
sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const;
void FillValueSets();
// ____ RangeSelectionListenerParent ____
virtual void listeningFinished( const OUString & rNewRange );
virtual void disposingRangeSelection();
private:
// category
// FixedLine m_pFlErrorCategory;
RadioButton* m_pRbNone;
RadioButton* m_pRbConst;
RadioButton* m_pRbPercent;
RadioButton* m_pRbFunction;
RadioButton* m_pRbRange;
ListBox* m_pLbFunction;
// parameters
VclFrame* m_pFlParameters;
VclBox* m_pBxPositive;
MetricField* m_pMfPositive;
Edit* m_pEdRangePositive;
PushButton* m_pIbRangePositive;
VclBox* m_pBxNegative;
MetricField* m_pMfNegative;
Edit* m_pEdRangeNegative;
PushButton* m_pIbRangeNegative;
CheckBox* m_pCbSyncPosNeg;
// indicator
// FixedLine* m_pFlIndicate;
RadioButton* m_pRbBoth;
RadioButton* m_pRbPositive;
RadioButton* m_pRbNegative;
FixedImage* m_pFiBoth;
FixedImage* m_pFiPositive;
FixedImage* m_pFiNegative;
FixedText* m_pUIStringPos;
FixedText* m_pUIStringNeg;
FixedText* m_pUIStringRbRange;
SvxChartKindError m_eErrorKind;
SvxChartIndicate m_eIndicate;
bool m_bErrorKindUnique;
bool m_bIndicatorUnique;
bool m_bPlusUnique;
bool m_bMinusUnique;
bool m_bRangePosUnique;
bool m_bRangeNegUnique;
bool m_bNoneAvailable;
tErrorBarType m_eErrorBarType;
sal_uInt16 m_nConstDecimalDigits;
sal_Int64 m_nConstSpinSize;
SfxTabPage* m_pParentWindow;
Dialog * m_pParentDialog;
boost::scoped_ptr< RangeSelectionHelper > m_apRangeSelectionHelper;
Edit * m_pCurrentRangeChoosingField;
bool m_bHasInternalDataProvider;
bool m_bDisableDataTableDialog;
DECL_LINK( CategoryChosen, void * );
DECL_LINK( SynchronizePosAndNeg, void * );
DECL_LINK( PosValueChanged, void * );
DECL_LINK( IndicatorChanged, void * );
DECL_LINK( ChooseRange, RangeSelectionButton * );
DECL_LINK( RangeChanged, Edit * );
void UpdateControlStates();
bool isRangeFieldContentValid( Edit & rEdit );
};
class oldErrorBarResources : public RangeSelectionListenerParent
{
public:
enum tErrorBarType
{
ERROR_BAR_X,
ERROR_BAR_Y
};
oldErrorBarResources(
Window* pParent, Dialog * pParentDialog, const SfxItemSet& rInAttrst,
bool bNoneAvailable,
tErrorBarType eType = ERROR_BAR_Y );
virtual ~ErrorBarResources();
virtual ~oldErrorBarResources();
void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
void SetErrorBarType( tErrorBarType eNewType );
......
......@@ -496,7 +496,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError )
InsertErrorBarsDialog aDlg(
m_pChartWindow, aItemSet,
uno::Reference< chart2::XChartDocument >( getModel(), uno::UNO_QUERY ),
bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X);
bYError ? oldErrorBarResources::ERROR_BAR_Y : oldErrorBarResources::ERROR_BAR_X);
aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, OUString() ) );
......
This diff is collapsed.
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