Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / chart2 / source / controller / dialogs / dlg_InsertAxis_Grid.cxx
blob9a227f59b2f503b35966d6efbc93740d69da5edd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_InsertAxis_Grid.hxx>
22 #include <chartview/ChartSfxItemIds.hxx>
23 #include <ObjectNameProvider.hxx>
25 #include <svl/eitem.hxx>
27 namespace chart
30 InsertAxisOrGridDialogData::InsertAxisOrGridDialogData()
31 : aPossibilityList(6)
32 , aExistenceList(6)
34 sal_Int32 nN = 0;
35 for(nN=6;nN--;)
36 aPossibilityList[nN]=true;
37 for(nN=6;nN--;)
38 aExistenceList[nN]=false;
41 // SchAxisDlg
43 SchAxisDlg::SchAxisDlg(weld::Window* pWindow,
44 const InsertAxisOrGridDialogData& rInput, bool bAxisDlg)
45 : GenericDialogController(pWindow,
46 bAxisDlg ?
47 OUString("modules/schart/ui/insertaxisdlg.ui") :
48 OUString("modules/schart/ui/insertgriddlg.ui"),
49 bAxisDlg ?
50 OString("InsertAxisDialog") :
51 OString("InsertGridDialog"))
52 , m_xCbPrimaryX(m_xBuilder->weld_check_button("primaryX"))
53 , m_xCbPrimaryY(m_xBuilder->weld_check_button("primaryY"))
54 , m_xCbPrimaryZ(m_xBuilder->weld_check_button("primaryZ"))
55 , m_xCbSecondaryX(m_xBuilder->weld_check_button("secondaryX"))
56 , m_xCbSecondaryY(m_xBuilder->weld_check_button("secondaryY"))
57 , m_xCbSecondaryZ(m_xBuilder->weld_check_button("secondaryZ"))
59 if (bAxisDlg)
61 //todo: remove if secondary z axis are possible somewhere
62 m_xCbSecondaryZ->hide();
65 m_xCbPrimaryX->set_active( rInput.aExistenceList[0] );
66 m_xCbPrimaryY->set_active( rInput.aExistenceList[1] );
67 m_xCbPrimaryZ->set_active( rInput.aExistenceList[2] );
68 m_xCbSecondaryX->set_active( rInput.aExistenceList[3] );
69 m_xCbSecondaryY->set_active( rInput.aExistenceList[4] );
70 m_xCbSecondaryZ->set_active( rInput.aExistenceList[5] );
72 m_xCbPrimaryX->set_sensitive( rInput.aPossibilityList[0] );
73 m_xCbPrimaryY->set_sensitive( rInput.aPossibilityList[1] );
74 m_xCbPrimaryZ->set_sensitive( rInput.aPossibilityList[2] );
75 m_xCbSecondaryX->set_sensitive( rInput.aPossibilityList[3] );
76 m_xCbSecondaryY->set_sensitive( rInput.aPossibilityList[4] );
77 m_xCbSecondaryZ->set_sensitive( rInput.aPossibilityList[5] );
80 void SchAxisDlg::getResult( InsertAxisOrGridDialogData& rOutput )
82 rOutput.aExistenceList[0]=m_xCbPrimaryX->get_active();
83 rOutput.aExistenceList[1]=m_xCbPrimaryY->get_active();
84 rOutput.aExistenceList[2]=m_xCbPrimaryZ->get_active();
85 rOutput.aExistenceList[3]=m_xCbSecondaryX->get_active();
86 rOutput.aExistenceList[4]=m_xCbSecondaryY->get_active();
87 rOutput.aExistenceList[5]=m_xCbSecondaryZ->get_active();
90 SchGridDlg::SchGridDlg(weld::Window* pParent, const InsertAxisOrGridDialogData& rInput)
91 : SchAxisDlg(pParent, rInput, false) //rInAttrs, b3D, bNet, bSecondaryX, bSecondaryY, false )
95 } //namespace chart
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */