1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Do without some friend declarations in LabelTrack...

... and leave "updated" alone, it's only for use in interactive dragging
This commit is contained in:
Paul Licameli
2018-11-08 16:53:45 -05:00
parent 0750f62e88
commit 8ff5a4b345
5 changed files with 55 additions and 35 deletions

View File

@@ -148,6 +148,15 @@ LabelTrack::LabelTrack(const LabelTrack &orig) :
ResetFlags();
}
void LabelTrack::SetLabel( size_t iLabel, const LabelStruct &newLabel )
{
if( iLabel >= mLabels.size() ) {
wxASSERT( false );
mLabels.resize( iLabel + 1 );
}
mLabels[ iLabel ] = newLabel;
}
LabelTrack::~LabelTrack()
{
}
@@ -937,6 +946,14 @@ void LabelTrack::Draw
}
}
void LabelTrack::SetSelectedIndex( int index )
{
if ( index >= 0 && index < mLabels.size() )
mSelIndex = index;
else
mSelIndex = -1;
}
/// uses GetTextExtent to find the character position
/// corresponding to the x pixel position.
int LabelTrack::FindCurrentCursorPosition(int xPos)