xref: /aoo41x/main/sc/source/ui/miscdlgs/delcldlg.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sc.hxx"
30 
31 #undef SC_DLLIMPLEMENTATION
32 
33 
34 
35 //------------------------------------------------------------------
36 
37 #include "delcldlg.hxx"
38 #include "scresid.hxx"
39 #include "miscdlgs.hrc"
40 
41 
42 static sal_uInt8 nDelItemChecked=0;
43 
44 //==================================================================
45 
46 ScDeleteCellDlg::ScDeleteCellDlg( Window* pParent, sal_Bool bDisallowCellMove ) :
47 	ModalDialog     ( pParent, ScResId( RID_SCDLG_DELCELL ) ),
48 	//
49     aFlFrame        ( this, ScResId( FL_FRAME ) ),
50 	aBtnCellsUp     ( this, ScResId( BTN_CELLSUP ) ),
51 	aBtnCellsLeft   ( this, ScResId( BTN_CELLSLEFT ) ),
52 	aBtnDelRows     ( this, ScResId( BTN_DELROWS ) ),
53 	aBtnDelCols     ( this, ScResId( BTN_DELCOLS ) ),
54 	aBtnOk          ( this, ScResId( BTN_OK ) ),
55 	aBtnCancel      ( this, ScResId( BTN_CANCEL ) ),
56 	aBtnHelp        ( this, ScResId( BTN_HELP ) )
57 {
58 
59 	if (bDisallowCellMove)
60 	{
61 		aBtnCellsUp.Disable();
62 		aBtnCellsLeft.Disable();
63 
64 		switch(nDelItemChecked)
65 		{
66 			case 2: aBtnDelRows.Check();break;
67 			case 3: aBtnDelCols.Check();break;
68 			default:aBtnDelRows.Check();break;
69 		}
70 	}
71 	else
72 	{
73 		switch(nDelItemChecked)
74 		{
75 			case 0: aBtnCellsUp.Check();break;
76 			case 1: aBtnCellsLeft.Check();break;
77 			case 2: aBtnDelRows.Check();break;
78 			case 3: aBtnDelCols.Check();break;
79 		}
80 	}
81 
82 	FreeResource();
83 }
84 
85 //------------------------------------------------------------------------
86 
87 DelCellCmd ScDeleteCellDlg::GetDelCellCmd() const
88 {
89 	DelCellCmd nReturn = DEL_NONE;
90 
91 	if ( aBtnCellsUp.IsChecked()   )
92 	{
93 		nDelItemChecked=0;
94 		nReturn = DEL_CELLSUP;
95 	}
96 	else if ( aBtnCellsLeft.IsChecked() )
97 	{
98 		nDelItemChecked=1;
99 		nReturn = DEL_CELLSLEFT;
100 	}
101 	else if ( aBtnDelRows.IsChecked()   )
102 	{
103 		nDelItemChecked=2;
104 		nReturn = DEL_DELROWS;
105 	}
106 	else if ( aBtnDelCols.IsChecked()   )
107 	{
108 		nDelItemChecked=3;
109 		nReturn = DEL_DELCOLS;
110 	}
111 
112 	return nReturn;
113 }
114 
115 __EXPORT ScDeleteCellDlg::~ScDeleteCellDlg()
116 {
117 }
118 
119 
120 
121