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