MCPcopy Create free account
hub / github.com/audacity/audacity / AdjustSize

Method AdjustSize

src/widgets/ASlider.cpp:673–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671}
672
673void LWSlider::AdjustSize(const wxSize & sz)
674{
675 mWidth = sz.GetWidth();
676 mHeight = sz.GetHeight();
677
678 if( mBitmap ){
679 mBitmap.reset();
680 }
681 mThumbWidth = 11;
682 mThumbHeight = 20;
683
684 if (mShowLabels || mDrawTicks)
685 {
686 if (mOrientation == wxHORIZONTAL)
687 {
688 mCenterY = mHeight - 9;
689 }
690 else
691 {
692 mCenterX = mWidth - 9;
693 }
694 }
695 else
696 {
697 if (mOrientation == wxHORIZONTAL)
698 {
699 mCenterY = mHeight / 2;
700 }
701 else
702 {
703 mCenterX = mWidth / 2;
704 }
705 }
706
707 if (mOrientation == wxHORIZONTAL)
708 {
709 mLeftX = mThumbWidth/2;
710 mRightX = mWidth - mThumbWidth/2 - 1;
711 mWidthX = mRightX - mLeftX;
712 }
713 else
714 {
715 mTopY = mThumbWidth/2;
716 mBottomY = mHeight - mThumbWidth/2 - 1;
717 mHeightY = mBottomY - mTopY;
718 }
719
720 Refresh();
721}
722
723void LWSlider::OnPaint(wxDC &dc, bool highlight)
724{

Callers 1

OnPaintMethod · 0.80

Calls 3

GetHeightMethod · 0.80
GetWidthMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected