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 "Project.h"
#include "ProjectHistory.h"
#include "ProjectRate.h"
#include "../../../ProjectSettings.h"
#include "../../../ProjectWindow.h"
#include "../../../ProjectWindows.h"
#include "../../../RefreshCode.h"
#include "../../../SyncLock.h"
#include "Theme.h"
#include "../../../TrackArt.h"
#include "../../../TrackArtist.h"
#include "../../../TrackPanelAx.h"
#include "../../../TrackPanel.h"
#include "../../../TrackPanelMouseEvent.h"
#include "UndoManager.h"
#include "ViewInfo.h"
#include "../../../widgets/AudacityTextEntryDialog.h"
#include "../../../widgets/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 2355 of file LabelTrackView.cpp.

◆ GetLabelTrackSyncLockPolicy

Definition at line 2368 of file LabelTrackView.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OnCutSelectedTextID 
OnCopySelectedTextID 
OnPasteSelectedTextID 
OnDeleteSelectedLabelID 
OnEditSelectedLabelID 

Definition at line 1904 of file LabelTrackView.cpp.

1905{
1906 OnCutSelectedTextID = 1, // OSX doesn't like a 0 menu id
1911};
@ OnEditSelectedLabelID
@ OnDeleteSelectedLabelID
@ OnPasteSelectedTextID
@ OnCopySelectedTextID
@ OnCutSelectedTextID

Function Documentation

◆ DEFINE_ATTACHED_VIRTUAL_OVERRIDE() [1/2]

DEFINE_ATTACHED_VIRTUAL_OVERRIDE ( DoGetLabelTrackView  )

Definition at line 2356 of file LabelTrackView.cpp.

2356 {
2357 return [](LabelTrack &track) {
2358 return std::make_shared<LabelTrackView>( track.SharedPointer() );
2359 };
2360}
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:89

◆ DEFINE_ATTACHED_VIRTUAL_OVERRIDE() [2/2]

DEFINE_ATTACHED_VIRTUAL_OVERRIDE ( GetLabelTrackSyncLockPolicy  )

Definition at line 2370 of file LabelTrackView.cpp.

2370 {
2371 return [](auto &) { return SyncLockPolicy::EndSeparator; };
2372}
@ 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 1336 of file LabelTrackView.cpp.

1337{
1338 int keyCode = evt.GetKeyCode();
1339
1340 // Accept everything outside of WXK_START through WXK_COMMAND, plus the keys
1341 // within that range that are usually printable, plus the ones we use for
1342 // keyboard navigation.
1343 return keyCode < WXK_START ||
1344 (keyCode >= WXK_END && keyCode < WXK_UP) ||
1345 (keyCode == WXK_RIGHT) ||
1346 (keyCode >= WXK_NUMPAD0 && keyCode <= WXK_DIVIDE) ||
1347 (keyCode >= WXK_NUMPAD_SPACE && keyCode <= WXK_NUMPAD_ENTER) ||
1348 (keyCode >= WXK_NUMPAD_HOME && keyCode <= WXK_NUMPAD_END) ||
1349 (keyCode >= WXK_NUMPAD_DELETE && keyCode <= WXK_NUMPAD_DIVIDE) ||
1350#if defined(__WXMAC__)
1351 (keyCode > WXK_RAW_CONTROL) ||
1352#endif
1353 (keyCode > WXK_WINDOWS_MENU);
1354}

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

1323{
1324 int keyCode = evt.GetKeyCode();
1325 return (keyCode < WXK_START
1326 && keyCode != WXK_SPACE && keyCode != WXK_DELETE && keyCode != WXK_RETURN) ||
1327 (keyCode >= WXK_NUMPAD0 && keyCode <= WXK_DIVIDE) ||
1328 (keyCode >= WXK_NUMPAD_EQUAL && keyCode <= WXK_NUMPAD_DIVIDE) ||
1329#if defined(__WXMAC__)
1330 (keyCode > WXK_RAW_CONTROL) ||
1331#endif
1332 (keyCode > WXK_WINDOWS_MENU);
1333}

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

Referenced by LabelTrackView::CreateCustomGlyphs().