Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #include "tbzoomsliderctrl.hxx"
20 : #include <vcl/image.hxx>
21 : #include <vcl/toolbox.hxx>
22 : #include <vcl/virdev.hxx>
23 : #include <vcl/svapp.hxx>
24 : #include <vcl/gradient.hxx>
25 : #include <svl/itemset.hxx>
26 : #include <sfx2/viewfrm.hxx>
27 : #include <sfx2/objsh.hxx>
28 : #include <svx/zoomslideritem.hxx>
29 : #include <svx/dialmgr.hxx>
30 : #include <svx/dialogs.hrc>
31 : #include <set>
32 : #include "docsh.hxx"
33 : #include "stlpool.hxx"
34 : #include "scitems.hxx"
35 : #include "printfun.hxx"
36 :
37 : //========================================================================
38 : // class ScZoomSliderControl ---------------------------------------
39 : //========================================================================
40 :
41 : // -----------------------------------------------------------------------
42 :
43 39 : SFX_IMPL_TOOLBOX_CONTROL( ScZoomSliderControl, SvxZoomSliderItem );
44 :
45 : // -----------------------------------------------------------------------
46 :
47 8 : ScZoomSliderControl::ScZoomSliderControl(
48 : sal_uInt16 nSlotId,
49 : sal_uInt16 nId,
50 : ToolBox& rTbx )
51 8 : :SfxToolBoxControl( nSlotId, nId, rTbx )
52 : {
53 8 : rTbx.Invalidate();
54 8 : }
55 :
56 : // -----------------------------------------------------------------------
57 :
58 16 : ScZoomSliderControl::~ScZoomSliderControl()
59 : {
60 :
61 16 : }
62 :
63 : // -----------------------------------------------------------------------
64 :
65 14 : void ScZoomSliderControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState,
66 : const SfxPoolItem* pState )
67 : {
68 14 : sal_uInt16 nId = GetId();
69 14 : ToolBox& rTbx = GetToolBox();
70 14 : ScZoomSliderWnd* pBox = (ScZoomSliderWnd*)(rTbx.GetItemWindow( nId ));
71 : OSL_ENSURE( pBox ,"Control not found!" );
72 :
73 14 : if ( SFX_ITEM_AVAILABLE != eState || pState->ISA( SfxVoidItem ) )
74 : {
75 0 : SvxZoomSliderItem aZoomSliderItem( 100 );
76 0 : pBox->Disable();
77 0 : pBox->UpdateFromItem( &aZoomSliderItem );
78 : }
79 : else
80 : {
81 14 : pBox->Enable();
82 : OSL_ENSURE( pState->ISA( SvxZoomSliderItem ), "invalid item type" );
83 14 : const SvxZoomSliderItem* pZoomSliderItem = dynamic_cast< const SvxZoomSliderItem* >( pState );
84 :
85 : OSL_ENSURE( pZoomSliderItem, "Sc::ScZoomSliderControl::StateChanged(), wrong item type!" );
86 14 : if( pZoomSliderItem )
87 14 : pBox->UpdateFromItem( pZoomSliderItem );
88 : }
89 14 : }
90 :
91 : // -----------------------------------------------------------------------
92 :
93 8 : Window* ScZoomSliderControl::CreateItemWindow( Window *pParent )
94 : {
95 : // #i98000# Don't try to get a value via SfxViewFrame::Current here.
96 : // The view's value is always notified via StateChanged later.
97 : ScZoomSliderWnd* pSlider = new ScZoomSliderWnd( pParent,
98 8 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >( m_xFrame->getController(),
99 8 : ::com::sun::star::uno::UNO_QUERY ), m_xFrame, 100 );
100 8 : return pSlider;
101 : }
102 :
103 : // -----------------------------------------------------------------------
104 :
105 8 : struct ScZoomSliderWnd::ScZoomSliderWnd_Impl
106 : {
107 : sal_uInt16 mnCurrentZoom;
108 : sal_uInt16 mnMinZoom;
109 : sal_uInt16 mnMaxZoom;
110 : sal_uInt16 mnSliderCenter;
111 : std::vector< long > maSnappingPointOffsets;
112 : std::vector< sal_uInt16 > maSnappingPointZooms;
113 : Image maSliderButton;
114 : Image maIncreaseButton;
115 : Image maDecreaseButton;
116 : bool mbValuesSet;
117 : bool mbOmitPaint;
118 :
119 8 : ScZoomSliderWnd_Impl( sal_uInt16 nCurrentZoom ) :
120 : mnCurrentZoom( nCurrentZoom ),
121 : mnMinZoom( 10 ),
122 : mnMaxZoom( 400 ),
123 : mnSliderCenter( 100 ),
124 : maSnappingPointOffsets(),
125 : maSnappingPointZooms(),
126 : maSliderButton(),
127 : maIncreaseButton(),
128 : maDecreaseButton(),
129 : mbValuesSet( true ),
130 8 : mbOmitPaint( false )
131 : {
132 :
133 8 : }
134 : };
135 :
136 : // -----------------------------------------------------------------------
137 :
138 : const long nButtonWidth = 10;
139 : const long nButtonHeight = 10;
140 : const long nIncDecWidth = 11;
141 : const long nIncDecHeight = 11;
142 : const long nSliderHeight = 2; //
143 : const long nSliderWidth = 4; //
144 : const long nSnappingHeight = 4;
145 : const long nSliderXOffset = 20;
146 : const long nSnappingEpsilon = 5; // snapping epsilon in pixels
147 : const long nSnappingPointsMinDist = nSnappingEpsilon; // minimum distance of two adjacent snapping points
148 :
149 :
150 : // -----------------------------------------------------------------------
151 :
152 0 : sal_uInt16 ScZoomSliderWnd::Offset2Zoom( long nOffset ) const
153 : {
154 0 : Size aSliderWindowSize = GetOutputSizePixel();
155 0 : const long nControlWidth = aSliderWindowSize.Width();
156 0 : sal_uInt16 nRet = 0;
157 :
158 0 : if( nOffset < nSliderXOffset )
159 0 : return mpImpl->mnMinZoom;
160 0 : if( nOffset > nControlWidth - nSliderXOffset )
161 0 : return mpImpl->mnMaxZoom;
162 :
163 : // check for snapping points:
164 0 : sal_uInt16 nCount = 0;
165 0 : std::vector< long >::iterator aSnappingPointIter;
166 0 : for ( aSnappingPointIter = mpImpl->maSnappingPointOffsets.begin();
167 0 : aSnappingPointIter != mpImpl->maSnappingPointOffsets.end();
168 : ++aSnappingPointIter )
169 : {
170 0 : const long nCurrent = *aSnappingPointIter;
171 0 : if ( std::abs(nCurrent - nOffset) < nSnappingEpsilon )
172 : {
173 0 : nOffset = nCurrent;
174 0 : nRet = mpImpl->maSnappingPointZooms[ nCount ];
175 0 : break;
176 : }
177 0 : ++nCount;
178 : }
179 :
180 0 : if( 0 == nRet )
181 : {
182 0 : if( nOffset < nControlWidth / 2 )
183 : {
184 : // first half of slider
185 0 : const long nFirstHalfRange = mpImpl->mnSliderCenter - mpImpl->mnMinZoom;
186 0 : const long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset;
187 0 : const long nZoomPerSliderPixel = (1000 * nFirstHalfRange) / nHalfSliderWidth;
188 0 : const long nOffsetToSliderLeft = nOffset - nSliderXOffset;
189 0 : nRet = mpImpl->mnMinZoom + sal_uInt16( nOffsetToSliderLeft * nZoomPerSliderPixel / 1000 );
190 : }
191 : else
192 : {
193 : // second half of slider
194 0 : const long nSecondHalfRange = mpImpl->mnMaxZoom - mpImpl->mnSliderCenter;
195 0 : const long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset;
196 0 : const long nZoomPerSliderPixel = 1000 * nSecondHalfRange / nHalfSliderWidth;
197 0 : const long nOffsetToSliderCenter = nOffset - nControlWidth/2;
198 0 : nRet = mpImpl->mnSliderCenter + sal_uInt16( nOffsetToSliderCenter * nZoomPerSliderPixel / 1000 );
199 : }
200 : }
201 :
202 0 : if( nRet < mpImpl->mnMinZoom )
203 0 : return mpImpl->mnMinZoom;
204 :
205 0 : else if( nRet > mpImpl->mnMaxZoom )
206 0 : return mpImpl->mnMaxZoom;
207 :
208 0 : return nRet;
209 : }
210 :
211 : // -----------------------------------------------------------------------
212 :
213 36 : long ScZoomSliderWnd::Zoom2Offset( sal_uInt16 nCurrentZoom ) const
214 : {
215 36 : Size aSliderWindowSize = GetOutputSizePixel();
216 36 : const long nControlWidth = aSliderWindowSize.Width();
217 36 : long nRect = nSliderXOffset;
218 :
219 36 : const long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset;
220 36 : if( nCurrentZoom <= mpImpl->mnSliderCenter )
221 : {
222 36 : nCurrentZoom = nCurrentZoom - mpImpl->mnMinZoom;
223 36 : const long nFirstHalfRange = mpImpl->mnSliderCenter - mpImpl->mnMinZoom;
224 36 : const long nSliderPixelPerZoomPercent = 1000 * nHalfSliderWidth / nFirstHalfRange;
225 36 : const long nOffset = (nSliderPixelPerZoomPercent * nCurrentZoom) / 1000;
226 36 : nRect += nOffset;
227 : }
228 : else
229 : {
230 0 : nCurrentZoom = nCurrentZoom - mpImpl->mnSliderCenter;
231 0 : const long nSecondHalfRange = mpImpl->mnMaxZoom - mpImpl->mnSliderCenter;
232 0 : const long nSliderPixelPerZoomPercent = 1000 * nHalfSliderWidth / nSecondHalfRange;
233 0 : const long nOffset = (nSliderPixelPerZoomPercent * nCurrentZoom) / 1000;
234 0 : nRect += nHalfSliderWidth + nOffset;
235 : }
236 36 : return nRect;
237 : }
238 :
239 : // -----------------------------------------------------------------------
240 :
241 :
242 8 : ScZoomSliderWnd::ScZoomSliderWnd( Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider,
243 : const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame , sal_uInt16 nCurrentZoom ):
244 : Window( pParent ),
245 8 : mpImpl( new ScZoomSliderWnd_Impl( nCurrentZoom ) ),
246 : aLogicalSize( 115, 40 ),
247 : m_xDispatchProvider( rDispatchProvider ),
248 16 : m_xFrame( _xFrame )
249 : {
250 8 : mpImpl->maSliderButton = Image( SVX_RES( RID_SVXBMP_SLIDERBUTTON ) );
251 8 : mpImpl->maIncreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERINCREASE ) );
252 8 : mpImpl->maDecreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERDECREASE ) );
253 8 : Size aSliderSize = LogicToPixel( Size( aLogicalSize), MapMode( MAP_10TH_MM ) );
254 8 : SetSizePixel( Size( aSliderSize.Width() * nSliderWidth-1, aSliderSize.Height() + nSliderHeight ) );
255 8 : }
256 :
257 : // -----------------------------------------------------------------------
258 :
259 24 : ScZoomSliderWnd::~ScZoomSliderWnd()
260 : {
261 8 : delete mpImpl;
262 16 : }
263 :
264 : // -----------------------------------------------------------------------
265 :
266 0 : void ScZoomSliderWnd::MouseButtonDown( const MouseEvent& rMEvt )
267 : {
268 0 : if ( !mpImpl->mbValuesSet )
269 0 : return ;
270 0 : Size aSliderWindowSize = GetOutputSizePixel();
271 :
272 0 : const Point aPoint = rMEvt.GetPosPixel();
273 :
274 0 : const long nButtonLeftOffset = ( nSliderXOffset - nIncDecWidth )/2;
275 0 : const long nButtonRightOffset = ( nSliderXOffset + nIncDecWidth )/2;
276 :
277 0 : const long nOldZoom = mpImpl->mnCurrentZoom;
278 :
279 : // click to - button
280 0 : if ( aPoint.X() >= nButtonLeftOffset && aPoint.X() <= nButtonRightOffset )
281 : {
282 0 : mpImpl->mnCurrentZoom = mpImpl->mnCurrentZoom - 5;
283 : }
284 : // click to + button
285 0 : else if ( aPoint.X() >= aSliderWindowSize.Width() - nSliderXOffset + nButtonLeftOffset &&
286 0 : aPoint.X() <= aSliderWindowSize.Width() - nSliderXOffset + nButtonRightOffset )
287 : {
288 0 : mpImpl->mnCurrentZoom = mpImpl->mnCurrentZoom + 5;
289 : }
290 0 : else if( aPoint.X() >= nSliderXOffset && aPoint.X() <= aSliderWindowSize.Width() - nSliderXOffset )
291 : {
292 0 : mpImpl->mnCurrentZoom = Offset2Zoom( aPoint.X() );
293 : }
294 :
295 0 : if( mpImpl->mnCurrentZoom < mpImpl->mnMinZoom )
296 0 : mpImpl->mnCurrentZoom = mpImpl->mnMinZoom;
297 0 : else if( mpImpl->mnCurrentZoom > mpImpl->mnMaxZoom )
298 0 : mpImpl->mnCurrentZoom = mpImpl->mnMaxZoom;
299 :
300 0 : if( nOldZoom == mpImpl->mnCurrentZoom )
301 0 : return ;
302 :
303 0 : Rectangle aRect( Point( 0, 0 ), aSliderWindowSize );
304 :
305 0 : Paint( aRect );
306 0 : mpImpl->mbOmitPaint = true;
307 :
308 0 : SvxZoomSliderItem aZoomSliderItem( mpImpl->mnCurrentZoom );
309 :
310 0 : ::com::sun::star::uno::Any a;
311 0 : aZoomSliderItem.QueryValue( a );
312 :
313 0 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 );
314 0 : aArgs[0].Name = OUString( "ScalingFactor" );
315 0 : aArgs[0].Value = a;
316 :
317 0 : SfxToolBoxControl::Dispatch( m_xDispatchProvider, OUString(".uno:ScalingFactor"), aArgs );
318 :
319 0 : mpImpl->mbOmitPaint = false;
320 : }
321 :
322 : // -----------------------------------------------------------------------
323 :
324 0 : void ScZoomSliderWnd::MouseMove( const MouseEvent& rMEvt )
325 : {
326 0 : if ( !mpImpl->mbValuesSet )
327 0 : return ;
328 :
329 0 : Size aSliderWindowSize = GetOutputSizePixel();
330 0 : const long nControlWidth = aSliderWindowSize.Width();
331 0 : const short nButtons = rMEvt.GetButtons();
332 :
333 : // check mouse move with button pressed
334 0 : if ( 1 == nButtons )
335 : {
336 0 : const Point aPoint = rMEvt.GetPosPixel();
337 :
338 0 : if ( aPoint.X() >= nSliderXOffset && aPoint.X() <= nControlWidth - nSliderXOffset )
339 : {
340 0 : mpImpl->mnCurrentZoom = Offset2Zoom( aPoint.X() );
341 :
342 0 : Rectangle aRect( Point( 0, 0 ), aSliderWindowSize );
343 0 : Paint( aRect );
344 :
345 0 : mpImpl->mbOmitPaint = true; // optimization: paint before executing command,
346 :
347 : // commit state change
348 0 : SvxZoomSliderItem aZoomSliderItem( mpImpl->mnCurrentZoom );
349 :
350 0 : ::com::sun::star::uno::Any a;
351 0 : aZoomSliderItem.QueryValue( a );
352 :
353 0 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 );
354 0 : aArgs[0].Name = OUString( "ScalingFactor" );
355 0 : aArgs[0].Value = a;
356 :
357 0 : SfxToolBoxControl::Dispatch( m_xDispatchProvider, OUString(".uno:ScalingFactor"), aArgs );
358 :
359 0 : mpImpl->mbOmitPaint = false;
360 : }
361 : }
362 : }
363 :
364 : // -----------------------------------------------------------------------
365 :
366 14 : void ScZoomSliderWnd::UpdateFromItem( const SvxZoomSliderItem* pZoomSliderItem )
367 : {
368 14 : if( pZoomSliderItem )
369 : {
370 14 : mpImpl->mnCurrentZoom = pZoomSliderItem->GetValue();
371 14 : mpImpl->mnMinZoom = pZoomSliderItem->GetMinZoom();
372 14 : mpImpl->mnMaxZoom = pZoomSliderItem->GetMaxZoom();
373 :
374 : OSL_ENSURE( mpImpl->mnMinZoom <= mpImpl->mnCurrentZoom &&
375 : mpImpl->mnMinZoom < mpImpl->mnSliderCenter &&
376 : mpImpl->mnMaxZoom >= mpImpl->mnCurrentZoom &&
377 : mpImpl->mnMaxZoom > mpImpl->mnSliderCenter,
378 : "Looks like the zoom slider item is corrupted" );
379 14 : const com::sun::star::uno::Sequence < sal_Int32 > rSnappingPoints = pZoomSliderItem->GetSnappingPoints();
380 14 : mpImpl->maSnappingPointOffsets.clear();
381 14 : mpImpl->maSnappingPointZooms.clear();
382 :
383 : // get all snapping points:
384 28 : std::set< sal_uInt16 > aTmpSnappingPoints;
385 28 : for ( sal_uInt16 j = 0; j < rSnappingPoints.getLength(); ++j )
386 : {
387 14 : const sal_Int32 nSnappingPoint = rSnappingPoints[j];
388 14 : aTmpSnappingPoints.insert( (sal_uInt16)nSnappingPoint );
389 : }
390 :
391 : // remove snapping points that are to close to each other:
392 14 : std::set< sal_uInt16 >::iterator aSnappingPointIter;
393 14 : long nLastOffset = 0;
394 :
395 28 : for ( aSnappingPointIter = aTmpSnappingPoints.begin(); aSnappingPointIter != aTmpSnappingPoints.end(); ++aSnappingPointIter )
396 : {
397 14 : const sal_uInt16 nCurrent = *aSnappingPointIter;
398 14 : const long nCurrentOffset = Zoom2Offset( nCurrent );
399 :
400 14 : if ( nCurrentOffset - nLastOffset >= nSnappingPointsMinDist )
401 : {
402 14 : mpImpl->maSnappingPointOffsets.push_back( nCurrentOffset );
403 14 : mpImpl->maSnappingPointZooms.push_back( nCurrent );
404 14 : nLastOffset = nCurrentOffset;
405 : }
406 14 : }
407 : }
408 :
409 14 : Size aSliderWindowSize = GetOutputSizePixel();
410 14 : Rectangle aRect( Point( 0, 0 ), aSliderWindowSize );
411 :
412 14 : if ( !mpImpl->mbOmitPaint )
413 14 : Paint(aRect);
414 14 : }
415 :
416 : // -----------------------------------------------------------------------
417 :
418 22 : void ScZoomSliderWnd::Paint( const Rectangle& rRect )
419 : {
420 22 : DoPaint( rRect );
421 22 : }
422 :
423 : // -----------------------------------------------------------------------
424 :
425 22 : void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ )
426 : {
427 22 : if( mpImpl->mbOmitPaint )
428 22 : return;
429 :
430 22 : Size aSliderWindowSize = GetOutputSizePixel();
431 22 : Rectangle aRect( Point( 0, 0 ), aSliderWindowSize );
432 :
433 22 : VirtualDevice* pVDev = new VirtualDevice( *this );
434 22 : pVDev->SetOutputSizePixel( aSliderWindowSize );
435 :
436 22 : Rectangle aSlider = aRect;
437 :
438 22 : aSlider.Top() += ( aSliderWindowSize.Height() - nSliderHeight )/2 - 1;
439 22 : aSlider.Bottom() = aSlider.Top() + nSliderHeight;
440 22 : aSlider.Left() += nSliderXOffset;
441 22 : aSlider.Right() -= nSliderXOffset;
442 :
443 22 : Rectangle aFirstLine( aSlider );
444 22 : aFirstLine.Bottom() = aFirstLine.Top();
445 :
446 22 : Rectangle aSecondLine( aSlider );
447 22 : aSecondLine.Top() = aSecondLine.Bottom();
448 :
449 22 : Rectangle aLeft( aSlider );
450 22 : aLeft.Right() = aLeft.Left();
451 :
452 22 : Rectangle aRight( aSlider );
453 22 : aRight.Left() = aRight.Right();
454 :
455 : // draw VirtualDevice's background color
456 22 : Color aStartColor,aEndColor;
457 22 : aStartColor = GetSettings().GetStyleSettings().GetFaceColor();
458 22 : aEndColor = GetSettings().GetStyleSettings().GetFaceColor();
459 22 : if( aEndColor.IsDark() )
460 0 : aStartColor = aEndColor;
461 :
462 22 : Gradient g;
463 22 : g.SetAngle( 0 );
464 22 : g.SetStyle( GradientStyle_LINEAR );
465 :
466 22 : g.SetStartColor( aStartColor );
467 22 : g.SetEndColor( aEndColor );
468 22 : pVDev->DrawGradient( aRect, g );
469 :
470 : // draw slider
471 22 : pVDev->SetLineColor( Color ( COL_WHITE ) );
472 22 : pVDev->DrawRect( aSecondLine );
473 22 : pVDev->DrawRect( aRight );
474 :
475 22 : pVDev->SetLineColor( Color( COL_GRAY ) );
476 22 : pVDev->DrawRect( aFirstLine );
477 22 : pVDev->DrawRect( aLeft );
478 :
479 : // draw snapping points:
480 22 : std::vector< long >::iterator aSnappingPointIter;
481 108 : for ( aSnappingPointIter = mpImpl->maSnappingPointOffsets.begin();
482 72 : aSnappingPointIter != mpImpl->maSnappingPointOffsets.end();
483 : ++aSnappingPointIter )
484 : {
485 14 : pVDev->SetLineColor( Color( COL_GRAY ) );
486 14 : Rectangle aSnapping( aRect );
487 14 : aSnapping.Bottom() = aSlider.Top();
488 14 : aSnapping.Top() = aSnapping.Bottom() - nSnappingHeight;
489 14 : aSnapping.Left() += *aSnappingPointIter;
490 14 : aSnapping.Right() = aSnapping.Left();
491 14 : pVDev->DrawRect( aSnapping );
492 :
493 14 : aSnapping.Top() += nSnappingHeight + nSliderHeight;
494 14 : aSnapping.Bottom() += nSnappingHeight + nSliderHeight;
495 14 : pVDev->DrawRect( aSnapping );
496 : }
497 :
498 : // draw slider button
499 22 : Point aImagePoint = aRect.TopLeft();
500 22 : aImagePoint.X() += Zoom2Offset( mpImpl->mnCurrentZoom );
501 22 : aImagePoint.X() -= nButtonWidth/2;
502 22 : aImagePoint.Y() += ( aSliderWindowSize.Height() - nButtonHeight)/2;
503 22 : pVDev->DrawImage( aImagePoint, mpImpl->maSliderButton );
504 :
505 : // draw decrease button
506 22 : aImagePoint = aRect.TopLeft();
507 22 : aImagePoint.X() += (nSliderXOffset - nIncDecWidth)/2;
508 22 : aImagePoint.Y() += ( aSliderWindowSize.Height() - nIncDecHeight)/2;
509 22 : pVDev->DrawImage( aImagePoint, mpImpl->maDecreaseButton );
510 :
511 : // draw increase button
512 22 : aImagePoint.X() = aRect.TopLeft().X() + aSliderWindowSize.Width() - nIncDecWidth - (nSliderXOffset - nIncDecWidth)/2;
513 22 : pVDev->DrawImage( aImagePoint, mpImpl->maIncreaseButton );
514 :
515 22 : DrawOutDev( Point(0, 0), aSliderWindowSize, Point(0, 0), aSliderWindowSize, *pVDev );
516 :
517 22 : delete pVDev;
518 :
519 93 : }
520 :
521 : // -----------------------------------------------------------------------
522 :
523 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|