![]() |
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 heavyweight=false, bool popup=true, int orientation=wxHORIZONTAL) | |
LWSlider (wxWindow *parent, const TranslatableString &name, const wxPoint &pos, const wxSize &size, int style, 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 heavyweight, bool popup, float speed, int orientation=wxHORIZONTAL) |
virtual | ~LWSlider () |
wxWindowID | GetId () |
void | SetId (wxWindowID id) |
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) |
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 | 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 |
std::unique_ptr< 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 | heavyweight = false , |
||
bool | popup = true , |
||
int | orientation = wxHORIZONTAL |
||
) |
Definition at line 474 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 | heavyweight = false , |
||
bool | popup = true , |
||
int | orientation = wxHORIZONTAL |
||
) |
Definition at line 492 of file ASlider.cpp.
References DB_SLIDER, FRAC_SLIDER, Init(), name, PAN_SLIDER, size, SPEED_SLIDER, STEP_CONTINUOUS, VEL_MAX, VEL_MIN, and VEL_SLIDER.
|
virtual |
Definition at line 595 of file ASlider.cpp.
void LWSlider::AdjustSize | ( | const wxSize & | sz | ) |
Definition at line 638 of file ASlider.cpp.
References mBitmap, mBottomY, mCenterX, mCenterY, mHeight, mHeightY, mLeftX, mOrientation, mRightX, mThumbHeight, mThumbWidth, mTopY, mWidth, mWidthX, and Refresh().
Referenced by Init(), and OnSize().
|
private |
Definition at line 1383 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 918 of file ASlider.cpp.
References GetWidestTips(), mParent, and mTipPanel.
Referenced by ShowTip().
void LWSlider::Decrease | ( | float | steps | ) |
Definition at line 1505 of file ASlider.cpp.
References mCurrentValue, mMaxValue, mMinValue, mStepValue, and Refresh().
Referenced by OnKeyDown(), OnMouseEvent(), TrackActions::Handler::OnTrackGainDec(), and TrackActions::Handler::OnTrackPanLeft().
|
private |
Definition at line 1078 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 1427 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 729 of file ASlider.cpp.
References _, ThemeBase::Bitmap(), ThemeBase::Colour(), DB_SLIDER, AColor::Line(), mBitmap, mBottomY, mCenterX, mCenterY, mHeight, mHeightY, mHW, mLeftX, mMaxValue, mMinValue, mOrientation, mParent, mRightX, mStyle, mThumbBitmap, mThumbBitmapHilited, mTopY, mWidth, mWidthX, PAN_SLIDER, safenew, theTheme, and AColor::UseThemeColour().
Referenced by OnPaint().
|
private |
Definition at line 945 of file ASlider.cpp.
References GetTip(), mCurrentValue, and mTipPanel.
Referenced by SendUpdate(), and ShowTip().
float LWSlider::Get | ( | bool | convert = true | ) |
Definition at line 1457 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 1543 of file ASlider.cpp.
References mEnabled.
wxWindowID LWSlider::GetId | ( | ) |
Definition at line 599 of file ASlider.cpp.
References mID.
float LWSlider::GetMaxValue | ( | ) | const |
Definition at line 1563 of file ASlider.cpp.
References mMaxValue.
float LWSlider::GetMinValue | ( | ) | const |
Definition at line 1558 of file ASlider.cpp.
References mMinValue.
void LWSlider::GetScroll | ( | float & | line, |
float & | page | ||
) |
Definition at line 620 of file ASlider.cpp.
References mScrollLine, and mScrollPage.
|
private |
Definition at line 956 of file ASlider.cpp.
References DB_SLIDER, TranslatableString::empty(), TranslatableString::Format(), FRAC_SLIDER, label, mName, mStyle, mTipTemplate, PAN_SLIDER, SPEED_SLIDER, VEL_SLIDER, Verbatim(), and XO.
Referenced by FormatPopWin(), GetWidestTips(), OnMouseEvent(), and SendUpdate().
|
private |
Definition at line 1021 of file ASlider.cpp.
References DB_SLIDER, TranslatableString::empty(), FRAC_SLIDER, GetTip(), mMaxValue, mMinValue, mStyle, mTipTemplate, PAN_SLIDER, SPEED_SLIDER, and VEL_SLIDER.
Referenced by CreatePopWin().
void LWSlider::Increase | ( | float | steps | ) |
Definition at line 1482 of file ASlider.cpp.
References mCurrentValue, mMaxValue, mMinValue, mStepValue, and Refresh().
Referenced by OnKeyDown(), OnMouseEvent(), TrackActions::Handler::OnTrackGainInc(), and TrackActions::Handler::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 | heavyweight, | ||
bool | popup, | ||
float | speed, | ||
int | orientation = wxHORIZONTAL |
||
) |
Definition at line 552 of file ASlider.cpp.
References AdjustSize(), mBitmap, mCanUseShift, mCurrentValue, mDefaultShortcut, mDefaultValue, mEnabled, mHW, mID, mIsDragging, mMaxValue, mMinValue, mName, mOrientation, Move(), mParent, mPopup, mScrollLine, mScrollPage, mSpeed, mStepValue, mStyle, mThumbBitmap, mThumbBitmapHilited, mTipPanel, name, and size.
Referenced by LWSlider().
void LWSlider::Move | ( | const wxPoint & | newpos | ) |
Definition at line 632 of file ASlider.cpp.
Referenced by Init().
void LWSlider::OnKeyDown | ( | wxKeyEvent & | event | ) |
Definition at line 1276 of file ASlider.cpp.
References Decrease(), Increase(), mCurrentValue, mEnabled, mMaxValue, mMinValue, mParent, mScrollLine, mScrollPage, SendUpdate(), and wxEVT_COMMAND_BUTTON_CLICKED.
void LWSlider::OnMouseEvent | ( | wxMouseEvent & | event | ) |
Definition at line 1115 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 674 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 720 of file ASlider.cpp.
References AdjustSize(), and Refresh().
void LWSlider::Redraw | ( | ) |
Definition at line 1534 of file ASlider.cpp.
References mBitmap, mThumbBitmap, mThumbBitmapHilited, and Refresh().
void LWSlider::Refresh | ( | ) |
Definition at line 1528 of file ASlider.cpp.
Referenced by AdjustSize(), Decrease(), Increase(), OnMouseEvent(), OnSize(), Redraw(), SendUpdate(), Set(), and SetEnabled().
void LWSlider::SendUpdate | ( | float | newValue | ) |
Definition at line 1343 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 1465 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 615 of file ASlider.cpp.
References mDefaultShortcut.
Referenced by SetDefaultValue().
void LWSlider::SetDefaultValue | ( | float | value | ) |
Definition at line 609 of file ASlider.cpp.
References mDefaultValue, and SetDefaultShortcut().
void LWSlider::SetEnabled | ( | bool | enabled | ) |
Definition at line 1548 of file ASlider.cpp.
References mEnabled, mThumbBitmap, mThumbBitmapHilited, and Refresh().
void LWSlider::SetId | ( | wxWindowID | id | ) |
Definition at line 604 of file ASlider.cpp.
|
inline |
|
private |
Definition at line 923 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 626 of file ASlider.cpp.
References mScrollLine, and mScrollPage.
void LWSlider::SetSpeed | ( | float | speed | ) |
void LWSlider::SetToolTipTemplate | ( | const TranslatableString & | tip | ) |
Definition at line 884 of file ASlider.cpp.
References mTipTemplate.
bool LWSlider::ShowDialog | ( | ) |
Definition at line 1068 of file ASlider.cpp.
References DoShowDialog(), mLeft, mParent, and mTop.
Referenced by TrackActions::Handler::OnTrackGain(), and TrackActions::Handler::OnTrackPan().
bool LWSlider::ShowDialog | ( | wxPoint | pos | ) |
Definition at line 1073 of file ASlider.cpp.
References DoShowDialog().
void LWSlider::ShowTip | ( | bool | show | ) |
Definition at line 889 of file ASlider.cpp.
References CreatePopWin(), FormatPopWin(), mTipPanel, and SetPopWinPosition().
Referenced by OnMouseEvent().
|
private |
Definition at line 1366 of file ASlider.cpp.
References mHeightY, mMaxValue, mMinValue, mOrientation, and mWidthX.
Referenced by OnMouseEvent(), and OnPaint().
|
private |
Definition at line 226 of file ASlider.h.
Referenced by AdjustSize(), DrawToBitmap(), Init(), OnPaint(), and Redraw().
|
private |
Definition at line 194 of file ASlider.h.
Referenced by AdjustSize(), ClickPositionToValue(), and DrawToBitmap().
|
private |
Definition at line 217 of file ASlider.h.
Referenced by ClickPositionToValue(), DragPositionToValue(), and Init().
|
private |
Definition at line 191 of file ASlider.h.
Referenced by AdjustSize(), DrawToBitmap(), OnMouseEvent(), and OnPaint().
|
private |
Definition at line 184 of file ASlider.h.
Referenced by AdjustSize(), DrawToBitmap(), OnMouseEvent(), and OnPaint().
|
private |
Definition at line 202 of file ASlider.h.
Referenced by DragPositionToValue(), and OnMouseEvent().
|
private |
Definition at line 201 of file ASlider.h.
Referenced by DragPositionToValue(), and OnMouseEvent().
|
private |
Definition at line 212 of file ASlider.h.
Referenced by Decrease(), DoShowDialog(), FormatPopWin(), Get(), Increase(), Init(), OnKeyDown(), OnMouseEvent(), OnPaint(), SendUpdate(), and Set().
|
private |
Definition at line 214 of file ASlider.h.
Referenced by Init(), OnMouseEvent(), and SetDefaultShortcut().
|
private |
Definition at line 215 of file ASlider.h.
Referenced by Init(), OnMouseEvent(), and SetDefaultValue().
|
private |
Definition at line 230 of file ASlider.h.
Referenced by GetEnabled(), Init(), OnKeyDown(), OnMouseEvent(), and SetEnabled().
|
private |
Definition at line 181 of file ASlider.h.
Referenced by AdjustSize(), DoShowDialog(), DrawToBitmap(), and SetPopWinPosition().
|
private |
Definition at line 195 of file ASlider.h.
Referenced by AdjustSize(), ClickPositionToValue(), DragPositionToValue(), DrawToBitmap(), and ValueToPosition().
|
private |
|
private |
|
private |
Definition at line 224 of file ASlider.h.
Referenced by Init(), OnMouseEvent(), and Set().
|
private |
Definition at line 177 of file ASlider.h.
Referenced by ClickPositionToValue(), Move(), OnMouseEvent(), OnPaint(), SetPopWinPosition(), and ShowDialog().
|
private |
Definition at line 186 of file ASlider.h.
Referenced by AdjustSize(), and DrawToBitmap().
|
private |
Definition at line 205 of file ASlider.h.
Referenced by ClickPositionToValue(), Decrease(), DragPositionToValue(), DrawToBitmap(), GetMaxValue(), GetWidestTips(), Increase(), Init(), OnKeyDown(), SendUpdate(), Set(), and ValueToPosition().
|
private |
Definition at line 204 of file ASlider.h.
Referenced by ClickPositionToValue(), Decrease(), DragPositionToValue(), DrawToBitmap(), GetMinValue(), GetWidestTips(), Increase(), Init(), OnKeyDown(), SendUpdate(), Set(), and ValueToPosition().
|
private |
Definition at line 228 of file ASlider.h.
Referenced by DoShowDialog(), GetTip(), and Init().
|
private |
Definition at line 172 of file ASlider.h.
Referenced by AdjustSize(), ClickPositionToValue(), DragPositionToValue(), DrawToBitmap(), Init(), OnMouseEvent(), OnPaint(), SetPopWinPosition(), and ValueToPosition().
|
private |
Definition at line 169 of file ASlider.h.
Referenced by CreatePopWin(), DrawToBitmap(), Init(), OnKeyDown(), OnMouseEvent(), Refresh(), SendUpdate(), SetPopWinPosition(), and ShowDialog().
|
private |
Definition at line 175 of file ASlider.h.
Referenced by Init(), and OnMouseEvent().
|
private |
Definition at line 187 of file ASlider.h.
Referenced by AdjustSize(), and DrawToBitmap().
|
private |
Definition at line 209 of file ASlider.h.
Referenced by DoShowDialog(), GetScroll(), Init(), OnKeyDown(), and SetScroll().
|
private |
Definition at line 210 of file ASlider.h.
Referenced by DoShowDialog(), GetScroll(), Init(), OnKeyDown(), and SetScroll().
|
private |
Definition at line 207 of file ASlider.h.
Referenced by DragPositionToValue(), Init(), and SetSpeed().
|
private |
Definition at line 206 of file ASlider.h.
Referenced by ClickPositionToValue(), Decrease(), DragPositionToValue(), Increase(), and Init().
|
private |
Definition at line 171 of file ASlider.h.
Referenced by DoShowDialog(), DrawToBitmap(), Get(), GetTip(), GetWidestTips(), Init(), and Set().
|
private |
Definition at line 226 of file ASlider.h.
Referenced by DrawToBitmap(), Init(), OnPaint(), Redraw(), and SetEnabled().
|
private |
Definition at line 226 of file ASlider.h.
Referenced by DrawToBitmap(), Init(), OnPaint(), Redraw(), and SetEnabled().
|
private |
Definition at line 199 of file ASlider.h.
Referenced by AdjustSize(), OnMouseEvent(), and OnPaint().
|
private |
Definition at line 198 of file ASlider.h.
Referenced by AdjustSize(), ClickPositionToValue(), OnMouseEvent(), and OnPaint().
|
private |
Definition at line 221 of file ASlider.h.
Referenced by CreatePopWin(), FormatPopWin(), Init(), OnPaint(), SendUpdate(), SetPopWinPosition(), and ShowTip().
|
private |
Definition at line 222 of file ASlider.h.
Referenced by GetTip(), GetWidestTips(), and SetToolTipTemplate().
|
private |
Definition at line 178 of file ASlider.h.
Referenced by Move(), OnMouseEvent(), OnPaint(), SetPopWinPosition(), and ShowDialog().
|
private |
Definition at line 193 of file ASlider.h.
Referenced by AdjustSize(), and DrawToBitmap().
|
private |
Definition at line 180 of file ASlider.h.
Referenced by AdjustSize(), DoShowDialog(), DrawToBitmap(), and SetPopWinPosition().
|
private |
Definition at line 188 of file ASlider.h.
Referenced by AdjustSize(), ClickPositionToValue(), DragPositionToValue(), DrawToBitmap(), and ValueToPosition().