Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
AttachableScrollBar Class Referencefinal

An AttachableScrollBar is a scroll bar that can be attached to multiple items and so control their scrolling. Uses floats internally, not ints, allowing for (external) control of zooming. More...

#include <AttachableScrollBar.h>

Inheritance diagram for AttachableScrollBar:
[legend]
Collaboration diagram for AttachableScrollBar:
[legend]

Public Member Functions

 AttachableScrollBar (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSB_HORIZONTAL)
 
 ~AttachableScrollBar (void)
 
void OnScroll (wxScrollEvent &event)
 
void SetViewInfo (ViewInfo *view)
 
void SetScrollBarFromViewInfo ()
 
void SetViewInfoFromScrollBar ()
 

Public Attributes

ViewInfompViewInfo
 

Detailed Description

An AttachableScrollBar is a scroll bar that can be attached to multiple items and so control their scrolling. Uses floats internally, not ints, allowing for (external) control of zooming.

Limitations:

Definition at line 24 of file AttachableScrollBar.h.

Constructor & Destructor Documentation

◆ AttachableScrollBar()

AttachableScrollBar::AttachableScrollBar ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxSB_HORIZONTAL 
)

Definition at line 41 of file AttachableScrollBar.cpp.

46 :
47 wxScrollBar( parent, id, pos, size, style )
48{
49 mpViewInfo = NULL;
50}

◆ ~AttachableScrollBar()

AttachableScrollBar::~AttachableScrollBar ( void  )

Definition at line 52 of file AttachableScrollBar.cpp.

53{
54}

Member Function Documentation

◆ OnScroll()

void AttachableScrollBar::OnScroll ( wxScrollEvent &  event)

Definition at line 95 of file AttachableScrollBar.cpp.

96{
97 if( mpViewInfo == NULL )
98 {
99 event.Skip();
100 return;
101 }
103 event.Skip(); // This is so that the parent control can refresh whatever it needs to...
104}

References mpViewInfo, and SetViewInfoFromScrollBar().

Here is the call graph for this function:

◆ SetScrollBarFromViewInfo()

void AttachableScrollBar::SetScrollBarFromViewInfo ( )

Definition at line 57 of file AttachableScrollBar.cpp.

58{
59 // FIXME: PRL Aug 2015: Screen Width in Viewinfo Not needed?
60#if 0
61 ViewInfo & mViewInfo = *mpViewInfo;
62
63 mViewInfo.sbarTotal = (int) (mViewInfo.GetTotalWidth());
64 mViewInfo.sbarScreen = (int) (mViewInfo.GetScreenWidth());
65 mViewInfo.sbarH = (int) (mViewInfo.GetBeforeScreenWidth());
66
67 SetScrollbar(mViewInfo.sbarH, mViewInfo.sbarScreen,
68 mViewInfo.sbarTotal, mViewInfo.sbarScreen, TRUE);
69#endif
70}
wxInt64 sbarTotal
Definition: ViewInfo.h:225
double GetBeforeScreenWidth() const
Definition: ViewInfo.h:205
wxInt64 sbarScreen
Definition: ViewInfo.h:224
double GetTotalWidth() const
Definition: ViewInfo.h:211
wxInt64 sbarH
Definition: ViewInfo.h:223

References ViewInfo::GetBeforeScreenWidth(), ViewInfo::GetTotalWidth(), mpViewInfo, ViewInfo::sbarH, ViewInfo::sbarScreen, and ViewInfo::sbarTotal.

Referenced by SetViewInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetViewInfo()

void AttachableScrollBar::SetViewInfo ( ViewInfo view)

Definition at line 89 of file AttachableScrollBar.cpp.

90{
91 mpViewInfo = view;
93}

References mpViewInfo, and SetScrollBarFromViewInfo().

Here is the call graph for this function:

◆ SetViewInfoFromScrollBar()

void AttachableScrollBar::SetViewInfoFromScrollBar ( )

Definition at line 73 of file AttachableScrollBar.cpp.

74{
75 // FIXME: PRL Aug 2015: Screen Width in Viewinfo Not needed?
76#if 0
77 ViewInfo & mViewInfo = *mpViewInfo;
78
79 int hlast = mViewInfo.sbarH;
80
81 mViewInfo.sbarH = GetThumbPosition();
82
83 if (mViewInfo.sbarH != hlast)
84 mViewInfo.SetBeforeScreenWidth(mViewInfo.sbarH);
85#endif
86}
void SetBeforeScreenWidth(wxInt64 beforeWidth, wxInt64 screenWidth, double lowerBoundTime=0.0)
Definition: ViewInfo.cpp:280

References mpViewInfo, ViewInfo::sbarH, and ViewInfo::SetBeforeScreenWidth().

Referenced by OnScroll().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mpViewInfo

ViewInfo* AttachableScrollBar::mpViewInfo

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