tbzoomsliderctrl.cxx (b3f79822) | tbzoomsliderctrl.cxx (119fc5b5) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 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 | 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 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 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. | 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 * | 19 * |
20 *************************************************************/ 21 22 | 20 *************************************************************/ 21 22 |
23 |
|
23#include "precompiled_sc.hxx" 24#ifndef _SC_ZOOMSLIDERTBCONTRL_HXX 25#include "tbzoomsliderctrl.hxx" 26#endif 27#ifndef _SV_IMAGE_HXX 28#include <vcl/image.hxx> 29#endif 30#ifndef _SV_TOOLBOX_HXX --- 25 unchanged lines hidden (view full) --- 56 57SFX_IMPL_TOOLBOX_CONTROL( ScZoomSliderControl, SvxZoomSliderItem ); 58 59// ----------------------------------------------------------------------- 60 61ScZoomSliderControl::ScZoomSliderControl( 62 sal_uInt16 nSlotId, 63 sal_uInt16 nId, | 24#include "precompiled_sc.hxx" 25#ifndef _SC_ZOOMSLIDERTBCONTRL_HXX 26#include "tbzoomsliderctrl.hxx" 27#endif 28#ifndef _SV_IMAGE_HXX 29#include <vcl/image.hxx> 30#endif 31#ifndef _SV_TOOLBOX_HXX --- 25 unchanged lines hidden (view full) --- 57 58SFX_IMPL_TOOLBOX_CONTROL( ScZoomSliderControl, SvxZoomSliderItem ); 59 60// ----------------------------------------------------------------------- 61 62ScZoomSliderControl::ScZoomSliderControl( 63 sal_uInt16 nSlotId, 64 sal_uInt16 nId, |
64 ToolBox& rTbx ) | 65 ToolBox& rTbx ) |
65 :SfxToolBoxControl( nSlotId, nId, rTbx ) 66{ 67 rTbx.Invalidate(); 68} 69 70// ----------------------------------------------------------------------- 71 72__EXPORT ScZoomSliderControl::~ScZoomSliderControl() --- 30 unchanged lines hidden (view full) --- 103} 104 105// ----------------------------------------------------------------------- 106 107Window* ScZoomSliderControl::CreateItemWindow( Window *pParent ) 108{ 109 // #i98000# Don't try to get a value via SfxViewFrame::Current here. 110 // The view's value is always notified via StateChanged later. | 66 :SfxToolBoxControl( nSlotId, nId, rTbx ) 67{ 68 rTbx.Invalidate(); 69} 70 71// ----------------------------------------------------------------------- 72 73__EXPORT ScZoomSliderControl::~ScZoomSliderControl() --- 30 unchanged lines hidden (view full) --- 104} 105 106// ----------------------------------------------------------------------- 107 108Window* ScZoomSliderControl::CreateItemWindow( Window *pParent ) 109{ 110 // #i98000# Don't try to get a value via SfxViewFrame::Current here. 111 // The view's value is always notified via StateChanged later. |
111 ScZoomSliderWnd* pSlider = new ScZoomSliderWnd( pParent, | 112 ScZoomSliderWnd* pSlider = new ScZoomSliderWnd( pParent, |
112 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >( m_xFrame->getController(), 113 ::com::sun::star::uno::UNO_QUERY ), m_xFrame, 100 ); | 113 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >( m_xFrame->getController(), 114 ::com::sun::star::uno::UNO_QUERY ), m_xFrame, 100 ); |
114 return pSlider; | 115 return pSlider; |
115} 116 117// ----------------------------------------------------------------------- 118 119struct ScZoomSliderWnd::ScZoomSliderWnd_Impl 120{ 121 sal_uInt16 mnCurrentZoom; 122 sal_uInt16 mnMinZoom; --- 13 unchanged lines hidden (view full) --- 136 mnMaxZoom( 400 ), 137 mnSliderCenter( 100 ), 138 maSnappingPointOffsets(), 139 maSnappingPointZooms(), 140 maSliderButton(), 141 maIncreaseButton(), 142 maDecreaseButton(), 143 mbValuesSet( true ), | 116} 117 118// ----------------------------------------------------------------------- 119 120struct ScZoomSliderWnd::ScZoomSliderWnd_Impl 121{ 122 sal_uInt16 mnCurrentZoom; 123 sal_uInt16 mnMinZoom; --- 13 unchanged lines hidden (view full) --- 137 mnMaxZoom( 400 ), 138 mnSliderCenter( 100 ), 139 maSnappingPointOffsets(), 140 maSnappingPointZooms(), 141 maSliderButton(), 142 maIncreaseButton(), 143 maDecreaseButton(), 144 mbValuesSet( true ), |
144 mbOmitPaint( false ) | 145 mbOmitPaint( false ) |
145 { 146 147 } 148}; 149 150// ----------------------------------------------------------------------- 151 152const long nButtonWidth = 10; 153const long nButtonHeight = 10; 154const long nIncDecWidth = 11; 155const long nIncDecHeight = 11; | 146 { 147 148 } 149}; 150 151// ----------------------------------------------------------------------- 152 153const long nButtonWidth = 10; 154const long nButtonHeight = 10; 155const long nIncDecWidth = 11; 156const long nIncDecHeight = 11; |
156const long nSliderHeight = 2; // 157const long nSliderWidth = 4; // | 157const long nSliderHeight = 2; // 158const long nSliderWidth = 4; // |
158const long nSnappingHeight = 4; 159const long nSliderXOffset = 20; 160const long nSnappingEpsilon = 5; // snapping epsilon in pixels 161const long nSnappingPointsMinDist = nSnappingEpsilon; // minimum distance of two adjacent snapping points 162 163 164// ----------------------------------------------------------------------- 165 166sal_uInt16 ScZoomSliderWnd::Offset2Zoom( long nOffset ) const 167{ 168 Size aSliderWindowSize = GetOutputSizePixel(); 169 const long nControlWidth = aSliderWindowSize.Width(); 170 sal_uInt16 nRet = 0; | 159const long nSnappingHeight = 4; 160const long nSliderXOffset = 20; 161const long nSnappingEpsilon = 5; // snapping epsilon in pixels 162const long nSnappingPointsMinDist = nSnappingEpsilon; // minimum distance of two adjacent snapping points 163 164 165// ----------------------------------------------------------------------- 166 167sal_uInt16 ScZoomSliderWnd::Offset2Zoom( long nOffset ) const 168{ 169 Size aSliderWindowSize = GetOutputSizePixel(); 170 const long nControlWidth = aSliderWindowSize.Width(); 171 sal_uInt16 nRet = 0; |
171 | 172 |
172 if( nOffset < nSliderXOffset ) 173 return mpImpl->mnMinZoom; 174 if( nOffset > nControlWidth - nSliderXOffset ) 175 return mpImpl->mnMaxZoom; 176 177 // check for snapping points: 178 sal_uInt16 nCount = 0; 179 std::vector< long >::iterator aSnappingPointIter; --- 30 unchanged lines hidden (view full) --- 210 const long nZoomPerSliderPixel = 1000 * nSecondHalfRange / nHalfSliderWidth; 211 const long nOffsetToSliderCenter = nOffset - nControlWidth/2; 212 nRet = mpImpl->mnSliderCenter + sal_uInt16( nOffsetToSliderCenter * nZoomPerSliderPixel / 1000 ); 213 } 214 } 215 216 if( nRet < mpImpl->mnMinZoom ) 217 return mpImpl->mnMinZoom; | 173 if( nOffset < nSliderXOffset ) 174 return mpImpl->mnMinZoom; 175 if( nOffset > nControlWidth - nSliderXOffset ) 176 return mpImpl->mnMaxZoom; 177 178 // check for snapping points: 179 sal_uInt16 nCount = 0; 180 std::vector< long >::iterator aSnappingPointIter; --- 30 unchanged lines hidden (view full) --- 211 const long nZoomPerSliderPixel = 1000 * nSecondHalfRange / nHalfSliderWidth; 212 const long nOffsetToSliderCenter = nOffset - nControlWidth/2; 213 nRet = mpImpl->mnSliderCenter + sal_uInt16( nOffsetToSliderCenter * nZoomPerSliderPixel / 1000 ); 214 } 215 } 216 217 if( nRet < mpImpl->mnMinZoom ) 218 return mpImpl->mnMinZoom; |
218 | 219 |
219 else if( nRet > mpImpl->mnMaxZoom ) 220 return mpImpl->mnMaxZoom; 221 222 return nRet; 223} 224 225// ----------------------------------------------------------------------- 226 227long ScZoomSliderWnd::Zoom2Offset( sal_uInt16 nCurrentZoom ) const 228{ 229 Size aSliderWindowSize = GetOutputSizePixel(); 230 const long nControlWidth = aSliderWindowSize.Width(); 231 long nRect = nSliderXOffset; 232 233 const long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset; 234 if( nCurrentZoom <= mpImpl->mnSliderCenter ) 235 { 236 nCurrentZoom = nCurrentZoom - mpImpl->mnMinZoom; 237 const long nFirstHalfRange = mpImpl->mnSliderCenter - mpImpl->mnMinZoom; | 220 else if( nRet > mpImpl->mnMaxZoom ) 221 return mpImpl->mnMaxZoom; 222 223 return nRet; 224} 225 226// ----------------------------------------------------------------------- 227 228long ScZoomSliderWnd::Zoom2Offset( sal_uInt16 nCurrentZoom ) const 229{ 230 Size aSliderWindowSize = GetOutputSizePixel(); 231 const long nControlWidth = aSliderWindowSize.Width(); 232 long nRect = nSliderXOffset; 233 234 const long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset; 235 if( nCurrentZoom <= mpImpl->mnSliderCenter ) 236 { 237 nCurrentZoom = nCurrentZoom - mpImpl->mnMinZoom; 238 const long nFirstHalfRange = mpImpl->mnSliderCenter - mpImpl->mnMinZoom; |
238 const long nSliderPixelPerZoomPercent = 1000 * nHalfSliderWidth / nFirstHalfRange; | 239 const long nSliderPixelPerZoomPercent = 1000 * nHalfSliderWidth / nFirstHalfRange; |
239 const long nOffset = (nSliderPixelPerZoomPercent * nCurrentZoom) / 1000; 240 nRect += nOffset; 241 } 242 else 243 { 244 nCurrentZoom = nCurrentZoom - mpImpl->mnSliderCenter; 245 const long nSecondHalfRange = mpImpl->mnMaxZoom - mpImpl->mnSliderCenter; | 240 const long nOffset = (nSliderPixelPerZoomPercent * nCurrentZoom) / 1000; 241 nRect += nOffset; 242 } 243 else 244 { 245 nCurrentZoom = nCurrentZoom - mpImpl->mnSliderCenter; 246 const long nSecondHalfRange = mpImpl->mnMaxZoom - mpImpl->mnSliderCenter; |
246 const long nSliderPixelPerZoomPercent = 1000 * nHalfSliderWidth / nSecondHalfRange; | 247 const long nSliderPixelPerZoomPercent = 1000 * nHalfSliderWidth / nSecondHalfRange; |
247 const long nOffset = (nSliderPixelPerZoomPercent * nCurrentZoom) / 1000; 248 nRect += nHalfSliderWidth + nOffset; 249 } 250 return nRect; 251} 252 253// ----------------------------------------------------------------------- 254 --- 19 unchanged lines hidden (view full) --- 274ScZoomSliderWnd::~ScZoomSliderWnd() 275{ 276 delete mpImpl; 277} 278 279// ----------------------------------------------------------------------- 280 281void ScZoomSliderWnd::MouseButtonDown( const MouseEvent& rMEvt ) | 248 const long nOffset = (nSliderPixelPerZoomPercent * nCurrentZoom) / 1000; 249 nRect += nHalfSliderWidth + nOffset; 250 } 251 return nRect; 252} 253 254// ----------------------------------------------------------------------- 255 --- 19 unchanged lines hidden (view full) --- 275ScZoomSliderWnd::~ScZoomSliderWnd() 276{ 277 delete mpImpl; 278} 279 280// ----------------------------------------------------------------------- 281 282void ScZoomSliderWnd::MouseButtonDown( const MouseEvent& rMEvt ) |
282{ | 283{ |
283 if ( !mpImpl->mbValuesSet ) 284 return ; 285 Size aSliderWindowSize = GetOutputSizePixel(); 286 287 const Point aPoint = rMEvt.GetPosPixel(); 288 289 const long nButtonLeftOffset = ( nSliderXOffset - nIncDecWidth )/2; 290 const long nButtonRightOffset = ( nSliderXOffset + nIncDecWidth )/2; --- 20 unchanged lines hidden (view full) --- 311 mpImpl->mnCurrentZoom = mpImpl->mnMinZoom; 312 else if( mpImpl->mnCurrentZoom > mpImpl->mnMaxZoom ) 313 mpImpl->mnCurrentZoom = mpImpl->mnMaxZoom; 314 315 if( nOldZoom == mpImpl->mnCurrentZoom ) 316 return ; 317 318 Rectangle aRect( Point( 0, 0 ), aSliderWindowSize ); | 284 if ( !mpImpl->mbValuesSet ) 285 return ; 286 Size aSliderWindowSize = GetOutputSizePixel(); 287 288 const Point aPoint = rMEvt.GetPosPixel(); 289 290 const long nButtonLeftOffset = ( nSliderXOffset - nIncDecWidth )/2; 291 const long nButtonRightOffset = ( nSliderXOffset + nIncDecWidth )/2; --- 20 unchanged lines hidden (view full) --- 312 mpImpl->mnCurrentZoom = mpImpl->mnMinZoom; 313 else if( mpImpl->mnCurrentZoom > mpImpl->mnMaxZoom ) 314 mpImpl->mnCurrentZoom = mpImpl->mnMaxZoom; 315 316 if( nOldZoom == mpImpl->mnCurrentZoom ) 317 return ; 318 319 Rectangle aRect( Point( 0, 0 ), aSliderWindowSize ); |
319 | 320 |
320 Paint( aRect ); 321 mpImpl->mbOmitPaint = true; | 321 Paint( aRect ); 322 mpImpl->mbOmitPaint = true; |
322 | 323 |
323 SvxZoomSliderItem aZoomSliderItem( mpImpl->mnCurrentZoom ); 324 325 ::com::sun::star::uno::Any a; 326 aZoomSliderItem.QueryValue( a ); | 324 SvxZoomSliderItem aZoomSliderItem( mpImpl->mnCurrentZoom ); 325 326 ::com::sun::star::uno::Any a; 327 aZoomSliderItem.QueryValue( a ); |
327 | 328 |
328 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 ); 329 aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScalingFactor" )); 330 aArgs[0].Value = a; | 329 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 ); 330 aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScalingFactor" )); 331 aArgs[0].Value = a; |
331 | 332 |
332 SfxToolBoxControl::Dispatch( m_xDispatchProvider, String::CreateFromAscii(".uno:ScalingFactor"), aArgs ); 333 334 mpImpl->mbOmitPaint = false; 335} 336 337// ----------------------------------------------------------------------- 338 339void ScZoomSliderWnd::MouseMove( const MouseEvent& rMEvt ) --- 9 unchanged lines hidden (view full) --- 349 if ( 1 == nButtons ) 350 { 351 const Point aPoint = rMEvt.GetPosPixel(); 352 353 if ( aPoint.X() >= nSliderXOffset && aPoint.X() <= nControlWidth - nSliderXOffset ) 354 { 355 mpImpl->mnCurrentZoom = Offset2Zoom( aPoint.X() ); 356 | 333 SfxToolBoxControl::Dispatch( m_xDispatchProvider, String::CreateFromAscii(".uno:ScalingFactor"), aArgs ); 334 335 mpImpl->mbOmitPaint = false; 336} 337 338// ----------------------------------------------------------------------- 339 340void ScZoomSliderWnd::MouseMove( const MouseEvent& rMEvt ) --- 9 unchanged lines hidden (view full) --- 350 if ( 1 == nButtons ) 351 { 352 const Point aPoint = rMEvt.GetPosPixel(); 353 354 if ( aPoint.X() >= nSliderXOffset && aPoint.X() <= nControlWidth - nSliderXOffset ) 355 { 356 mpImpl->mnCurrentZoom = Offset2Zoom( aPoint.X() ); 357 |
357 Rectangle aRect( Point( 0, 0 ), aSliderWindowSize ); | 358 Rectangle aRect( Point( 0, 0 ), aSliderWindowSize ); |
358 Paint( aRect ); 359 360 mpImpl->mbOmitPaint = true; // optimization: paint before executing command, 361 362 // commit state change 363 SvxZoomSliderItem aZoomSliderItem( mpImpl->mnCurrentZoom ); 364 365 ::com::sun::star::uno::Any a; --- 16 unchanged lines hidden (view full) --- 382{ 383 if( pZoomSliderItem ) 384 { 385 mpImpl->mnCurrentZoom = pZoomSliderItem->GetValue(); 386 mpImpl->mnMinZoom = pZoomSliderItem->GetMinZoom(); 387 mpImpl->mnMaxZoom = pZoomSliderItem->GetMaxZoom(); 388 389 DBG_ASSERT( mpImpl->mnMinZoom <= mpImpl->mnCurrentZoom && | 359 Paint( aRect ); 360 361 mpImpl->mbOmitPaint = true; // optimization: paint before executing command, 362 363 // commit state change 364 SvxZoomSliderItem aZoomSliderItem( mpImpl->mnCurrentZoom ); 365 366 ::com::sun::star::uno::Any a; --- 16 unchanged lines hidden (view full) --- 383{ 384 if( pZoomSliderItem ) 385 { 386 mpImpl->mnCurrentZoom = pZoomSliderItem->GetValue(); 387 mpImpl->mnMinZoom = pZoomSliderItem->GetMinZoom(); 388 mpImpl->mnMaxZoom = pZoomSliderItem->GetMaxZoom(); 389 390 DBG_ASSERT( mpImpl->mnMinZoom <= mpImpl->mnCurrentZoom && |
390 mpImpl->mnMinZoom < mpImpl->mnSliderCenter && | 391 mpImpl->mnMinZoom < mpImpl->mnSliderCenter && |
391 mpImpl->mnMaxZoom >= mpImpl->mnCurrentZoom && 392 mpImpl->mnMaxZoom > mpImpl->mnSliderCenter, 393 "Looks like the zoom slider item is corrupted" ); 394 const com::sun::star::uno::Sequence < sal_Int32 > rSnappingPoints = pZoomSliderItem->GetSnappingPoints(); 395 mpImpl->maSnappingPointOffsets.clear(); 396 mpImpl->maSnappingPointZooms.clear(); 397 398 // get all snapping points: --- 19 unchanged lines hidden (view full) --- 418 mpImpl->maSnappingPointZooms.push_back( nCurrent ); 419 nLastOffset = nCurrentOffset; 420 } 421 } 422 } 423 424 Size aSliderWindowSize = GetOutputSizePixel(); 425 Rectangle aRect( Point( 0, 0 ), aSliderWindowSize ); | 392 mpImpl->mnMaxZoom >= mpImpl->mnCurrentZoom && 393 mpImpl->mnMaxZoom > mpImpl->mnSliderCenter, 394 "Looks like the zoom slider item is corrupted" ); 395 const com::sun::star::uno::Sequence < sal_Int32 > rSnappingPoints = pZoomSliderItem->GetSnappingPoints(); 396 mpImpl->maSnappingPointOffsets.clear(); 397 mpImpl->maSnappingPointZooms.clear(); 398 399 // get all snapping points: --- 19 unchanged lines hidden (view full) --- 419 mpImpl->maSnappingPointZooms.push_back( nCurrent ); 420 nLastOffset = nCurrentOffset; 421 } 422 } 423 } 424 425 Size aSliderWindowSize = GetOutputSizePixel(); 426 Rectangle aRect( Point( 0, 0 ), aSliderWindowSize ); |
426 | 427 |
427 if ( !mpImpl->mbOmitPaint ) 428 Paint(aRect); 429} 430 431// ----------------------------------------------------------------------- 432 433void ScZoomSliderWnd::Paint( const Rectangle& rRect ) 434{ --- 4 unchanged lines hidden (view full) --- 439 440void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ ) 441{ 442 if( mpImpl->mbOmitPaint ) 443 return; 444 445 Size aSliderWindowSize = GetOutputSizePixel(); 446 Rectangle aRect( Point( 0, 0 ), aSliderWindowSize ); | 428 if ( !mpImpl->mbOmitPaint ) 429 Paint(aRect); 430} 431 432// ----------------------------------------------------------------------- 433 434void ScZoomSliderWnd::Paint( const Rectangle& rRect ) 435{ --- 4 unchanged lines hidden (view full) --- 440 441void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ ) 442{ 443 if( mpImpl->mbOmitPaint ) 444 return; 445 446 Size aSliderWindowSize = GetOutputSizePixel(); 447 Rectangle aRect( Point( 0, 0 ), aSliderWindowSize ); |
447 | 448 |
448 VirtualDevice* pVDev = new VirtualDevice( *this ); 449 pVDev->SetOutputSizePixel( aSliderWindowSize ); 450 451 Rectangle aSlider = aRect; 452 453 aSlider.Top() += ( aSliderWindowSize.Height() - nSliderHeight )/2 - 1; 454 aSlider.Bottom() = aSlider.Top() + nSliderHeight; 455 aSlider.Left() += nSliderXOffset; --- 22 unchanged lines hidden (view full) --- 478 g.SetAngle( 0 ); 479 g.SetStyle( GRADIENT_LINEAR ); 480 481 g.SetStartColor( aStartColor ); 482 g.SetEndColor( aEndColor ); 483 pVDev->DrawGradient( aRect, g ); 484 485 // draw slider | 449 VirtualDevice* pVDev = new VirtualDevice( *this ); 450 pVDev->SetOutputSizePixel( aSliderWindowSize ); 451 452 Rectangle aSlider = aRect; 453 454 aSlider.Top() += ( aSliderWindowSize.Height() - nSliderHeight )/2 - 1; 455 aSlider.Bottom() = aSlider.Top() + nSliderHeight; 456 aSlider.Left() += nSliderXOffset; --- 22 unchanged lines hidden (view full) --- 479 g.SetAngle( 0 ); 480 g.SetStyle( GRADIENT_LINEAR ); 481 482 g.SetStartColor( aStartColor ); 483 g.SetEndColor( aEndColor ); 484 pVDev->DrawGradient( aRect, g ); 485 486 // draw slider |
486 pVDev->SetLineColor( Color ( COL_WHITE ) ); | 487 pVDev->SetLineColor( Color ( COL_GRAY ) ); |
487 pVDev->DrawRect( aSecondLine ); 488 pVDev->DrawRect( aRight ); 489 | 488 pVDev->DrawRect( aSecondLine ); 489 pVDev->DrawRect( aRight ); 490 |
490 pVDev->SetLineColor( Color( COL_GRAY ) ); | 491 pVDev->SetLineColor( Color ( COL_GRAY ) ); |
491 pVDev->DrawRect( aFirstLine ); 492 pVDev->DrawRect( aLeft ); 493 494 // draw snapping points: 495 std::vector< long >::iterator aSnappingPointIter; 496 for ( aSnappingPointIter = mpImpl->maSnappingPointOffsets.begin(); 497 aSnappingPointIter != mpImpl->maSnappingPointOffsets.end(); 498 ++aSnappingPointIter ) 499 { 500 pVDev->SetLineColor( Color( COL_GRAY ) ); 501 Rectangle aSnapping( aRect ); | 492 pVDev->DrawRect( aFirstLine ); 493 pVDev->DrawRect( aLeft ); 494 495 // draw snapping points: 496 std::vector< long >::iterator aSnappingPointIter; 497 for ( aSnappingPointIter = mpImpl->maSnappingPointOffsets.begin(); 498 aSnappingPointIter != mpImpl->maSnappingPointOffsets.end(); 499 ++aSnappingPointIter ) 500 { 501 pVDev->SetLineColor( Color( COL_GRAY ) ); 502 Rectangle aSnapping( aRect ); |
502 aSnapping.Bottom() = aSlider.Top(); | 503 aSnapping.Bottom() = aSlider.Top(); |
503 aSnapping.Top() = aSnapping.Bottom() - nSnappingHeight; 504 aSnapping.Left() += *aSnappingPointIter; 505 aSnapping.Right() = aSnapping.Left(); 506 pVDev->DrawRect( aSnapping ); 507 508 aSnapping.Top() += nSnappingHeight + nSliderHeight; 509 aSnapping.Bottom() += nSnappingHeight + nSliderHeight; 510 pVDev->DrawRect( aSnapping ); --- 10 unchanged lines hidden (view full) --- 521 aImagePoint = aRect.TopLeft(); 522 aImagePoint.X() += (nSliderXOffset - nIncDecWidth)/2; 523 aImagePoint.Y() += ( aSliderWindowSize.Height() - nIncDecHeight)/2; 524 pVDev->DrawImage( aImagePoint, mpImpl->maDecreaseButton ); 525 526 // draw increase button 527 aImagePoint.X() = aRect.TopLeft().X() + aSliderWindowSize.Width() - nIncDecWidth - (nSliderXOffset - nIncDecWidth)/2; 528 pVDev->DrawImage( aImagePoint, mpImpl->maIncreaseButton ); | 504 aSnapping.Top() = aSnapping.Bottom() - nSnappingHeight; 505 aSnapping.Left() += *aSnappingPointIter; 506 aSnapping.Right() = aSnapping.Left(); 507 pVDev->DrawRect( aSnapping ); 508 509 aSnapping.Top() += nSnappingHeight + nSliderHeight; 510 aSnapping.Bottom() += nSnappingHeight + nSliderHeight; 511 pVDev->DrawRect( aSnapping ); --- 10 unchanged lines hidden (view full) --- 522 aImagePoint = aRect.TopLeft(); 523 aImagePoint.X() += (nSliderXOffset - nIncDecWidth)/2; 524 aImagePoint.Y() += ( aSliderWindowSize.Height() - nIncDecHeight)/2; 525 pVDev->DrawImage( aImagePoint, mpImpl->maDecreaseButton ); 526 527 // draw increase button 528 aImagePoint.X() = aRect.TopLeft().X() + aSliderWindowSize.Width() - nIncDecWidth - (nSliderXOffset - nIncDecWidth)/2; 529 pVDev->DrawImage( aImagePoint, mpImpl->maIncreaseButton ); |
529 | 530 |
530 DrawOutDev( Point(0, 0), aSliderWindowSize, Point(0, 0), aSliderWindowSize, *pVDev ); 531 532 delete pVDev; | 531 DrawOutDev( Point(0, 0), aSliderWindowSize, Point(0, 0), aSliderWindowSize, *pVDev ); 532 533 delete pVDev; |
533 | |
534} 535 536// ----------------------------------------------------------------------- | 534} 535 536// ----------------------------------------------------------------------- |