Audacity  2.2.2
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:

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 ( 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 ( void  )

Definition at line 52 of file AttachableScrollBar.cpp.

53 {
54 }

Member Function Documentation

void AttachableScrollBar::OnScroll ( wxScrollEvent &  event)

Definition at line 95 of file AttachableScrollBar.cpp.

References mpViewInfo, and SetViewInfoFromScrollBar().

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 }
void AttachableScrollBar::SetScrollBarFromViewInfo ( )

Definition at line 57 of file AttachableScrollBar.cpp.

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

Referenced by SetViewInfo().

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 }
ViewInfo is used mainly to hold the zooming, selection and scroll information. It also has some statu...
Definition: ViewInfo.h:141
wxInt64 sbarH
Definition: ViewInfo.h:166
double GetBeforeScreenWidth() const
Definition: ViewInfo.h:149
wxInt64 sbarTotal
Definition: ViewInfo.h:168
double GetTotalWidth() const
Definition: ViewInfo.h:155
wxInt64 sbarScreen
Definition: ViewInfo.h:167
void AttachableScrollBar::SetViewInfo ( ViewInfo view)

Definition at line 89 of file AttachableScrollBar.cpp.

References mpViewInfo, and SetScrollBarFromViewInfo().

90 {
91  mpViewInfo = view;
93 }
void AttachableScrollBar::SetViewInfoFromScrollBar ( )

Definition at line 73 of file AttachableScrollBar.cpp.

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

Referenced by OnScroll().

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:161
ViewInfo is used mainly to hold the zooming, selection and scroll information. It also has some statu...
Definition: ViewInfo.h:141
wxInt64 sbarH
Definition: ViewInfo.h:166

Member Data Documentation

ViewInfo* AttachableScrollBar::mpViewInfo

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