Audacity  2.3.1
Public Member Functions | Private Attributes | List of all members
HighlightTextCtrl Class Referencefinal

#include <Lyrics.h>

Inheritance diagram for HighlightTextCtrl:

Public Member Functions

 HighlightTextCtrl (LyricsPanel *parent, wxWindowID id, const wxString &value=wxT(""), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 
virtual ~HighlightTextCtrl ()
 
void OnMouseEvent (wxMouseEvent &evt)
 

Private Attributes

LyricsPanelmLyricsPanel
 

Detailed Description

Definition at line 50 of file Lyrics.h.

Constructor & Destructor Documentation

HighlightTextCtrl::HighlightTextCtrl ( LyricsPanel parent,
wxWindowID  id,
const wxString &  value = wxT(""),
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize 
)

Definition at line 31 of file Lyrics.cpp.

36 : wxTextCtrl(parent, id, // wxWindow* parent, wxWindowID id,
37  value, // const wxString& value = "",
38  pos, // const wxPoint& pos = wxDefaultPosition,
39  size, // const wxSize& size = wxDefaultSize,
40  wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 | wxTE_AUTO_URL | wxTE_NOHIDESEL), //v | wxHSCROLL)
41  mLyricsPanel(parent)
42 {
43 }
LyricsPanel * mLyricsPanel
Definition: Lyrics.h:63
virtual HighlightTextCtrl::~HighlightTextCtrl ( )
inlinevirtual

Definition at line 58 of file Lyrics.h.

58 {};

Member Function Documentation

void HighlightTextCtrl::OnMouseEvent ( wxMouseEvent &  evt)

Definition at line 45 of file Lyrics.cpp.

References LyricsPanel::FindSyllable(), GetActiveProject(), LyricsPanel::GetCurrentSyllableIndex(), LyricsPanel::GetSyllable(), mLyricsPanel, AudacityProject::mViewInfo, ViewInfo::selectedRegion, AudacityProject::SetSel0(), SelectedRegion::setT1(), and Syllable::t.

46 {
47  if (event.ButtonUp())
48  {
49  long from, to;
50  this->GetSelection(&from, &to);
51 
52  int nCurSyl = mLyricsPanel->GetCurrentSyllableIndex();
53  int nNewSyl = mLyricsPanel->FindSyllable(from);
54  if (nNewSyl != nCurSyl)
55  {
56  Syllable* pCurSyl = mLyricsPanel->GetSyllable(nNewSyl);
58  pProj->SetSel0(pCurSyl->t);
59 
60  //v Should probably select to end as in
61  // SelectActions::Handler::OnSelectCursorEnd,
62  // but better to generalize that in AudacityProject methods.
63  pProj->mViewInfo.selectedRegion.setT1(pCurSyl->t);
64  }
65  }
66 
67  event.Skip();
68 }
Syllable * GetSyllable(int nSyl)
Definition: Lyrics.h:93
SelectedRegion selectedRegion
Definition: ViewInfo.h:162
void SetSel0(double)
Definition: Project.cpp:1483
LyricsPanel * mLyricsPanel
Definition: Lyrics.h:63
int GetCurrentSyllableIndex()
Definition: Lyrics.h:92
double t
Definition: Lyrics.h:37
int FindSyllable(long startChar)
Definition: Lyrics.cpp:221
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:174
bool setT1(double t, bool maySwap=true)
ViewInfo mViewInfo
Definition: Project.h:555
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:311
used in LyricsPanel, a Syllable gives positional information to be used with the bouncing ball effect...
Definition: Lyrics.h:30

Member Data Documentation

LyricsPanel* HighlightTextCtrl::mLyricsPanel
private

Definition at line 63 of file Lyrics.h.

Referenced by OnMouseEvent().


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