1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlg_View3D.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
34 #include "dlg_View3D.hxx"
35 #include "dlg_View3D.hrc"
36 #include "Strings.hrc"
37 #include "TabPages.hrc"
39 #include "NoWarningThisInCTOR.hxx"
40 #include "tp_3D_SceneGeometry.hxx"
41 #include "tp_3D_SceneAppearance.hxx"
42 #include "tp_3D_SceneIllumination.hxx"
43 #include "ChartModelHelper.hxx"
45 #include "ControllerLockGuard.hxx"
46 #include <com/sun/star/beans/XPropertySet.hpp>
49 #include <vcl/msgbox.hxx>
51 //.............................................................................
54 //.............................................................................
56 using namespace ::com::sun::star
;
57 using namespace ::com::sun::star::chart2
;
59 //-----------------------------------------------------------------------------
60 //-------------------------------------------------------------------
61 //-------------------------------------------------------------------
64 USHORT
View3DDialog::m_nLastPageId
= 0;
66 View3DDialog::View3DDialog(Window
* pParent
, const uno::Reference
< frame::XModel
> & xChartModel
, XColorTable
* pColorTable
)
67 : TabDialog(pParent
,SchResId(DLG_3D_VIEW
))
68 , m_aTabControl(this,SchResId(TABCTRL
))
69 , m_aBtnOK(this,SchResId(BTN_OK
))
70 , m_aBtnCancel(this,SchResId(BTN_CANCEL
))
71 , m_aBtnHelp(this,SchResId(BTN_HELP
))
75 , m_aControllerLocker(xChartModel
)
79 uno::Reference
< beans::XPropertySet
> xSceneProperties( ChartModelHelper::findDiagram( xChartModel
), uno::UNO_QUERY
);
80 m_pGeometry
= new ThreeD_SceneGeometry_TabPage(&m_aTabControl
,xSceneProperties
,m_aControllerLocker
);
81 m_pAppearance
= new ThreeD_SceneAppearance_TabPage(&m_aTabControl
,xChartModel
,m_aControllerLocker
);
82 m_pIllumination
= new ThreeD_SceneIllumination_TabPage(&m_aTabControl
,xSceneProperties
,xChartModel
,pColorTable
);
84 m_aTabControl
.InsertPage( TP_3D_SCENEGEOMETRY
, String(SchResId(STR_PAGE_PERSPECTIVE
)) );
85 m_aTabControl
.InsertPage( TP_3D_SCENEAPPEARANCE
, String(SchResId(STR_PAGE_APPEARANCE
)) );
86 m_aTabControl
.InsertPage( TP_3D_SCENEILLUMINATION
, String(SchResId(STR_PAGE_ILLUMINATION
)) );
88 m_aTabControl
.SetTabPage( TP_3D_SCENEGEOMETRY
, m_pGeometry
);
89 m_aTabControl
.SetTabPage( TP_3D_SCENEAPPEARANCE
, m_pAppearance
);
90 m_aTabControl
.SetTabPage( TP_3D_SCENEILLUMINATION
, m_pIllumination
);
92 m_aTabControl
.SelectTabPage( m_nLastPageId
);
95 View3DDialog::~View3DDialog()
99 delete m_pIllumination
;
101 m_nLastPageId
= m_aTabControl
.GetCurPageId();
104 short View3DDialog::Execute()
106 short nResult
= TabDialog::Execute();
107 if( nResult
== RET_OK
)
110 m_pGeometry
->commitPendingChanges();
112 m_pAppearance
->commitPendingChanges();
113 if( m_pIllumination
)
114 m_pIllumination
->commitPendingChanges();
119 //.............................................................................
121 //.............................................................................