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