Line data Source code
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_InsertAxis_Grid.hxx"
21 :
22 : #include "ResId.hxx"
23 : #include "chartview/ChartSfxItemIds.hxx"
24 : #include "HelpIds.hrc"
25 : #include "ObjectNameProvider.hxx"
26 :
27 : #include <svl/eitem.hxx>
28 :
29 : namespace chart
30 : {
31 :
32 0 : InsertAxisOrGridDialogData::InsertAxisOrGridDialogData()
33 : : aPossibilityList(6)
34 0 : , aExistenceList(6)
35 : {
36 0 : sal_Int32 nN = 0;
37 0 : for(nN=6;nN--;)
38 0 : aPossibilityList[nN]=true;
39 0 : for(nN=6;nN--;)
40 0 : aExistenceList[nN]=false;
41 0 : }
42 :
43 : // SchAxisDlg
44 :
45 0 : SchAxisDlg::SchAxisDlg(vcl::Window* pWindow,
46 : const InsertAxisOrGridDialogData& rInput, bool bAxisDlg)
47 : : ModalDialog(pWindow,
48 : bAxisDlg ?
49 : OUString("InsertAxisDialog") :
50 : OUString("InsertGridDialog"),
51 : bAxisDlg ?
52 : OUString("modules/schart/ui/insertaxisdlg.ui") :
53 0 : OUString("modules/schart/ui/insertgriddlg.ui"))
54 : {
55 0 : get(m_pCbPrimaryX, "primaryX");
56 0 : get(m_pCbPrimaryY, "primaryY");
57 0 : get(m_pCbPrimaryZ, "primaryZ");
58 0 : get(m_pCbSecondaryX, "secondaryX");
59 0 : get(m_pCbSecondaryY, "secondaryY");
60 0 : get(m_pCbSecondaryZ, "secondaryZ");
61 :
62 0 : if (bAxisDlg)
63 : {
64 :
65 : //todo: remove if secondary z axis are possible somewhere
66 0 : m_pCbSecondaryZ->Hide();
67 : }
68 :
69 0 : m_pCbPrimaryX->Check( rInput.aExistenceList[0] );
70 0 : m_pCbPrimaryY->Check( rInput.aExistenceList[1] );
71 0 : m_pCbPrimaryZ->Check( rInput.aExistenceList[2] );
72 0 : m_pCbSecondaryX->Check( rInput.aExistenceList[3] );
73 0 : m_pCbSecondaryY->Check( rInput.aExistenceList[4] );
74 0 : m_pCbSecondaryZ->Check( rInput.aExistenceList[5] );
75 :
76 0 : m_pCbPrimaryX->Enable( rInput.aPossibilityList[0] );
77 0 : m_pCbPrimaryY->Enable( rInput.aPossibilityList[1] );
78 0 : m_pCbPrimaryZ->Enable( rInput.aPossibilityList[2] );
79 0 : m_pCbSecondaryX->Enable( rInput.aPossibilityList[3] );
80 0 : m_pCbSecondaryY->Enable( rInput.aPossibilityList[4] );
81 0 : m_pCbSecondaryZ->Enable( rInput.aPossibilityList[5] );
82 0 : }
83 :
84 0 : SchAxisDlg::~SchAxisDlg()
85 : {
86 0 : disposeOnce();
87 0 : }
88 :
89 0 : void SchAxisDlg::dispose()
90 : {
91 0 : m_pCbPrimaryX.clear();
92 0 : m_pCbPrimaryY.clear();
93 0 : m_pCbPrimaryZ.clear();
94 0 : m_pCbSecondaryX.clear();
95 0 : m_pCbSecondaryY.clear();
96 0 : m_pCbSecondaryZ.clear();
97 0 : ModalDialog::dispose();
98 0 : }
99 :
100 :
101 0 : void SchAxisDlg::getResult( InsertAxisOrGridDialogData& rOutput )
102 : {
103 0 : rOutput.aExistenceList[0]=m_pCbPrimaryX->IsChecked();
104 0 : rOutput.aExistenceList[1]=m_pCbPrimaryY->IsChecked();
105 0 : rOutput.aExistenceList[2]=m_pCbPrimaryZ->IsChecked();
106 0 : rOutput.aExistenceList[3]=m_pCbSecondaryX->IsChecked();
107 0 : rOutput.aExistenceList[4]=m_pCbSecondaryY->IsChecked();
108 0 : rOutput.aExistenceList[5]=m_pCbSecondaryZ->IsChecked();
109 0 : }
110 :
111 0 : SchGridDlg::SchGridDlg( vcl::Window* pParent, const InsertAxisOrGridDialogData& rInput )
112 0 : : SchAxisDlg( pParent, rInput, false )//rInAttrs, b3D, bNet, bSecondaryX, bSecondaryY, false )
113 : {
114 0 : }
115 :
116 57 : } //namespace chart
117 :
118 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|