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