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 <vcl/msgbox.hxx>
34
35 #include "shtabdlg.hxx"
36 #include "scresid.hxx"
37 #include "miscdlgs.hrc"
38
39
40 //==================================================================
41
ScShowTabDlg(Window * pParent)42 ScShowTabDlg::ScShowTabDlg( Window* pParent ) :
43 ModalDialog ( pParent, ScResId( RID_SCDLG_SHOW_TAB ) ),
44 aFtLbTitle ( this, ScResId( FT_LABEL ) ),
45 aLb ( this, ScResId( LB_ENTRYLIST ) ),
46 aBtnOk ( this, ScResId( BTN_OK ) ),
47 aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
48 aBtnHelp ( this, ScResId( BTN_HELP ) )
49 {
50 aLb.Clear();
51 aLb.SetDoubleClickHdl( LINK( this, ScShowTabDlg, DblClkHdl ) );
52
53 //-------------
54 FreeResource();
55 }
56
57 //------------------------------------------------------------------------
58
SetDescription(const String & rTitle,const String & rFixedText,const rtl::OString & rDlgHelpId,const rtl::OString & sLbHelpId)59 void ScShowTabDlg::SetDescription(
60 const String& rTitle, const String& rFixedText,
61 const rtl::OString& rDlgHelpId, const rtl::OString& sLbHelpId )
62 {
63 SetText( rTitle );
64 aFtLbTitle.SetText( rFixedText );
65 SetHelpId( rDlgHelpId );
66 aLb.SetHelpId( sLbHelpId );
67 }
68
Insert(const String & rString,sal_Bool bSelected)69 void ScShowTabDlg::Insert( const String& rString, sal_Bool bSelected )
70 {
71 aLb.InsertEntry( rString );
72 if( bSelected )
73 aLb.SelectEntryPos( aLb.GetEntryCount() - 1 );
74 }
75
76 //------------------------------------------------------------------------
77
GetSelectEntryCount() const78 sal_uInt16 ScShowTabDlg::GetSelectEntryCount() const
79 {
80 return aLb.GetSelectEntryCount();
81 }
82
GetSelectEntry(sal_uInt16 nPos) const83 String ScShowTabDlg::GetSelectEntry(sal_uInt16 nPos) const
84 {
85 return aLb.GetSelectEntry(nPos);
86 }
87
GetSelectEntryPos(sal_uInt16 nPos) const88 sal_uInt16 ScShowTabDlg::GetSelectEntryPos(sal_uInt16 nPos) const
89 {
90 return aLb.GetSelectEntryPos(nPos);
91 }
92
93 //------------------------------------------------------------------------
94
IMPL_LINK_INLINE_START(ScShowTabDlg,DblClkHdl,void *,EMPTYARG)95 IMPL_LINK_INLINE_START( ScShowTabDlg, DblClkHdl, void *, EMPTYARG )
96 {
97 EndDialog( RET_OK );
98 return 0;
99 }
IMPL_LINK_INLINE_END(ScShowTabDlg,DblClkHdl,void *,EMPTYARG)100 IMPL_LINK_INLINE_END( ScShowTabDlg, DblClkHdl, void *, EMPTYARG )
101
102 __EXPORT ScShowTabDlg::~ScShowTabDlg()
103 {
104 }
105
106
107
108