![]() |
Audacity 3.2.0
|
Lightweight version of ASlider. In other words it does not have a window permanently associated with it. More...
#include <ASlider.h>
Public Member Functions | |
LWSlider (wxWindow *parent, const TranslatableString &name, const wxPoint &pos, const wxSize &size, float minValue, float maxValue, float stepValue, bool canUseShift, int style, bool showlabels=true, bool drawticks=true, bool drawtrack=true, bool alwayshidetip=false, bool heavyweight=false, bool popup=true, int orientation=wxHORIZONTAL) | |
LWSlider (wxWindow *parent, const TranslatableString &name, const wxPoint &pos, const wxSize &size, int style, bool showlabels=true, bool drawticks=true, bool drawtrack=true, bool alwayshidetip=false, bool heavyweight=false, bool popup=true, int orientation=wxHORIZONTAL) | |
void | Init (wxWindow *parent, const TranslatableString &name, const wxPoint &pos, const wxSize &size, float minValue, float maxValue, float stepValue, bool canUseShift, int style, bool showlabels, bool drawticks, bool drawtrack, bool alwayshidetip, bool heavyweight, bool popup, float speed, int orientation=wxHORIZONTAL) |
virtual | ~LWSlider () |
wxWindowID | GetId () |
void | SetId (wxWindowID id) |
void | SetName (const TranslatableString &name) |
void | SetDefaultValue (float value) |
void | SetDefaultShortcut (bool value) |
void | GetScroll (float &line, float &page) |
void | SetScroll (float line, float page) |
void | ShowTip (bool show) |
void | SetToolTipTemplate (const TranslatableString &tip) |
float | Get (bool convert=true) |
void | Set (float value) |
void | Increase (float steps) |
void | Decrease (float steps) |
void | SetSpeed (float speed) |
void | Move (const wxPoint &newpos) |
void | AdjustSize (const wxSize &sz) |
void | OnPaint (wxDC &dc, bool highlighted) |
void | OnSize (wxSizeEvent &event) |
void | OnMouseEvent (wxMouseEvent &event) |
void | OnKeyDown (wxKeyEvent &event) |
void | Refresh () |
void | Redraw () |
bool | ShowDialog () |
bool | ShowDialog (wxPoint pos) |
void | SetEnabled (bool enabled) |
bool | GetEnabled () const |
float | GetMinValue () const |
float | GetMaxValue () const |
void | SetParent (wxWindow *parent) |
void | SendUpdate (float newValue) |
wxString | GetStringValue () const |
void | OnKillFocus () |
Private Member Functions | |
TranslatableString | GetTip (float value) const |
TranslatableStrings | GetWidestTips () const |
void | FormatPopWin () |
void | SetPopWinPosition () |
void | CreatePopWin () |
void | DrawToBitmap (wxDC &dc) |
bool | DoShowDialog (wxPoint pos) |
int | ValueToPosition (float val) |
float | DragPositionToValue (int fromPos, bool shiftDown) |
float | ClickPositionToValue (int fromPos, bool shiftDown) |
Private Attributes | |
wxWindow * | mParent |
int | mStyle |
int | mOrientation |
bool | mShowLabels |
bool | mDrawTicks |
bool | mDrawTrack |
bool | mAlwaysHideTip |
bool | mHW |
bool | mPopup |
int | mLeft |
int | mTop |
int | mWidth |
int | mHeight |
int | mCenterY |
int | mLeftX |
int | mRightX |
int | mWidthX |
int | mCenterX |
int | mTopY |
int | mBottomY |
int | mHeightY |
int | mThumbWidth |
int | mThumbHeight |
float | mClickValue |
int | mClickPos |
float | mMinValue |
float | mMaxValue |
float | mStepValue |
float | mSpeed |
float | mScrollLine |
float | mScrollPage |
float | mCurrentValue |
bool | mDefaultShortcut |
float | mDefaultValue |
bool | mCanUseShift |
wxWindowID | mID |
wxWeakRef< TipWindow > | mTipPanel |
TranslatableString | mTipTemplate |
bool | mIsDragging |
std::unique_ptr< wxBitmap > | mBitmap |
std::unique_ptr< wxBitmap > | mThumbBitmap |
std::unique_ptr< wxBitmap > | mThumbBitmapHilited |
TranslatableString | mName |
bool | mEnabled |
Friends | |
class | ASlider |
class | ASliderAx |
Lightweight version of ASlider. In other words it does not have a window permanently associated with it.
LWSlider::LWSlider | ( | wxWindow * | parent, |
const TranslatableString & | name, | ||
const wxPoint & | pos, | ||
const wxSize & | size, | ||
float | minValue, | ||
float | maxValue, | ||
float | stepValue, | ||
bool | canUseShift, | ||
int | style, | ||
bool | showlabels = true , |
||
bool | drawticks = true , |
||
bool | drawtrack = true , |
||
bool | alwayshidetip = false , |
||
bool | heavyweight = false , |
||
bool | popup = true , |
||
int | orientation = wxHORIZONTAL |
||
) |
Definition at line 476 of file ASlider.cpp.
References Init(), name, and size.
LWSlider::LWSlider | ( | wxWindow * | parent, |
const TranslatableString & | name, | ||
const wxPoint & | pos, | ||
const wxSize & | size, | ||
int | style, | ||
bool | showlabels = true , |
||
bool | drawticks = true , |
||
bool | drawtrack = true , |
||
bool | alwayshidetip = false , |
||
bool | heavyweight = false , |
||
bool | popup = true , |
||
int | orientation = wxHORIZONTAL |
||
) |
Definition at line 499 of file ASlider.cpp.
References DB_SLIDER, FRAC_SLIDER, Init(), name, PAN_SLIDER, PERCENT_SLIDER, size, SPEED_SLIDER, STEP_CONTINUOUS, VEL_MAX, VEL_MIN, and VEL_SLIDER.
|
virtual |
Definition at line 617 of file ASlider.cpp.
void LWSlider::AdjustSize | ( | const wxSize & | sz | ) |
Definition at line 671 of file ASlider.cpp.
References mBitmap, mBottomY, mCenterX, mCenterY, mDrawTicks, mHeight, mHeightY, mLeftX, mOrientation, mRightX, mShowLabels, mThumbHeight, mThumbWidth, mTopY, mWidth, mWidthX, and Refresh().
Referenced by Init(), and OnSize().
|
private |
Definition at line 1481 of file ASlider.cpp.
References mBottomY, mCanUseShift, mHeightY, mLeft, mMaxValue, mMinValue, mOrientation, mStepValue, mThumbWidth, mWidthX, and STEP_CONTINUOUS.
Referenced by OnMouseEvent().
|
private |
Definition at line 957 of file ASlider.cpp.
References GetWidestTips(), mAlwaysHideTip, mParent, mTipPanel, and safenew.
Referenced by Init(), SetName(), and SetParent().
void LWSlider::Decrease | ( | float | steps | ) |
Definition at line 1603 of file ASlider.cpp.
References mCurrentValue, mMaxValue, mMinValue, mStepValue, and Refresh().
Referenced by OnKeyDown(), OnMouseEvent(), anonymous_namespace{TrackMenus.cpp}::OnTrackGainDec(), and anonymous_namespace{TrackMenus.cpp}::OnTrackPanLeft().
|
private |
Definition at line 1132 of file ASlider.cpp.
References SliderDialog::Get(), Get(), mCurrentValue, mHeight, mName, mScrollLine, mScrollPage, mStyle, mWidth, and SendUpdate().
Referenced by OnMouseEvent(), and ShowDialog().
|
private |
Definition at line 1525 of file ASlider.cpp.
References mCanUseShift, mClickPos, mClickValue, mHeightY, mMaxValue, mMinValue, mOrientation, mSpeed, mStepValue, mWidthX, and STEP_CONTINUOUS.
Referenced by OnMouseEvent().
|
private |
Definition at line 776 of file ASlider.cpp.
References _, ThemeBase::Bitmap(), ThemeBase::Colour(), DB_SLIDER, AColor::Line(), mBitmap, mBottomY, mCenterX, mCenterY, mDrawTicks, mDrawTrack, mHeight, mHeightY, mHW, mLeftX, mMaxValue, mMinValue, mOrientation, mParent, mRightX, mShowLabels, mStyle, mThumbBitmap, mThumbBitmapHilited, mTopY, mWidth, mWidthX, PAN_SLIDER, safenew, theTheme, and AColor::UseThemeColour().
Referenced by OnPaint().
|
private |
Definition at line 988 of file ASlider.cpp.
References GetTip(), mCurrentValue, and mTipPanel.
Referenced by SendUpdate().
float LWSlider::Get | ( | bool | convert = true | ) |
Definition at line 1555 of file ASlider.cpp.
References DB_SLIDER, DB_TO_LINEAR, mCurrentValue, and mStyle.
Referenced by DoShowDialog(), SliderHandle::Drag(), SliderHandle::Release(), anonymous_namespace{TrackMenus.cpp}::SetTrackGain(), and anonymous_namespace{TrackMenus.cpp}::SetTrackPan().
bool LWSlider::GetEnabled | ( | ) | const |
Definition at line 1641 of file ASlider.cpp.
References mEnabled.
wxWindowID LWSlider::GetId | ( | ) |
Definition at line 621 of file ASlider.cpp.
References mID.
float LWSlider::GetMaxValue | ( | ) | const |
Definition at line 1661 of file ASlider.cpp.
References mMaxValue.
float LWSlider::GetMinValue | ( | ) | const |
Definition at line 1656 of file ASlider.cpp.
References mMinValue.
void LWSlider::GetScroll | ( | float & | line, |
float & | page | ||
) |
Definition at line 653 of file ASlider.cpp.
References mScrollLine, and mScrollPage.
wxString LWSlider::GetStringValue | ( | ) | const |
Definition at line 1435 of file ASlider.cpp.
References DB_SLIDER, FRAC_SLIDER, mCurrentValue, mStyle, PAN_SLIDER, PERCENT_SLIDER, SPEED_SLIDER, VEL_SLIDER, and wxT().
|
private |
Definition at line 999 of file ASlider.cpp.
References DB_SLIDER, TranslatableString::empty(), TranslatableString::Format(), FRAC_SLIDER, label, mName, mStyle, mTipTemplate, PAN_SLIDER, PERCENT_SLIDER, SPEED_SLIDER, VEL_SLIDER, Verbatim(), and XO().
Referenced by FormatPopWin(), GetWidestTips(), OnMouseEvent(), SendUpdate(), and ShowTip().
|
private |
Definition at line 1072 of file ASlider.cpp.
References DB_SLIDER, TranslatableString::empty(), FRAC_SLIDER, GetTip(), mMaxValue, mMinValue, mStyle, mTipTemplate, PAN_SLIDER, PERCENT_SLIDER, SPEED_SLIDER, and VEL_SLIDER.
Referenced by CreatePopWin().
void LWSlider::Increase | ( | float | steps | ) |
Definition at line 1580 of file ASlider.cpp.
References mCurrentValue, mMaxValue, mMinValue, mStepValue, and Refresh().
Referenced by OnKeyDown(), OnMouseEvent(), anonymous_namespace{TrackMenus.cpp}::OnTrackGainInc(), and anonymous_namespace{TrackMenus.cpp}::OnTrackPanRight().
void LWSlider::Init | ( | wxWindow * | parent, |
const TranslatableString & | name, | ||
const wxPoint & | pos, | ||
const wxSize & | size, | ||
float | minValue, | ||
float | maxValue, | ||
float | stepValue, | ||
bool | canUseShift, | ||
int | style, | ||
bool | showlabels, | ||
bool | drawticks, | ||
bool | drawtrack, | ||
bool | alwayshidetip, | ||
bool | heavyweight, | ||
bool | popup, | ||
float | speed, | ||
int | orientation = wxHORIZONTAL |
||
) |
Definition at line 565 of file ASlider.cpp.
References AdjustSize(), CreatePopWin(), mAlwaysHideTip, mBitmap, mCanUseShift, mCurrentValue, mDefaultShortcut, mDefaultValue, mDrawTicks, mDrawTrack, mEnabled, mHW, mID, mIsDragging, mMaxValue, mMinValue, mName, mOrientation, Move(), mParent, mPopup, mScrollLine, mScrollPage, mShowLabels, mSpeed, mStepValue, mStyle, mThumbBitmap, mThumbBitmapHilited, name, and size.
Referenced by LWSlider().
void LWSlider::Move | ( | const wxPoint & | newpos | ) |
Definition at line 665 of file ASlider.cpp.
Referenced by Init().
void LWSlider::OnKeyDown | ( | wxKeyEvent & | event | ) |
Definition at line 1330 of file ASlider.cpp.
References Decrease(), Increase(), mCurrentValue, mEnabled, mMaxValue, mMinValue, mParent, mScrollLine, mScrollPage, SendUpdate(), ShowTip(), and wxEVT_COMMAND_BUTTON_CLICKED.
void LWSlider::OnKillFocus | ( | ) |
Definition at line 1458 of file ASlider.cpp.
References ShowTip().
void LWSlider::OnMouseEvent | ( | wxMouseEvent & | event | ) |
Definition at line 1169 of file ASlider.cpp.
References ClickPositionToValue(), Decrease(), DoShowDialog(), DragPositionToValue(), FindProjectFromWindow(), ProjectStatus::Get(), GetTip(), Increase(), mCenterX, mCenterY, mClickPos, mClickValue, mCurrentValue, mDefaultShortcut, mDefaultValue, mEnabled, mIsDragging, mLeft, mOrientation, mParent, mPopup, mThumbHeight, mThumbWidth, mTop, Refresh(), SendUpdate(), ProjectStatus::Set(), ShowTip(), and ValueToPosition().
Referenced by SliderHandle::Cancel(), SliderHandle::Drag(), and SliderHandle::Release().
void LWSlider::OnPaint | ( | wxDC & | dc, |
bool | highlighted | ||
) |
Definition at line 721 of file ASlider.cpp.
References DrawToBitmap(), mBitmap, mCenterX, mCenterY, mCurrentValue, mHW, mLeft, mOrientation, mThumbBitmap, mThumbBitmapHilited, mThumbHeight, mThumbWidth, mTipPanel, mTop, and ValueToPosition().
void LWSlider::OnSize | ( | wxSizeEvent & | event | ) |
Definition at line 767 of file ASlider.cpp.
References AdjustSize(), and Refresh().
void LWSlider::Redraw | ( | ) |
Definition at line 1632 of file ASlider.cpp.
References mBitmap, mThumbBitmap, mThumbBitmapHilited, and Refresh().
void LWSlider::Refresh | ( | ) |
Definition at line 1626 of file ASlider.cpp.
Referenced by AdjustSize(), Decrease(), Increase(), OnMouseEvent(), OnSize(), Redraw(), SendUpdate(), Set(), and SetEnabled().
void LWSlider::SendUpdate | ( | float | newValue | ) |
Definition at line 1412 of file ASlider.cpp.
References FindProjectFromWindow(), FormatPopWin(), ProjectStatus::Get(), GetTip(), mCurrentValue, mID, mMaxValue, mMinValue, mParent, mTipPanel, Refresh(), and ProjectStatus::Set().
Referenced by DoShowDialog(), OnKeyDown(), OnMouseEvent(), SliderDialog::TransferDataFromWindow(), and SliderDialog::TransferDataToWindow().
void LWSlider::Set | ( | float | value | ) |
Definition at line 1563 of file ASlider.cpp.
References DB_SLIDER, LINEAR_TO_DB, mCurrentValue, mIsDragging, mMaxValue, mMinValue, mStyle, and Refresh().
Referenced by SliderDialog::TransferDataFromWindow(), and SliderDialog::TransferDataToWindow().
void LWSlider::SetDefaultShortcut | ( | bool | value | ) |
Definition at line 648 of file ASlider.cpp.
References mDefaultShortcut.
Referenced by SetDefaultValue().
void LWSlider::SetDefaultValue | ( | float | value | ) |
Definition at line 642 of file ASlider.cpp.
References mDefaultValue, and SetDefaultShortcut().
void LWSlider::SetEnabled | ( | bool | enabled | ) |
Definition at line 1646 of file ASlider.cpp.
References mEnabled, mThumbBitmap, mThumbBitmapHilited, and Refresh().
void LWSlider::SetId | ( | wxWindowID | id | ) |
Definition at line 626 of file ASlider.cpp.
void LWSlider::SetName | ( | const TranslatableString & | name | ) |
Definition at line 631 of file ASlider.cpp.
References CreatePopWin(), mName, mTipPanel, and name.
void LWSlider::SetParent | ( | wxWindow * | parent | ) |
Definition at line 1403 of file ASlider.cpp.
References CreatePopWin(), and mParent.
|
private |
Definition at line 966 of file ASlider.cpp.
References mHeight, mLeft, mOrientation, mParent, mTipPanel, mTop, and mWidth.
Referenced by ShowTip().
void LWSlider::SetScroll | ( | float | line, |
float | page | ||
) |
Definition at line 659 of file ASlider.cpp.
References mScrollLine, and mScrollPage.
void LWSlider::SetSpeed | ( | float | speed | ) |
void LWSlider::SetToolTipTemplate | ( | const TranslatableString & | tip | ) |
Definition at line 937 of file ASlider.cpp.
References mTipTemplate.
bool LWSlider::ShowDialog | ( | ) |
Definition at line 1122 of file ASlider.cpp.
References DoShowDialog(), mLeft, mParent, and mTop.
Referenced by anonymous_namespace{TrackMenus.cpp}::OnTrackGain(), and anonymous_namespace{TrackMenus.cpp}::OnTrackPan().
bool LWSlider::ShowDialog | ( | wxPoint | pos | ) |
Definition at line 1127 of file ASlider.cpp.
References DoShowDialog().
void LWSlider::ShowTip | ( | bool | show | ) |
Definition at line 942 of file ASlider.cpp.
References GetTip(), mCurrentValue, mTipPanel, and SetPopWinPosition().
Referenced by OnKeyDown(), OnKillFocus(), and OnMouseEvent().
|
private |
Definition at line 1464 of file ASlider.cpp.
References mHeightY, mMaxValue, mMinValue, mOrientation, mWidthX, and staffpad::audio::simd::rint().
Referenced by OnMouseEvent(), and OnPaint().
|
private |
Definition at line 198 of file ASlider.h.
Referenced by CreatePopWin(), and Init().
|
private |
Definition at line 252 of file ASlider.h.
Referenced by AdjustSize(), DrawToBitmap(), Init(), OnPaint(), and Redraw().
|
private |
Definition at line 220 of file ASlider.h.
Referenced by AdjustSize(), ClickPositionToValue(), and DrawToBitmap().
|
private |
Definition at line 243 of file ASlider.h.
Referenced by ClickPositionToValue(), DragPositionToValue(), and Init().
|
private |
Definition at line 217 of file ASlider.h.
Referenced by AdjustSize(), DrawToBitmap(), OnMouseEvent(), and OnPaint().
|
private |
Definition at line 210 of file ASlider.h.
Referenced by AdjustSize(), DrawToBitmap(), OnMouseEvent(), and OnPaint().
|
private |
Definition at line 228 of file ASlider.h.
Referenced by DragPositionToValue(), and OnMouseEvent().
|
private |
Definition at line 227 of file ASlider.h.
Referenced by DragPositionToValue(), and OnMouseEvent().
|
private |
Definition at line 238 of file ASlider.h.
Referenced by Decrease(), DoShowDialog(), FormatPopWin(), Get(), GetStringValue(), Increase(), Init(), OnKeyDown(), OnMouseEvent(), OnPaint(), SendUpdate(), Set(), and ShowTip().
|
private |
Definition at line 240 of file ASlider.h.
Referenced by Init(), OnMouseEvent(), and SetDefaultShortcut().
|
private |
Definition at line 241 of file ASlider.h.
Referenced by Init(), OnMouseEvent(), and SetDefaultValue().
|
private |
Definition at line 195 of file ASlider.h.
Referenced by AdjustSize(), DrawToBitmap(), and Init().
|
private |
Definition at line 196 of file ASlider.h.
Referenced by DrawToBitmap(), and Init().
|
private |
Definition at line 256 of file ASlider.h.
Referenced by GetEnabled(), Init(), OnKeyDown(), OnMouseEvent(), and SetEnabled().
|
private |
Definition at line 207 of file ASlider.h.
Referenced by AdjustSize(), DoShowDialog(), DrawToBitmap(), and SetPopWinPosition().
|
private |
Definition at line 221 of file ASlider.h.
Referenced by AdjustSize(), ClickPositionToValue(), DragPositionToValue(), DrawToBitmap(), and ValueToPosition().
|
private |
|
private |
|
private |
Definition at line 250 of file ASlider.h.
Referenced by Init(), OnMouseEvent(), and Set().
|
private |
Definition at line 203 of file ASlider.h.
Referenced by ClickPositionToValue(), Move(), OnMouseEvent(), OnPaint(), SetPopWinPosition(), and ShowDialog().
|
private |
Definition at line 212 of file ASlider.h.
Referenced by AdjustSize(), and DrawToBitmap().
|
private |
Definition at line 231 of file ASlider.h.
Referenced by ClickPositionToValue(), Decrease(), DragPositionToValue(), DrawToBitmap(), GetMaxValue(), GetWidestTips(), Increase(), Init(), OnKeyDown(), SendUpdate(), Set(), and ValueToPosition().
|
private |
Definition at line 230 of file ASlider.h.
Referenced by ClickPositionToValue(), Decrease(), DragPositionToValue(), DrawToBitmap(), GetMinValue(), GetWidestTips(), Increase(), Init(), OnKeyDown(), SendUpdate(), Set(), and ValueToPosition().
|
private |
|
private |
Definition at line 192 of file ASlider.h.
Referenced by AdjustSize(), ClickPositionToValue(), DragPositionToValue(), DrawToBitmap(), Init(), OnMouseEvent(), OnPaint(), SetPopWinPosition(), and ValueToPosition().
|
private |
Definition at line 189 of file ASlider.h.
Referenced by CreatePopWin(), DrawToBitmap(), Init(), OnKeyDown(), OnMouseEvent(), Refresh(), SendUpdate(), SetParent(), SetPopWinPosition(), and ShowDialog().
|
private |
Definition at line 201 of file ASlider.h.
Referenced by Init(), and OnMouseEvent().
|
private |
Definition at line 213 of file ASlider.h.
Referenced by AdjustSize(), and DrawToBitmap().
|
private |
Definition at line 235 of file ASlider.h.
Referenced by DoShowDialog(), GetScroll(), Init(), OnKeyDown(), and SetScroll().
|
private |
Definition at line 236 of file ASlider.h.
Referenced by DoShowDialog(), GetScroll(), Init(), OnKeyDown(), and SetScroll().
|
private |
Definition at line 194 of file ASlider.h.
Referenced by AdjustSize(), DrawToBitmap(), and Init().
|
private |
Definition at line 233 of file ASlider.h.
Referenced by DragPositionToValue(), Init(), and SetSpeed().
|
private |
Definition at line 232 of file ASlider.h.
Referenced by ClickPositionToValue(), Decrease(), DragPositionToValue(), Increase(), and Init().
|
private |
Definition at line 191 of file ASlider.h.
Referenced by DoShowDialog(), DrawToBitmap(), Get(), GetStringValue(), GetTip(), GetWidestTips(), Init(), and Set().
|
private |
Definition at line 252 of file ASlider.h.
Referenced by DrawToBitmap(), Init(), OnPaint(), Redraw(), and SetEnabled().
|
private |
Definition at line 252 of file ASlider.h.
Referenced by DrawToBitmap(), Init(), OnPaint(), Redraw(), and SetEnabled().
|
private |
Definition at line 225 of file ASlider.h.
Referenced by AdjustSize(), OnMouseEvent(), and OnPaint().
|
private |
Definition at line 224 of file ASlider.h.
Referenced by AdjustSize(), ClickPositionToValue(), OnMouseEvent(), and OnPaint().
|
private |
Definition at line 247 of file ASlider.h.
Referenced by CreatePopWin(), FormatPopWin(), OnPaint(), SendUpdate(), SetName(), SetPopWinPosition(), and ShowTip().
|
private |
Definition at line 248 of file ASlider.h.
Referenced by GetTip(), GetWidestTips(), and SetToolTipTemplate().
|
private |
Definition at line 204 of file ASlider.h.
Referenced by Move(), OnMouseEvent(), OnPaint(), SetPopWinPosition(), and ShowDialog().
|
private |
Definition at line 219 of file ASlider.h.
Referenced by AdjustSize(), and DrawToBitmap().
|
private |
Definition at line 206 of file ASlider.h.
Referenced by AdjustSize(), DoShowDialog(), DrawToBitmap(), and SetPopWinPosition().
|
private |
Definition at line 214 of file ASlider.h.
Referenced by AdjustSize(), ClickPositionToValue(), DragPositionToValue(), DrawToBitmap(), and ValueToPosition().