Update ooo320-m1
[ooovba.git] / svx / source / cui / fontsubs.cxx
blob9c35b1a8330fdd39afb9eb2f927f018303dbcd43
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fontsubs.cxx,v $
10 * $Revision: 1.13 $
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_svx.hxx"
34 #ifdef SVX_DLLIMPLEMENTATION
35 #undef SVX_DLLIMPLEMENTATION
36 #endif
38 #ifdef PRECOMPILED
39 #include "svxpch.hxx"
40 #endif
41 #include <tools/shl.hxx>
42 #include <svtools/ctrltool.hxx>
43 #include <vcl/svapp.hxx>
44 #include <vcl/wrkwin.hxx>
45 #ifndef _OFA_FONTSUBSTCONFIG_HXX
46 #include <svtools/fontsubstconfig.hxx>
47 #endif
48 #include <svtools/sourceviewconfig.hxx>
50 #include "fontsubs.hrc"
51 #include "fontsubs.hxx"
52 #include <svx/dialmgr.hxx>
53 #include "helpid.hrc"
54 #include <svx/dialogs.hrc>
56 /*********************************************************************/
57 /* */
58 /* TabPage Fontersetzung */
59 /* */
60 /*********************************************************************/
62 #define CBCOL_FIRST 0
63 #define CBCOL_SECOND 1
64 #define CBCOL_BOTH 2
66 SvxFontSubstTabPage::SvxFontSubstTabPage( Window* pParent,
67 const SfxItemSet& rSet ) :
68 SfxTabPage(pParent, SVX_RES(RID_SVX_FONT_SUBSTITUTION), rSet),
69 aUseTableCB (this, SVX_RES(CB_USETABLE)),
70 aFont1FT (this, SVX_RES(FT_FONT1)),
71 aFont1CB (this, SVX_RES(CB_FONT1)),
72 aFont2FT (this, SVX_RES(FT_FONT2)),
73 aFont2CB (this, SVX_RES(CB_FONT2)),
74 aNewDelTBX (this, SVX_RES(TBX_SUBSTNEWDEL)),
75 aCheckLB (this, SVX_RES(CLB_SUBSTITUTES)),
77 aSourceViewFontsFL (this, SVX_RES(FL_SOURCEVIEW )),
78 aFontNameFT (this, SVX_RES(FT_FONTNAME )),
79 aFontNameLB (this, SVX_RES(LB_FONTNAME )),
80 aNonPropFontsOnlyCB(this, SVX_RES(CB_NONPROP )),
81 aFontHeightFT (this, SVX_RES(FT_FONTHEIGHT )),
82 aFontHeightLB (this, SVX_RES(LB_FONTHEIGHT )),
84 aImageList (SVX_RES(IL_ICON)),
86 sAutomatic (SVX_RES( STR_AUTOMATIC )),
87 pConfig(new SvtFontSubstConfig),
88 pSourceViewConfig(new svt::SourceViewConfig),
90 sHeader1 (SVX_RES( STR_HEADER1 )),
91 sHeader2 (SVX_RES( STR_HEADER2 )),
92 sHeader3 (SVX_RES( STR_HEADER3 )),
93 sHeader4 (SVX_RES( STR_HEADER4 )),
95 sFontGroup ("FontSubstitution"),
96 pCheckButtonData(0)
98 FreeResource();
100 aTextColor = aCheckLB.GetTextColor();
102 for(USHORT k = 0; k < aNewDelTBX.GetItemCount(); k++)
103 aNewDelTBX.SetItemImage(aNewDelTBX.GetItemId(k),
104 aImageList.GetImage(aNewDelTBX.GetItemId(k)));
106 aNewDelTBX.SetSizePixel( aNewDelTBX.CalcWindowSizePixel() );
108 long nDelta = ( aFont1CB.GetSizePixel().Height() -
109 aNewDelTBX.GetSizePixel().Height() ) / 2;
110 Point aNewPnt = aNewDelTBX.GetPosPixel();
111 aNewPnt.Y() += nDelta;
112 aNewDelTBX.SetPosPixel( aNewPnt );
114 aCheckLB.SetHelpId(HID_OFA_FONT_SUBST_CLB);
115 aCheckLB.SetWindowBits(aCheckLB.GetStyle()|WB_HSCROLL|WB_VSCROLL);
116 aCheckLB.SetSelectionMode(MULTIPLE_SELECTION);
117 aCheckLB.SortByCol(2);
119 Link aLink(LINK(this, SvxFontSubstTabPage, SelectHdl));
121 aCheckLB.SetSelectHdl(aLink);
122 aUseTableCB.SetClickHdl(aLink);
123 aFont1CB.SetSelectHdl(aLink);
124 aFont1CB.SetModifyHdl(aLink);
125 aFont2CB.SetSelectHdl(aLink);
126 aFont2CB.SetModifyHdl(aLink);
127 aNewDelTBX.SetClickHdl(aLink);
129 aNonPropFontsOnlyCB.SetClickHdl(LINK(this, SvxFontSubstTabPage, NonPropFontsHdl));
131 static long aStaticTabs[] = { 4, 0, 0, 0, 0 };
132 long nW1 = GetTextWidth( sHeader1 );
133 long nW2 = GetTextWidth( sHeader2 );
134 long nMax = Max( nW1, nW2 ) + 6; // width of the longest header + a little offset
135 long nMin = aFontNameFT.LogicToPixel( Size( 30, 0 ), MAP_APPFONT ).Width();
136 nMax = Max( nMax, nMin );
137 const long nDoubleMax = 2*nMax;
138 const long nRest = aCheckLB.GetSizePixel().Width() - nDoubleMax;
139 aStaticTabs[2] = nMax;
140 aStaticTabs[3] = nDoubleMax;
141 aStaticTabs[4] = nDoubleMax + nRest/2;
142 aCheckLB.SvxSimpleTable::SetTabs( aStaticTabs, MAP_PIXEL );
144 String sHeader(sHeader1);
145 String sTab(String::CreateFromAscii("\t"));
146 String sTabSpace(String::CreateFromAscii("\t "));
147 sHeader += sTab;
148 sHeader += sHeader2;
149 sHeader += sTabSpace;
150 sHeader += sHeader3;
151 sHeader += sTabSpace;
152 sHeader += sHeader4;
153 // sHeader += sTabSpace;
154 aCheckLB.InsertHeaderEntry(sHeader);
156 HeaderBar* pBar = aCheckLB.GetTheHeaderBar();
158 HeaderBarItemBits nBits = pBar->GetItemBits(1) | HIB_FIXEDPOS | HIB_FIXED;
159 nBits &= ~HIB_CLICKABLE;
160 pBar->SetItemBits(1, nBits);
161 pBar->SetItemBits(2, nBits);
163 USHORT nHeight;
164 for(nHeight = 6; nHeight <= 16; nHeight++)
165 aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight));
166 for(nHeight = 18; nHeight <= 28; nHeight+= 2)
167 aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight));
168 for(nHeight = 32; nHeight <= 48; nHeight+= 4)
169 aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight));
170 for(nHeight = 54; nHeight <= 72; nHeight+= 6)
171 aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight));
172 for(nHeight = 80; nHeight <= 96; nHeight+= 8)
173 aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight));
176 /*********************************************************************/
177 /* */
178 /*********************************************************************/
180 SvLBoxEntry* SvxFontSubstTabPage::CreateEntry(String& rFont1, String& rFont2)
182 SvLBoxEntry* pEntry = new SvLBoxEntry;
184 if( !pCheckButtonData )
185 pCheckButtonData = new SvLBoxButtonData( &aCheckLB );
187 pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0)); // Sonst Puff!
189 pEntry->AddItem( new SvLBoxButton( pEntry,
190 SvLBoxButtonKind_enabledCheckbox, 0,
191 pCheckButtonData ) );
192 pEntry->AddItem( new SvLBoxButton( pEntry,
193 SvLBoxButtonKind_enabledCheckbox, 0,
194 pCheckButtonData ) );
196 pEntry->AddItem( new SvLBoxString( pEntry, 0, rFont1 ) );
197 pEntry->AddItem( new SvLBoxString( pEntry, 0, rFont2 ) );
199 return pEntry;
202 /*********************************************************************/
203 /* */
204 /*********************************************************************/
207 SvxFontSubstTabPage::~SvxFontSubstTabPage()
209 delete pCheckButtonData;
210 delete pConfig;
211 delete pSourceViewConfig;
214 /*********************************************************************/
215 /* */
216 /*********************************************************************/
218 SfxTabPage* SvxFontSubstTabPage::Create( Window* pParent,
219 const SfxItemSet& rAttrSet)
221 return new SvxFontSubstTabPage(pParent, rAttrSet);
224 /*********************************************************************/
225 /* */
226 /*********************************************************************/
228 BOOL SvxFontSubstTabPage::FillItemSet( SfxItemSet& )
230 pConfig->ClearSubstitutions();// remove all entries
232 pConfig->Enable(aUseTableCB.IsChecked());
234 SvLBoxEntry* pEntry = aCheckLB.First();
236 while (pEntry)
238 SubstitutionStruct aAdd;
239 aAdd.sFont = aCheckLB.GetEntryText(pEntry, 0);
240 aAdd.sReplaceBy = aCheckLB.GetEntryText(pEntry, 1);
241 aAdd.bReplaceAlways = aCheckLB.IsChecked(pEntry, 0);
242 aAdd.bReplaceOnScreenOnly = aCheckLB.IsChecked(pEntry, 1);
243 pConfig->AddSubstitution(aAdd);
244 pEntry = aCheckLB.Next(pEntry);
246 if(pConfig->IsModified())
247 pConfig->Commit();
248 pConfig->Apply();
249 if(aFontHeightLB.GetSavedValue() != aFontHeightLB.GetSelectEntryPos())
250 pSourceViewConfig->SetFontHeight((sal_Int16)aFontHeightLB.GetSelectEntry().ToInt32());
251 if(aNonPropFontsOnlyCB.GetSavedValue() != aNonPropFontsOnlyCB.IsChecked())
252 pSourceViewConfig->SetShowProportionalFontsOnly(aNonPropFontsOnlyCB.IsChecked());
253 //font name changes cannot be detected by saved values
254 String sFontName;
255 if(aFontNameLB.GetSelectEntryPos())
256 sFontName = aFontNameLB.GetSelectEntry();
257 pSourceViewConfig->SetFontName(sFontName);
259 return FALSE;
262 /*********************************************************************/
263 /* */
264 /*********************************************************************/
267 void SvxFontSubstTabPage::Reset( const SfxItemSet& )
269 aCheckLB.SetUpdateMode(FALSE);
270 aCheckLB.Clear();
272 FontList aFntLst( Application::GetDefaultDevice() );
273 aFont1CB.Fill( &aFntLst );
274 aFont2CB.Fill( &aFntLst );
276 sal_Int32 nCount = pConfig->SubstitutionCount();
277 if (nCount)
278 aUseTableCB.Check(pConfig->IsEnabled());
280 for (sal_Int32 i = 0; i < nCount; i++)
282 const SubstitutionStruct* pSubs = pConfig->GetSubstitution(i);
283 String aTmpStr1(pSubs->sFont);
284 String aTmpStr2(pSubs->sReplaceBy);
285 SvLBoxEntry* pEntry = CreateEntry(aTmpStr1, aTmpStr2);
286 aCheckLB.Insert(pEntry);
287 aCheckLB.CheckEntry(pEntry, 0, pSubs->bReplaceAlways);
288 aCheckLB.CheckEntry(pEntry, 1, pSubs->bReplaceOnScreenOnly);
291 CheckEnable();
292 aCheckLB.SetUpdateMode(TRUE);
294 //fill font name box first
295 aNonPropFontsOnlyCB.Check(pSourceViewConfig->IsShowProportionalFontsOnly());
296 NonPropFontsHdl(&aNonPropFontsOnlyCB);
297 String sFontName(pSourceViewConfig->GetFontName());
298 if(sFontName.Len())
299 aFontNameLB.SelectEntry(sFontName);
300 else
301 aFontNameLB.SelectEntryPos(0);
302 short nFontHeight = pSourceViewConfig->GetFontHeight();
303 aFontHeightLB.SelectEntry(String::CreateFromInt32(nFontHeight));
304 aNonPropFontsOnlyCB.SaveValue();
305 aFontHeightLB.SaveValue();
308 /*********************************************************************/
309 /* */
310 /*********************************************************************/
312 IMPL_LINK(SvxFontSubstTabPage, SelectHdl, Window*, pWin)
314 if (pWin == &aNewDelTBX)
316 SvLBoxEntry* pEntry;
317 // nCol ist behaemmerterweise die nCol'te Textspalte, werden nicht gezaehlt!
318 // Daher als Spalte "0".
319 ULONG nPos = aCheckLB.GetEntryPos(aFont1CB.GetText(), 0);
321 switch (aNewDelTBX.GetCurItemId())
323 case BT_SUBSTAPPLY:
325 if (nPos != 0xffffffff)
327 // Eintrag aendern
328 aCheckLB.SetEntryText(aFont2CB.GetText(), nPos, 1);
329 pEntry = aCheckLB.GetEntry(nPos);
331 else
333 // Neuer Eintrag
334 String sFont1 = aFont1CB.GetText();
335 String sFont2 = aFont2CB.GetText();
337 pEntry = CreateEntry(sFont1, sFont2);
338 aCheckLB.Insert(pEntry);
340 aCheckLB.SelectAll(FALSE);
341 aCheckLB.Select(pEntry);
343 break;
345 case BT_SUBSTDELETE:
347 if (nPos != 0xffffffff)
349 pEntry = aCheckLB.FirstSelected();
350 while (pEntry)
352 SvLBoxEntry* pDelEntry = pEntry;
353 pEntry = aCheckLB.NextSelected(pEntry);
354 aCheckLB.RemoveEntry(pDelEntry);
358 break;
362 if (pWin == &aCheckLB)
364 SvLBoxEntry* pEntry = aCheckLB.FirstSelected();
366 if (aCheckLB.NextSelected(pEntry) == 0)
368 aFont1CB.SetText(aCheckLB.GetEntryText(pEntry, 0));
369 aFont2CB.SetText(aCheckLB.GetEntryText(pEntry, 1));
373 if (pWin == &aFont1CB)
375 ULONG nPos = aCheckLB.GetEntryPos(aFont1CB.GetText(), 0);
377 if (nPos != 0xffffffff)
379 SvLBoxEntry* pEntry = aCheckLB.GetEntry(nPos);
381 if (pEntry != aCheckLB.FirstSelected())
383 aCheckLB.SelectAll(FALSE);
384 aCheckLB.Select(pEntry);
389 CheckEnable();
391 return 0;
393 /* -----------------------------29.08.2002 11:47------------------------------
395 ---------------------------------------------------------------------------*/
396 IMPL_LINK(SvxFontSubstTabPage, NonPropFontsHdl, CheckBox*, pBox)
398 String sFontName = aFontNameLB.GetSelectEntry();
399 BOOL bNonPropOnly = pBox->IsChecked();
400 aFontNameLB.Clear();
401 FontList aFntLst( Application::GetDefaultDevice() );
402 aFontNameLB.InsertEntry(sAutomatic);
403 USHORT nFontCount = aFntLst.GetFontNameCount();
404 for(USHORT nFont = 0; nFont < nFontCount; nFont++)
406 const FontInfo& rInfo = aFntLst.GetFontName( nFont );
407 if(!bNonPropOnly || rInfo.GetPitch() == PITCH_FIXED)
408 aFontNameLB.InsertEntry(rInfo.GetName());
410 aFontNameLB.SelectEntry(sFontName);
411 return 0;
413 /*********************************************************************/
414 /* */
415 /*********************************************************************/
417 void SvxFontSubstTabPage::CheckEnable()
419 BOOL bEnableAll = aUseTableCB.IsChecked();
421 if (bEnableAll)
423 BOOL bApply, bDelete;
425 SvLBoxEntry* pEntry = aCheckLB.FirstSelected();
427 String sEntry = aFont1CB.GetText();
428 sEntry += '\t';
429 sEntry += aFont2CB.GetText();
431 /* if (!aFont1CB.GetText().Len() || !aFont2CB.GetText().Len() ||
432 aFont1CB.GetText() == aFont2CB.GetText() ||
433 aCheckLB.GetEntryPos(sEntry) != 0xffffffff ||
434 (pEntry != 0 && aCheckLB.NextSelected(pEntry) != 0))
435 bApply = FALSE;
436 else
437 bApply = TRUE;*/
439 // Wegen OS/2-Optimierungsfehler (Bug #56267) etwas umstaendlicher:
440 if (!aFont1CB.GetText().Len() || !aFont2CB.GetText().Len())
441 bApply = FALSE;
442 else if(aFont1CB.GetText() == aFont2CB.GetText())
443 bApply = FALSE;
444 else if(aCheckLB.GetEntryPos(sEntry) != 0xffffffff)
445 bApply = FALSE;
446 else if(pEntry != 0 && aCheckLB.NextSelected(pEntry) != 0)
447 bApply = FALSE;
448 else
449 bApply = TRUE;
451 bDelete = pEntry != 0;
453 aNewDelTBX.EnableItem(BT_SUBSTAPPLY, bApply);
454 aNewDelTBX.EnableItem(BT_SUBSTDELETE, bDelete);
457 if (bEnableAll)
459 if (!aCheckLB.IsEnabled())
461 aCheckLB.EnableTable();
462 aCheckLB.SetTextColor(aTextColor);
463 aCheckLB.Invalidate();
464 SelectHdl(&aFont1CB);
467 else
469 if (aCheckLB.IsEnabled())
471 aCheckLB.DisableTable();
472 aCheckLB.SetTextColor(Color(COL_GRAY));
473 aCheckLB.Invalidate();
474 aCheckLB.SelectAll(FALSE);
477 aNewDelTBX.Enable(bEnableAll);
478 aFont1FT.Enable(bEnableAll);
479 aFont1CB.Enable(bEnableAll);
480 aFont2FT.Enable(bEnableAll);
481 aFont2CB.Enable(bEnableAll);
484 /*********************************************************************/
485 /* */
486 /*********************************************************************/
488 void SvxFontSubstCheckListBox::SetTabs()
490 SvxSimpleTable::SetTabs();
491 USHORT nAdjust = SV_LBOXTAB_ADJUST_RIGHT|SV_LBOXTAB_ADJUST_LEFT|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_ADJUST_NUMERIC|SV_LBOXTAB_FORCE;
493 SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(1);
494 pTab->nFlags &= ~nAdjust;
495 pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
497 pTab = (SvLBoxTab*)aTabs.GetObject(2);
498 pTab->nFlags &= ~nAdjust;
499 pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
501 /* -----------------------------22.05.2002 11:06------------------------------
503 ---------------------------------------------------------------------------*/
504 void SvxFontSubstCheckListBox::KeyInput( const KeyEvent& rKEvt )
506 if(!rKEvt.GetKeyCode().GetModifier() &&
507 KEY_SPACE == rKEvt.GetKeyCode().GetCode())
509 ULONG nSelPos = GetModel()->GetAbsPos(GetCurEntry());
510 USHORT nCol = GetCurrentTabPos() - 1;
511 if ( nCol < 2 )
513 CheckEntryPos( nSelPos, nCol, !IsChecked( nSelPos, nCol ) );
514 CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, (void*)GetEntry( nSelPos ) );
516 else
518 USHORT nCheck = IsChecked(nSelPos, 1) ? 1 : 0;
519 if(IsChecked(nSelPos, 0))
520 nCheck += 2;
521 nCheck--;
522 nCheck &= 3;
523 CheckEntryPos(nSelPos, 1, 0 != (nCheck & 1));
524 CheckEntryPos(nSelPos, 0, 0 != (nCheck & 2));
527 else
528 SvxSimpleTable::KeyInput(rKEvt);
531 /*********************************************************************/
532 /* */
533 /*********************************************************************/
535 void SvxFontSubstCheckListBox::CheckEntryPos(ULONG nPos, USHORT nCol, BOOL bChecked)
537 if ( nPos < GetEntryCount() )
538 SetCheckButtonState(
539 GetEntry(nPos),
540 nCol,
541 bChecked ? SvButtonState( SV_BUTTON_CHECKED ) :
542 SvButtonState( SV_BUTTON_UNCHECKED ) );
545 /*********************************************************************/
546 /* */
547 /*********************************************************************/
549 void SvxFontSubstCheckListBox::CheckEntry(SvLBoxEntry* pEntry, USHORT nCol, BOOL bChecked)
551 if ( pEntry )
552 SetCheckButtonState(
553 pEntry,
554 nCol,
555 bChecked ? SvButtonState( SV_BUTTON_CHECKED ) :
556 SvButtonState( SV_BUTTON_UNCHECKED ) );
559 /*********************************************************************/
560 /* */
561 /*********************************************************************/
563 BOOL SvxFontSubstCheckListBox::IsChecked(ULONG nPos, USHORT nCol)
565 return GetCheckButtonState( GetEntry(nPos), nCol ) == SV_BUTTON_CHECKED;
568 /*********************************************************************/
569 /* */
570 /*********************************************************************/
572 BOOL SvxFontSubstCheckListBox::IsChecked(SvLBoxEntry* pEntry, USHORT nCol)
574 return GetCheckButtonState( pEntry, nCol ) == SV_BUTTON_CHECKED;
577 /*********************************************************************/
578 /* */
579 /*********************************************************************/
581 void SvxFontSubstCheckListBox::SetCheckButtonState( SvLBoxEntry* pEntry, USHORT nCol, SvButtonState eState)
583 SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
585 DBG_ASSERT(pItem,"SetCheckButton:Item not found");
586 if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON)
588 switch( eState )
590 case SV_BUTTON_CHECKED:
591 pItem->SetStateChecked();
592 break;
594 case SV_BUTTON_UNCHECKED:
595 pItem->SetStateUnchecked();
596 break;
598 case SV_BUTTON_TRISTATE:
599 pItem->SetStateTristate();
600 break;
602 InvalidateEntry( pEntry );
606 /*********************************************************************/
607 /* */
608 /*********************************************************************/
610 SvButtonState SvxFontSubstCheckListBox::GetCheckButtonState( SvLBoxEntry* pEntry, USHORT nCol ) const
612 SvButtonState eState = SV_BUTTON_UNCHECKED;
613 SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
614 DBG_ASSERT(pItem,"GetChButnState:Item not found");
616 if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON)
618 USHORT nButtonFlags = pItem->GetButtonFlags();
619 eState = pCheckButtonData->ConvertToButtonState( nButtonFlags );
622 return eState;