1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "dlg_View3D.hxx"
21 #include "Strings.hrc"
22 #include "ResourceIds.hrc"
24 #include "tp_3D_SceneGeometry.hxx"
25 #include "tp_3D_SceneAppearance.hxx"
26 #include "tp_3D_SceneIllumination.hxx"
27 #include "ChartModelHelper.hxx"
29 #include "ControllerLockGuard.hxx"
30 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <vcl/msgbox.hxx>
37 using namespace ::com::sun::star
;
38 using namespace ::com::sun::star::chart2
;
40 sal_uInt16
View3DDialog::m_nLastPageId
= 0;
42 View3DDialog::View3DDialog(vcl::Window
* pParent
, const uno::Reference
< frame::XModel
> & xChartModel
, const XColorListRef
&pColorTable
)
43 : TabDialog(pParent
, "3DViewDialog", "modules/schart/ui/3dviewdialog.ui")
47 , m_aControllerLocker(xChartModel
)
49 get(m_pTabControl
, "tabcontrol");
51 uno::Reference
< beans::XPropertySet
> xSceneProperties( ChartModelHelper::findDiagram( xChartModel
), uno::UNO_QUERY
);
52 m_pGeometry
= VclPtr
<ThreeD_SceneGeometry_TabPage
>::Create(m_pTabControl
,xSceneProperties
,m_aControllerLocker
);
53 m_pAppearance
= VclPtr
<ThreeD_SceneAppearance_TabPage
>::Create(m_pTabControl
,xChartModel
,m_aControllerLocker
);
54 m_pIllumination
= VclPtr
<ThreeD_SceneIllumination_TabPage
>::Create(m_pTabControl
,xSceneProperties
,xChartModel
,pColorTable
);
56 m_pTabControl
->InsertPage( TP_3D_SCENEGEOMETRY
, SCH_RESSTR(STR_PAGE_PERSPECTIVE
) );
57 m_pTabControl
->InsertPage( TP_3D_SCENEAPPEARANCE
, SCH_RESSTR(STR_PAGE_APPEARANCE
) );
58 m_pTabControl
->InsertPage( TP_3D_SCENEILLUMINATION
, SCH_RESSTR(STR_PAGE_ILLUMINATION
) );
60 m_pTabControl
->SetTabPage( TP_3D_SCENEGEOMETRY
, m_pGeometry
);
61 m_pTabControl
->SetTabPage( TP_3D_SCENEAPPEARANCE
, m_pAppearance
);
62 m_pTabControl
->SetTabPage( TP_3D_SCENEILLUMINATION
, m_pIllumination
);
64 m_pTabControl
->SelectTabPage( m_nLastPageId
);
67 View3DDialog::~View3DDialog()
72 void View3DDialog::dispose()
74 m_pGeometry
.disposeAndClear();
75 m_pAppearance
.disposeAndClear();
76 m_pIllumination
.disposeAndClear();
78 m_nLastPageId
= m_pTabControl
->GetCurPageId();
79 m_pTabControl
.clear();
83 short View3DDialog::Execute()
85 short nResult
= TabDialog::Execute();
86 if( nResult
== RET_OK
)
89 m_pGeometry
->commitPendingChanges();
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */