Audacity 3.2.0
Namespaces | Typedefs | Enumerations | Functions | Variables
LabelTrackView.cpp File Reference
#include "LabelTrackView.h"
#include "LabelTrackVRulerControls.h"
#include "LabelGlyphHandle.h"
#include "LabelTextHandle.h"
#include "../../../LabelTrack.h"
#include "AColor.h"
#include "../../../widgets/BasicMenu.h"
#include "AllThemeResources.h"
#include "../../../HitTestResult.h"
#include "PendingTracks.h"
#include "Project.h"
#include "ProjectHistory.h"
#include "ProjectNumericFormats.h"
#include "ProjectRate.h"
#include "../../../ProjectWindows.h"
#include "../../../RefreshCode.h"
#include "SyncLock.h"
#include "Theme.h"
#include "../../../TrackArt.h"
#include "../../../TrackArtist.h"
#include "TrackFocus.h"
#include "../../../TrackPanel.h"
#include "../../../TrackPanelMouseEvent.h"
#include "UndoManager.h"
#include "ViewInfo.h"
#include "Viewport.h"
#include "AudacityTextEntryDialog.h"
#include "wxWidgetsWindowPlacement.h"
#include <wx/clipbrd.h>
#include <wx/dcclient.h>
#include <wx/font.h>
#include <wx/frame.h>
#include <wx/menu.h>
#include "../../../TrackPanelDrawingContext.h"
#include "../../../LabelDialog.h"
Include dependency graph for LabelTrackView.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{LabelTrackView.cpp}
 

Typedefs

using DoGetLabelTrackView = DoGetView::Override< LabelTrack >
 
using GetLabelTrackSyncLockPolicy = GetSyncLockPolicy::Override< const LabelTrack >
 

Enumerations

enum  {
  OnCutSelectedTextID = 1 , OnCopySelectedTextID , OnPasteSelectedTextID , OnDeleteSelectedLabelID ,
  OnEditSelectedLabelID
}
 

Functions

void anonymous_namespace{LabelTrackView.cpp}::getXPos (const LabelStruct &ls, wxDC &dc, int *xPos1, int cursorPos)
 
LabelTrackHitanonymous_namespace{LabelTrackView.cpp}::findHit (TrackPanel *pPanel)
 
static bool IsGoodLabelFirstKey (const wxKeyEvent &evt)
 Returns true for keys we capture to start a label. More...
 
static bool IsGoodLabelEditKey (const wxKeyEvent &evt)
 This returns true for keys we capture for label editing. More...
 
 DEFINE_ATTACHED_VIRTUAL_OVERRIDE (DoGetLabelTrackView)
 
 DEFINE_ATTACHED_VIRTUAL_OVERRIDE (GetLabelTrackSyncLockPolicy)
 

Variables

static const char *const GlyphXpmRegionSpec []
 

Typedef Documentation

◆ DoGetLabelTrackView

Definition at line 2333 of file LabelTrackView.cpp.

◆ GetLabelTrackSyncLockPolicy

Definition at line 2347 of file LabelTrackView.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OnCutSelectedTextID 
OnCopySelectedTextID 
OnPasteSelectedTextID 
OnDeleteSelectedLabelID 
OnEditSelectedLabelID 

Definition at line 1886 of file LabelTrackView.cpp.

1887{
1888 OnCutSelectedTextID = 1, // OSX doesn't like a 0 menu id
1893};
@ OnEditSelectedLabelID
@ OnDeleteSelectedLabelID
@ OnPasteSelectedTextID
@ OnCopySelectedTextID
@ OnCutSelectedTextID

Function Documentation

◆ DEFINE_ATTACHED_VIRTUAL_OVERRIDE() [1/2]

DEFINE_ATTACHED_VIRTUAL_OVERRIDE ( DoGetLabelTrackView  )

Definition at line 2334 of file LabelTrackView.cpp.

2334 {
2335 return [](LabelTrack &track, size_t) {
2336 return std::make_shared<LabelTrackView>(
2337 track.SharedPointer<LabelTrack>());
2338 };
2339}
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:95
std::shared_ptr< Subclass > SharedPointer()
Definition: Track.h:146

References Track::SharedPointer().

Here is the call graph for this function:

◆ DEFINE_ATTACHED_VIRTUAL_OVERRIDE() [2/2]

DEFINE_ATTACHED_VIRTUAL_OVERRIDE ( GetLabelTrackSyncLockPolicy  )

Definition at line 2349 of file LabelTrackView.cpp.

2349 {
2350 return [](auto &) { return SyncLockPolicy::EndSeparator; };
2351}
@ EndSeparator
Delimits the end of a group (of which it is a part)

References EndSeparator.

◆ IsGoodLabelEditKey()

static bool IsGoodLabelEditKey ( const wxKeyEvent &  evt)
static

This returns true for keys we capture for label editing.

Definition at line 1318 of file LabelTrackView.cpp.

1319{
1320 int keyCode = evt.GetKeyCode();
1321
1322 // Accept everything outside of WXK_START through WXK_COMMAND, plus the keys
1323 // within that range that are usually printable, plus the ones we use for
1324 // keyboard navigation.
1325 return keyCode < WXK_START ||
1326 (keyCode >= WXK_END && keyCode < WXK_UP) ||
1327 (keyCode == WXK_RIGHT) ||
1328 (keyCode >= WXK_NUMPAD0 && keyCode <= WXK_DIVIDE) ||
1329 (keyCode >= WXK_NUMPAD_SPACE && keyCode <= WXK_NUMPAD_ENTER) ||
1330 (keyCode >= WXK_NUMPAD_HOME && keyCode <= WXK_NUMPAD_END) ||
1331 (keyCode >= WXK_NUMPAD_DELETE && keyCode <= WXK_NUMPAD_DIVIDE) ||
1332#if defined(__WXMAC__)
1333 (keyCode > WXK_RAW_CONTROL) ||
1334#endif
1335 (keyCode > WXK_WINDOWS_MENU);
1336}

Referenced by LabelTrackView::DoCaptureKey(), and LabelTrackView::DoKeyDown().

Here is the caller graph for this function:

◆ IsGoodLabelFirstKey()

static bool IsGoodLabelFirstKey ( const wxKeyEvent &  evt)
static

Returns true for keys we capture to start a label.

Definition at line 1304 of file LabelTrackView.cpp.

1305{
1306 int keyCode = evt.GetKeyCode();
1307 return (keyCode < WXK_START
1308 && keyCode != WXK_SPACE && keyCode != WXK_DELETE && keyCode != WXK_RETURN) ||
1309 (keyCode >= WXK_NUMPAD0 && keyCode <= WXK_DIVIDE) ||
1310 (keyCode >= WXK_NUMPAD_EQUAL && keyCode <= WXK_NUMPAD_DIVIDE) ||
1311#if defined(__WXMAC__)
1312 (keyCode > WXK_RAW_CONTROL) ||
1313#endif
1314 (keyCode > WXK_WINDOWS_MENU);
1315}

Referenced by LabelTrackView::DoCaptureKey(), and LabelTrackView::DoKeyDown().

Here is the caller graph for this function:

Variable Documentation

◆ GlyphXpmRegionSpec

const char* const GlyphXpmRegionSpec[]
static

Definition at line 2159 of file LabelTrackView.cpp.

Referenced by LabelTrackView::CreateCustomGlyphs().