Update ooo320-m1
[ooovba.git] / chart2 / source / controller / dialogs / dlg_InsertAxis_Grid.cxx
blob2d8c34069bd6c5800a1c188d10d755146ac7140f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlg_InsertAxis_Grid.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
33 #include "dlg_InsertAxis_Grid.hxx"
34 #include "dlg_InsertAxis_Grid.hrc"
36 #include "ResId.hxx"
37 #include "chartview/ChartSfxItemIds.hxx"
38 #include "SchSlotIds.hxx"
39 #include "HelpIds.hrc"
40 #include "NoWarningThisInCTOR.hxx"
41 #include "ObjectNameProvider.hxx"
43 // header for class SfxBoolItem
44 #include <svtools/eitem.hxx>
46 //.............................................................................
47 namespace chart
49 //.............................................................................
51 InsertAxisOrGridDialogData::InsertAxisOrGridDialogData()
52 : aPossibilityList(6)
53 , aExistenceList(6)
55 sal_Int32 nN = 0;
56 for(nN=6;nN--;)
57 aPossibilityList[nN]=true;
58 for(nN=6;nN--;)
59 aExistenceList[nN]=false;
62 //==============================
64 // SchAxisDlg
66 //==============================
68 SchAxisDlg::SchAxisDlg( Window* pWindow
69 , const InsertAxisOrGridDialogData& rInput, BOOL bAxisDlg )
71 ModalDialog( pWindow, SchResId( DLG_AXIS_OR_GRID )),
73 aFlPrimary( this, SchResId( FL_PRIMARY_AXIS )),
74 aFlPrimaryGrid( this, SchResId( FL_PRIMARY_GRID )),
75 aCbPrimaryX( this, SchResId( CB_X_PRIMARY )),
76 aCbPrimaryY( this, SchResId( CB_Y_PRIMARY )),
77 aCbPrimaryZ( this, SchResId( CB_Z_PRIMARY )),
79 aFlSecondary( this, SchResId( FL_SECONDARY_AXIS )),
80 aFlSecondaryGrid( this, SchResId( FL_SECONDARY_GRID )),
81 aCbSecondaryX( this, SchResId( CB_X_SECONDARY )),
82 aCbSecondaryY( this, SchResId( CB_Y_SECONDARY )),
83 aCbSecondaryZ( this, SchResId( CB_Z_SECONDARY )),
85 aPbOK( this, SchResId( BTN_OK )),
86 aPbCancel( this, SchResId( BTN_CANCEL )),
87 aPbHelp( this, SchResId( BTN_HELP ))
89 //rOutAttrs( rInAttrs )
91 FreeResource();
92 if(!bAxisDlg)
94 SetHelpId( SID_INSERT_GRIDS );
95 SetText( ObjectNameProvider::getName(OBJECTTYPE_GRID,true) );
97 aCbPrimaryX.SetHelpId( HID_SCH_CB_XGRID );
98 aCbPrimaryY.SetHelpId( HID_SCH_CB_YGRID );
99 aCbPrimaryZ.SetHelpId( HID_SCH_CB_ZGRID );
100 aCbSecondaryX.SetHelpId( HID_SCH_CB_SECONDARY_XGRID );
101 aCbSecondaryY.SetHelpId( HID_SCH_CB_SECONDARY_YGRID );
102 aCbSecondaryZ.SetHelpId( HID_SCH_CB_SECONDARY_ZGRID );
104 aFlPrimary.Hide();
105 aFlSecondary.Hide();
106 aFlPrimaryGrid.Show();
107 aFlSecondaryGrid.Show();
109 else
111 SetText( ObjectNameProvider::getName(OBJECTTYPE_AXIS,true) );
113 //todo: remove if secondary z axis are possible somewhere
115 aCbSecondaryZ.Hide();
117 Size aSize( GetSizePixel() );
118 //aSize.Height() -= aCbSecondaryZ.GetSizePixel().Height();
119 aSize.Height() -= ( aCbSecondaryZ.GetPosPixel().Y() - aCbSecondaryY.GetPosPixel().Y() );
120 SetSizePixel(aSize);
124 aCbPrimaryX.Check( rInput.aExistenceList[0] );
125 aCbPrimaryY.Check( rInput.aExistenceList[1] );
126 aCbPrimaryZ.Check( rInput.aExistenceList[2] );
127 aCbSecondaryX.Check( rInput.aExistenceList[3] );
128 aCbSecondaryY.Check( rInput.aExistenceList[4] );
129 aCbSecondaryZ.Check( rInput.aExistenceList[5] );
131 aCbPrimaryX.Enable( rInput.aPossibilityList[0] );
132 aCbPrimaryY.Enable( rInput.aPossibilityList[1] );
133 aCbPrimaryZ.Enable( rInput.aPossibilityList[2] );
134 aCbSecondaryX.Enable( rInput.aPossibilityList[3] );
135 aCbSecondaryY.Enable( rInput.aPossibilityList[4] );
136 aCbSecondaryZ.Enable( rInput.aPossibilityList[5] );
139 SchAxisDlg::~SchAxisDlg()
143 void SchAxisDlg::getResult( InsertAxisOrGridDialogData& rOutput )
145 rOutput.aExistenceList[0]=aCbPrimaryX.IsChecked();
146 rOutput.aExistenceList[1]=aCbPrimaryY.IsChecked();
147 rOutput.aExistenceList[2]=aCbPrimaryZ.IsChecked();
148 rOutput.aExistenceList[3]=aCbSecondaryX.IsChecked();
149 rOutput.aExistenceList[4]=aCbSecondaryY.IsChecked();
150 rOutput.aExistenceList[5]=aCbSecondaryZ.IsChecked();
153 SchGridDlg::SchGridDlg( Window* pParent, const InsertAxisOrGridDialogData& rInput )
154 : SchAxisDlg( pParent, rInput, false )//rInAttrs, b3D, bNet, bSecondaryX, bSecondaryY, false )
158 SchGridDlg::~SchGridDlg()
162 //.............................................................................
163 } //namespace chart
164 //.............................................................................