xref: /trunk/main/sw/source/ui/index/multmrk.cxx (revision efeef26f)
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_sw.hxx"
26 
27 #ifdef SW_DLLIMPLEMENTATION
28 #undef SW_DLLIMPLEMENTATION
29 #endif
30 
31 
32 
33 #include "swtypes.hxx"
34 
35 #include "multmrk.hxx"
36 #include "toxmgr.hxx"
37 
38 #include "index.hrc"
39 #include "multmrk.hrc"
40 
41 
SwMultiTOXMarkDlg(Window * pParent,SwTOXMgr & rTOXMgr)42 SwMultiTOXMarkDlg::SwMultiTOXMarkDlg( Window* pParent, SwTOXMgr& rTOXMgr ) :
43 
44 	SvxStandardDialog(pParent, SW_RES(DLG_MULTMRK)),
45 
46     aTOXFL(this,    SW_RES(FL_TOX)),
47 	aEntryFT(this, 	SW_RES(FT_ENTRY)),
48 	aTextFT(this, 	SW_RES(FT_TEXT)),
49 	aTOXFT(this, 	SW_RES(FT_TOX)),
50     aTOXLB(this,    SW_RES(LB_TOX)),
51     aOkBT(this,     SW_RES(OK_BT)),
52 	aCancelBT(this, SW_RES(CANCEL_BT)),
53 	rMgr( rTOXMgr ),
54 	nPos(0)
55 {
56 	aTOXLB.SetSelectHdl(LINK(this, SwMultiTOXMarkDlg, SelectHdl));
57 
58 	sal_uInt16 nSize = rMgr.GetTOXMarkCount();
59 	for(sal_uInt16 i=0; i < nSize; ++i)
60 		aTOXLB.InsertEntry(rMgr.GetTOXMark(i)->GetText());
61 
62 	aTOXLB.SelectEntryPos(0);
63 	aTextFT.SetText(rMgr.GetTOXMark(0)->GetTOXType()->GetTypeName());
64 
65 	FreeResource();
66 }
67 
68 
IMPL_LINK_INLINE_START(SwMultiTOXMarkDlg,SelectHdl,ListBox *,pBox)69 IMPL_LINK_INLINE_START( SwMultiTOXMarkDlg, SelectHdl, ListBox *, pBox )
70 {
71 	if(pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
72 	{	SwTOXMark* pMark = rMgr.GetTOXMark(pBox->GetSelectEntryPos());
73 		aTextFT.SetText(pMark->GetTOXType()->GetTypeName());
74 		nPos = pBox->GetSelectEntryPos();
75 	}
76 	return 0;
77 }
IMPL_LINK_INLINE_END(SwMultiTOXMarkDlg,SelectHdl,ListBox *,pBox)78 IMPL_LINK_INLINE_END( SwMultiTOXMarkDlg, SelectHdl, ListBox *, pBox )
79 
80 
81 void SwMultiTOXMarkDlg::Apply()
82 {
83 	rMgr.SetCurTOXMark(nPos);
84 }
85 
86 /*-----------------25.02.94 22:06-------------------
87  dtor ueberladen
88 --------------------------------------------------*/
89 
90 
~SwMultiTOXMarkDlg()91 SwMultiTOXMarkDlg::~SwMultiTOXMarkDlg() {}
92 
93 
94 
95