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_scui.hxx"
26
27
28
29
30 //------------------------------------------------------------------
31
32 #include "crdlg.hxx"
33 #include "scresid.hxx"
34 #include "miscdlgs.hrc"
35
36
37 //==================================================================
38
ScColOrRowDlg(Window * pParent,const String & rStrTitle,const String & rStrLabel,sal_Bool bColDefault)39 ScColOrRowDlg::ScColOrRowDlg( Window* pParent,
40 const String& rStrTitle,
41 const String& rStrLabel,
42 sal_Bool bColDefault )
43
44 : ModalDialog ( pParent, ScResId( RID_SCDLG_COLORROW ) ),
45 //
46 aFlFrame ( this, ScResId( FL_FRAME ) ),
47 aBtnRows ( this, ScResId( BTN_GROUP_ROWS ) ),
48 aBtnCols ( this, ScResId( BTN_GROUP_COLS ) ),
49 aBtnOk ( this, ScResId( BTN_OK ) ),
50 aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
51 aBtnHelp ( this, ScResId( BTN_HELP ) )
52 {
53 SetText( rStrTitle );
54 aFlFrame.SetText( rStrLabel );
55
56 if ( bColDefault )
57 aBtnCols.Check();
58 else
59 aBtnRows.Check();
60
61 aBtnOk.SetClickHdl( LINK( this, ScColOrRowDlg, OkHdl ) );
62
63 FreeResource();
64 }
65
66 //------------------------------------------------------------------------
67
~ScColOrRowDlg()68 __EXPORT ScColOrRowDlg::~ScColOrRowDlg()
69 {
70 }
71
72 //------------------------------------------------------------------------
73
IMPL_LINK_INLINE_START(ScColOrRowDlg,OkHdl,OKButton *,EMPTYARG)74 IMPL_LINK_INLINE_START( ScColOrRowDlg, OkHdl, OKButton *, EMPTYARG )
75 {
76 EndDialog( aBtnCols.IsChecked() ? SCRET_COLS : SCRET_ROWS );
77 return 0;
78 }
79 IMPL_LINK_INLINE_END( ScColOrRowDlg, OkHdl, OKButton *, EMPTYARG )
80
81
82
83