xref: /trunk/main/sc/source/ui/miscdlgs/namecrea.cxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
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 "namecrea.hxx"
38 #include "scresid.hxx"
39 #include "miscdlgs.hrc"
40 
41 
42 //==================================================================
43 
44 ScNameCreateDlg::ScNameCreateDlg( Window * pParent, sal_uInt16 nFlags )
45     : ModalDialog( pParent, ScResId(RID_SCDLG_NAMES_CREATE) ),
46     aFixedLine      ( this, ScResId( FL_FRAME ) ),
47     aTopBox         ( this, ScResId( BTN_TOP ) ),
48     aLeftBox        ( this, ScResId( BTN_LEFT ) ),
49     aBottomBox      ( this, ScResId( BTN_BOTTOM ) ),
50     aRightBox       ( this, ScResId( BTN_RIGHT ) ),
51     aOKButton       ( this, ScResId( BTN_OK ) ),
52     aCancelButton   ( this, ScResId( BTN_CANCEL ) ),
53     aHelpButton     ( this, ScResId( BTN_HELP ) )
54 {
55     aTopBox.Check   ( (nFlags & NAME_TOP)   ? sal_True : sal_False );
56     aLeftBox.Check  ( (nFlags & NAME_LEFT)  ? sal_True : sal_False );
57     aBottomBox.Check( (nFlags & NAME_BOTTOM)? sal_True : sal_False );
58     aRightBox.Check ( (nFlags & NAME_RIGHT) ? sal_True : sal_False );
59 
60     FreeResource();
61 }
62 
63 //------------------------------------------------------------------
64 
65 sal_uInt16 ScNameCreateDlg::GetFlags() const
66 {
67     sal_uInt16  nResult = 0;
68 
69     nResult |= aTopBox.IsChecked()      ? NAME_TOP:     0 ;
70     nResult |= aLeftBox.IsChecked()     ? NAME_LEFT:    0 ;
71     nResult |= aBottomBox.IsChecked()   ? NAME_BOTTOM:  0 ;
72     nResult |= aRightBox.IsChecked()    ? NAME_RIGHT:   0 ;
73 
74     return nResult;
75 }
76 
77 
78 
79 
80