1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fldfunc.cxx,v $
10 * $Revision: 1.22.214.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
33 #ifdef SW_DLLIMPLEMENTATION
34 #undef SW_DLLIMPLEMENTATION
38 #include <sfx2/app.hxx>
39 #include <basic/basmgr.hxx>
40 #include <basic/sbmod.hxx>
42 #include <swtypes.hxx>
44 #include <globals.hrc>
47 #include <docufld.hxx>
52 #include <swmodule.hxx>
54 #include <fldfunc.hxx>
56 #include <flddropdown.hxx>
61 #include <fldtdlg.hrc>
64 #define USER_DATA_VERSION_1 "1"
65 #define USER_DATA_VERSION USER_DATA_VERSION_1
67 using namespace ::com::sun::star
;
71 /*--------------------------------------------------------------------
73 --------------------------------------------------------------------*/
75 SwFldFuncPage::SwFldFuncPage(Window
* pParent
, const SfxItemSet
& rCoreSet
) :
76 SwFldPage( pParent
, SW_RES( TP_FLD_FUNC
), rCoreSet
),
78 aTypeFT (this, SW_RES(FT_FUNCTYPE
)),
79 aTypeLB (this, SW_RES(LB_FUNCTYPE
)),
80 aSelectionFT(this, SW_RES(FT_FUNCSELECTION
)),
81 aSelectionLB(this, SW_RES(LB_FUNCSELECTION
)),
82 aFormatFT (this, SW_RES(FT_FUNCFORMAT
)),
83 aFormatLB (this, SW_RES(LB_FUNCFORMAT
)),
84 aNameFT (this, SW_RES(FT_FUNCNAME
)),
85 aNameED (this, SW_RES(ED_FUNCNAME
)),
86 aValueFT (this, SW_RES(FT_FUNCVALUE
)),
87 aValueED (this, SW_RES(ED_FUNCVALUE
)),
88 aCond1FT (this, SW_RES(FT_FUNCCOND1
)),
89 aCond1ED (this, SW_RES(ED_FUNCCOND1
)),
90 aCond2FT (this, SW_RES(FT_FUNCCOND2
)),
91 aCond2ED (this, SW_RES(ED_FUNCCOND2
)),
92 aMacroBT (this, SW_RES(BT_FUNCMACRO
)),
93 aListItemFT( this, SW_RES( FT_LISTITEM
)),
94 aListItemED( this, SW_RES( ED_LISTITEM
)),
95 aListAddPB( this, SW_RES( PB_LISTADD
)),
96 aListItemsFT( this, SW_RES( FT_LISTITEMS
)),
97 aListItemsLB( this, SW_RES( LB_LISTITEMS
)),
98 aListRemovePB( this, SW_RES( PB_LISTREMOVE
)),
99 aListUpPB( this, SW_RES( PB_LISTUP
)),
100 aListDownPB( this, SW_RES( PB_LISTDOWN
)),
101 aListNameFT( this, SW_RES( FT_LISTNAME
)),
102 aListNameED( this, SW_RES( ED_LISTNAME
)),
103 bDropDownLBChanged(false)
107 aNameED
.SetPosPixel(Point(aNameED
.GetPosPixel().X(), aFormatLB
.GetPosPixel().Y()));
109 aNameED
.SetModifyHdl(LINK(this, SwFldFuncPage
, ModifyHdl
));
111 sOldValueFT
= aValueFT
.GetText();
112 sOldNameFT
= aNameFT
.GetText();
114 aCond1ED
.ShowBrackets(FALSE
);
115 aCond2ED
.ShowBrackets(FALSE
);
117 // SwWrtShell* pSh = (SwWrtShell*)ViewShell::GetCurrShell();
120 /*--------------------------------------------------------------------
122 --------------------------------------------------------------------*/
124 SwFldFuncPage::~SwFldFuncPage()
128 /*--------------------------------------------------------------------
130 --------------------------------------------------------------------*/
132 void SwFldFuncPage::Reset(const SfxItemSet
& )
135 Init(); // Allgemeine initialisierung
137 aTypeLB
.SetUpdateMode(FALSE
);
140 USHORT nPos
, nTypeId
;
144 // TypeListBox initialisieren
145 const SwFldGroupRgn
& rRg
= GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
147 // Typ-Listbox fuellen
148 for(short i
= rRg
.nStart
; i
< rRg
.nEnd
; ++i
)
150 nTypeId
= GetFldMgr().GetTypeId(i
);
151 nPos
= aTypeLB
.InsertEntry(GetFldMgr().GetTypeStr(i
));
152 aTypeLB
.SetEntryData(nPos
, reinterpret_cast<void*>(nTypeId
));
157 nTypeId
= GetCurField()->GetTypeId();
158 nPos
= aTypeLB
.InsertEntry(GetFldMgr().GetTypeStr(GetFldMgr().GetPos(nTypeId
)));
159 aTypeLB
.SetEntryData(nPos
, reinterpret_cast<void*>(nTypeId
));
161 if (nTypeId
== TYP_MACROFLD
)
163 String
sName(GetCurField()->GetPar1());
164 GetFldMgr().SetMacroPath(sName
);
168 // alte Pos selektieren
169 RestorePos(&aTypeLB
);
171 aTypeLB
.SetDoubleClickHdl (LINK(this, SwFldFuncPage
, InsertHdl
));
172 aTypeLB
.SetSelectHdl (LINK(this, SwFldFuncPage
, TypeHdl
));
173 aSelectionLB
.SetSelectHdl (LINK(this, SwFldFuncPage
, SelectHdl
));
174 aSelectionLB
.SetDoubleClickHdl (LINK(this, SwFldFuncPage
, InsertMacroHdl
));
175 aFormatLB
.SetDoubleClickHdl (LINK(this, SwFldFuncPage
, InsertHdl
));
176 aMacroBT
.SetClickHdl (LINK(this, SwFldFuncPage
, MacroHdl
));
177 Link
aListModifyLk( LINK(this, SwFldFuncPage
, ListModifyHdl
));
178 aListAddPB
.SetClickHdl(aListModifyLk
);
179 aListRemovePB
.SetClickHdl(aListModifyLk
);
180 aListUpPB
.SetClickHdl(aListModifyLk
);
181 aListDownPB
.SetClickHdl(aListModifyLk
);
182 aListItemED
.SetReturnActionLink(aListModifyLk
);
183 Link aListEnableLk
= LINK(this, SwFldFuncPage
, ListEnableHdl
);
184 aListItemED
.SetModifyHdl(aListEnableLk
);
185 aListItemsLB
.SetSelectHdl(aListEnableLk
);
189 String sUserData
= GetUserData();
190 if(sUserData
.GetToken(0, ';').EqualsIgnoreCaseAscii(USER_DATA_VERSION_1
))
192 String sVal
= sUserData
.GetToken(1, ';');
193 USHORT nVal
= static_cast< USHORT
>(sVal
.ToInt32());
194 if(nVal
!= USHRT_MAX
)
196 for(USHORT i
= 0; i
< aTypeLB
.GetEntryCount(); i
++)
197 if(nVal
== (USHORT
)(ULONG
)aTypeLB
.GetEntryData(i
))
199 aTypeLB
.SelectEntryPos(i
);
207 aTypeLB
.SetUpdateMode(TRUE
);
212 aValueED
.SaveValue();
213 aCond1ED
.SaveValue();
214 aCond2ED
.SaveValue();
215 nOldFormat
= GetCurField()->GetFormat();
219 /*--------------------------------------------------------------------
221 --------------------------------------------------------------------*/
223 IMPL_LINK( SwFldFuncPage
, TypeHdl
, ListBox
*, EMPTYARG
)
225 // Alte ListBoxPos sichern
226 const USHORT nOld
= GetTypeSel();
228 // Aktuelle ListBoxPos
229 SetTypeSel(aTypeLB
.GetSelectEntryPos());
231 if(GetTypeSel() == LISTBOX_ENTRY_NOTFOUND
)
234 aTypeLB
.SelectEntryPos(0);
237 if (nOld
!= GetTypeSel())
239 USHORT nTypeId
= (USHORT
)(ULONG
)aTypeLB
.GetEntryData(GetTypeSel());
241 // Auswahl-Listbox fuellen
244 // Format-Listbox fuellen
247 USHORT nSize
= GetFldMgr().GetFormatCount(nTypeId
, FALSE
, IsFldDlgHtmlMode());
249 for (USHORT i
= 0; i
< nSize
; i
++)
251 USHORT nPos
= aFormatLB
.InsertEntry(GetFldMgr().GetFormatStr(nTypeId
, i
));
252 aFormatLB
.SetEntryData( nPos
, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId
, i
)) );
257 if (IsFldEdit() && nTypeId
== TYP_JUMPEDITFLD
)
258 aFormatLB
.SelectEntry(SW_RESSTR(FMT_MARK_BEGIN
+ (USHORT
)GetCurField()->GetFormat()));
260 if (!aFormatLB
.GetSelectEntryCount())
261 aFormatLB
.SelectEntryPos(0);
264 BOOL bValue
= FALSE
, bName
= FALSE
, bMacro
= FALSE
, bInsert
= TRUE
;
265 BOOL bShowSelection
= FALSE
;
266 BOOL bFormat
= nSize
!= 0;
268 // fuer Conditional Text zwei Controls
269 BOOL bDropDown
= TYP_DROPDOWN
== nTypeId
;
270 BOOL bCondTxtFld
= TYP_CONDTXTFLD
== nTypeId
;
272 aCond1FT
.Show(!bDropDown
&& bCondTxtFld
);
273 aCond1ED
.Show(!bDropDown
&& bCondTxtFld
);
274 aCond2FT
.Show(!bDropDown
&& bCondTxtFld
);
275 aCond2ED
.Show(!bDropDown
&& bCondTxtFld
);
276 aValueFT
.Show(!bDropDown
&& !bCondTxtFld
);
277 aValueED
.Show(!bDropDown
&& !bCondTxtFld
);
278 aMacroBT
.Show(!bDropDown
);
279 aNameED
.Show(!bDropDown
);
280 aNameFT
.Show(!bDropDown
);
282 aListItemFT
.Show(bDropDown
);
283 aListItemED
.Show(bDropDown
);
284 aListAddPB
.Show(bDropDown
);
285 aListItemsFT
.Show(bDropDown
);
286 aListItemsLB
.Show(bDropDown
);
287 aListRemovePB
.Show(bDropDown
);
288 aListUpPB
.Show(bDropDown
);
289 aListDownPB
.Show(bDropDown
);
290 aListNameFT
.Show(bDropDown
);
291 aListNameED
.Show(bDropDown
);
293 aNameED
.SetDropEnable(FALSE
);
299 const SwDropDownField
* pDrop
= (const SwDropDownField
*)GetCurField();
300 uno::Sequence
<OUString
> aItems
= pDrop
->GetItemSequence();
301 const OUString
* pArray
= aItems
.getConstArray();
302 aListItemsLB
.Clear();
303 for(sal_Int32 i
= 0; i
< aItems
.getLength(); i
++)
304 aListItemsLB
.InsertEntry(pArray
[i
]);
305 aListItemsLB
.SelectEntry(pDrop
->GetSelectedItem());
306 aListNameED
.SetText(pDrop
->GetPar2());
307 aListNameED
.SaveValue();
308 bDropDownLBChanged
= false;
312 aNameED
.SetText(GetCurField()->GetPar1());
313 aValueED
.SetText(GetCurField()->GetPar2());
318 aNameED
.SetText(aEmptyStr
);
319 aValueED
.SetText(aEmptyStr
);
324 if( aNameFT
.GetText() != sOldNameFT
)
325 aNameFT
.SetText(sOldNameFT
);
326 if (aValueFT
.GetText() != sOldValueFT
)
327 aValueFT
.SetText(sOldValueFT
);
333 if (GetFldMgr().GetMacroPath().Len())
338 aNameFT
.SetText(SW_RESSTR(STR_MACNAME
));
339 aValueFT
.SetText(SW_RESSTR(STR_PROMPT
));
340 aNameED
.SetText(GetFldMgr().GetMacroName());
343 case TYP_HIDDENPARAFLD
:
344 aNameFT
.SetText(SW_RESSTR(STR_COND
));
345 aNameED
.SetDropEnable(TRUE
);
349 case TYP_HIDDENTXTFLD
:
351 aNameFT
.SetText(SW_RESSTR(STR_COND
));
352 aNameED
.SetDropEnable(TRUE
);
353 aValueFT
.SetText(SW_RESSTR(STR_INSTEXT
));
354 SwWrtShell
* pSh
= GetActiveWrtShell();
355 if (!IsFldEdit() && pSh
)
356 aValueED
.SetText(pSh
->GetSelTxt());
357 bName
= bValue
= TRUE
;
362 aNameFT
.SetText(SW_RESSTR(STR_COND
));
363 aNameED
.SetDropEnable(TRUE
);
366 aCond1ED
.SetText(GetCurField()->GetPar2().GetToken(0, '|'));
367 aCond2ED
.SetText(GetCurField()->GetPar2().GetToken(1, '|'));
370 bName
= bValue
= TRUE
;
373 case TYP_JUMPEDITFLD
:
374 aNameFT
.SetText(SW_RESSTR(STR_JUMPEDITFLD
));
375 aValueFT
.SetText(SW_RESSTR(STR_PROMPT
));
376 bName
= bValue
= TRUE
;
380 aValueFT
.SetText(SW_RESSTR(STR_PROMPT
));
382 // bShowSelection = TRUE;
385 case TYP_COMBINED_CHARS
:
387 aNameFT
.SetText(SW_RESSTR(STR_COMBCHRS_FT
));
388 aNameED
.SetDropEnable(TRUE
);
391 const USHORT nLen
= aNameED
.GetText().Len();
392 if( !nLen
|| nLen
> MAX_COMBINED_CHARACTERS
)
417 aFormatLB
.Enable(bFormat
);
418 aFormatFT
.Enable(bFormat
);
419 aNameFT
.Enable(bName
);
420 aNameED
.Enable(bName
);
421 aValueFT
.Enable(bValue
);
422 aValueED
.Enable(bValue
);
423 aMacroBT
.Enable(bMacro
);
425 EnableInsert( bInsert
);
431 /*--------------------------------------------------------------------
433 --------------------------------------------------------------------*/
435 IMPL_LINK( SwFldFuncPage
, SelectHdl
, ListBox
*, EMPTYARG
)
437 USHORT nTypeId
= (USHORT
)(ULONG
)aTypeLB
.GetEntryData(GetTypeSel());
439 if( TYP_MACROFLD
== nTypeId
)
440 aNameED
.SetText( aSelectionLB
.GetSelectEntry() );
445 /*--------------------------------------------------------------------
447 --------------------------------------------------------------------*/
449 IMPL_LINK( SwFldFuncPage
, InsertMacroHdl
, ListBox
*, EMPTYARG
)
456 /* -----------------16.06.2003 16:24-----------------
458 --------------------------------------------------*/
459 IMPL_LINK( SwFldFuncPage
, ListModifyHdl
, Control
*, pControl
)
461 aListItemsLB
.SetUpdateMode(FALSE
);
462 if(pControl
== &aListAddPB
||
463 pControl
== &aListItemED
&& aListAddPB
.IsEnabled())
465 String
sEntry(aListItemED
.GetText());
466 aListItemsLB
.InsertEntry(sEntry
);
467 aListItemsLB
.SelectEntry(sEntry
);
469 else if(aListItemsLB
.GetSelectEntryCount())
471 USHORT nSelPos
= aListItemsLB
.GetSelectEntryPos();
472 if(pControl
== &aListRemovePB
)
474 aListItemsLB
.RemoveEntry(nSelPos
);
475 aListItemsLB
.SelectEntryPos(nSelPos
? nSelPos
- 1 : 0);
477 else if(pControl
== &aListUpPB
)
481 String sEntry
= aListItemsLB
.GetSelectEntry();
482 aListItemsLB
.RemoveEntry(nSelPos
);
484 aListItemsLB
.InsertEntry(sEntry
, nSelPos
);
485 aListItemsLB
.SelectEntryPos(nSelPos
);
488 else if(pControl
== &aListDownPB
)
490 if(nSelPos
< aListItemsLB
.GetEntryCount() - 1)
492 String sEntry
= aListItemsLB
.GetSelectEntry();
493 aListItemsLB
.RemoveEntry(nSelPos
);
495 aListItemsLB
.InsertEntry(sEntry
, nSelPos
);
496 aListItemsLB
.SelectEntryPos(nSelPos
);
500 bDropDownLBChanged
= true;
501 aListItemsLB
.SetUpdateMode(TRUE
);
505 /* -----------------17.06.2003 08:36-----------------
507 --------------------------------------------------*/
508 IMPL_LINK( SwFldFuncPage
, ListEnableHdl
, void*, EMPTYARG
)
510 //enable "Add" button when text is in the Edit that's not already member of the box
511 aListAddPB
.Enable(aListItemED
.GetText().Len() &&
512 LISTBOX_ENTRY_NOTFOUND
== aListItemsLB
.GetEntryPos(aListItemED
.GetText()));
513 BOOL bEnableButtons
= aListItemsLB
.GetSelectEntryCount() > 0;
514 aListRemovePB
.Enable(bEnableButtons
);
515 aListUpPB
.Enable(bEnableButtons
&& (aListItemsLB
.GetSelectEntryPos() > 0));
516 aListDownPB
.Enable(bEnableButtons
&&
517 (aListItemsLB
.GetSelectEntryPos() < (aListItemsLB
.GetEntryCount() - 1)));
522 /*--------------------------------------------------------------------
523 Beschreibung: Typen in der SelectionBox erneuern
524 --------------------------------------------------------------------*/
527 void SwFldFuncPage::UpdateSubType()
529 USHORT nTypeId
= (USHORT
)(ULONG
)aTypeLB
.GetEntryData(GetTypeSel());
531 // Auswahl-Listbox fuellen
532 aSelectionLB
.SetUpdateMode(FALSE
);
533 aSelectionLB
.Clear();
536 GetFldMgr().GetSubTypes(nTypeId
, aLst
);
537 USHORT nCount
= aLst
.Count();
539 for (USHORT i
= 0; i
< nCount
; ++i
)
541 USHORT nPos
= aSelectionLB
.InsertEntry(*aLst
[i
]);
542 aSelectionLB
.SetEntryData(nPos
, reinterpret_cast<void*>(i
));
545 BOOL bEnable
= nCount
!= 0;
547 aSelectionLB
.Enable( bEnable
);
548 aSelectionFT
.Enable( bEnable
);
552 aSelectionLB
.SelectEntryPos(0);
555 if (nTypeId
== TYP_MACROFLD
)
557 BOOL bHasMacro
= GetFldMgr().GetMacroPath().Len() != 0;
561 aNameED
.SetText(GetFldMgr().GetMacroName());
565 EnableInsert(bHasMacro
);
568 aSelectionLB
.SetUpdateMode(TRUE
);
571 /*--------------------------------------------------------------------
572 Beschreibung: MacroBrowser aufrufen, Listbox mit Macros fuellen
573 --------------------------------------------------------------------*/
575 IMPL_LINK( SwFldFuncPage
, MacroHdl
, Button
*, pBtn
)
577 Window
* pDefModalDlgParent
= Application::GetDefDialogParent();
578 Application::SetDefDialogParent( pBtn
);
580 String
sMacro(TurnMacroString(aNameED
.GetText()));
581 while (sMacro
.SearchAndReplace('.', ';') != STRING_NOTFOUND
) ;
583 if (GetFldMgr().ChooseMacro(sMacro
))
586 Application::SetDefDialogParent( pDefModalDlgParent
);
591 /*--------------------------------------------------------------------
593 --------------------------------------------------------------------*/
595 BOOL
SwFldFuncPage::FillItemSet(SfxItemSet
& )
597 USHORT nTypeId
= (USHORT
)(ULONG
)aTypeLB
.GetEntryData(GetTypeSel());
601 ULONG nFormat
= aFormatLB
.GetSelectEntryPos();
603 if(nFormat
== LISTBOX_ENTRY_NOTFOUND
)
606 nFormat
= (ULONG
)aFormatLB
.GetEntryData((USHORT
)nFormat
);
608 String
aVal(aValueED
.GetText());
609 String
aName(aNameED
.GetText());
615 // to prevent removal of CR/LF restore old content
616 if(!aNameED
.IsModified() && IsFldEdit())
617 aName
= GetCurField()->GetPar1();
622 // use the full script URL, not the name in the Edit control
623 aName
= GetFldMgr().GetMacroPath();
627 aVal
= aCond1ED
.GetText();
629 aVal
+= aCond2ED
.GetText();
633 aName
= aListNameED
.GetText();
634 for(USHORT i
= 0; i
< aListItemsLB
.GetEntryCount(); i
++)
638 aVal
+= aListItemsLB
.GetEntry(i
);
647 aNameED
.GetSavedValue() != aNameED
.GetText() ||
648 aValueED
.GetSavedValue() != aValueED
.GetText() ||
649 aCond1ED
.GetSavedValue() != aCond1ED
.GetText() ||
650 aCond2ED
.GetSavedValue() != aCond2ED
.GetText() ||
651 aListNameED
.GetSavedValue() != aListNameED
.GetText() ||
652 bDropDownLBChanged
||
653 nOldFormat
!= nFormat
)
655 InsertFld( nTypeId
, nSubType
, aName
, aVal
, nFormat
);
658 ModifyHdl(); // Insert ggf enablen/disablen
663 /*--------------------------------------------------------------------
665 --------------------------------------------------------------------*/
667 String
SwFldFuncPage::TurnMacroString(const String
&rMacro
)
671 // Inhalt von aName umdrehen
675 for (USHORT i
= 0; i
< 4 && nPos
!= STRING_NOTFOUND
; i
++)
678 sTmp
= rMacro
.Copy(nPos
);
680 sTmp
= rMacro
.GetToken(0, '.', nPos
);
684 sBuf
.Insert( sTmp
, 0 );
692 /*--------------------------------------------------------------------
694 --------------------------------------------------------------------*/
696 SfxTabPage
* SwFldFuncPage::Create( Window
* pParent
,
697 const SfxItemSet
& rAttrSet
)
699 return ( new SwFldFuncPage( pParent
, rAttrSet
) );
702 /*--------------------------------------------------------------------
704 --------------------------------------------------------------------*/
706 USHORT
SwFldFuncPage::GetGroup()
711 /* -----------------12.01.99 10:09-------------------
713 * --------------------------------------------------*/
714 void SwFldFuncPage::FillUserData()
716 String
sData( String::CreateFromAscii(
717 RTL_CONSTASCII_STRINGPARAM( USER_DATA_VERSION
)));
719 USHORT nTypeSel
= aTypeLB
.GetSelectEntryPos();
720 if( LISTBOX_ENTRY_NOTFOUND
== nTypeSel
)
721 nTypeSel
= USHRT_MAX
;
723 nTypeSel
= sal::static_int_cast
< USHORT
>(reinterpret_cast< sal_uIntPtr
>(aTypeLB
.GetEntryData( nTypeSel
)));
724 sData
+= String::CreateFromInt32( nTypeSel
);
728 IMPL_LINK( SwFldFuncPage
, ModifyHdl
, Edit
*, EMPTYARG
)
730 String
aName(aNameED
.GetText());
731 const USHORT nLen
= aName
.Len();
734 USHORT nTypeId
= (USHORT
)(ULONG
)aTypeLB
.GetEntryData(GetTypeSel());
736 if( TYP_COMBINED_CHARS
== nTypeId
&&
737 (!nLen
|| nLen
> MAX_COMBINED_CHARACTERS
))
740 EnableInsert( bEnable
);