Files
libreoffice/chart2/source/controller/dialogs/tp_Scale.cxx

832 lines
30 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2003-10-06 08:58:36 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2003-10-06 08:58:36 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2003-10-06 08:58:36 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2003-10-06 08:58:36 +00:00
*
* This file is part of OpenOffice.org.
2003-10-06 08:58:36 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2003-10-06 08:58:36 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2003-10-06 08:58:36 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2003-10-06 08:58:36 +00:00
*
************************************************************************/
2003-10-06 08:58:36 +00:00
#include "tp_Scale.hxx"
2010-11-30 01:45:03 +01:00
#include "tp_Scale.hrc"
2003-10-06 08:58:36 +00:00
#include "ResId.hxx"
#include "Strings.hrc"
#include "chartview/ChartSfxItemIds.hxx"
#include "NoWarningThisInCTOR.hxx"
2008-12-12 12:17:17 +00:00
#include "AxisHelper.hxx"
#include <svx/svxids.hrc>
2003-10-06 08:58:36 +00:00
#include <rtl/math.hxx>
// header for class SvxDoubleItem
#include <svx/chrtitem.hxx>
// header for class SfxBoolItem
#include <svl/eitem.hxx>
2003-10-06 08:58:36 +00:00
// header for SfxInt32Item
#include <svl/intitem.hxx>
2003-10-06 08:58:36 +00:00
// header for class WarningBox
#include <vcl/msgbox.hxx>
// header for class SvNumberformat
#ifndef _ZFORMAT_HXX
#include <svl/zformat.hxx>
2003-10-06 08:58:36 +00:00
#endif
#include <svtools/controldims.hrc>
#include <com/sun/star/chart2/AxisType.hpp>
using namespace ::com::sun::star;
2003-10-06 08:58:36 +00:00
//.............................................................................
namespace chart
{
//.............................................................................
namespace
{
2010-11-30 01:45:03 +01:00
void lcl_placeControlAtX( Control& rControl, long nNewXPos )
{
Point aPos( rControl.GetPosPixel() );
aPos.X() = nNewXPos;
rControl.SetPosPixel(aPos);
}
void lcl_placeControlAtY( Control& rControl, long nNewYPos )
{
Point aPos( rControl.GetPosPixel() );
aPos.Y() = nNewYPos;
rControl.SetPosPixel(aPos);
}
2008-12-12 12:17:17 +00:00
void lcl_shiftControls( Control& rEdit, Control& rAuto, long nNewXPos )
{
Point aPos( rEdit.GetPosPixel() );
long nShift = nNewXPos - aPos.X();
aPos.X() = nNewXPos;
rEdit.SetPosPixel(aPos);
aPos = rAuto.GetPosPixel();
aPos.X() += nShift;
rAuto.SetPosPixel(aPos);
}
long lcl_getLabelDistance( Control& rControl )
2008-12-12 12:17:17 +00:00
{
return rControl.LogicToPixel( Size(RSC_SP_CTRL_DESC_X, 0), MapMode(MAP_APPFONT) ).Width();
}
2008-12-12 12:17:17 +00:00
void lcl_setValue( FormattedField& rFmtField, double fValue )
{
rFmtField.SetValue( fValue );
rFmtField.SetDefaultValue( fValue );
2008-12-12 12:17:17 +00:00
}
}
ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
2008-12-12 12:17:17 +00:00
SfxTabPage(pWindow, SchResId(TP_SCALE), rInAttrs),
2003-10-06 08:58:36 +00:00
2008-12-12 12:17:17 +00:00
aFlScale(this, SchResId(FL_SCALE)),
2010-11-30 01:45:03 +01:00
aCbxReverse(this, SchResId(CBX_REVERSE)),
aCbxLogarithm(this, SchResId(CBX_LOGARITHM)),
m_aTxt_AxisType(this, SchResId (TXT_AXIS_TYPE)),
m_aLB_AxisType(this, SchResId(LB_AXIS_TYPE)),
aTxtMin (this, SchResId (TXT_MIN)),
aFmtFldMin(this, SchResId(EDT_MIN)),
aCbxAutoMin(this, SchResId(CBX_AUTO_MIN)),
2010-11-30 01:45:03 +01:00
aTxtMax(this, SchResId (TXT_MAX)),
aFmtFldMax(this, SchResId(EDT_MAX)),
aCbxAutoMax(this, SchResId(CBX_AUTO_MAX)),
2010-11-30 01:45:03 +01:00
m_aTxt_TimeResolution(this, SchResId (TXT_TIME_RESOLUTION)),
m_aLB_TimeResolution(this, SchResId(LB_TIME_RESOLUTION)),
m_aCbx_AutoTimeResolution(this, SchResId(CBX_AUTO_TIME_RESOLUTION)),
aTxtMain (this, SchResId (TXT_STEP_MAIN)),
aFmtFldStepMain(this, SchResId(EDT_STEP_MAIN)),
2010-11-30 01:45:03 +01:00
m_aMt_MainDateStep(this, SchResId(MT_MAIN_DATE_STEP)),
m_aLB_MainTimeUnit(this, SchResId(LB_MAIN_TIME_UNIT)),
aCbxAutoStepMain(this, SchResId(CBX_AUTO_STEP_MAIN)),
2010-11-30 01:45:03 +01:00
aTxtHelpCount (this, SchResId (TXT_STEP_HELP_COUNT)),
aTxtHelp (this, SchResId (TXT_STEP_HELP)),
aMtStepHelp (this, SchResId (MT_STEPHELP)),
2010-11-30 01:45:03 +01:00
m_aLB_HelpTimeUnit(this, SchResId(LB_HELP_TIME_UNIT)),
aCbxAutoStepHelp(this, SchResId(CBX_AUTO_STEP_HELP)),
2008-12-12 12:17:17 +00:00
aTxtOrigin (this, SchResId (TXT_ORIGIN)),
aFmtFldOrigin(this, SchResId(EDT_ORIGIN)),
aCbxAutoOrigin(this, SchResId(CBX_AUTO_ORIGIN)),
2008-12-12 12:17:17 +00:00
2003-10-06 08:58:36 +00:00
fMin(0.0),
fMax(0.0),
fStepMain(0.0),
nStepHelp(0),
fOrigin(0.0),
2010-11-30 01:45:03 +01:00
m_nTimeResolution(1),
m_nMainTimeUnit(1),
m_nHelpTimeUnit(1),
m_nAxisType(chart2::AxisType::REALNUMBER),
m_bAllowDateAxis(false),
2008-12-12 12:17:17 +00:00
pNumFormatter(NULL),
m_bShowAxisOrigin(false)
2003-10-06 08:58:36 +00:00
{
FreeResource();
SetExchangeSupport();
aCbxAutoMin.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
aCbxAutoMax.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
aCbxAutoStepMain.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
aCbxAutoStepHelp.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
aCbxAutoOrigin.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
2010-11-30 01:45:03 +01:00
m_aCbx_AutoTimeResolution.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
m_aLB_AxisType.SetDropDownLineCount(3);
m_aLB_AxisType.SetSelectHdl(LINK(this, ScaleTabPage, SelectAxisTypeHdl));
m_aLB_TimeResolution.SetDropDownLineCount(3);
m_aLB_MainTimeUnit.SetDropDownLineCount(3);
m_aLB_HelpTimeUnit.SetDropDownLineCount(3);
aFmtFldMin.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
aFmtFldMax.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
aFmtFldStepMain.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
aFmtFldOrigin.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
HideAllControls();
}
IMPL_LINK( ScaleTabPage, FmtFieldModifiedHdl, FormattedField*, pFmtFied )
{
if( pFmtFied )
pFmtFied->SetDefaultValue( pFmtFied->GetValue() );
return 0;
}
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
void ScaleTabPage::StateChanged( StateChangedType nType )
{
TabPage::StateChanged( nType );
if( nType == STATE_CHANGE_INITSHOW )
AdjustControlPositions();
}
void ScaleTabPage::AdjustControlPositions()
{
//optimize position of the controls
long nLabelWidth = ::std::max( aTxtMin.CalcMinimumSize().Width(), aTxtMax.CalcMinimumSize().Width() );
nLabelWidth = ::std::max( aTxtMain.CalcMinimumSize().Width(), nLabelWidth );
nLabelWidth = ::std::max( aTxtHelp.CalcMinimumSize().Width(), nLabelWidth );
2010-11-30 01:45:03 +01:00
nLabelWidth = ::std::max( aTxtHelpCount.CalcMinimumSize().Width(), nLabelWidth );
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
nLabelWidth = ::std::max( aTxtOrigin.CalcMinimumSize().Width(), nLabelWidth );
2010-11-30 01:45:03 +01:00
nLabelWidth = ::std::max( m_aTxt_TimeResolution.CalcMinimumSize().Width(), nLabelWidth );
nLabelWidth = ::std::max( m_aTxt_AxisType.CalcMinimumSize().Width(), nLabelWidth );
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
nLabelWidth+=1;
2010-11-30 01:45:03 +01:00
long nLabelDistance = lcl_getLabelDistance(aTxtMin);
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
long nNewXPos = aTxtMin.GetPosPixel().X() + nLabelWidth + nLabelDistance;
//ensure that the auto checkboxes are wide enough and have correct size for calculation
aCbxAutoMin.SetSizePixel( aCbxAutoMin.CalcMinimumSize() );
aCbxAutoMax.SetSizePixel( aCbxAutoMax.CalcMinimumSize() );
aCbxAutoStepMain.SetSizePixel( aCbxAutoStepMain.CalcMinimumSize() );
aCbxAutoStepHelp.SetSizePixel( aCbxAutoStepHelp.CalcMinimumSize() );
aCbxAutoOrigin.SetSizePixel( aCbxAutoOrigin.CalcMinimumSize() );
2010-11-30 01:45:03 +01:00
m_aCbx_AutoTimeResolution.SetSizePixel( m_aCbx_AutoTimeResolution.CalcMinimumSize() );
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
//ensure new pos is ok
2010-11-30 01:45:03 +01:00
long nWidthOfOtherControls = m_aLB_MainTimeUnit.GetPosPixel().X() + m_aLB_MainTimeUnit.GetSizePixel().Width() - aFmtFldMin.GetPosPixel().X();
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
long nDialogWidth = GetSizePixel().Width();
long nLeftSpace = nDialogWidth - nNewXPos - nWidthOfOtherControls;
if(nLeftSpace>=0)
{
Size aSize( aTxtMin.GetSizePixel() );
aSize.Width() = nLabelWidth;
aTxtMin.SetSizePixel(aSize);
aTxtMax.SetSizePixel(aSize);
aTxtMain.SetSizePixel(aSize);
aTxtHelp.SetSizePixel(aSize);
2010-11-30 01:45:03 +01:00
aTxtHelpCount.SetSizePixel(aSize);
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
aTxtOrigin.SetSizePixel(aSize);
2010-11-30 01:45:03 +01:00
m_aTxt_TimeResolution.SetSizePixel(aSize);
m_aTxt_AxisType.SetSizePixel(aSize);
long nOrgAutoCheckX = aCbxAutoMin.GetPosPixel().X();
lcl_placeControlAtX( aCbxAutoStepMain, nOrgAutoCheckX );
lcl_placeControlAtX( aCbxAutoStepHelp, nOrgAutoCheckX );
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
lcl_shiftControls( aFmtFldMin, aCbxAutoMin, nNewXPos );
lcl_shiftControls( aFmtFldMax, aCbxAutoMax, nNewXPos );
lcl_shiftControls( aFmtFldStepMain, aCbxAutoStepMain, nNewXPos );
2010-11-30 01:45:03 +01:00
lcl_placeControlAtX( m_aMt_MainDateStep, aFmtFldStepMain.GetPosPixel().X() );
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
lcl_shiftControls( aMtStepHelp, aCbxAutoStepHelp, nNewXPos );
lcl_shiftControls( aFmtFldOrigin, aCbxAutoOrigin, nNewXPos );
2010-11-30 01:45:03 +01:00
lcl_shiftControls( m_aLB_TimeResolution, m_aCbx_AutoTimeResolution, nNewXPos );
lcl_placeControlAtX( m_aLB_AxisType, nNewXPos );
nNewXPos = aCbxAutoStepMain.GetPosPixel().X() + aCbxAutoStepMain.GetSizePixel().Width() + nLabelDistance;
lcl_placeControlAtX( m_aLB_MainTimeUnit, nNewXPos );
lcl_placeControlAtX( m_aLB_HelpTimeUnit, nNewXPos );
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
}
2010-11-30 01:45:03 +01:00
PlaceIntervalControlsAccordingToAxisType();
CWS-TOOLING: integrate CWS chart35 2009-02-20 12:33:54 +0100 nn r268312 : correct line ends 2009-01-19 12:50:45 +0100 iha r266491 : #i91800# style:text-position='0' is wrongly imported 2009-01-19 11:59:09 +0100 iha r266486 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-16 16:45:50 +0100 iha r266435 : #i93802# clockwise does not work on solars sparc 2009-01-16 13:23:37 +0100 iha r266414 : #i91037# Position of Datalabels in 3D Bar-Charts are crossing the edge 2009-01-15 14:09:27 +0100 iha r266370 : #i98102# checkbox show equation should not be checked initially 2009-01-14 17:41:33 +0100 iha r266323 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 16:23:06 +0100 iha r266316 : #i97133# #i97318# chart type is not detected correctly in case of invisible series 2009-01-14 13:43:38 +0100 iha r266298 : #i84417# Unable to edit existing chart title with clipboard 2009-01-14 13:43:04 +0100 iha r266297 : #i84417# Unable to edit existing chart title with IME 2009-01-14 13:14:15 +0100 dr r266293 : do not set CharEscapement property if not needed 2009-01-14 00:48:46 +0100 er r266262 : #i81383# changed ASC and JIS to use transliteration provided by i18n transliteration; patch from <bluedwarf> 2009-01-14 00:28:06 +0100 er r266261 : #i97536# silence gcc's unbracketed && || warnings 2009-01-13 22:43:45 +0100 er r266259 : #i97905# corrected IndexKey order 2009-01-13 20:36:15 +0100 er r266254 : #i97905# add SKK/EUR conversion (plus MTL/EUR and CYP/EUR) 2009-01-13 20:31:17 +0100 er r266253 : #i97905# updated locale data; contributed by <brko> 2009-01-13 11:57:08 +0100 iha r266204 : #i84103# cannot set data in xy diagram in draw 2009-01-12 20:29:37 +0100 nn r266181 : #i97680# GetStylesContainer: handle non-available style family 2009-01-12 19:53:19 +0100 nn r266180 : #i98000# don't get initial zoom value via SfxViewFrame::Current 2009-01-12 16:11:19 +0100 iha r266166 : #i71686# XY charts without valid x values are not imported correctly from Excel 2009-01-09 17:10:20 +0100 iha r266102 : #i95051# truncated asian strings on scale tabpage 2009-01-09 15:58:46 +0100 iha r266094 : #i89430# truncated asian strings in smooth lines dialog 2009-01-09 13:09:14 +0100 iha r266076 : #i94813# importing pie chart with multiline categories crashes
2009-03-03 11:39:43 +00:00
}
2010-11-30 01:45:03 +01:00
void ScaleTabPage::PlaceIntervalControlsAccordingToAxisType()
{
2010-11-30 01:45:03 +01:00
long nMinX = std::min( aCbxAutoStepMain.GetPosPixel().X(), m_aLB_MainTimeUnit.GetPosPixel().X() );
long nLabelDistance = lcl_getLabelDistance(aTxtMin);
long nListWidth = m_aLB_MainTimeUnit.GetSizePixel().Width();
if( chart2::AxisType::DATE == m_nAxisType )
{
lcl_placeControlAtX( m_aLB_MainTimeUnit, nMinX );
lcl_placeControlAtX( m_aLB_HelpTimeUnit, nMinX );
long nSecondX = nMinX + nListWidth + nLabelDistance;
lcl_placeControlAtX( aCbxAutoStepMain, nSecondX );
lcl_placeControlAtX( aCbxAutoStepHelp, nSecondX );
long nOne = m_aMt_MainDateStep.LogicToPixel( Size(0, 1), MapMode(MAP_APPFONT) ).Height();
long nYMajor = m_aMt_MainDateStep.GetPosPixel().Y();
lcl_placeControlAtY( aCbxAutoStepMain , nYMajor+(3*nOne));
lcl_placeControlAtY( aTxtMain , nYMajor+nOne+nOne);
long nYMinor = m_aLB_HelpTimeUnit.GetPosPixel().Y();
lcl_placeControlAtY( aMtStepHelp , nYMinor );
lcl_placeControlAtY( aCbxAutoStepHelp , nYMinor+(3*nOne));
}
else
{
lcl_placeControlAtX( aCbxAutoStepMain, nMinX );
lcl_placeControlAtX( aCbxAutoStepHelp, nMinX );
long nSecondX = nMinX + aCbxAutoStepMain.GetSizePixel().Width() + nLabelDistance;
long nSecondXMax = GetSizePixel().Width() - nListWidth;
if( nSecondX > nSecondXMax )
nSecondX = nSecondXMax;
lcl_placeControlAtX( m_aLB_MainTimeUnit, nSecondX );
lcl_placeControlAtX( m_aLB_HelpTimeUnit, nSecondX );
}
2003-10-06 08:58:36 +00:00
}
2010-11-30 01:45:03 +01:00
void ScaleTabPage::EnableControls()
{
bool bValueAxis = chart2::AxisType::REALNUMBER == m_nAxisType || chart2::AxisType::PERCENT == m_nAxisType || chart2::AxisType::DATE == m_nAxisType;
bool bDateAxis = chart2::AxisType::DATE == m_nAxisType;
m_aTxt_AxisType.Show(m_bAllowDateAxis);
m_aLB_AxisType.Show(m_bAllowDateAxis);
aCbxLogarithm.Show( bValueAxis && !bDateAxis );
aTxtMin.Show( bValueAxis );
aFmtFldMin.Show( bValueAxis );
aCbxAutoMin.Show( bValueAxis );
aTxtMax.Show( bValueAxis );
aFmtFldMax.Show( bValueAxis );
aCbxAutoMax.Show( bValueAxis );
aTxtMain.Show( bValueAxis );
aFmtFldStepMain.Show( bValueAxis );
aCbxAutoStepMain.Show( bValueAxis );
aTxtHelp.Show( bValueAxis );
aTxtHelpCount.Show( bValueAxis );
aMtStepHelp.Show( bValueAxis );
aCbxAutoStepHelp.Show( bValueAxis );
aTxtOrigin.Show( m_bShowAxisOrigin && bValueAxis );
aFmtFldOrigin.Show( m_bShowAxisOrigin && bValueAxis );
aCbxAutoOrigin.Show( m_bShowAxisOrigin && bValueAxis );
aTxtHelpCount.Show( bValueAxis && !bDateAxis );
aTxtHelp.Show( bDateAxis );
m_aTxt_TimeResolution.Show( bDateAxis );
m_aLB_TimeResolution.Show( bDateAxis );
m_aCbx_AutoTimeResolution.Show( bDateAxis );
bool bWasDateAxis = m_aMt_MainDateStep.IsVisible();
if( bWasDateAxis != bDateAxis )
{
//transport value from one to other control
if( bWasDateAxis )
lcl_setValue( aFmtFldStepMain, m_aMt_MainDateStep.GetValue() );
2010-11-30 01:45:03 +01:00
else
m_aMt_MainDateStep.SetValue( static_cast<sal_Int32>(aFmtFldStepMain.GetValue()) );
}
aFmtFldStepMain.Show( bValueAxis && !bDateAxis );
m_aMt_MainDateStep.Show( bDateAxis );
2008-12-12 12:17:17 +00:00
2010-11-30 01:45:03 +01:00
m_aLB_MainTimeUnit.Show( bDateAxis );
m_aLB_HelpTimeUnit.Show( bDateAxis );
2008-12-12 12:17:17 +00:00
2010-11-30 01:45:03 +01:00
EnableValueHdl(&aCbxAutoMin);
EnableValueHdl(&aCbxAutoMax);
EnableValueHdl(&aCbxAutoStepMain);
EnableValueHdl(&aCbxAutoStepHelp);
EnableValueHdl(&aCbxAutoOrigin);
EnableValueHdl(&m_aCbx_AutoTimeResolution);
}
2008-12-12 12:17:17 +00:00
IMPL_LINK( ScaleTabPage, EnableValueHdl, CheckBox *, pCbx )
2003-10-06 08:58:36 +00:00
{
2010-11-30 01:45:03 +01:00
bool bEnable = pCbx && !pCbx->IsChecked() && pCbx->IsEnabled();
2003-10-06 08:58:36 +00:00
if (pCbx == &aCbxAutoMin)
{
2010-11-30 01:45:03 +01:00
aFmtFldMin.Enable( bEnable );
2003-10-06 08:58:36 +00:00
}
else if (pCbx == &aCbxAutoMax)
{
2010-11-30 01:45:03 +01:00
aFmtFldMax.Enable( bEnable );
2003-10-06 08:58:36 +00:00
}
else if (pCbx == &aCbxAutoStepMain)
{
2010-11-30 01:45:03 +01:00
aFmtFldStepMain.Enable( bEnable );
m_aMt_MainDateStep.Enable( bEnable );
m_aLB_MainTimeUnit.Enable( bEnable );
2003-10-06 08:58:36 +00:00
}
else if (pCbx == &aCbxAutoStepHelp)
{
2010-11-30 01:45:03 +01:00
aMtStepHelp.Enable( bEnable );
m_aLB_HelpTimeUnit.Enable( bEnable );
}
else if (pCbx == &m_aCbx_AutoTimeResolution)
{
m_aLB_TimeResolution.Enable( bEnable );
2003-10-06 08:58:36 +00:00
}
else if (pCbx == &aCbxAutoOrigin)
{
2010-11-30 01:45:03 +01:00
aFmtFldOrigin.Enable( bEnable );
2003-10-06 08:58:36 +00:00
}
return 0;
}
2010-11-30 01:45:03 +01:00
enum AxisTypeListBoxEntry
{
TYPE_AUTO=0,
TYPE_TEXT=1,
TYPE_DATE=2
};
IMPL_LINK_NOARG(ScaleTabPage, SelectAxisTypeHdl)
2010-11-30 01:45:03 +01:00
{
sal_uInt16 nPos = m_aLB_AxisType.GetSelectEntryPos();
2010-11-30 01:45:03 +01:00
if( nPos==TYPE_DATE )
m_nAxisType = chart2::AxisType::DATE;
else
m_nAxisType = chart2::AxisType::CATEGORY;
if( chart2::AxisType::DATE == m_nAxisType )
aCbxLogarithm.Check(false);
EnableControls();
PlaceIntervalControlsAccordingToAxisType();
SetNumFormat();
return 0;
}
SfxTabPage* ScaleTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs)
2003-10-06 08:58:36 +00:00
{
return new ScaleTabPage(pWindow, rOutAttrs);
2003-10-06 08:58:36 +00:00
}
sal_Bool ScaleTabPage::FillItemSet(SfxItemSet& rOutAttrs)
2003-10-06 08:58:36 +00:00
{
OSL_PRECOND( pNumFormatter, "No NumberFormatter available" );
2003-10-06 08:58:36 +00:00
2010-11-30 01:45:03 +01:00
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXISTYPE, m_nAxisType));
if(m_bAllowDateAxis)
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_DATEAXIS, TYPE_AUTO==m_aLB_AxisType.GetSelectEntryPos()));
bool bAutoScale = false;
if( m_nAxisType==chart2::AxisType::CATEGORY )
bAutoScale = true;//reset scaling for category charts
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MIN ,bAutoScale || aCbxAutoMin.IsChecked()));
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MAX ,bAutoScale || aCbxAutoMax.IsChecked()));
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP,bAutoScale || aCbxAutoStepHelp.IsChecked()));
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN ,bAutoScale || aCbxAutoOrigin.IsChecked()));
2003-10-06 08:58:36 +00:00
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_LOGARITHM ,aCbxLogarithm.IsChecked()));
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_REVERSE ,aCbxReverse.IsChecked()));
2003-10-06 08:58:36 +00:00
rOutAttrs.Put(SvxDoubleItem(fMax , SCHATTR_AXIS_MAX));
rOutAttrs.Put(SvxDoubleItem(fMin , SCHATTR_AXIS_MIN));
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_STEP_HELP, nStepHelp));
rOutAttrs.Put(SvxDoubleItem(fOrigin , SCHATTR_AXIS_ORIGIN));
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN,bAutoScale || aCbxAutoStepMain.IsChecked()));
2003-10-06 08:58:36 +00:00
rOutAttrs.Put(SvxDoubleItem(fStepMain,SCHATTR_AXIS_STEP_MAIN));
2010-11-30 01:45:03 +01:00
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_TIME_RESOLUTION,bAutoScale || m_aCbx_AutoTimeResolution.IsChecked()));
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_TIME_RESOLUTION,m_nTimeResolution));
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_MAIN_TIME_UNIT,m_nMainTimeUnit));
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_HELP_TIME_UNIT,m_nHelpTimeUnit));
return sal_True;
2003-10-06 08:58:36 +00:00
}
void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
2003-10-06 08:58:36 +00:00
{
OSL_PRECOND( pNumFormatter, "No NumberFormatter available" );
2003-10-06 08:58:36 +00:00
if(!pNumFormatter)
return;
const SfxPoolItem *pPoolItem = NULL;
if (rInAttrs.GetItemState(SCHATTR_AXIS_ALLOW_DATEAXIS, sal_True, &pPoolItem) == SFX_ITEM_SET)
2010-11-30 01:45:03 +01:00
m_bAllowDateAxis = (bool) ((const SfxBoolItem*)pPoolItem)->GetValue();
m_nAxisType=chart2::AxisType::REALNUMBER;
if (rInAttrs.GetItemState(SCHATTR_AXISTYPE, sal_True, &pPoolItem) == SFX_ITEM_SET)
2010-11-30 01:45:03 +01:00
m_nAxisType = (int) ((const SfxInt32Item*)pPoolItem)->GetValue();
if( m_nAxisType==chart2::AxisType::DATE && !m_bAllowDateAxis )
m_nAxisType=chart2::AxisType::CATEGORY;
2010-11-30 01:45:03 +01:00
if( m_bAllowDateAxis )
{
2010-11-30 01:45:03 +01:00
bool bAutoDateAxis = false;
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_DATEAXIS, sal_True, &pPoolItem) == SFX_ITEM_SET)
2010-11-30 01:45:03 +01:00
bAutoDateAxis = (bool) ((const SfxBoolItem*)pPoolItem)->GetValue();
2011-02-07 13:06:08 +01:00
sal_uInt16 nPos = 0;
2010-11-30 01:45:03 +01:00
if( m_nAxisType==chart2::AxisType::DATE )
nPos=TYPE_DATE;
else if( bAutoDateAxis )
nPos=TYPE_AUTO;
else
nPos=TYPE_TEXT;
m_aLB_AxisType.SelectEntryPos( nPos );
}
2003-10-06 08:58:36 +00:00
if( m_bAllowDateAxis )
aCbxReverse.SetHelpId("chart2:CheckBox:TP_SCALE:CBX_REVERSE:MayBeDateAxis");
else if( m_nAxisType==chart2::AxisType::CATEGORY || m_nAxisType==chart2::AxisType::SERIES )
aCbxReverse.SetHelpId("chart2:CheckBox:TP_SCALE:CBX_REVERSE:Category");
2010-11-30 01:45:03 +01:00
PlaceIntervalControlsAccordingToAxisType();
aCbxAutoMin.Check( true );
aCbxAutoMax.Check( true );
aCbxAutoStepMain.Check( true );
aCbxAutoStepHelp.Check( true );
aCbxAutoOrigin.Check( true );
m_aCbx_AutoTimeResolution.Check( true );
2003-10-06 08:58:36 +00:00
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MIN,sal_True,&pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
aCbxAutoMin.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
if (rInAttrs.GetItemState(SCHATTR_AXIS_MIN,sal_True, &pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
{
fMin = ((const SvxDoubleItem*)pPoolItem)->GetValue();
lcl_setValue( aFmtFldMin, fMin );
2003-10-06 08:58:36 +00:00
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MAX,sal_True, &pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
aCbxAutoMax.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
if (rInAttrs.GetItemState(SCHATTR_AXIS_MAX,sal_True, &pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
{
fMax = ((const SvxDoubleItem*)pPoolItem)->GetValue();
lcl_setValue( aFmtFldMax, fMax );
2003-10-06 08:58:36 +00:00
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_MAIN,sal_True, &pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
aCbxAutoStepMain.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_MAIN,sal_True, &pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
{
fStepMain = ((const SvxDoubleItem*)pPoolItem)->GetValue();
lcl_setValue( aFmtFldStepMain, fStepMain );
2010-11-30 01:45:03 +01:00
m_aMt_MainDateStep.SetValue( static_cast<sal_Int32>(fStepMain) );
2003-10-06 08:58:36 +00:00
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_HELP,sal_True, &pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
aCbxAutoStepHelp.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
if (rInAttrs.GetItemState(SCHATTR_AXIS_LOGARITHM,sal_True, &pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
aCbxLogarithm.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
if (rInAttrs.GetItemState(SCHATTR_AXIS_REVERSE,sal_True, &pPoolItem) == SFX_ITEM_SET)
aCbxReverse.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_HELP,sal_True, &pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
{
nStepHelp = ((const SfxInt32Item*)pPoolItem)->GetValue();
aMtStepHelp.SetValue( nStepHelp );
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_ORIGIN,sal_True, &pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
aCbxAutoOrigin.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
if (rInAttrs.GetItemState(SCHATTR_AXIS_ORIGIN,sal_True, &pPoolItem) == SFX_ITEM_SET)
2003-10-06 08:58:36 +00:00
{
fOrigin = ((const SvxDoubleItem*)pPoolItem)->GetValue();
lcl_setValue( aFmtFldOrigin, fOrigin );
2003-10-06 08:58:36 +00:00
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_TIME_RESOLUTION,sal_True, &pPoolItem) == SFX_ITEM_SET)
2010-11-30 01:45:03 +01:00
m_aCbx_AutoTimeResolution.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
if (rInAttrs.GetItemState(SCHATTR_AXIS_TIME_RESOLUTION,sal_True, &pPoolItem) == SFX_ITEM_SET)
2010-11-30 01:45:03 +01:00
{
m_nTimeResolution = ((const SfxInt32Item*)pPoolItem)->GetValue();
m_aLB_TimeResolution.SelectEntryPos( m_nTimeResolution );
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_MAIN_TIME_UNIT,sal_True, &pPoolItem) == SFX_ITEM_SET)
2010-11-30 01:45:03 +01:00
{
m_nMainTimeUnit = ((const SfxInt32Item*)pPoolItem)->GetValue();
m_aLB_MainTimeUnit.SelectEntryPos( m_nMainTimeUnit );
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_HELP_TIME_UNIT,sal_True, &pPoolItem) == SFX_ITEM_SET)
2010-11-30 01:45:03 +01:00
{
m_nHelpTimeUnit = ((const SfxInt32Item*)pPoolItem)->GetValue();
m_aLB_HelpTimeUnit.SelectEntryPos( m_nHelpTimeUnit );
}
EnableControls();
SetNumFormat();
2003-10-06 08:58:36 +00:00
}
int ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet)
2003-10-06 08:58:36 +00:00
{
if( !pNumFormatter )
{
2011-03-01 19:05:02 +01:00
OSL_FAIL( "No NumberFormatter available" );
2003-10-06 08:58:36 +00:00
return LEAVE_PAGE;
}
2010-11-30 01:45:03 +01:00
bool bDateAxis = chart2::AxisType::DATE == m_nAxisType;
sal_uInt32 nIndex = pNumFormatter->GetStandardIndex(LANGUAGE_SYSTEM);
const SfxPoolItem *pPoolItem = NULL;
if( GetItemSet().GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, sal_True, &pPoolItem ) == SFX_ITEM_SET )
nIndex = static_cast< sal_uInt32 >( static_cast< const SfxInt32Item* >(pPoolItem)->GetValue());
else
{
OSL_FAIL( "Using Standard Language" );
}
2010-11-30 01:45:03 +01:00
Control* pControl = NULL;
sal_uInt16 nErrStrId = 0;
2003-10-06 08:58:36 +00:00
double fDummy;
fMax = aFmtFldMax.GetValue();
fMin = aFmtFldMin.GetValue();
fOrigin = aFmtFldOrigin.GetValue();
2010-11-30 01:45:03 +01:00
fStepMain = bDateAxis ? m_aMt_MainDateStep.GetValue() : aFmtFldStepMain.GetValue();
nStepHelp = static_cast< sal_Int32 >( aMtStepHelp.GetValue());
2010-11-30 01:45:03 +01:00
m_nTimeResolution = m_aLB_TimeResolution.GetSelectEntryPos();
m_nMainTimeUnit = m_aLB_MainTimeUnit.GetSelectEntryPos();
m_nHelpTimeUnit = m_aLB_HelpTimeUnit.GetSelectEntryPos();
if( chart2::AxisType::REALNUMBER != m_nAxisType )
aCbxLogarithm.Show( false );
//check wich entries need user action
2003-10-06 08:58:36 +00:00
if ( aCbxLogarithm.IsChecked() &&
( ( !aCbxAutoMin.IsChecked() && fMin <= 0.0 )
|| ( !aCbxAutoMax.IsChecked() && fMax <= 0.0 ) ) )
{
2010-11-30 01:45:03 +01:00
pControl = &aFmtFldMin;
2003-10-06 08:58:36 +00:00
nErrStrId = STR_BAD_LOGARITHM;
}
2010-11-30 01:45:03 +01:00
else if (!aCbxAutoMax.IsChecked() && !aCbxAutoMin.IsChecked() &&
fMin >= fMax)
{
pControl = &aFmtFldMin;
nErrStrId = STR_MIN_GREATER_MAX;
}
else if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0)
2003-10-06 08:58:36 +00:00
{
2010-11-30 01:45:03 +01:00
pControl = &aFmtFldStepMain;
2003-10-06 08:58:36 +00:00
nErrStrId = STR_STEP_GT_ZERO;
}
// check for entries that cannot be parsed for the current number format
2010-11-30 01:45:03 +01:00
else if ( aFmtFldMin.IsModified()
2003-10-06 08:58:36 +00:00
&& !aCbxAutoMin.IsChecked()
&& !pNumFormatter->IsNumberFormat(aFmtFldMin.GetText(), nIndex, fDummy))
{
2010-11-30 01:45:03 +01:00
pControl = &aFmtFldMin;
2003-10-06 08:58:36 +00:00
nErrStrId = STR_INVALID_NUMBER;
}
else if (aFmtFldMax.IsModified() && !aCbxAutoMax.IsChecked() &&
!pNumFormatter->IsNumberFormat(aFmtFldMax.GetText(),
nIndex, fDummy))
{
2010-11-30 01:45:03 +01:00
pControl = &aFmtFldMax;
2003-10-06 08:58:36 +00:00
nErrStrId = STR_INVALID_NUMBER;
}
2010-11-30 01:45:03 +01:00
else if ( !bDateAxis && aFmtFldStepMain.IsModified() && !aCbxAutoStepMain.IsChecked() &&
2003-10-06 08:58:36 +00:00
!pNumFormatter->IsNumberFormat(aFmtFldStepMain.GetText(),
nIndex, fDummy))
{
2010-11-30 01:45:03 +01:00
pControl = &aFmtFldStepMain;
nErrStrId = STR_STEP_GT_ZERO;
2003-10-06 08:58:36 +00:00
}
else if (aFmtFldOrigin.IsModified() && !aCbxAutoOrigin.IsChecked() &&
!pNumFormatter->IsNumberFormat(aFmtFldOrigin.GetText(),
nIndex, fDummy))
{
2010-11-30 01:45:03 +01:00
pControl = &aFmtFldOrigin;
2003-10-06 08:58:36 +00:00
nErrStrId = STR_INVALID_NUMBER;
}
else if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0.0)
{
2010-11-30 01:45:03 +01:00
pControl = &aFmtFldStepMain;
nErrStrId = STR_STEP_GT_ZERO;
2003-10-06 08:58:36 +00:00
}
2010-11-30 01:45:03 +01:00
else if( bDateAxis )
{
if( !aCbxAutoStepMain.IsChecked() && !aCbxAutoStepHelp.IsChecked() )
{
if( m_nHelpTimeUnit > m_nMainTimeUnit )
{
pControl = &m_aLB_MainTimeUnit;
nErrStrId = STR_INVALID_INTERVALS;
}
else if( m_nHelpTimeUnit == m_nMainTimeUnit && nStepHelp > fStepMain )
{
pControl = &m_aLB_MainTimeUnit;
nErrStrId = STR_INVALID_INTERVALS;
}
}
if( !nErrStrId && !m_aCbx_AutoTimeResolution.IsChecked() )
{
if( (!aCbxAutoStepMain.IsChecked() && m_nTimeResolution > m_nMainTimeUnit )
||
(!aCbxAutoStepHelp.IsChecked() && m_nTimeResolution > m_nHelpTimeUnit )
)
{
pControl = &m_aLB_TimeResolution;
nErrStrId = STR_INVALID_TIME_UNIT;
}
}
}
2003-10-06 08:58:36 +00:00
2010-11-30 01:45:03 +01:00
if( ShowWarning( nErrStrId, pControl ) )
2003-10-06 08:58:36 +00:00
return KEEP_PAGE;
if( pItemSet )
FillItemSet( *pItemSet );
return LEAVE_PAGE;
}
void ScaleTabPage::SetNumFormatter( SvNumberFormatter* pFormatter )
2003-10-06 08:58:36 +00:00
{
pNumFormatter = pFormatter;
aFmtFldMax.SetFormatter( pNumFormatter );
aFmtFldMin.SetFormatter( pNumFormatter );
aFmtFldStepMain.SetFormatter( pNumFormatter );
aFmtFldOrigin.SetFormatter( pNumFormatter );
2011-02-07 20:20:44 +01:00
// #i6278# allow more decimal places than the output format. As
// the numbers shown in the edit fields are used for input, it makes more
// sense to display the values in the input format rather than the output
// format.
aFmtFldMax.UseInputStringForFormatting();
aFmtFldMin.UseInputStringForFormatting();
aFmtFldStepMain.UseInputStringForFormatting();
aFmtFldOrigin.UseInputStringForFormatting();
2003-10-06 08:58:36 +00:00
SetNumFormat();
}
void ScaleTabPage::SetNumFormat()
2003-10-06 08:58:36 +00:00
{
const SfxPoolItem *pPoolItem = NULL;
if( GetItemSet().GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, sal_True, &pPoolItem ) == SFX_ITEM_SET )
2003-10-06 08:58:36 +00:00
{
sal_uLong nFmt = (sal_uLong)((const SfxInt32Item*)pPoolItem)->GetValue();
2003-10-06 08:58:36 +00:00
aFmtFldMax.SetFormatKey( nFmt );
aFmtFldMin.SetFormatKey( nFmt );
aFmtFldOrigin.SetFormatKey( nFmt );
2008-12-12 12:17:17 +00:00
if( pNumFormatter )
2003-10-06 08:58:36 +00:00
{
2008-12-12 12:17:17 +00:00
short eType = pNumFormatter->GetType( nFmt );
if( eType == NUMBERFORMAT_DATE )
{
// for intervals use standard format for dates (so you can enter a number of days)
const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
if( pFormat )
nFmt = pNumFormatter->GetStandardIndex( pFormat->GetLanguage());
else
nFmt = pNumFormatter->GetStandardIndex();
}
else if( eType == NUMBERFORMAT_DATETIME )
{
// for intervals use time format for date times
const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
if( pFormat )
nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_TIME, pFormat->GetLanguage() );
else
nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_TIME );
}
2010-11-30 01:45:03 +01:00
if( chart2::AxisType::DATE == m_nAxisType && ( eType != NUMBERFORMAT_DATE && eType != NUMBERFORMAT_DATETIME) )
{
const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
if( pFormat )
nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_DATE, pFormat->GetLanguage() );
else
nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_DATE );
aFmtFldMax.SetFormatKey( nFmt );
aFmtFldMin.SetFormatKey( nFmt );
aFmtFldOrigin.SetFormatKey( nFmt );
}
2003-10-06 08:58:36 +00:00
}
aFmtFldStepMain.SetFormatKey( nFmt );
}
}
2008-12-12 12:17:17 +00:00
void ScaleTabPage::ShowAxisOrigin( bool bShowOrigin )
{
m_bShowAxisOrigin = bShowOrigin;
if( !AxisHelper::isAxisPositioningEnabled() )
m_bShowAxisOrigin = true;
}
2011-02-07 13:06:08 +01:00
bool ScaleTabPage::ShowWarning( sal_uInt16 nResIdMessage, Control* pControl /* = NULL */ )
2003-10-06 08:58:36 +00:00
{
if( nResIdMessage == 0 )
return false;
WarningBox( this, WinBits( WB_OK ), String( SchResId( nResIdMessage ))).Execute();
if( pControl )
{
pControl->GrabFocus();
2010-11-30 01:45:03 +01:00
Edit* pEdit = dynamic_cast<Edit*>(pControl);
if(pEdit)
pEdit->SetSelection( Selection( 0, SELECTION_MAX ));
2003-10-06 08:58:36 +00:00
}
return true;
}
void ScaleTabPage::HideAllControls()
{
// We need to set these controls invisible when the class is instantiated
// since some code in EnableControls() depends on that logic. The real
// visibility of these controls depend on axis data type, and are
// set in EnableControls().
m_aTxt_AxisType.Hide();
m_aLB_AxisType.Hide();
aCbxLogarithm.Hide();
aTxtMin.Hide();
aFmtFldMin.Hide();
aCbxAutoMin.Hide();
aTxtMax.Hide();
aFmtFldMax.Hide();
aCbxAutoMax.Hide();
aTxtMain.Hide();
aFmtFldStepMain.Hide();
aCbxAutoStepMain.Hide();
aTxtHelp.Hide();
aTxtHelpCount.Hide();
aMtStepHelp.Hide();
aCbxAutoStepHelp.Hide();
aTxtOrigin.Hide();
aFmtFldOrigin.Hide();
aCbxAutoOrigin.Hide();
aTxtHelpCount.Hide();
aTxtHelp.Hide();
m_aTxt_TimeResolution.Hide();
m_aLB_TimeResolution.Hide();
m_aCbx_AutoTimeResolution.Hide();
aFmtFldStepMain.Hide();
m_aMt_MainDateStep.Hide();
m_aLB_MainTimeUnit.Hide();
m_aLB_HelpTimeUnit.Hide();
}
2003-10-06 08:58:36 +00:00
//.............................................................................
} //namespace chart
//.............................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */