Audacity  2.2.0
LWSlider Class Reference

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 wxString &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 wxString &name, const wxPoint &pos, const wxSize &size, int style, bool heavyweight=false, bool popup=true, int orientation=wxHORIZONTAL)
 
void Init (wxWindow *parent, const wxString &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 wxString &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 OnKeyEvent (wxKeyEvent &event)
 
void Refresh ()
 
bool ShowDialog ()
 
bool ShowDialog (wxPoint pos)
 
void SetEnabled (bool enabled)
 
bool GetEnabled ()
 
void SetParent (wxWindow *parent)
 

Static Public Member Functions

static void DeleteSharedTipPanel ()
 

Private Member Functions

wxString GetTip (float value) const
 
wxString GetMaxTip () const
 
void FormatPopWin ()
 
void SetPopWinPosition ()
 
void CreatePopWin ()
 
void Draw (wxDC &dc)
 
bool DoShowDialog (wxPoint pos)
 
void SendUpdate (float newValue)
 
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< TipPanelmTipPanel
 
wxString mTipTemplate
 
bool mIsDragging
 
std::unique_ptr< wxBitmap > mBitmap
 
std::unique_ptr< wxBitmap > mThumbBitmap
 
std::unique_ptr< wxBitmap > mThumbBitmapHilited
 
wxString mName
 
bool mEnabled
 

Friends

class ASlider
 
class ASliderAx
 

Detailed Description

Lightweight version of ASlider. In other words it does not have a window permanently associated with it.

Constructor & Destructor Documentation

LWSlider::LWSlider ( wxWindow *  parent,
const wxString &  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 
)

References Init().

LWSlider::LWSlider ( wxWindow *  parent,
const wxString &  name,
const wxPoint &  pos,
const wxSize &  size,
int  style,
bool  heavyweight = false,
bool  popup = true,
int  orientation = wxHORIZONTAL 
)
LWSlider::~LWSlider ( )
virtual

Member Function Documentation

void LWSlider::AdjustSize ( const wxSize &  sz)
float LWSlider::ClickPositionToValue ( int  fromPos,
bool  shiftDown 
)
private
void LWSlider::CreatePopWin ( )
private

References GetMaxTip(), mParent, and mTipPanel.

Referenced by ShowTip().

static void LWSlider::DeleteSharedTipPanel ( )
static
bool LWSlider::DoShowDialog ( wxPoint  pos)
private
float LWSlider::DragPositionToValue ( int  fromPos,
bool  shiftDown 
)
private
void LWSlider::FormatPopWin ( )
private

References GetTip(), mCurrentValue, and mTipPanel.

Referenced by SendUpdate(), and ShowTip().

float LWSlider::Get ( bool  convert = true)
bool LWSlider::GetEnabled ( )

References mEnabled.

wxWindowID LWSlider::GetId ( )

References mID.

wxString LWSlider::GetMaxTip ( ) const
private
void LWSlider::GetScroll ( float &  line,
float &  page 
)

References mScrollLine, and mScrollPage.

wxString LWSlider::GetTip ( float  value) const
private
void LWSlider::Init ( wxWindow *  parent,
const wxString &  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 
)
void LWSlider::Move ( const wxPoint &  newpos)

References mLeft, and mTop.

Referenced by Init().

void LWSlider::OnKeyEvent ( wxKeyEvent &  event)
void LWSlider::OnPaint ( wxDC &  dc,
bool  highlighted 
)
void LWSlider::OnSize ( wxSizeEvent &  event)

References AdjustSize(), and Refresh().

void LWSlider::Refresh ( )
void LWSlider::SendUpdate ( float  newValue)
private
void LWSlider::Set ( float  value)
void LWSlider::SetDefaultShortcut ( bool  value)

References mDefaultShortcut.

Referenced by SetDefaultValue().

void LWSlider::SetDefaultValue ( float  value)
void LWSlider::SetEnabled ( bool  enabled)
void LWSlider::SetId ( wxWindowID  id)

References mID.

void LWSlider::SetParent ( wxWindow *  parent)
inline

References mParent.

void LWSlider::SetPopWinPosition ( )
private

References mHeight, mLeft, mOrientation, mParent, mTipPanel, mTop, and mWidth.

Referenced by ShowTip().

void LWSlider::SetScroll ( float  line,
float  page 
)

References mScrollLine, and mScrollPage.

void LWSlider::SetSpeed ( float  speed)

References mSpeed.

void LWSlider::SetToolTipTemplate ( const wxString &  tip)

References mTipTemplate.

bool LWSlider::ShowDialog ( )
bool LWSlider::ShowDialog ( wxPoint  pos)

References DoShowDialog().

void LWSlider::ShowTip ( bool  show)
int LWSlider::ValueToPosition ( float  val)
private

References mHeightY, mMaxValue, mMinValue, mOrientation, and mWidthX.

Referenced by OnMouseEvent(), and OnPaint().

Friends And Related Function Documentation

friend class ASlider
friend
friend class ASliderAx
friend

Member Data Documentation

std::unique_ptr<wxBitmap> LWSlider::mBitmap
private

Referenced by AdjustSize(), Draw(), Init(), and OnPaint().

int LWSlider::mBottomY
private
bool LWSlider::mCanUseShift
private
int LWSlider::mCenterX
private
int LWSlider::mCenterY
private
int LWSlider::mClickPos
private
float LWSlider::mClickValue
private
float LWSlider::mCurrentValue
private
bool LWSlider::mDefaultShortcut
private
float LWSlider::mDefaultValue
private

Referenced by Init(), OnMouseEvent(), and SetDefaultValue().

bool LWSlider::mEnabled
private
int LWSlider::mHeight
private
int LWSlider::mHeightY
private
bool LWSlider::mHW
private

Referenced by Init(), OnPaint(), and Refresh().

wxWindowID LWSlider::mID
private

Referenced by GetId(), Init(), SendUpdate(), and SetId().

bool LWSlider::mIsDragging
private

Referenced by Init(), OnMouseEvent(), and Set().

int LWSlider::mLeft
private
int LWSlider::mLeftX
private

Referenced by AdjustSize(), and Draw().

wxString LWSlider::mName
private

Referenced by DoShowDialog(), GetMaxTip(), GetTip(), and Init().

wxWindow* LWSlider::mParent
private
bool LWSlider::mPopup
private

Referenced by Init(), and OnMouseEvent().

int LWSlider::mRightX
private

Referenced by AdjustSize(), and Draw().

float LWSlider::mScrollLine
private
float LWSlider::mScrollPage
private
float LWSlider::mSpeed
private

Referenced by DragPositionToValue(), Init(), and SetSpeed().

float LWSlider::mStepValue
private
int LWSlider::mStyle
private
std::unique_ptr<wxBitmap> LWSlider::mThumbBitmap
private

Referenced by Draw(), Init(), OnPaint(), and SetEnabled().

std::unique_ptr<wxBitmap> LWSlider::mThumbBitmapHilited
private

Referenced by Draw(), Init(), OnPaint(), and SetEnabled().

int LWSlider::mThumbHeight
private
int LWSlider::mThumbWidth
private
std::unique_ptr<TipPanel> LWSlider::mTipPanel
private
wxString LWSlider::mTipTemplate
private
int LWSlider::mTop
private
int LWSlider::mTopY
private

Referenced by AdjustSize(), and Draw().

int LWSlider::mWidth
private
int LWSlider::mWidthX
private

The documentation for this class was generated from the following files: