xref: /trunk/main/sc/source/ui/miscdlgs/lbseldlg.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 "lbseldlg.hxx"
35 #include "scresid.hxx"
36 #include "miscdlgs.hrc"
37 
38 
39 //==================================================================
40 
ScSelEntryDlg(Window * pParent,sal_uInt16 nResId,const String & aTitle,const String & aLbTitle,List & aEntryList)41 ScSelEntryDlg::ScSelEntryDlg(      Window*  pParent,
42 								   sal_uInt16	nResId,
43 							 const String&  aTitle,
44 							 const String&  aLbTitle,
45 								   List&    aEntryList ) :
46 	ModalDialog     ( pParent, ScResId( nResId ) ),
47 	//
48     aFlLbTitle      ( this, ScResId( FL_ENTRYLIST ) ),
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 	SetText( aTitle );
55     aFlLbTitle.SetText( aLbTitle );
56 	aLb.Clear();
57 	aLb.SetDoubleClickHdl( LINK( this, ScSelEntryDlg, DblClkHdl ) );
58 
59 	void*   pListEntry = aEntryList.First();
60 	while ( pListEntry )
61 	{
62 		aLb.InsertEntry( *((String*)pListEntry ) );
63 		pListEntry = aEntryList.Next();
64 	}
65 
66 	if ( aLb.GetEntryCount() > 0 )
67 		aLb.SelectEntryPos( 0 );
68 
69 	//-------------
70 	FreeResource();
71 }
72 
73 //------------------------------------------------------------------------
74 
GetSelectEntry() const75 String ScSelEntryDlg::GetSelectEntry() const
76 {
77 	return aLb.GetSelectEntry();
78 }
79 
80 //------------------------------------------------------------------------
81 
82 //UNUSED2008-05  sal_uInt16 ScSelEntryDlg::GetSelectEntryPos() const
83 //UNUSED2008-05  {
84 //UNUSED2008-05      return aLb.GetSelectEntryPos();
85 //UNUSED2008-05  }
86 
87 //------------------------------------------------------------------------
88 
IMPL_LINK_INLINE_START(ScSelEntryDlg,DblClkHdl,void *,EMPTYARG)89 IMPL_LINK_INLINE_START( ScSelEntryDlg, DblClkHdl, void *, EMPTYARG )
90 {
91 	EndDialog( RET_OK );
92 	return 0;
93 }
IMPL_LINK_INLINE_END(ScSelEntryDlg,DblClkHdl,void *,EMPTYARG)94 IMPL_LINK_INLINE_END( ScSelEntryDlg, DblClkHdl, void *, EMPTYARG )
95 
96 //------------------------------------------------------------------------
97 
98 __EXPORT ScSelEntryDlg::~ScSelEntryDlg()
99 {
100 }
101 
102 
103 
104