xref: /aoo41x/main/sc/source/ui/miscdlgs/crdlg.cxx (revision b3f79822)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sc.hxx"
26 
27 #undef SC_DLLIMPLEMENTATION
28 
29 
30 
31 //------------------------------------------------------------------
32 
33 #include "crdlg.hxx"
34 #include "scresid.hxx"
35 #include "miscdlgs.hrc"
36 
37 
38 //==================================================================
39 
ScColOrRowDlg(Window * pParent,const String & rStrTitle,const String & rStrLabel,sal_Bool bColDefault)40 ScColOrRowDlg::ScColOrRowDlg( Window*		pParent,
41 							  const String&	rStrTitle,
42 							  const String&	rStrLabel,
43 							  sal_Bool			bColDefault )
44 
45 	:	ModalDialog     ( pParent, ScResId( RID_SCDLG_COLORROW ) ),
46 		//
47         aFlFrame        ( this, ScResId( FL_FRAME ) ),
48 		aBtnRows        ( this, ScResId( BTN_GROUP_ROWS ) ),
49 		aBtnCols        ( this, ScResId( BTN_GROUP_COLS ) ),
50 		aBtnOk          ( this, ScResId( BTN_OK ) ),
51 		aBtnCancel      ( this, ScResId( BTN_CANCEL ) ),
52 		aBtnHelp        ( this, ScResId( BTN_HELP ) )
53 {
54 	SetText( rStrTitle );
55     aFlFrame.SetText( rStrLabel );
56 
57 	if ( bColDefault )
58 		aBtnCols.Check();
59 	else
60 		aBtnRows.Check();
61 
62 	aBtnOk.SetClickHdl( LINK( this, ScColOrRowDlg, OkHdl ) );
63 
64 	FreeResource();
65 }
66 
67 //------------------------------------------------------------------------
68 
~ScColOrRowDlg()69 __EXPORT ScColOrRowDlg::~ScColOrRowDlg()
70 {
71 }
72 
73 //------------------------------------------------------------------------
74 
IMPL_LINK_INLINE_START(ScColOrRowDlg,OkHdl,OKButton *,EMPTYARG)75 IMPL_LINK_INLINE_START( ScColOrRowDlg, OkHdl, OKButton *, EMPTYARG )
76 {
77 	EndDialog( aBtnCols.IsChecked() ? SCRET_COLS : SCRET_ROWS );
78 	return 0;
79 }
80 IMPL_LINK_INLINE_END( ScColOrRowDlg, OkHdl, OKButton *, EMPTYARG )
81 
82 
83 
84