| 671 | } |
| 672 | |
| 673 | void 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 | |
| 723 | void LWSlider::OnPaint(wxDC &dc, bool highlight) |
| 724 | { |