Files
libreoffice/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
Vladimir Glazounov 607780f039 INTEGRATION: CWS chart2mst3 (1.2.4); FILE MERGED
2007/05/14 20:03:54 bm 1.2.4.8: RESYNC: (1.4-1.5); FILE MERGED
2006/10/18 17:05:15 bm 1.2.4.7: RESYNC: (1.3-1.4); FILE MERGED
2006/02/20 14:45:46 iha 1.2.4.6: move SchItemPool from controller to view lib -> ChartItemPool
2005/11/23 16:51:29 iha 1.2.4.5: cleanup SchSfxItemIds.hxx + removed unused defines
2005/11/23 15:17:27 iha 1.2.4.4: support BarOverlap and GapWidth
2005/10/07 11:22:15 bm 1.2.4.3: RESYNC: (1.2-1.3); FILE MERGED
2004/06/01 18:53:38 iha 1.2.4.2: no warnings+cleanup
2004/04/27 15:00:39 iha 1.2.4.1: warnings removed
2007-05-22 16:49:18 +00:00

179 lines
5.4 KiB
C++

/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: tp_SeriesToAxis.cxx,v $
*
* $Revision: 1.6 $
*
* last change: $Author: vg $ $Date: 2007-05-22 17:49:18 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library 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 for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
#include "tp_SeriesToAxis.hxx"
#include "ResId.hxx"
#include "TabPages.hrc"
#include "chartview/ChartSfxItemIds.hxx"
#include "NoWarningThisInCTOR.hxx"
// header for class SfxBoolItem
#ifndef _SFXENUMITEM_HXX
#include <svtools/eitem.hxx>
#endif
// header for SfxInt32Item
#ifndef _SFXINTITEM_HXX
#include <svtools/intitem.hxx>
#endif
//.............................................................................
namespace chart
{
//.............................................................................
SchOptionTabPage::SchOptionTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
SfxTabPage(pWindow, SchResId(TP_OPTIONS), rInAttrs),
aGrpAxis(this, SchResId(GRP_OPT_AXIS)),
aRbtAxis1(this,SchResId(RBT_OPT_AXIS_1)),
aRbtAxis2(this,SchResId(RBT_OPT_AXIS_2)),
aGrpBar(this, SchResId(GB_BAR)),
aFTGap(this,SchResId(FT_GAP)),
aMTGap(this,SchResId(MT_GAP)),
aFTOverlap(this,SchResId(FT_OVERLAP)),
aMTOverlap(this,SchResId(MT_OVERLAP)),
aCBConnect(this,SchResId(CB_CONNECTOR))
{
FreeResource();
}
/*************************************************************************
|*
|* Dtor
|*
\************************************************************************/
SchOptionTabPage::~SchOptionTabPage()
{
}
/*************************************************************************
|*
|* Erzeugung
|*
\*************************************************************************/
SfxTabPage* SchOptionTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs)
{
return new SchOptionTabPage(pWindow, rOutAttrs);
}
/*************************************************************************
|*
|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen
|*
\*************************************************************************/
BOOL SchOptionTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{
if(aRbtAxis2.IsChecked())
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS,CHART_AXIS_SECONDARY_Y));
else
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS,CHART_AXIS_PRIMARY_Y));
if(aMTGap.IsVisible())
rOutAttrs.Put(SfxInt32Item(SCHATTR_BAR_GAPWIDTH,aMTGap.GetValue()));
if(aMTOverlap.IsVisible())
rOutAttrs.Put(SfxInt32Item(SCHATTR_BAR_OVERLAP,aMTOverlap.GetValue()));
if(aCBConnect.IsVisible())
rOutAttrs.Put(SfxBoolItem(SCHATTR_BAR_CONNECT,aCBConnect.IsChecked()));
return TRUE;
}
/*************************************************************************
|*
|* Initialisierung
|*
\*************************************************************************/
void SchOptionTabPage::Reset(const SfxItemSet& rInAttrs)
{
const SfxPoolItem *pPoolItem = NULL;
aRbtAxis1.Check(TRUE);
aRbtAxis2.Check(FALSE);
if (rInAttrs.GetItemState(SCHATTR_AXIS,TRUE, &pPoolItem) == SFX_ITEM_SET)
{
long nVal=((const SfxInt32Item*)pPoolItem)->GetValue();
if(nVal==CHART_AXIS_SECONDARY_Y)
{
aRbtAxis2.Check(TRUE);
aRbtAxis1.Check(FALSE);
}
}
long nTmp;
if (rInAttrs.GetItemState(SCHATTR_BAR_GAPWIDTH, TRUE, &pPoolItem) == SFX_ITEM_SET)
{
nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue();
aMTGap.SetValue(nTmp);
}
else
{
aMTGap.Show(FALSE);
aFTGap.Show(FALSE);
}
if (rInAttrs.GetItemState(SCHATTR_BAR_OVERLAP, TRUE, &pPoolItem) == SFX_ITEM_SET)
{
nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue();
aMTOverlap.SetValue(nTmp);
}
else
{
aMTOverlap.Show(FALSE);
aFTOverlap.Show(FALSE);
}
if (rInAttrs.GetItemState(SCHATTR_BAR_CONNECT, TRUE, &pPoolItem) == SFX_ITEM_SET)
{
nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue();
aCBConnect.Check(BOOL(nTmp));
}
else
{
aCBConnect.Show(FALSE);
}
}
//.............................................................................
} //namespace chart
//.............................................................................