Audacity  3.0.3
Functions
anonymous_namespace{LabelTrackView.cpp} Namespace Reference

Functions

void getXPos (const LabelStruct &ls, wxDC &dc, int *xPos1, int cursorPos)
 
LabelTrackHitfindHit (TrackPanel *pPanel)
 

Function Documentation

◆ findHit()

LabelTrackHit* anonymous_namespace{LabelTrackView.cpp}::findHit ( TrackPanel pPanel)

Definition at line 763 of file LabelTrackView.cpp.

764  {
765  if (! pPanel )
766  return nullptr;
767 
768  // Fetch the highlighting state
769  auto target = pPanel->Target();
770  if (target) {
771  auto handle = dynamic_cast<LabelGlyphHandle*>( target.get() );
772  if (handle)
773  return &*handle->mpHit;
774  }
775  return nullptr;
776  }

References LabelGlyphHandle::mpHit, and CellularPanel::Target().

Referenced by LabelTrackView::Draw().

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

◆ getXPos()

void anonymous_namespace{LabelTrackView.cpp}::getXPos ( const LabelStruct ls,
wxDC &  dc,
int *  xPos1,
int  cursorPos 
)

Definition at line 706 of file LabelTrackView.cpp.

707 {
708  *xPos1 = ls.xText;
709  if( cursorPos > 0)
710  {
711  int partWidth;
712  // Calculate the width of the substring and add it to Xpos
713  dc.GetTextExtent(ls.title.Left(cursorPos), &partWidth, NULL);
714  *xPos1 += partWidth;
715  }
716 }

References LabelStruct::title, and LabelStruct::xText.

Referenced by LabelTrackView::CalcCursorX(), and LabelTrackView::CalcHighlightXs().

Here is the caller graph for this function:
LabelStruct::title
wxString title
Definition: LabelTrack.h:71
CellularPanel::Target
UIHandlePtr Target()
Definition: CellularPanel.cpp:1170
LabelGlyphHandle
Definition: LabelGlyphHandle.h:50
LabelGlyphHandle::mpHit
std::shared_ptr< LabelTrackHit > mpHit
Definition: LabelGlyphHandle.h:85
LabelStruct::xText
int xText
Pixel position of right hand glyph.
Definition: LabelTrack.h:77