LibreOffice Module chart2 (master) 1
dlg_View3D.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <dlg_View3D.hxx>
21#include <strings.hrc>
22#include <ResId.hxx>
26#include <ChartModelHelper.hxx>
27#include <ChartModel.hxx>
28#include <Diagram.hxx>
29
30namespace chart
31{
32
33using namespace ::com::sun::star;
34using namespace ::com::sun::star::chart2;
35
36sal_uInt16 View3DDialog::m_nLastPageId = 0;
37
39 : GenericDialogController(pParent, "modules/schart/ui/3dviewdialog.ui", "3DViewDialog")
40 , m_aControllerLocker(xChartModel)
41 , m_xTabControl(m_xBuilder->weld_notebook("tabcontrol"))
42{
43 rtl::Reference< Diagram > xSceneProperties = xChartModel->getFirstChartDiagram();
44
45 m_xTabControl->append_page("geometry", SchResId(STR_PAGE_PERSPECTIVE));
46 m_xGeometry.reset(new ThreeD_SceneGeometry_TabPage(m_xTabControl->get_page("geometry"), xSceneProperties, m_aControllerLocker));
47
48 m_xTabControl->append_page("appearance", SchResId(STR_PAGE_APPEARANCE));
49 m_xAppearance.reset(new ThreeD_SceneAppearance_TabPage(m_xTabControl->get_page("appearance"), xChartModel, m_aControllerLocker));
50
51 m_xTabControl->append_page("illumination", SchResId(STR_PAGE_ILLUMINATION));
52 m_xIllumination.reset(new ThreeD_SceneIllumination_TabPage(m_xTabControl->get_page("illumination"), m_xDialog.get(),
53 xSceneProperties, xChartModel));
54
55 m_xTabControl->connect_enter_page(LINK(this, View3DDialog, ActivatePageHdl));
56
57 m_xTabControl->set_current_page(m_nLastPageId);
58}
59
60IMPL_LINK(View3DDialog, ActivatePageHdl, const OUString&, rPage, void)
61{
62 if (rPage == "appearance")
63 m_xAppearance->ActivatePage();
64}
65
67{
68 m_nLastPageId = m_xTabControl->get_current_page();
69}
70
72{
73 short nResult = GenericDialogController::run();
74 if (nResult == RET_OK && m_xGeometry)
75 m_xGeometry->commitPendingChanges();
76 return nResult;
77}
78
79} //namespace chart
80
81/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< ThreeD_SceneAppearance_TabPage > m_xAppearance
Definition: dlg_View3D.hxx:52
virtual short run() override
Definition: dlg_View3D.cxx:71
virtual ~View3DDialog() override
Definition: dlg_View3D.cxx:66
std::unique_ptr< weld::Notebook > m_xTabControl
Definition: dlg_View3D.hxx:50
View3DDialog(weld::Window *pWindow, const rtl::Reference<::chart::ChartModel > &xChartModel)
Definition: dlg_View3D.cxx:38
static sal_uInt16 m_nLastPageId
Definition: dlg_View3D.hxx:48
std::unique_ptr< ThreeD_SceneIllumination_TabPage > m_xIllumination
Definition: dlg_View3D.hxx:53
ControllerLockHelper m_aControllerLocker
Definition: dlg_View3D.hxx:46
std::unique_ptr< ThreeD_SceneGeometry_TabPage > m_xGeometry
Definition: dlg_View3D.hxx:51
std::shared_ptr< weld::Dialog > m_xDialog
OUString OOO_DLLPUBLIC_CHARTTOOLS SchResId(TranslateId aId)
Definition: ResId.cxx:24
IMPL_LINK(StackingResourceGroup, StackingChangeHdl, weld::Toggleable &, rRadio, void)
RET_OK