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_chart2.hxx"
26 #include "tp_AxisPositions.hxx"
27
28 #include "ResId.hxx"
29 #include "TabPages.hrc"
30 #include "Strings.hrc"
31 #include "chartview/ChartSfxItemIds.hxx"
32 #include "NoWarningThisInCTOR.hxx"
33 #include "AxisHelper.hxx"
34
35 #ifndef _SVX_SVXIDS_HRC
36 #include <svx/svxids.hrc>
37 #endif
38 #include <rtl/math.hxx>
39 // header for class SvxDoubleItem
40 #include <svx/chrtitem.hxx>
41 // header for class SfxBoolItem
42 #include <svl/eitem.hxx>
43 // header for SfxInt32Item
44 #include <svl/intitem.hxx>
45
46 // header for class WarningBox
47 #include <vcl/msgbox.hxx>
48
49 // header for class SvNumberformat
50 #ifndef _ZFORMAT_HXX
51 #ifndef _ZFORLIST_DECLARE_TABLE
52 #define _ZFORLIST_DECLARE_TABLE
53 #endif
54 #include <svl/zformat.hxx>
55 #endif
56
57 #include <svtools/controldims.hrc>
58
59 #include <com/sun/star/chart/ChartAxisPosition.hpp>
60 #include <com/sun/star/chart2/AxisType.hpp>
61
62 using namespace ::com::sun::star;
63
64 //.............................................................................
65 namespace chart
66 {
67 //.............................................................................
68
69 namespace
70 {
lcl_newXPos(Control & rControl,long nXPos)71 void lcl_newXPos( Control& rControl, long nXPos )
72 {
73 Point aPos( rControl.GetPosPixel() );
74 aPos.X() = nXPos;
75 rControl.SetPosPixel(aPos);
76 }
77
lcl_shiftY(Control & rControl,long nYDiff)78 void lcl_shiftY( Control& rControl, long nYDiff )
79 {
80 Point aPos( rControl.GetPosPixel() );
81 aPos.Y() += nYDiff;
82 rControl.SetPosPixel(aPos);
83 }
84
85 }
86
AxisPositionsTabPage(Window * pWindow,const SfxItemSet & rInAttrs)87 AxisPositionsTabPage::AxisPositionsTabPage(Window* pWindow,const SfxItemSet& rInAttrs)
88 : SfxTabPage(pWindow, SchResId(TP_AXIS_POSITIONS), rInAttrs)
89
90 , m_aFL_AxisLine(this,SchResId(FL_AXIS_LINE))
91 , m_aFT_CrossesAt(this,SchResId(FT_CROSSES_OTHER_AXIS_AT))
92 , m_aLB_CrossesAt(this,SchResId(LB_CROSSES_OTHER_AXIS_AT))
93 , m_aED_CrossesAt(this,SchResId(EDT_CROSSES_OTHER_AXIS_AT))
94 , m_aED_CrossesAtCategory(this,SchResId(EDT_CROSSES_OTHER_AXIS_AT_CATEGORY))
95 , m_aCB_AxisBetweenCategories(this, SchResId(CB_AXIS_BETWEEN_CATEGORIES))
96
97 , m_aFL_Labels(this,SchResId(FL_LABELS))
98 , m_aFT_PlaceLabels( this, SchResId( FT_PLACE_LABELS ) )
99 , m_aLB_PlaceLabels( this, SchResId( LB_PLACE_LABELS ) )
100 , m_aFT_LabelDistance( this, SchResId( FT_AXIS_LABEL_DISTANCE ) )
101 , m_aED_LabelDistance( this, SchResId( EDT_AXIS_LABEL_DISTANCE ) )
102
103 , m_aFL_Ticks(this,SchResId(FL_TICKS))
104 , m_aFT_Major(this,SchResId(FT_MAJOR))
105 , m_aCB_TicksInner(this,SchResId(CB_TICKS_INNER))
106 , m_aCB_TicksOuter(this,SchResId(CB_TICKS_OUTER))
107 , m_aFT_Minor(this,SchResId(FT_MINOR))
108 , m_aCB_MinorInner(this,SchResId(CB_MINOR_INNER))
109 , m_aCB_MinorOuter(this,SchResId(CB_MINOR_OUTER))
110
111 , m_aFL_Vertical(this,SchResId(FL_VERTICAL))
112 , m_aFT_PlaceTicks(this,SchResId(FT_PLACE_TICKS))
113 , m_aLB_PlaceTicks(this,SchResId(LB_PLACE_TICKS))
114
115 , m_aFL_Grids(this,SchResId(FL_GRIDS))
116 , m_aCB_MajorGrid(this,SchResId(CB_MAJOR_GRID))
117 , m_aPB_MajorGrid(this,SchResId(PB_MAJOR_GRID))
118 , m_aCB_MinorGrid(this,SchResId(CB_MINOR_GRID))
119 , m_aPB_MinorGrid(this,SchResId(PB_MINOR_GRID))
120
121 , m_pNumFormatter(NULL)
122 , m_bCrossingAxisIsCategoryAxis(false)
123 , m_aCategories()
124 {
125 FreeResource();
126 SetExchangeSupport();
127
128 const long nDialogWidth = GetSizePixel().Width();
129 const long nDistance = LogicToPixel( Size(RSC_SP_CTRL_X, 0), MapMode(MAP_APPFONT) ).Width();
130
131 //axis line controls
132 {
133 if( m_aFT_CrossesAt.CalcMinimumSize().Width() < m_aFT_CrossesAt.GetSizePixel().Width() )
134 {
135 m_aFT_CrossesAt.SetSizePixel(m_aFT_CrossesAt.CalcMinimumSize());
136 long nXPos = m_aFT_CrossesAt.GetPosPixel().X() + m_aFT_CrossesAt.GetSizePixel().Width() + nDistance;
137 lcl_newXPos( m_aLB_CrossesAt, nXPos );
138
139 nXPos += m_aLB_CrossesAt.GetSizePixel().Width() + nDistance;
140 lcl_newXPos( m_aED_CrossesAt, nXPos );
141 lcl_newXPos( m_aED_CrossesAtCategory, nXPos );
142 }
143 }
144
145 long nFixTextHeight = m_aFT_PlaceLabels.GetSizePixel().Height();
146 long nLabelPlacementWidth = m_aFT_PlaceLabels.CalcMinimumSize().Width();
147 long nMarkPlacementWidth = m_aFT_PlaceTicks.CalcMinimumSize().Width();
148
149
150 long nWidth_0 = ::std::max( m_aFT_Major.CalcMinimumSize().Width(), m_aFT_Minor.CalcMinimumSize().Width() );
151 nWidth_0 = ::std::max( nWidth_0, nLabelPlacementWidth );
152 nWidth_0 = ::std::max( nWidth_0, nMarkPlacementWidth );
153 nLabelPlacementWidth = nMarkPlacementWidth = nWidth_0;
154
155 //label placement
156 {
157 m_aFT_PlaceLabels.SetSizePixel( Size( nLabelPlacementWidth, nFixTextHeight ) );
158 long nXPos = m_aFT_PlaceLabels.GetPosPixel().X() + nLabelPlacementWidth + nDistance;
159 lcl_newXPos( m_aLB_PlaceLabels, nXPos );
160 m_aLB_PlaceLabels.SetSizePixel(m_aLB_PlaceLabels.CalcMinimumSize());
161 }
162
163 //tickmark placement
164 {
165 m_aFT_PlaceTicks.SetSizePixel( Size( nMarkPlacementWidth, nFixTextHeight ) );
166 long nXPos = m_aFT_PlaceTicks.GetPosPixel().X() + nMarkPlacementWidth + nDistance;
167 lcl_newXPos( m_aLB_PlaceTicks, nXPos );
168 m_aLB_PlaceTicks.SetSizePixel( m_aLB_PlaceTicks.CalcMinimumSize() );
169 }
170
171 //tickmark controls
172 {
173 long nWidth_1 = ::std::max( m_aCB_TicksInner.CalcMinimumSize().Width(), m_aCB_MinorInner.CalcMinimumSize().Width() );
174 long nWidth_2 = ::std::max( m_aCB_TicksOuter.CalcMinimumSize().Width(), m_aCB_MinorOuter.CalcMinimumSize().Width() );
175
176 long nLeftSpace = nDialogWidth - nWidth_0 - nWidth_1 - nWidth_2 - 3*nDistance;
177
178 if(nLeftSpace>=0)
179 {
180 m_aFT_Major.SetSizePixel(m_aFT_Major.CalcMinimumSize());
181 m_aFT_Minor.SetSizePixel(m_aFT_Minor.CalcMinimumSize());
182
183 m_aCB_TicksInner.SetSizePixel( m_aCB_TicksInner.CalcMinimumSize() );
184 m_aCB_MinorInner.SetSizePixel( m_aCB_MinorInner.CalcMinimumSize() );
185
186 m_aCB_TicksOuter.SetSizePixel( m_aCB_TicksOuter.CalcMinimumSize() );
187 m_aCB_MinorOuter.SetSizePixel( m_aCB_MinorOuter.CalcMinimumSize() );
188
189 long nXPos = m_aFT_Major.GetPosPixel().X() + nWidth_0 + nDistance;
190 lcl_newXPos( m_aCB_TicksInner, nXPos );
191 lcl_newXPos( m_aCB_MinorInner, nXPos );
192
193 nXPos += nWidth_1 + nDistance;
194 lcl_newXPos( m_aCB_TicksOuter, nXPos );
195 lcl_newXPos( m_aCB_MinorOuter, nXPos );
196
197 nXPos += nWidth_2 + nDistance;
198 lcl_newXPos( m_aFL_Vertical, nXPos );
199 }
200 }
201
202 //right alignement of listboxes:
203 {
204 long nLabelRightBorder = m_aLB_PlaceLabels.GetPosPixel().X() + m_aLB_PlaceLabels.GetSizePixel().Width();
205 long nTickmarksRightBorder = m_aLB_PlaceTicks.GetPosPixel().X() + m_aLB_PlaceTicks.GetSizePixel().Width();
206
207 long nNewRightBorder = ::std::max( m_aLB_CrossesAt.GetPosPixel().X() + m_aLB_CrossesAt.GetSizePixel().Width(), nLabelRightBorder);
208 nNewRightBorder = ::std::max( nTickmarksRightBorder, nNewRightBorder );
209
210 long nListBoxHeight = m_aLB_PlaceLabels.GetSizePixel().Height();
211 m_aLB_PlaceLabels.SetSizePixel( Size( m_aLB_PlaceLabels.GetSizePixel().Width()+nNewRightBorder-nLabelRightBorder, nListBoxHeight ) );
212 m_aLB_PlaceTicks.SetSizePixel( Size( m_aLB_PlaceTicks.GetSizePixel().Width()+nNewRightBorder-nTickmarksRightBorder, nListBoxHeight ) );
213 }
214
215 m_aLB_CrossesAt.SetSelectHdl( LINK( this, AxisPositionsTabPage, CrossesAtSelectHdl ) );
216 m_aLB_CrossesAt.SetDropDownLineCount( m_aLB_CrossesAt.GetEntryCount() );
217
218 m_aLB_PlaceLabels.SetSelectHdl( LINK( this, AxisPositionsTabPage, PlaceLabelsSelectHdl ) );
219 m_aLB_PlaceLabels.SetDropDownLineCount( m_aLB_PlaceLabels.GetEntryCount() );
220 m_aLB_PlaceTicks.SetDropDownLineCount( m_aLB_PlaceTicks.GetEntryCount() );
221 m_aCB_TicksInner.SetAccessibleRelationLabeledBy(&m_aFT_Major);
222 m_aCB_TicksOuter.SetAccessibleRelationLabeledBy(&m_aFT_Major);
223 m_aCB_MinorInner.SetAccessibleRelationLabeledBy(&m_aFT_Minor);
224 m_aCB_MinorOuter.SetAccessibleRelationLabeledBy(&m_aFT_Minor);
225 }
226
Create(Window * pWindow,const SfxItemSet & rOutAttrs)227 SfxTabPage* AxisPositionsTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs)
228 {
229 return new AxisPositionsTabPage(pWindow, rOutAttrs);
230 }
231
FillItemSet(SfxItemSet & rOutAttrs)232 sal_Bool AxisPositionsTabPage::FillItemSet(SfxItemSet& rOutAttrs)
233 {
234 // axis line
235 sal_uInt16 nPos = m_aLB_CrossesAt.GetSelectEntryPos();
236 rOutAttrs.Put( SfxInt32Item( SCHATTR_AXIS_POSITION, nPos+1 ));
237 if( 2==nPos )
238 {
239 double fCrossover = m_aED_CrossesAt.GetValue();
240 if( m_bCrossingAxisIsCategoryAxis )
241 fCrossover = m_aED_CrossesAtCategory.GetSelectEntryPos()+1;
242 rOutAttrs.Put(SvxDoubleItem(fCrossover,SCHATTR_AXIS_POSITION_VALUE));
243 }
244
245 // labels
246 sal_uInt16 nLabelPos = m_aLB_PlaceLabels.GetSelectEntryPos();
247 if( nLabelPos != LISTBOX_ENTRY_NOTFOUND )
248 rOutAttrs.Put( SfxInt32Item( SCHATTR_AXIS_LABEL_POSITION, nLabelPos ));
249
250 // tick marks
251 long nTicks=0;
252 long nMinorTicks=0;
253
254 if(m_aCB_MinorInner.IsChecked())
255 nMinorTicks|=CHAXIS_MARK_INNER;
256 if(m_aCB_MinorOuter.IsChecked())
257 nMinorTicks|=CHAXIS_MARK_OUTER;
258 if(m_aCB_TicksInner.IsChecked())
259 nTicks|=CHAXIS_MARK_INNER;
260 if(m_aCB_TicksOuter.IsChecked())
261 nTicks|=CHAXIS_MARK_OUTER;
262
263 rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_TICKS,nTicks));
264 rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_HELPTICKS,nMinorTicks));
265
266 sal_uInt16 nMarkPos = m_aLB_PlaceTicks.GetSelectEntryPos();
267 if( nMarkPos != LISTBOX_ENTRY_NOTFOUND )
268 rOutAttrs.Put( SfxInt32Item( SCHATTR_AXIS_MARK_POSITION, nMarkPos ));
269
270 return sal_True;
271 }
272
Reset(const SfxItemSet & rInAttrs)273 void AxisPositionsTabPage::Reset(const SfxItemSet& rInAttrs)
274 {
275 //init and enable controls
276 m_aED_CrossesAt.Show( !m_bCrossingAxisIsCategoryAxis );
277 m_aED_CrossesAtCategory.Show( m_bCrossingAxisIsCategoryAxis );
278 const sal_Int32 nMaxCount = LISTBOX_ENTRY_NOTFOUND;
279 if( m_bCrossingAxisIsCategoryAxis )
280 {
281 for( sal_Int32 nN=0; nN<m_aCategories.getLength() && nN<nMaxCount; nN++ )
282 m_aED_CrossesAtCategory.InsertEntry( m_aCategories[nN] );
283
284 sal_uInt16 nCount = m_aED_CrossesAtCategory.GetEntryCount();
285 if( nCount>30 )
286 nCount=30;
287 m_aED_CrossesAtCategory.SetDropDownLineCount( nCount );
288 }
289
290 if( m_aLB_CrossesAt.GetEntryCount() > 3 )
291 {
292 if( m_bCrossingAxisIsCategoryAxis )
293 m_aLB_CrossesAt.RemoveEntry(2);
294 else
295 m_aLB_CrossesAt.RemoveEntry(3);
296 }
297
298 //fill controls
299 const SfxPoolItem *pPoolItem = NULL;
300
301 //axis line
302 if(rInAttrs.GetItemState(SCHATTR_AXIS_POSITION,sal_True, &pPoolItem)== SFX_ITEM_SET)
303 {
304 bool bZero = false;
305 sal_uInt16 nPos = (sal_uInt16)static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
306 if(nPos==0)
307 {
308 //switch to value
309 bZero = true;
310 nPos = 2;
311 }
312 else
313 nPos--;
314
315 if( nPos < m_aLB_CrossesAt.GetEntryCount() )
316 m_aLB_CrossesAt.SelectEntryPos( nPos );
317 CrossesAtSelectHdl( (void*)0 );
318
319 if( rInAttrs.GetItemState(SCHATTR_AXIS_POSITION_VALUE,sal_True, &pPoolItem)== SFX_ITEM_SET || bZero )
320 {
321 double fCrossover = 0.0;
322 if( !bZero )
323 fCrossover = (((const SvxDoubleItem*)pPoolItem)->GetValue());
324 if( m_bCrossingAxisIsCategoryAxis )
325 m_aED_CrossesAtCategory.SelectEntryPos( static_cast<sal_uInt16>(::rtl::math::round(fCrossover-1.0)) );
326 else
327 m_aED_CrossesAt.SetValue(fCrossover);
328 }
329 else
330 {
331 m_aED_CrossesAtCategory.SetNoSelection();
332 m_aED_CrossesAt.SetTextValue(XubString());
333 }
334 }
335 else
336 {
337 m_aLB_CrossesAt.SetNoSelection();
338 m_aED_CrossesAt.Enable( sal_False );
339 }
340
341 // Labels
342 if( rInAttrs.GetItemState( SCHATTR_AXIS_LABEL_POSITION, sal_False, &pPoolItem ) == SFX_ITEM_SET )
343 {
344 sal_uInt16 nPos = (sal_uInt16)static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
345 if( nPos < m_aLB_PlaceLabels.GetEntryCount() )
346 m_aLB_PlaceLabels.SelectEntryPos( nPos );
347 }
348 else
349 m_aLB_PlaceLabels.SetNoSelection();
350 PlaceLabelsSelectHdl( (void*)0 );
351
352 // Tick marks
353 long nTicks=0,nMinorTicks=0;
354 if(rInAttrs.GetItemState(SCHATTR_AXIS_TICKS,sal_True, &pPoolItem)== SFX_ITEM_SET)
355 nTicks=((const SfxInt32Item*)pPoolItem)->GetValue();
356 if(rInAttrs.GetItemState(SCHATTR_AXIS_HELPTICKS,sal_True, &pPoolItem)== SFX_ITEM_SET)
357 nMinorTicks=((const SfxInt32Item*)pPoolItem)->GetValue();
358
359 m_aCB_TicksInner.Check(sal_Bool(nTicks&CHAXIS_MARK_INNER));
360 m_aCB_TicksOuter.Check(sal_Bool(nTicks&CHAXIS_MARK_OUTER));
361 m_aCB_MinorInner.Check(sal_Bool(nMinorTicks&CHAXIS_MARK_INNER));
362 m_aCB_MinorOuter.Check(sal_Bool(nMinorTicks&CHAXIS_MARK_OUTER));
363
364 // Tick position
365 if( rInAttrs.GetItemState( SCHATTR_AXIS_MARK_POSITION, sal_False, &pPoolItem ) == SFX_ITEM_SET )
366 {
367 sal_uInt16 nPos = (sal_uInt16)static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
368 if( nPos < m_aLB_PlaceTicks.GetEntryCount() )
369 m_aLB_PlaceTicks.SelectEntryPos( nPos );
370 }
371 else
372 m_aLB_PlaceTicks.SetNoSelection();
373
374
375 if( !m_bSupportAxisPositioning )
376 {
377 m_aFL_AxisLine.Show(false);
378 m_aFT_CrossesAt.Show(false);
379 m_aLB_CrossesAt.Show(false);
380 m_aED_CrossesAt.Show(false);
381 m_aED_CrossesAtCategory.Show(false);
382 m_aCB_AxisBetweenCategories.Show(false);
383
384 m_aFL_Labels.Show(false);
385 m_aFT_PlaceLabels.Show(false);
386 m_aLB_PlaceLabels.Show(false);
387 m_aFT_LabelDistance.Show(false);
388 m_aED_LabelDistance.Show(false);
389
390 m_aFL_Vertical.Show(false);
391 m_aFT_PlaceTicks.Show(false);
392 m_aLB_PlaceTicks.Show(false);
393
394 long nYDiff = m_aFL_AxisLine.GetPosPixel().Y() - m_aFL_Ticks.GetPosPixel().Y();
395 lcl_shiftY( m_aFL_Ticks, nYDiff );
396 lcl_shiftY( m_aFT_Major, nYDiff );
397 lcl_shiftY( m_aCB_TicksInner, nYDiff );
398 lcl_shiftY( m_aCB_TicksOuter, nYDiff );
399
400 lcl_shiftY( m_aFT_Minor, nYDiff );
401 lcl_shiftY( m_aCB_MinorInner, nYDiff );
402 lcl_shiftY( m_aCB_MinorOuter, nYDiff );
403 }
404 else if( !AxisHelper::isAxisPositioningEnabled() )
405 {
406 m_aFL_AxisLine.Enable(false);
407 m_aFT_CrossesAt.Enable(false);
408 m_aLB_CrossesAt.Enable(false);
409 m_aED_CrossesAt.Enable(false);
410 m_aED_CrossesAtCategory.Enable(false);
411 m_aCB_AxisBetweenCategories.Enable(false);
412
413 m_aFL_Labels.Enable(false);
414 m_aFT_PlaceLabels.Enable(false);
415 m_aLB_PlaceLabels.Enable(false);
416 m_aFT_LabelDistance.Enable(false);
417 m_aED_LabelDistance.Enable(false);
418
419 m_aFL_Vertical.Enable(false);
420 m_aFT_PlaceTicks.Enable(false);
421 m_aLB_PlaceTicks.Enable(false);
422
423 //todo: maybe set a special help id to all those controls
424 }
425 }
426
DeactivatePage(SfxItemSet * pItemSet)427 int AxisPositionsTabPage::DeactivatePage(SfxItemSet* pItemSet)
428 {
429 if( pItemSet )
430 FillItemSet( *pItemSet );
431
432 return LEAVE_PAGE;
433 }
434
SetNumFormatter(SvNumberFormatter * pFormatter)435 void AxisPositionsTabPage::SetNumFormatter( SvNumberFormatter* pFormatter )
436 {
437 m_pNumFormatter = pFormatter;
438 m_aED_CrossesAt.SetFormatter( m_pNumFormatter );
439 m_aED_CrossesAt.UseInputStringForFormatting();
440
441 const SfxPoolItem *pPoolItem = NULL;
442 if( GetItemSet().GetItemState( SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT, sal_True, &pPoolItem ) == SFX_ITEM_SET )
443 {
444 sal_uLong nFmt = (sal_uLong)((const SfxInt32Item*)pPoolItem)->GetValue();
445 m_aED_CrossesAt.SetFormatKey( nFmt );
446 }
447 }
448
SetCrossingAxisIsCategoryAxis(bool bCrossingAxisIsCategoryAxis)449 void AxisPositionsTabPage::SetCrossingAxisIsCategoryAxis( bool bCrossingAxisIsCategoryAxis )
450 {
451 m_bCrossingAxisIsCategoryAxis = bCrossingAxisIsCategoryAxis;
452 }
453
SetCategories(const::com::sun::star::uno::Sequence<rtl::OUString> & rCategories)454 void AxisPositionsTabPage::SetCategories( const ::com::sun::star::uno::Sequence< rtl::OUString >& rCategories )
455 {
456 m_aCategories = rCategories;
457 }
458
SupportAxisPositioning(bool bSupportAxisPositioning)459 void AxisPositionsTabPage::SupportAxisPositioning( bool bSupportAxisPositioning )
460 {
461 m_bSupportAxisPositioning = bSupportAxisPositioning;
462 }
463
IMPL_LINK(AxisPositionsTabPage,CrossesAtSelectHdl,void *,EMPTYARG)464 IMPL_LINK ( AxisPositionsTabPage, CrossesAtSelectHdl, void *, EMPTYARG )
465 {
466 sal_uInt16 nPos = m_aLB_CrossesAt.GetSelectEntryPos();
467 m_aED_CrossesAt.Show( (2==nPos) && !m_bCrossingAxisIsCategoryAxis );
468 m_aED_CrossesAtCategory.Show( (2==nPos) && m_bCrossingAxisIsCategoryAxis );
469
470 if(! m_aED_CrossesAt.GetText().Len() )
471 m_aED_CrossesAt.SetValue(0.0);
472 if( 0 == m_aED_CrossesAtCategory.GetSelectEntryCount() )
473 m_aED_CrossesAtCategory.SelectEntryPos(0);
474
475 PlaceLabelsSelectHdl( (void*)0 );
476 return 0;
477 }
478
IMPL_LINK(AxisPositionsTabPage,PlaceLabelsSelectHdl,void *,EMPTYARG)479 IMPL_LINK ( AxisPositionsTabPage, PlaceLabelsSelectHdl, void *, EMPTYARG )
480 {
481 sal_uInt16 nLabelPos = m_aLB_PlaceLabels.GetSelectEntryPos();
482
483 bool bEnableTickmarkPlacement = (nLabelPos>1);
484 if( bEnableTickmarkPlacement )
485 {
486 sal_uInt16 nAxisPos = m_aLB_CrossesAt.GetSelectEntryPos();
487 if( nLabelPos-2 == nAxisPos )
488 bEnableTickmarkPlacement=false;
489 }
490 m_aFT_PlaceTicks.Enable(bEnableTickmarkPlacement);
491 m_aLB_PlaceTicks.Enable(bEnableTickmarkPlacement);
492
493 return 0;
494 }
495
496 //.............................................................................
497 } //namespace chart
498 //.............................................................................
499