merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / controller / dialogs / tp_Scale.cxx
blob067b005c091230fc2e987dd59323abf742300ddf
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: tp_Scale.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_chart2.hxx"
33 #include "tp_Scale.hxx"
35 #include "ResId.hxx"
36 #include "TabPages.hrc"
37 #include "Strings.hrc"
38 #include "chartview/ChartSfxItemIds.hxx"
39 #include "NoWarningThisInCTOR.hxx"
40 #include "AxisHelper.hxx"
42 #ifndef _SVX_SVXIDS_HRC
43 #include <svx/svxids.hrc>
44 #endif
45 #include <rtl/math.hxx>
46 // header for class SvxDoubleItem
47 #include <svx/chrtitem.hxx>
48 // header for class SfxBoolItem
49 #include <svtools/eitem.hxx>
50 // header for SfxInt32Item
51 #include <svtools/intitem.hxx>
53 // header for class WarningBox
54 #include <vcl/msgbox.hxx>
56 // header for class SvNumberformat
57 #ifndef _ZFORMAT_HXX
58 #ifndef _ZFORLIST_DECLARE_TABLE
59 #define _ZFORLIST_DECLARE_TABLE
60 #endif
61 #include <svtools/zformat.hxx>
62 #endif
64 #include <svtools/controldims.hrc>
66 #include <com/sun/star/chart2/AxisType.hpp>
68 using namespace ::com::sun::star;
70 //.............................................................................
71 namespace chart
73 //.............................................................................
75 namespace
78 void lcl_shiftControls( Control& rEdit, Control& rAuto, long nNewXPos )
80 Point aPos( rEdit.GetPosPixel() );
81 long nShift = nNewXPos - aPos.X();
82 aPos.X() = nNewXPos;
83 rEdit.SetPosPixel(aPos);
85 aPos = rAuto.GetPosPixel();
86 aPos.X() += nShift;
87 rAuto.SetPosPixel(aPos);
90 void lcl_placeControlsAtY( Control& rTop, Control& rBottom, long nNewYPos )
92 Point aPos( rTop.GetPosPixel() );
93 long nShift = nNewYPos - aPos.Y();
94 aPos.Y() = nNewYPos;
95 rTop.SetPosPixel(aPos);
97 aPos = rBottom.GetPosPixel();
98 aPos.Y() += nShift;
99 rBottom.SetPosPixel(aPos);
104 ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
105 SfxTabPage(pWindow, SchResId(TP_SCALE), rInAttrs),
107 aFlScale(this, SchResId(FL_SCALE)),
108 aTxtMin (this, SchResId (TXT_MIN)),
109 aFmtFldMin(this, SchResId(EDT_MIN)),
110 aCbxAutoMin(this, SchResId(CBX_AUTO_MIN)),
111 aTxtMax(this, SchResId (TXT_MAX)),
112 aFmtFldMax(this, SchResId(EDT_MAX)),
113 aCbxAutoMax(this, SchResId(CBX_AUTO_MAX)),
114 aTxtMain (this, SchResId (TXT_STEP_MAIN)),
115 aFmtFldStepMain(this, SchResId(EDT_STEP_MAIN)),
116 aCbxAutoStepMain(this, SchResId(CBX_AUTO_STEP_MAIN)),
117 aTxtHelp (this, SchResId (TXT_STEP_HELP)),
118 aMtStepHelp (this, SchResId (MT_STEPHELP)),
119 aCbxAutoStepHelp(this, SchResId(CBX_AUTO_STEP_HELP)),
121 aTxtOrigin (this, SchResId (TXT_ORIGIN)),
122 aFmtFldOrigin(this, SchResId(EDT_ORIGIN)),
123 aCbxAutoOrigin(this, SchResId(CBX_AUTO_ORIGIN)),
125 aCbxLogarithm(this, SchResId(CBX_LOGARITHM)),
126 aCbxReverse(this, SchResId(CBX_REVERSE)),
128 fMin(0.0),
129 fMax(0.0),
130 fStepMain(0.0),
131 nStepHelp(0),
132 fOrigin(0.0),
133 nAxisType(chart2::AxisType::REALNUMBER),
134 pNumFormatter(NULL),
135 m_bShowAxisOrigin(false)
137 FreeResource();
138 SetExchangeSupport();
140 aCbxAutoMin.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
141 aCbxAutoMax.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
142 aCbxAutoStepMain.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
143 aCbxAutoStepHelp.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
144 aCbxAutoOrigin.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
147 void ScaleTabPage::StateChanged( StateChangedType nType )
149 TabPage::StateChanged( nType );
151 if( nType == STATE_CHANGE_INITSHOW )
152 AdjustControlPositions();
155 void ScaleTabPage::AdjustControlPositions()
157 //optimize position of the controls
158 long nLabelWidth = ::std::max( aTxtMin.CalcMinimumSize().Width(), aTxtMax.CalcMinimumSize().Width() );
159 nLabelWidth = ::std::max( aTxtMain.CalcMinimumSize().Width(), nLabelWidth );
160 nLabelWidth = ::std::max( aTxtHelp.CalcMinimumSize().Width(), nLabelWidth );
161 nLabelWidth = ::std::max( aTxtOrigin.CalcMinimumSize().Width(), nLabelWidth );
162 nLabelWidth+=1;
164 long nLabelDistance = aTxtMin.LogicToPixel( Size(RSC_SP_CTRL_DESC_X, 0), MapMode(MAP_APPFONT) ).Width();
165 long nNewXPos = aTxtMin.GetPosPixel().X() + nLabelWidth + nLabelDistance;
167 //ensure that the auto checkboxes are wide enough and have correct size for calculation
168 aCbxAutoMin.SetSizePixel( aCbxAutoMin.CalcMinimumSize() );
169 aCbxAutoMax.SetSizePixel( aCbxAutoMax.CalcMinimumSize() );
170 aCbxAutoStepMain.SetSizePixel( aCbxAutoStepMain.CalcMinimumSize() );
171 aCbxAutoStepHelp.SetSizePixel( aCbxAutoStepHelp.CalcMinimumSize() );
172 aCbxAutoOrigin.SetSizePixel( aCbxAutoOrigin.CalcMinimumSize() );
174 //ensure new pos is ok
175 long nWidthOfOtherControls = aCbxAutoMin.GetPosPixel().X() + aCbxAutoMin.GetSizePixel().Width() - aFmtFldMin.GetPosPixel().X();
176 long nDialogWidth = GetSizePixel().Width();
178 long nLeftSpace = nDialogWidth - nNewXPos - nWidthOfOtherControls;
179 if(nLeftSpace>=0)
181 Size aSize( aTxtMin.GetSizePixel() );
182 aSize.Width() = nLabelWidth;
183 aTxtMin.SetSizePixel(aSize);
184 aTxtMax.SetSizePixel(aSize);
185 aTxtMain.SetSizePixel(aSize);
186 aTxtHelp.SetSizePixel(aSize);
187 aTxtOrigin.SetSizePixel(aSize);
189 lcl_shiftControls( aFmtFldMin, aCbxAutoMin, nNewXPos );
190 lcl_shiftControls( aFmtFldMax, aCbxAutoMax, nNewXPos );
191 lcl_shiftControls( aFmtFldStepMain, aCbxAutoStepMain, nNewXPos );
192 lcl_shiftControls( aMtStepHelp, aCbxAutoStepHelp, nNewXPos );
193 lcl_shiftControls( aFmtFldOrigin, aCbxAutoOrigin, nNewXPos );
197 void ScaleTabPage::EnableControls()
199 bool bEnableForValueOrPercentAxis = chart2::AxisType::REALNUMBER == nAxisType || chart2::AxisType::PERCENT == nAxisType;
200 aFlScale.Enable( bEnableForValueOrPercentAxis );
201 aTxtMin.Enable( bEnableForValueOrPercentAxis );
202 aFmtFldMin.Enable( bEnableForValueOrPercentAxis );
203 aCbxAutoMin.Enable( bEnableForValueOrPercentAxis );
204 aTxtMax.Enable( bEnableForValueOrPercentAxis );
205 aFmtFldMax.Enable( bEnableForValueOrPercentAxis );
206 aCbxAutoMax.Enable( bEnableForValueOrPercentAxis );
207 aTxtMain.Enable( bEnableForValueOrPercentAxis );
208 aFmtFldStepMain.Enable( bEnableForValueOrPercentAxis );
209 aCbxAutoStepMain.Enable( bEnableForValueOrPercentAxis );
210 aTxtHelp.Enable( bEnableForValueOrPercentAxis );
211 aMtStepHelp.Enable( bEnableForValueOrPercentAxis );
212 aCbxAutoStepHelp.Enable( bEnableForValueOrPercentAxis );
213 aCbxLogarithm.Enable( bEnableForValueOrPercentAxis );
215 aTxtOrigin.Show( m_bShowAxisOrigin && bEnableForValueOrPercentAxis );
216 aFmtFldOrigin.Show( m_bShowAxisOrigin && bEnableForValueOrPercentAxis );
217 aCbxAutoOrigin.Show( m_bShowAxisOrigin && bEnableForValueOrPercentAxis );
219 long nNewYPos = aTxtOrigin.GetPosPixel().Y();
220 if( m_bShowAxisOrigin )
221 nNewYPos += ( aTxtOrigin.GetPosPixel().Y() - aTxtHelp.GetPosPixel().Y() );
222 lcl_placeControlsAtY( aCbxLogarithm, aCbxReverse, nNewYPos );
227 IMPL_LINK( ScaleTabPage, EnableValueHdl, CheckBox *, pCbx )
229 if (pCbx == &aCbxAutoMin)
231 aFmtFldMin.Enable(!aCbxAutoMin.IsChecked());
233 else if (pCbx == &aCbxAutoMax)
235 aFmtFldMax.Enable(!aCbxAutoMax.IsChecked());
237 else if (pCbx == &aCbxAutoStepMain)
239 aFmtFldStepMain.Enable(!aCbxAutoStepMain.IsChecked());
241 else if (pCbx == &aCbxAutoStepHelp)
243 aMtStepHelp.Show ();
244 aMtStepHelp.Enable( ! aCbxAutoStepHelp.IsChecked() );
246 else if (pCbx == &aCbxAutoOrigin)
248 aFmtFldOrigin.Enable(!aCbxAutoOrigin.IsChecked());
250 return 0;
253 SfxTabPage* ScaleTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs)
255 return new ScaleTabPage(pWindow, rOutAttrs);
258 BOOL ScaleTabPage::FillItemSet(SfxItemSet& rOutAttrs)
260 DBG_ASSERT( pNumFormatter, "No NumberFormatter available" );
262 rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MIN ,aCbxAutoMin.IsChecked()));
263 rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MAX ,aCbxAutoMax.IsChecked()));
264 rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP,aCbxAutoStepHelp.IsChecked()));
265 rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN ,aCbxAutoOrigin.IsChecked()));
266 rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_LOGARITHM ,aCbxLogarithm.IsChecked()));
267 rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_REVERSE ,aCbxReverse.IsChecked()));
268 rOutAttrs.Put(SvxDoubleItem(fMax , SCHATTR_AXIS_MAX));
269 rOutAttrs.Put(SvxDoubleItem(fMin , SCHATTR_AXIS_MIN));
270 rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_STEP_HELP, nStepHelp));
271 rOutAttrs.Put(SvxDoubleItem(fOrigin , SCHATTR_AXIS_ORIGIN));
273 rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN,aCbxAutoStepMain.IsChecked()));
274 rOutAttrs.Put(SvxDoubleItem(fStepMain,SCHATTR_AXIS_STEP_MAIN));
276 return TRUE;
279 void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
281 DBG_ASSERT( pNumFormatter, "No NumberFormatter available" );
282 if(!pNumFormatter)
283 return;
285 const SfxPoolItem *pPoolItem = NULL;
286 nAxisType=chart2::AxisType::REALNUMBER;
287 if (rInAttrs.GetItemState(SCHATTR_AXISTYPE, TRUE, &pPoolItem) == SFX_ITEM_SET)
289 nAxisType = (int) ((const SfxInt32Item*)pPoolItem)->GetValue();
290 EnableControls();
293 if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MIN,TRUE,&pPoolItem) == SFX_ITEM_SET)
294 aCbxAutoMin.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
296 if (rInAttrs.GetItemState(SCHATTR_AXIS_MIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
298 fMin = ((const SvxDoubleItem*)pPoolItem)->GetValue();
299 aFmtFldMin.SetValue( fMin );
302 if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MAX,TRUE, &pPoolItem) == SFX_ITEM_SET)
303 aCbxAutoMax.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
305 if (rInAttrs.GetItemState(SCHATTR_AXIS_MAX,TRUE, &pPoolItem) == SFX_ITEM_SET)
307 fMax = ((const SvxDoubleItem*)pPoolItem)->GetValue();
308 aFmtFldMax.SetValue( fMax );
311 if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_MAIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
312 aCbxAutoStepMain.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
314 if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_MAIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
316 fStepMain = ((const SvxDoubleItem*)pPoolItem)->GetValue();
317 aFmtFldStepMain.SetValue( fStepMain );
319 if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_HELP,TRUE, &pPoolItem) == SFX_ITEM_SET)
320 aCbxAutoStepHelp.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
321 if (rInAttrs.GetItemState(SCHATTR_AXIS_LOGARITHM,TRUE, &pPoolItem) == SFX_ITEM_SET)
322 aCbxLogarithm.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
323 if (rInAttrs.GetItemState(SCHATTR_AXIS_REVERSE,TRUE, &pPoolItem) == SFX_ITEM_SET)
324 aCbxReverse.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
325 if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_HELP,TRUE, &pPoolItem) == SFX_ITEM_SET)
327 nStepHelp = ((const SfxInt32Item*)pPoolItem)->GetValue();
328 aMtStepHelp.SetValue( nStepHelp );
330 if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_ORIGIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
331 aCbxAutoOrigin.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
332 if (rInAttrs.GetItemState(SCHATTR_AXIS_ORIGIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
334 fOrigin = ((const SvxDoubleItem*)pPoolItem)->GetValue();
335 aFmtFldOrigin.SetValue( fOrigin );
338 EnableValueHdl(&aCbxAutoMin);
339 EnableValueHdl(&aCbxAutoMax);
340 EnableValueHdl(&aCbxAutoStepMain);
341 EnableValueHdl(&aCbxAutoStepHelp);
342 EnableValueHdl(&aCbxAutoOrigin);
345 int ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet)
347 if( !pNumFormatter )
349 DBG_ERROR( "No NumberFormatter available" );
350 return LEAVE_PAGE;
353 sal_uInt32 nIndex = pNumFormatter->GetStandardIndex(LANGUAGE_SYSTEM);
354 const SfxPoolItem *pPoolItem = NULL;
355 if( GetItemSet().GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, TRUE, &pPoolItem ) == SFX_ITEM_SET )
356 nIndex = static_cast< sal_uInt32 >( static_cast< const SfxInt32Item* >(pPoolItem)->GetValue());
357 else
359 OSL_ENSURE( false, "Using Standard Language" );
362 Edit* pEdit = NULL;
363 USHORT nErrStrId = 0;
364 double fDummy;
366 fMax = aFmtFldMax.GetValue();
367 fMin = aFmtFldMin.GetValue();
368 fOrigin = aFmtFldOrigin.GetValue();
369 fStepMain = aFmtFldStepMain.GetValue();
370 nStepHelp = static_cast< sal_Int32 >( aMtStepHelp.GetValue());
372 //do some reasonable automatic correction of user input if necessary
373 if (!aCbxAutoMax.IsChecked() && !aCbxAutoMin.IsChecked() &&
374 fMin >= fMax)
376 pEdit = &aFmtFldMin;
377 nErrStrId = STR_MIN_GREATER_MAX;
379 // check for entries in invalid ranges
380 if ( aCbxLogarithm.IsChecked() &&
381 ( ( !aCbxAutoMin.IsChecked() && fMin <= 0.0 )
382 || ( !aCbxAutoMax.IsChecked() && fMax <= 0.0 ) ) )
384 pEdit = &aFmtFldMin;
385 nErrStrId = STR_BAD_LOGARITHM;
387 if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0)
389 pEdit = &aFmtFldStepMain;
390 nErrStrId = STR_STEP_GT_ZERO;
393 //check wich entries need user action
395 // check for entries that cannot be parsed for the current number format
396 if ( aFmtFldMin.IsModified()
397 && !aCbxAutoMin.IsChecked()
398 && !pNumFormatter->IsNumberFormat(aFmtFldMin.GetText(), nIndex, fDummy))
400 pEdit = &aFmtFldMin;
401 nErrStrId = STR_INVALID_NUMBER;
403 else if (aFmtFldMax.IsModified() && !aCbxAutoMax.IsChecked() &&
404 !pNumFormatter->IsNumberFormat(aFmtFldMax.GetText(),
405 nIndex, fDummy))
407 pEdit = &aFmtFldMax;
408 nErrStrId = STR_INVALID_NUMBER;
410 else if (aFmtFldStepMain.IsModified() && !aCbxAutoStepMain.IsChecked() &&
411 !pNumFormatter->IsNumberFormat(aFmtFldStepMain.GetText(),
412 nIndex, fDummy))
414 pEdit = &aFmtFldStepMain;
415 nErrStrId = STR_STEP_GT_ZERO;
417 else if (aFmtFldOrigin.IsModified() && !aCbxAutoOrigin.IsChecked() &&
418 !pNumFormatter->IsNumberFormat(aFmtFldOrigin.GetText(),
419 nIndex, fDummy))
421 pEdit = &aFmtFldOrigin;
422 nErrStrId = STR_INVALID_NUMBER;
424 else if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0.0)
426 pEdit = &aFmtFldStepMain;
427 nErrStrId = STR_STEP_GT_ZERO;
430 if( ShowWarning( nErrStrId, pEdit ) )
431 return KEEP_PAGE;
433 if( pItemSet )
434 FillItemSet( *pItemSet );
436 return LEAVE_PAGE;
439 void ScaleTabPage::SetNumFormatter( SvNumberFormatter* pFormatter )
441 pNumFormatter = pFormatter;
442 aFmtFldMax.SetFormatter( pNumFormatter );
443 aFmtFldMin.SetFormatter( pNumFormatter );
444 aFmtFldStepMain.SetFormatter( pNumFormatter );
445 aFmtFldOrigin.SetFormatter( pNumFormatter );
447 // #101318#, #i6278# allow more decimal places than the output format. As
448 // the numbers shown in the edit fields are used for input, it makes more
449 // sense to display the values in the input format rather than the output
450 // format.
451 aFmtFldMax.UseInputStringForFormatting();
452 aFmtFldMin.UseInputStringForFormatting();
453 aFmtFldStepMain.UseInputStringForFormatting();
454 aFmtFldOrigin.UseInputStringForFormatting();
456 SetNumFormat();
459 void ScaleTabPage::SetNumFormat()
461 const SfxPoolItem *pPoolItem = NULL;
463 if( GetItemSet().GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, TRUE, &pPoolItem ) == SFX_ITEM_SET )
465 ULONG nFmt = (ULONG)((const SfxInt32Item*)pPoolItem)->GetValue();
467 aFmtFldMax.SetFormatKey( nFmt );
468 aFmtFldMin.SetFormatKey( nFmt );
469 aFmtFldOrigin.SetFormatKey( nFmt );
471 if( pNumFormatter )
473 short eType = pNumFormatter->GetType( nFmt );
474 if( eType == NUMBERFORMAT_DATE )
476 // for intervals use standard format for dates (so you can enter a number of days)
477 const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
478 if( pFormat )
479 nFmt = pNumFormatter->GetStandardIndex( pFormat->GetLanguage());
480 else
481 nFmt = pNumFormatter->GetStandardIndex();
483 else if( eType == NUMBERFORMAT_DATETIME )
485 // for intervals use time format for date times
486 const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
487 if( pFormat )
488 nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_TIME, pFormat->GetLanguage() );
489 else
490 nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_TIME );
494 aFmtFldStepMain.SetFormatKey( nFmt );
498 void ScaleTabPage::ShowAxisOrigin( bool bShowOrigin )
500 m_bShowAxisOrigin = bShowOrigin;
501 if( !AxisHelper::isAxisPositioningEnabled() )
502 m_bShowAxisOrigin = true;
505 bool ScaleTabPage::ShowWarning( USHORT nResIdMessage, Edit * pControl /* = NULL */ )
507 if( nResIdMessage == 0 )
508 return false;
510 WarningBox( this, WinBits( WB_OK ), String( SchResId( nResIdMessage ))).Execute();
511 if( pControl )
513 pControl->GrabFocus();
514 pControl->SetSelection( Selection( 0, SELECTION_MAX ));
516 return true;
519 //.............................................................................
520 } //namespace chart
521 //.............................................................................