65 int mRangeInPixels;// Range in Pixel |
65 int mRangeInPixels;// Range in Pixel |
66 int mCurrTickInPixels;// Current Tick posion in pixels |
66 int mCurrTickInPixels;// Current Tick posion in pixels |
67 CAlfVisual * mVisual;// Stores the current visual hit |
67 CAlfVisual * mVisual;// Stores the current visual hit |
68 TPoint mDragPoint;// Point at which drag started |
68 TPoint mDragPoint;// Point at which drag started |
69 TPoint mLongTapPos;// Point at which button down happened |
69 TPoint mLongTapPos;// Point at which button down happened |
|
70 TSize mTrackTopImageSizePrt; |
|
71 TSize mTrackTopImageSizeLsc; |
|
72 TSize mTrackMiddleImageSizePrt; |
|
73 TSize mTrackMiddleImageSizeLsc; |
|
74 TSize mTrackBottomImageSizePrt; |
|
75 TSize mTrackBottomImageSizeLsc; |
|
76 TSize mSliderHandleSizePrt; |
|
77 TSize mSliderHandleSizeLsc; |
|
78 TSize mImagePlusSizePrt; |
|
79 TSize mImagePlusSizeLsc; |
|
80 TSize mImageMinusSizePrt; |
|
81 TSize mImageMinusSizeLsc; |
70 int mDragStartStep;// Tick positon of Drag Start |
82 int mDragStartStep;// Tick positon of Drag Start |
71 int mCurrTick;// Stores current tick |
83 int mCurrTick;// Stores current tick |
72 int mTick;// Stores Tick Size |
84 int mTick;// Stores Tick Size |
73 int mTrackStartPoint;// Slider Track Start Point in pixel |
85 int mTrackStartPoint;// Slider Track Start Point in pixel |
74 int mHandleGhostHieghtDelta; |
86 int mHandleGhostHieghtDelta; |
75 bool mOrientationLandScape; |
87 bool mOrientationLandScape; |
76 bool mHasBackground; // for background only created once |
88 bool mHasBackground; // for background only created once |
77 int mdirection;// 0 - nomovement,1 up movement 2 down |
89 int mdirection;// 0 - nomovement,1 up movement 2 down |
78 bool mLayoutMirrored;// RTL if True else LTR |
90 bool mLayoutMirrored;// RTL if True else LTR |
79 int mImageTextureId; // to differtiate between textures |
91 int mImageTextureId; // to differtiate between textures |
80 int mTrackTopTextureId ;// to store the auto generated texture id's |
92 int mTrackTopTexturePrtId ;// to store the auto generated texture id's |
81 int mTrackBottomTextureId; |
93 int mTrackTopTextureLscId; |
82 int mTrackMiddleTextureId; |
94 int mTrackBottomTexturePrtId; |
83 int mMarkerTextureId; |
95 int mTrackBottomTextureLscId; |
84 int mZoomInTextureId; |
96 int mTrackMiddleTextureLscId; |
85 int mZoomOutTextureId; |
97 int mTrackMiddleTexturePrtId; |
|
98 int mMarkerTextureLscId; |
|
99 int mMarkerTexturePrtId; |
|
100 int mZoomInTexturePrtId; |
|
101 int mZoomInTextureLscId; |
|
102 int mZoomOutTexturePrtId; |
|
103 int mZoomOutTextureLscId; |
|
104 |
86 |
105 |
87 CAlfLayout* mMainLayout; |
106 CAlfLayout* mMainLayout; |
88 CAlfLayout* mBaseSliderLayout;// Slider Background |
107 CAlfLayout* mBaseSliderLayout;// Slider Background |
89 CAlfTexture* mTexture; |
108 CAlfTexture* mTexture; |
90 CAlfLayout* mSliderCentre;// Track layout |
109 CAlfLayout* mSliderCentre;// Track layout |
307 EVSliderPane,mData->mMainLayout,KVariety3); |
351 EVSliderPane,mData->mMainLayout,KVariety3); |
308 mData->mBaseSliderLayout->SetRect( |
352 mData->mBaseSliderLayout->SetRect( |
309 TRect( TPoint(layoutRect.Rect().iTl.iX,layoutRect.Rect().iTl.iY ), |
353 TRect( TPoint(layoutRect.Rect().iTl.iX,layoutRect.Rect().iTl.iY ), |
310 TSize( layoutRect.Rect().Size().iWidth, |
354 TSize( layoutRect.Rect().Size().iWidth, |
311 layoutRect.Rect().Size().iHeight ))) ; |
355 layoutRect.Rect().Size().iHeight ))) ; |
|
356 |
312 if(!mData->mHasBackground) |
357 if(!mData->mHasBackground) |
313 SetBackgroundBrush(); |
358 SetBackgroundBrush(); |
314 // Set Position and Size for Extended touch layout for track |
359 // Set Position and Size for Extended touch layout for track |
315 mData->mSliderCentreGhost->SetRect( |
360 mData->mSliderCentreGhost->SetRect( |
316 TRect( TPoint(0,0 ), |
361 TRect( TPoint(0,0 ), |
317 TSize( layoutRect.Rect().Size().iWidth, |
362 TSize( layoutRect.Rect().Size().iWidth, |
318 layoutRect.Rect().Size().iHeight ))); |
363 layoutRect.Rect().Size().iHeight ))); |
319 |
364 |
320 |
365 |
321 //get the lct rect for mImageMinus and set it |
366 //get the lct rect for mSliderCentre and set it |
322 // aid_touch_size_slider_min(2) |
367 //aaslider_bg_pane_cp001(6) |
323 layoutRect = MulSliderUtils::GetComponentRect( |
368 layoutRect = MulSliderUtils::GetComponentRect( |
324 EVSliderMinus,mData->mBaseSliderLayout,KVariety2); |
369 EVSliderBgPane, |
325 mData->mImageMinus->SetRect( |
370 mData->mBaseSliderLayout, |
326 TRect( TPoint( layoutRect.Rect().iTl.iX,layoutRect.Rect().iTl.iY ), |
371 KVariety6); |
|
372 |
|
373 mData->mSliderCentre->SetRect( |
|
374 TRect( TPoint( layoutRect.Rect().iTl.iX , |
|
375 layoutRect.Rect().iTl.iY), |
327 TSize( layoutRect.Rect().Size().iWidth, |
376 TSize( layoutRect.Rect().Size().iWidth, |
328 layoutRect.Rect().Size().iHeight ))) ; |
377 layoutRect.Rect().Size().iHeight ))); |
329 |
378 |
330 //get the lct rect for mImagePlus and set it |
379 //get the lct rect for mTrackTopImage and set it |
331 // aid_touch_size_slider_max(1) |
380 //aaslider_bg_pane_cp001_g1(0) |
332 layoutRect = MulSliderUtils::GetComponentRect( |
381 layoutRect = MulSliderUtils::GetComponentRect( |
333 EVSliderPlus, |
382 EVSliderTop, |
334 mData->mBaseSliderLayout, |
383 mData->mSliderCentre, |
335 KVariety1); |
384 KVariety0); |
336 mData->mImagePlus->SetRect( |
385 |
337 TRect( TPoint( layoutRect.Rect().iTl.iX,layoutRect.Rect().iTl.iY ), |
386 mData->mTrackTopImage->SetRect( |
|
387 TRect( TPoint(0,layoutRect.Rect().iTl.iY), |
338 TSize( layoutRect.Rect().Size().iWidth, |
388 TSize( layoutRect.Rect().Size().iWidth, |
339 layoutRect.Rect().Size().iHeight ))) ; |
389 layoutRect.Rect().Size().iHeight ))); |
340 |
390 |
|
391 mSliderModel->IsLandscape() ? mData->mTrackTopImageSizeLsc = layoutRect.Rect().Size(): |
|
392 mData->mTrackTopImageSizePrt = layoutRect.Rect().Size(); |
|
393 |
|
394 //get the lct rect for mTrackMiddleImage and set it |
|
395 //aaslider_bg_pane_cp001_g3(0) |
|
396 layoutRect = MulSliderUtils::GetComponentRect( |
|
397 EVSliderMiddle, |
|
398 mData->mSliderCentre, |
|
399 KVariety0); |
|
400 mData->mTrackMiddleImage->SetRect( |
|
401 TRect( TPoint( 0,layoutRect.Rect().iTl.iY), |
|
402 TSize( layoutRect.Rect().Size().iWidth, |
|
403 layoutRect.Rect().Size().iHeight ))); |
|
404 |
|
405 mSliderModel->IsLandscape() ? mData->mTrackMiddleImageSizeLsc = layoutRect.Rect().Size(): |
|
406 mData->mTrackMiddleImageSizePrt = layoutRect.Rect().Size(); |
|
407 //get the lct rect for mTrackEndImage and set it |
|
408 //aaslider_bg_pane_cp001_g2(0) |
|
409 layoutRect = MulSliderUtils::GetComponentRect( |
|
410 EVSliderEnd, |
|
411 mData->mSliderCentre, |
|
412 KVariety0); |
|
413 mData->mTrackEndImage->SetRect( |
|
414 TRect( TPoint(0,layoutRect.Rect().iTl.iY), |
|
415 TSize( layoutRect.Rect().Size().iWidth, |
|
416 layoutRect.Rect().Size().iHeight ))); |
|
417 mSliderModel->IsLandscape() ? mData->mTrackBottomImageSizeLsc = layoutRect.Rect().Size(): |
|
418 mData->mTrackBottomImageSizePrt = layoutRect.Rect().Size(); |
|
419 |
|
420 if(mData->mTrackTopImage && mData->mTrackMiddleImage && mData->mTrackEndImage) |
|
421 { |
|
422 setTrackImage(); |
|
423 } |
|
424 |
|
425 |
341 //get the lct rect for mSliderHandle and set it |
426 //get the lct rect for mSliderHandle and set it |
342 //aid_touch_size_slider_marker(5) |
427 //aid_touch_size_slider_marker(5) |
343 layoutRect = MulSliderUtils::GetComponentRect( |
428 layoutRect = MulSliderUtils::GetComponentRect( |
344 EVSliderMarker, |
429 EVSliderMarker, |
345 mData->mBaseSliderLayout, |
430 mData->mBaseSliderLayout, |
346 KVariety5); |
431 KVariety5); |
347 mData->mSliderHandle->SetRect( |
432 mData->mSliderHandle->SetRect( |
348 TRect( TPoint( layoutRect.Rect().iTl.iX,layoutRect.Rect().iTl.iY ), |
433 TRect( TPoint( layoutRect.Rect().iTl.iX,layoutRect.Rect().iTl.iY ), |
349 TSize( layoutRect.Rect().Size().iWidth, |
434 TSize( layoutRect.Rect().Size().iWidth, |
350 layoutRect.Rect().Size().iHeight ))) ; |
435 layoutRect.Rect().Size().iHeight ))) ; |
|
436 mSliderModel->IsLandscape() ? mData->mSliderHandleSizeLsc = layoutRect.Rect().Size(): |
|
437 mData->mSliderHandleSizePrt = layoutRect.Rect().Size(); |
351 |
438 |
352 layoutRect = MulSliderUtils::GetComponentRect( |
439 layoutRect = MulSliderUtils::GetComponentRect( |
353 EVSliderMarkerExtended, |
440 EVSliderMarkerExtended, |
354 mData->mBaseSliderLayout, |
441 mData->mBaseSliderLayout, |
355 KVariety5); |
442 KVariety5); |
361 TRect( TPoint( mData->mBaseSliderLayout->Pos().iX.ValueNow(), |
448 TRect( TPoint( mData->mBaseSliderLayout->Pos().iX.ValueNow(), |
362 mData->mSliderHandle->Pos().iY.ValueNow()- |
449 mData->mSliderHandle->Pos().iY.ValueNow()- |
363 mData->mHandleGhostHieghtDelta/2), |
450 mData->mHandleGhostHieghtDelta/2), |
364 TSize( mData->mBaseSliderLayout->Size().iX.ValueNow(), |
451 TSize( mData->mBaseSliderLayout->Size().iX.ValueNow(), |
365 layoutRect.Rect().Size().iHeight))); |
452 layoutRect.Rect().Size().iHeight))); |
366 |
453 |
367 //get the lct rect for mSliderCentre and set it |
|
368 //aaslider_bg_pane_cp001(6) |
|
369 layoutRect = MulSliderUtils::GetComponentRect( |
|
370 EVSliderBgPane, |
|
371 mData->mBaseSliderLayout, |
|
372 KVariety6); |
|
373 mData->mSliderCentre->SetRect( |
|
374 TRect( TPoint( layoutRect.Rect().iTl.iX , |
|
375 layoutRect.Rect().iTl.iY), |
|
376 TSize( layoutRect.Rect().Size().iWidth, |
|
377 layoutRect.Rect().Size().iHeight ))); |
|
378 |
|
379 //get the lct rect for mTrackTopImage and set it |
|
380 //aaslider_bg_pane_cp001_g1(0) |
|
381 layoutRect = MulSliderUtils::GetComponentRect( |
|
382 EVSliderTop, |
|
383 mData->mSliderCentre, |
|
384 KVariety0); |
|
385 mData->mTrackTopImage->SetRect( |
|
386 TRect( TPoint(0,layoutRect.Rect().iTl.iY), |
|
387 TSize( layoutRect.Rect().Size().iWidth, |
|
388 layoutRect.Rect().Size().iHeight ))); |
|
389 |
|
390 //get the lct rect for mTrackMiddleImage and set it |
|
391 //aaslider_bg_pane_cp001_g3(0) |
|
392 layoutRect = MulSliderUtils::GetComponentRect( |
|
393 EVSliderMiddle, |
|
394 mData->mSliderCentre, |
|
395 KVariety0); |
|
396 mData->mTrackMiddleImage->SetRect( |
|
397 TRect( TPoint( 0,layoutRect.Rect().iTl.iY), |
|
398 TSize( layoutRect.Rect().Size().iWidth, |
|
399 layoutRect.Rect().Size().iHeight ))); |
|
400 |
|
401 //get the lct rect for mTrackEndImage and set it |
|
402 //aaslider_bg_pane_cp001_g2(0) |
|
403 layoutRect = MulSliderUtils::GetComponentRect( |
|
404 EVSliderEnd, |
|
405 mData->mSliderCentre, |
|
406 KVariety0); |
|
407 mData->mTrackEndImage->SetRect( |
|
408 TRect( TPoint(0,layoutRect.Rect().iTl.iY), |
|
409 TSize( layoutRect.Rect().Size().iWidth, |
|
410 layoutRect.Rect().Size().iHeight ))); |
|
411 |
|
412 if(mData->mTrackTopImage && |
|
413 mData->mTrackMiddleImage && |
|
414 mData->mTrackEndImage) |
|
415 { |
|
416 setTrackImage(); |
|
417 } |
|
418 if(mData->mSliderHandle) |
454 if(mData->mSliderHandle) |
419 { |
455 { |
420 mData->mImageTextureId = KAlfMarkerTextureId; |
456 mData->mImageTextureId = KAlfMarkerTextureId; |
421 // Create the texture from bitmap provider |
457 // Create the texture from bitmap provider |
422 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
458 mData->mSliderHandle->SetImage( skinTexture(mData->mSliderHandleSizePrt ,mData->mSliderHandleSizeLsc , mData->mMarkerTexturePrtId, mData->mMarkerTextureLscId ) ); |
423 KAlfAutoGeneratedTextureId/*KAlfMarkerTextureId*/, |
459 } |
424 (MAlfBitmapProvider *)this, |
460 |
425 (TAlfTextureFlags)(EAlfTextureFlagRetainResolution| |
461 //get the lct rect for mImagePlus and set it |
426 EAlfTextureFlagSkinContent))); |
462 // aid_touch_size_slider_max(1) |
427 TAlfImage aImage(*mData->mTexture ); |
463 layoutRect = MulSliderUtils::GetComponentRect( |
428 mData->mSliderHandle->SetImage(aImage); |
464 EVSliderPlus, |
429 |
465 mData->mBaseSliderLayout, |
430 } |
466 KVariety1); |
431 |
467 mData->mImagePlus->SetRect( |
|
468 TRect( TPoint( layoutRect.Rect().iTl.iX,layoutRect.Rect().iTl.iY ), |
|
469 TSize( layoutRect.Rect().Size().iWidth, |
|
470 layoutRect.Rect().Size().iHeight ))) ; |
|
471 |
|
472 mSliderModel->IsLandscape() ? mData->mImagePlusSizeLsc = layoutRect.Rect().Size(): |
|
473 mData->mImagePlusSizePrt = layoutRect.Rect().Size(); |
432 if(mData->mImagePlus) |
474 if(mData->mImagePlus) |
433 { |
475 { |
434 mData->mImageTextureId = KAlfZoomInTextureId; |
476 mData->mImageTextureId = KAlfZoomInTextureId; |
435 // Create the texture from bitmap provider |
477 // Create the texture from bitmap provider |
436 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
478 mData->mImagePlus->SetImage(skinTexture(mData->mImagePlusSizePrt ,mData->mImagePlusSizeLsc , mData->mZoomInTexturePrtId, mData->mZoomInTextureLscId )); |
437 KAlfAutoGeneratedTextureId/*KAlfZoomInTextureId*/, |
479 } |
438 (MAlfBitmapProvider *)this, |
480 |
439 (TAlfTextureFlags)(EAlfTextureFlagRetainResolution|EAlfTextureFlagSkinContent))); |
481 //get the lct rect for mImageMinus and set it |
440 TAlfImage aImage(*mData->mTexture ); |
482 // aid_touch_size_slider_min(2) |
441 mData->mImagePlus->SetImage(aImage); |
483 layoutRect = MulSliderUtils::GetComponentRect( |
442 } |
484 EVSliderMinus,mData->mBaseSliderLayout,KVariety2); |
443 |
485 |
|
486 mData->mImageMinus->SetRect( |
|
487 TRect( TPoint( layoutRect.Rect().iTl.iX,layoutRect.Rect().iTl.iY ), |
|
488 TSize( layoutRect.Rect().Size().iWidth, |
|
489 layoutRect.Rect().Size().iHeight ))) ; |
|
490 |
|
491 mSliderModel->IsLandscape() ? mData->mImageMinusSizeLsc = layoutRect.Rect().Size(): |
|
492 mData->mImageMinusSizePrt = layoutRect.Rect().Size(); |
444 if(mData->mImageMinus) |
493 if(mData->mImageMinus) |
445 { |
494 { |
446 mData->mImageTextureId = KAlfZoomOutTextureId; |
495 mData->mImageTextureId = KAlfZoomOutTextureId; |
447 // Create the texture from bitmap provider |
496 // Create the texture from bitmap provider |
448 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
497 mData->mImageMinus->SetImage(skinTexture(mData->mImageMinusSizePrt ,mData->mImageMinusSizeLsc , mData->mZoomOutTexturePrtId, mData->mZoomOutTextureLscId )); |
449 KAlfAutoGeneratedTextureId/*KAlfZoomOutTextureId*/, |
|
450 (MAlfBitmapProvider *)this, |
|
451 (TAlfTextureFlags)(EAlfTextureFlagRetainResolution|EAlfTextureFlagSkinContent))); |
|
452 TAlfImage aImage(*mData->mTexture ); |
|
453 mData->mImageMinus->SetImage(aImage); |
|
454 |
498 |
455 } |
499 } |
456 } |
500 } |
457 } |
501 } |
458 // --------------------------------------------------------------------------- |
502 // --------------------------------------------------------------------------- |
460 // --------------------------------------------------------------------------- |
504 // --------------------------------------------------------------------------- |
461 // |
505 // |
462 |
506 |
463 void MulSliderVertical::setTrackImage() |
507 void MulSliderVertical::setTrackImage() |
464 { |
508 { |
465 //Review |
509 |
466 TInt flags = EAlfTextureFlagSkinContent; |
510 CAlfControl* ctrl = (CAlfControl*)&control(); |
467 flags |= EAlfTextureFlagAutoSize; |
511 //creating texture for topimage |
468 |
512 mData->mImageTextureId = KAlfTrackTopTextureId; |
469 CAlfControl* ctrl = (CAlfControl*)&control(); |
513 mData->mTrackTopImage->SetImage( skinTexture(mData->mTrackTopImageSizePrt ,mData->mTrackTopImageSizeLsc , mData->mTrackTopTexturePrtId, mData->mTrackTopTextureLscId ) ) ; |
470 //creating texture for topimage |
514 |
471 mData->mImageTextureId = KAlfTrackTopTextureId; |
515 //creating texture for middleimage |
472 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
516 mData->mImageTextureId = KAlfTrackMiddleTextureId; |
473 KAlfAutoGeneratedTextureId/*KAlfTrackTopTextureId*/, |
517 mData->mTrackMiddleImage->SetImage(skinTexture(mData->mTrackMiddleImageSizePrt ,mData->mTrackMiddleImageSizeLsc , mData->mTrackMiddleTexturePrtId, mData->mTrackMiddleTextureLscId )); |
474 (MAlfBitmapProvider *)this, |
518 |
475 (TAlfTextureFlags)(EAlfTextureFlagRetainResolution|EAlfTextureFlagSkinContent))); |
519 //creating texture for bottom image |
476 |
520 mData->mImageTextureId = KAlfTrackBottomTextureId; |
477 TAlfImage trackTopImage(*mData->mTexture ); |
521 mData->mTrackEndImage->SetImage( skinTexture(mData->mTrackBottomImageSizePrt ,mData->mTrackBottomImageSizeLsc , mData->mTrackBottomTexturePrtId, mData->mTrackBottomTextureLscId ) ); |
478 //creating texture for middleimage |
|
479 mData->mImageTextureId = KAlfTrackMiddleTextureId; |
|
480 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
|
481 KAlfAutoGeneratedTextureId/*KAlfTrackMiddleTextureId*/, |
|
482 (MAlfBitmapProvider *)this, |
|
483 (TAlfTextureFlags)(EAlfTextureFlagRetainResolution|EAlfTextureFlagSkinContent))); |
|
484 |
|
485 TAlfImage trackMiddleImage(*mData->mTexture ); |
|
486 |
|
487 //creating texture for bottom image |
|
488 mData->mImageTextureId = KAlfTrackBottomTextureId; |
|
489 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
|
490 KAlfAutoGeneratedTextureId/*KAlfTrackBottomTextureId*/, |
|
491 (MAlfBitmapProvider *)this, |
|
492 (TAlfTextureFlags)(EAlfTextureFlagDefault))); |
|
493 |
|
494 |
|
495 TAlfImage trackEndImage(*mData->mTexture ); |
|
496 // Set Image on visuals |
|
497 mData->mTrackTopImage->SetImage(trackTopImage); |
|
498 mData->mTrackMiddleImage->SetImage(trackMiddleImage); |
|
499 mData->mTrackEndImage->SetImage(trackEndImage); |
|
500 |
522 |
501 }//End of setImage |
523 }//End of setImage |
502 |
524 |
503 // --------------------------------------------------------------------------- |
525 // --------------------------------------------------------------------------- |
504 // ProvideBitmapL() |
526 // ProvideBitmapL() |
689 CleanupStack::Pop(brush); |
718 CleanupStack::Pop(brush); |
690 } |
719 } |
691 mData->mHasBackground = true; |
720 mData->mHasBackground = true; |
692 } |
721 } |
693 |
722 |
|
723 // ---------------------------------------------------------------------------- |
|
724 // skinTexture() |
|
725 // ---------------------------------------------------------------------------- |
|
726 // |
|
727 TAlfImage MulSliderVertical::skinTexture(TSize aPrtImageSize, TSize aLscImageSize, TInt aPrtSkinId, TInt aLscSkinId ) |
|
728 { |
|
729 const CAlfControl* ctrl = (CAlfControl*)(&control()); |
|
730 |
|
731 if ( aPrtImageSize != aLscImageSize ) |
|
732 { |
|
733 if ( aPrtSkinId == 0 || aLscSkinId == 0 ) |
|
734 { |
|
735 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
|
736 KAlfAutoGeneratedTextureId, |
|
737 (MAlfBitmapProvider *)this, |
|
738 (TAlfTextureFlags)(EAlfTextureFlagRetainResolution|EAlfTextureFlagSkinContent))); |
|
739 TAlfImage dummyImage(*mData->mTexture); |
|
740 return dummyImage; |
|
741 } |
|
742 } |
|
743 else if ( aPrtSkinId == 0 || aLscSkinId == 0 ) |
|
744 { |
|
745 TInt id = aPrtSkinId > aLscSkinId ? aPrtSkinId : aLscSkinId; |
|
746 mData->mTexture = ((ctrl->Env()).TextureManager().TextureL(id)); |
|
747 TAlfImage dummyImage(*mData->mTexture); |
|
748 return dummyImage; |
|
749 } |
|
750 |
|
751 TInt textureId = mSliderModel->IsLandscape() ? aLscSkinId : aPrtSkinId; |
|
752 mData->mTexture = ((ctrl->Env()).TextureManager().TextureL( textureId )); |
|
753 TAlfImage dummyImage(*mData->mTexture); |
|
754 return dummyImage; |
|
755 } |
|
756 |
|
757 |
694 // --------------------------------------------------------------------------- |
758 // --------------------------------------------------------------------------- |
695 // MakeTransparent() |
759 // MakeTransparent() |
696 // --------------------------------------------------------------------------- |
760 // --------------------------------------------------------------------------- |
697 // |
761 // |
698 void MulSliderVertical::MakeTransparent(bool aVal) |
762 void MulSliderVertical::MakeTransparent(bool aVal) |
713 // ConvertDataToPixels |
777 // ConvertDataToPixels |
714 // --------------------------------------------------------------------------- |
778 // --------------------------------------------------------------------------- |
715 // |
779 // |
716 void MulSliderVertical::ConvertDataToPixels() |
780 void MulSliderVertical::ConvertDataToPixels() |
717 { |
781 { |
|
782 float sliderCentreSize = mData->mSliderCentre->Size().iY.ValueNow(); |
|
783 float sliderHandleSize = mData->mSliderHandle->Size().iY.ValueNow(); |
|
784 float sliderCentrePos = mData->mSliderCentre->Pos().iY.ValueNow(); |
|
785 |
718 // Calculate the range in pixel values |
786 // Calculate the range in pixel values |
719 mData->mRangeInPixels = |
787 mData->mRangeInPixels = sliderCentreSize - sliderHandleSize; |
720 (mData->mSliderCentre->Size().iY.ValueNow() - |
|
721 mData->mSliderHandle->Size().iY.ValueNow()); |
|
722 |
788 |
723 if(mSliderModel->MaxRange() - mSliderModel->MinRange() != 0) |
789 if(mSliderModel->MaxRange() - mSliderModel->MinRange() != 0) |
724 { |
790 { |
725 // Calculate Tick Size in Pixels |
791 // Calculate Tick Size in Pixels |
726 mData->mTickInPixels = |
792 mData->mTickInPixels = |
727 (mData->mSliderCentre->Size().iY.ValueNow() - |
793 (sliderCentreSize - sliderHandleSize) / |
728 mData->mSliderHandle->Size().iY.ValueNow()) / |
794 (mSliderModel->MaxRange() - mSliderModel->MinRange()) ; |
729 (mSliderModel->MaxRange() - mSliderModel->MinRange()) ; |
|
730 } |
795 } |
731 // Get the track start pixel value |
796 // Get the track start pixel value |
732 mData->mTrackStartPoint = mData->mSliderCentre->Pos().iY.ValueNow() + |
797 mData->mTrackStartPoint = |
733 mData->mSliderCentre->Size().iY.ValueNow() - |
798 sliderCentrePos + |
734 mData->mSliderHandle->Size().iY.ValueNow() ; |
799 sliderCentreSize - |
|
800 sliderHandleSize ; |
735 // Store current tick |
801 // Store current tick |
736 mData->mCurrTick = mSliderModel->PrimaryValue() ; |
802 mData->mCurrTick = mSliderModel->PrimaryValue() ; |
737 if(mSliderModel->MaxRange()== mSliderModel->MinRange()) |
803 if(mSliderModel->MaxRange()== mSliderModel->MinRange()) |
738 { |
804 { |
739 mData->mTrackStartPoint= mData->mSliderCentre->Pos().iY.ValueNow(); |
805 mData->mTrackStartPoint= sliderCentrePos; |
740 } |
806 } |
741 mData->mTick = mSliderModel->Tick(); |
807 mData->mTick = mSliderModel->Tick(); |
742 } |
808 } |
743 |
809 |
744 |
810 |