Audacity 3.2.0
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 743 of file LabelTrackView.cpp.

744 {
745 if (! pPanel )
746 return nullptr;
747
748 // Fetch the highlighting state
749 auto target = pPanel->Target();
750 if (target) {
751 auto handle = dynamic_cast<LabelGlyphHandle*>( target.get() );
752 if (handle)
753 return &*handle->mpHit;
754 }
755 return nullptr;
756 }
UIHandlePtr Target()
std::shared_ptr< LabelTrackHit > mpHit

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 686 of file LabelTrackView.cpp.

687{
688 *xPos1 = ls.xText;
689 if( cursorPos > 0)
690 {
691 int partWidth;
692 // Calculate the width of the substring and add it to Xpos
693 dc.GetTextExtent(ls.title.Left(cursorPos), &partWidth, NULL);
694 *xPos1 += partWidth;
695 }
696}
wxString title
Definition: LabelTrack.h:81
int xText
Pixel position of right hand glyph.
Definition: LabelTrack.h:87

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

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

Here is the caller graph for this function: