tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / chart2 / source / controller / dialogs / dlg_InsertAxis_Grid.cxx
blob0fcdcaf164a9107f4d15d6e4dab6dd85f1ecd1a2
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 namespace chart
25 InsertAxisOrGridDialogData::InsertAxisOrGridDialogData()
26 : aPossibilityList{ true, true, true, true, true, true }
27 , aExistenceList{ false, false, false, false, false, false }
31 // SchAxisDlg
33 SchAxisDlg::SchAxisDlg(weld::Window* pWindow,
34 const InsertAxisOrGridDialogData& rInput, bool bAxisDlg)
35 : GenericDialogController(pWindow,
36 bAxisDlg ?
37 u"modules/schart/ui/insertaxisdlg.ui"_ustr :
38 u"modules/schart/ui/insertgriddlg.ui"_ustr,
39 bAxisDlg ?
40 u"InsertAxisDialog"_ustr :
41 u"InsertGridDialog"_ustr)
42 , m_xCbPrimaryX(m_xBuilder->weld_check_button(u"primaryX"_ustr))
43 , m_xCbPrimaryY(m_xBuilder->weld_check_button(u"primaryY"_ustr))
44 , m_xCbPrimaryZ(m_xBuilder->weld_check_button(u"primaryZ"_ustr))
45 , m_xCbSecondaryX(m_xBuilder->weld_check_button(u"secondaryX"_ustr))
46 , m_xCbSecondaryY(m_xBuilder->weld_check_button(u"secondaryY"_ustr))
47 , m_xCbSecondaryZ(m_xBuilder->weld_check_button(u"secondaryZ"_ustr))
49 if (bAxisDlg)
51 //todo: remove if secondary z axis are possible somewhere
52 m_xCbSecondaryZ->hide();
55 m_xCbPrimaryX->set_active( rInput.aExistenceList[0] );
56 m_xCbPrimaryY->set_active( rInput.aExistenceList[1] );
57 m_xCbPrimaryZ->set_active( rInput.aExistenceList[2] );
58 m_xCbSecondaryX->set_active( rInput.aExistenceList[3] );
59 m_xCbSecondaryY->set_active( rInput.aExistenceList[4] );
60 m_xCbSecondaryZ->set_active( rInput.aExistenceList[5] );
62 m_xCbPrimaryX->set_sensitive( rInput.aPossibilityList[0] );
63 m_xCbPrimaryY->set_sensitive( rInput.aPossibilityList[1] );
64 m_xCbPrimaryZ->set_sensitive( rInput.aPossibilityList[2] );
65 m_xCbSecondaryX->set_sensitive( rInput.aPossibilityList[3] );
66 m_xCbSecondaryY->set_sensitive( rInput.aPossibilityList[4] );
67 m_xCbSecondaryZ->set_sensitive( rInput.aPossibilityList[5] );
70 void SchAxisDlg::getResult( InsertAxisOrGridDialogData& rOutput )
72 sal_Bool* pExistenceList = rOutput.aExistenceList.getArray();
73 pExistenceList[0]=m_xCbPrimaryX->get_active();
74 pExistenceList[1]=m_xCbPrimaryY->get_active();
75 pExistenceList[2]=m_xCbPrimaryZ->get_active();
76 pExistenceList[3]=m_xCbSecondaryX->get_active();
77 pExistenceList[4]=m_xCbSecondaryY->get_active();
78 pExistenceList[5]=m_xCbSecondaryZ->get_active();
81 SchGridDlg::SchGridDlg(weld::Window* pParent, const InsertAxisOrGridDialogData& rInput)
82 : SchAxisDlg(pParent, rInput, false) //rInAttrs, b3D, bNet, bSecondaryX, bSecondaryY, false )
86 } //namespace chart
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */