1*cde9e8dcSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*cde9e8dcSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*cde9e8dcSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*cde9e8dcSAndrew Rist * distributed with this work for additional information
6*cde9e8dcSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*cde9e8dcSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*cde9e8dcSAndrew Rist * "License"); you may not use this file except in compliance
9*cde9e8dcSAndrew Rist * with the License. You may obtain a copy of the License at
10*cde9e8dcSAndrew Rist *
11*cde9e8dcSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*cde9e8dcSAndrew Rist *
13*cde9e8dcSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*cde9e8dcSAndrew Rist * software distributed under the License is distributed on an
15*cde9e8dcSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*cde9e8dcSAndrew Rist * KIND, either express or implied. See the License for the
17*cde9e8dcSAndrew Rist * specific language governing permissions and limitations
18*cde9e8dcSAndrew Rist * under the License.
19*cde9e8dcSAndrew Rist *
20*cde9e8dcSAndrew Rist *************************************************************/
21*cde9e8dcSAndrew Rist
22*cde9e8dcSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_chart2.hxx"
26cdf0e10cSrcweir #include "dlg_InsertAxis_Grid.hxx"
27cdf0e10cSrcweir #include "dlg_InsertAxis_Grid.hrc"
28cdf0e10cSrcweir
29cdf0e10cSrcweir #include "ResId.hxx"
30cdf0e10cSrcweir #include "chartview/ChartSfxItemIds.hxx"
31cdf0e10cSrcweir #include "SchSlotIds.hxx"
32cdf0e10cSrcweir #include "HelpIds.hrc"
33cdf0e10cSrcweir #include "NoWarningThisInCTOR.hxx"
34cdf0e10cSrcweir #include "ObjectNameProvider.hxx"
35cdf0e10cSrcweir
36cdf0e10cSrcweir // header for class SfxBoolItem
37cdf0e10cSrcweir #include <svl/eitem.hxx>
38cdf0e10cSrcweir
39cdf0e10cSrcweir //.............................................................................
40cdf0e10cSrcweir namespace chart
41cdf0e10cSrcweir {
42cdf0e10cSrcweir //.............................................................................
43cdf0e10cSrcweir
InsertAxisOrGridDialogData()44cdf0e10cSrcweir InsertAxisOrGridDialogData::InsertAxisOrGridDialogData()
45cdf0e10cSrcweir : aPossibilityList(6)
46cdf0e10cSrcweir , aExistenceList(6)
47cdf0e10cSrcweir {
48cdf0e10cSrcweir sal_Int32 nN = 0;
49cdf0e10cSrcweir for(nN=6;nN--;)
50cdf0e10cSrcweir aPossibilityList[nN]=true;
51cdf0e10cSrcweir for(nN=6;nN--;)
52cdf0e10cSrcweir aExistenceList[nN]=false;
53cdf0e10cSrcweir }
54cdf0e10cSrcweir
55cdf0e10cSrcweir //==============================
56cdf0e10cSrcweir //
57cdf0e10cSrcweir // SchAxisDlg
58cdf0e10cSrcweir //
59cdf0e10cSrcweir //==============================
60cdf0e10cSrcweir
SchAxisDlg(Window * pWindow,const InsertAxisOrGridDialogData & rInput,sal_Bool bAxisDlg)61cdf0e10cSrcweir SchAxisDlg::SchAxisDlg( Window* pWindow
62cdf0e10cSrcweir , const InsertAxisOrGridDialogData& rInput, sal_Bool bAxisDlg )
63cdf0e10cSrcweir :
64cdf0e10cSrcweir ModalDialog( pWindow, SchResId( DLG_AXIS_OR_GRID )),
65cdf0e10cSrcweir
66cdf0e10cSrcweir aFlPrimary( this, SchResId( FL_PRIMARY_AXIS )),
67cdf0e10cSrcweir aFlPrimaryGrid( this, SchResId( FL_PRIMARY_GRID )),
68cdf0e10cSrcweir aCbPrimaryX( this, SchResId( CB_X_PRIMARY )),
69cdf0e10cSrcweir aCbPrimaryY( this, SchResId( CB_Y_PRIMARY )),
70cdf0e10cSrcweir aCbPrimaryZ( this, SchResId( CB_Z_PRIMARY )),
71cdf0e10cSrcweir
72cdf0e10cSrcweir aFlSecondary( this, SchResId( FL_SECONDARY_AXIS )),
73cdf0e10cSrcweir aFlSecondaryGrid( this, SchResId( FL_SECONDARY_GRID )),
74cdf0e10cSrcweir aCbSecondaryX( this, SchResId( CB_X_SECONDARY )),
75cdf0e10cSrcweir aCbSecondaryY( this, SchResId( CB_Y_SECONDARY )),
76cdf0e10cSrcweir aCbSecondaryZ( this, SchResId( CB_Z_SECONDARY )),
77cdf0e10cSrcweir
78cdf0e10cSrcweir aPbOK( this, SchResId( BTN_OK )),
79cdf0e10cSrcweir aPbCancel( this, SchResId( BTN_CANCEL )),
80cdf0e10cSrcweir aPbHelp( this, SchResId( BTN_HELP ))
81cdf0e10cSrcweir
82cdf0e10cSrcweir //rOutAttrs( rInAttrs )
83cdf0e10cSrcweir {
84cdf0e10cSrcweir FreeResource();
85cdf0e10cSrcweir if(!bAxisDlg)
86cdf0e10cSrcweir {
87cdf0e10cSrcweir SetHelpId( HID_INSERT_GRIDS );
88cdf0e10cSrcweir SetText( ObjectNameProvider::getName(OBJECTTYPE_GRID,true) );
89cdf0e10cSrcweir
90cdf0e10cSrcweir aCbPrimaryX.SetHelpId( HID_SCH_CB_XGRID );
91cdf0e10cSrcweir aCbPrimaryY.SetHelpId( HID_SCH_CB_YGRID );
92cdf0e10cSrcweir aCbPrimaryZ.SetHelpId( HID_SCH_CB_ZGRID );
93cdf0e10cSrcweir aCbSecondaryX.SetHelpId( HID_SCH_CB_SECONDARY_XGRID );
94cdf0e10cSrcweir aCbSecondaryY.SetHelpId( HID_SCH_CB_SECONDARY_YGRID );
95cdf0e10cSrcweir aCbSecondaryZ.SetHelpId( HID_SCH_CB_SECONDARY_ZGRID );
96cdf0e10cSrcweir
97cdf0e10cSrcweir aFlPrimary.Hide();
98cdf0e10cSrcweir aFlSecondary.Hide();
99cdf0e10cSrcweir aFlPrimaryGrid.Show();
100cdf0e10cSrcweir aFlSecondaryGrid.Show();
101cdf0e10cSrcweir }
102cdf0e10cSrcweir else
103cdf0e10cSrcweir {
104cdf0e10cSrcweir SetText( ObjectNameProvider::getName(OBJECTTYPE_AXIS,true) );
105cdf0e10cSrcweir
106cdf0e10cSrcweir //todo: remove if secondary z axis are possible somewhere
107cdf0e10cSrcweir {
108cdf0e10cSrcweir aCbSecondaryZ.Hide();
109cdf0e10cSrcweir
110cdf0e10cSrcweir Size aSize( GetSizePixel() );
111cdf0e10cSrcweir //aSize.Height() -= aCbSecondaryZ.GetSizePixel().Height();
112cdf0e10cSrcweir aSize.Height() -= ( aCbSecondaryZ.GetPosPixel().Y() - aCbSecondaryY.GetPosPixel().Y() );
113cdf0e10cSrcweir SetSizePixel(aSize);
114cdf0e10cSrcweir }
115cdf0e10cSrcweir }
116cdf0e10cSrcweir
117cdf0e10cSrcweir aCbPrimaryX.Check( rInput.aExistenceList[0] );
118cdf0e10cSrcweir aCbPrimaryY.Check( rInput.aExistenceList[1] );
119cdf0e10cSrcweir aCbPrimaryZ.Check( rInput.aExistenceList[2] );
120cdf0e10cSrcweir aCbSecondaryX.Check( rInput.aExistenceList[3] );
121cdf0e10cSrcweir aCbSecondaryY.Check( rInput.aExistenceList[4] );
122cdf0e10cSrcweir aCbSecondaryZ.Check( rInput.aExistenceList[5] );
123cdf0e10cSrcweir
124cdf0e10cSrcweir aCbPrimaryX.Enable( rInput.aPossibilityList[0] );
125cdf0e10cSrcweir aCbPrimaryY.Enable( rInput.aPossibilityList[1] );
126cdf0e10cSrcweir aCbPrimaryZ.Enable( rInput.aPossibilityList[2] );
127cdf0e10cSrcweir aCbSecondaryX.Enable( rInput.aPossibilityList[3] );
128cdf0e10cSrcweir aCbSecondaryY.Enable( rInput.aPossibilityList[4] );
129cdf0e10cSrcweir aCbSecondaryZ.Enable( rInput.aPossibilityList[5] );
130cdf0e10cSrcweir }
131cdf0e10cSrcweir
~SchAxisDlg()132cdf0e10cSrcweir SchAxisDlg::~SchAxisDlg()
133cdf0e10cSrcweir {
134cdf0e10cSrcweir }
135cdf0e10cSrcweir
getResult(InsertAxisOrGridDialogData & rOutput)136cdf0e10cSrcweir void SchAxisDlg::getResult( InsertAxisOrGridDialogData& rOutput )
137cdf0e10cSrcweir {
138cdf0e10cSrcweir rOutput.aExistenceList[0]=aCbPrimaryX.IsChecked();
139cdf0e10cSrcweir rOutput.aExistenceList[1]=aCbPrimaryY.IsChecked();
140cdf0e10cSrcweir rOutput.aExistenceList[2]=aCbPrimaryZ.IsChecked();
141cdf0e10cSrcweir rOutput.aExistenceList[3]=aCbSecondaryX.IsChecked();
142cdf0e10cSrcweir rOutput.aExistenceList[4]=aCbSecondaryY.IsChecked();
143cdf0e10cSrcweir rOutput.aExistenceList[5]=aCbSecondaryZ.IsChecked();
144cdf0e10cSrcweir }
145cdf0e10cSrcweir
SchGridDlg(Window * pParent,const InsertAxisOrGridDialogData & rInput)146cdf0e10cSrcweir SchGridDlg::SchGridDlg( Window* pParent, const InsertAxisOrGridDialogData& rInput )
147cdf0e10cSrcweir : SchAxisDlg( pParent, rInput, false )//rInAttrs, b3D, bNet, bSecondaryX, bSecondaryY, false )
148cdf0e10cSrcweir {
149cdf0e10cSrcweir }
150cdf0e10cSrcweir
~SchGridDlg()151cdf0e10cSrcweir SchGridDlg::~SchGridDlg()
152cdf0e10cSrcweir {
153cdf0e10cSrcweir }
154cdf0e10cSrcweir
155cdf0e10cSrcweir //.............................................................................
156cdf0e10cSrcweir } //namespace chart
157cdf0e10cSrcweir //.............................................................................
158cdf0e10cSrcweir
159cdf0e10cSrcweir
160cdf0e10cSrcweir
161