Audacity  3.0.3
Namespaces | Typedefs | Functions
Journal::WindowPaths Namespace Reference

Namespaces

 anonymous_namespace{JournalWindowPaths.cpp}
 

Typedefs

using Path = Identifier
 

Functions

Path FindPath (const wxWindow &window)
 
wxWindow * FindByPath (const Path &path)
 

Typedef Documentation

◆ Path

Definition at line 24 of file JournalWindowPaths.h.

Function Documentation

◆ FindByPath()

wxWindow * Journal::WindowPaths::FindByPath ( const Path path)

Definition at line 116 of file JournalWindowPaths.cpp.

117 {
118  auto components = wxSplit( path.GET(), PathSeparator, EscapeCharacter );
119  if ( !components.empty() ) {
120  auto iter = components.begin(), end = components.end();
121  auto pWindow = FindByNameAmongPeers( *iter++, wxTopLevelWindows );
122  while ( pWindow && iter != end )
123  pWindow = FindByNameAmongPeers( *iter++, pWindow->GetChildren() );
124  return pWindow;
125  }
126  return nullptr;
127 }

References Journal::EscapeCharacter, Journal::WindowPaths::anonymous_namespace{JournalWindowPaths.cpp}::FindByNameAmongPeers(), Identifier::GET(), and Journal::WindowPaths::anonymous_namespace{JournalWindowPaths.cpp}::PathSeparator.

Referenced by Journal::Events::anonymous_namespace{JournalEvents.cpp}::BooleanCommandType(), Journal::Events::anonymous_namespace{JournalEvents.cpp}::NullaryCommandType(), Journal::Events::anonymous_namespace{JournalEvents.cpp}::NumericalCommandType(), and Journal::Events::anonymous_namespace{JournalEvents.cpp}::TextualCommandType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindPath()

Path Journal::WindowPaths::FindPath ( const wxWindow &  window)

Definition at line 109 of file JournalWindowPaths.cpp.

110 {
111  wxArrayStringEx components;
112  PathComponents( window, components );
113  return wxJoin( components, PathSeparator, EscapeCharacter );
114 }

References Journal::EscapeCharacter, Journal::WindowPaths::anonymous_namespace{JournalWindowPaths.cpp}::PathComponents(), and Journal::WindowPaths::anonymous_namespace{JournalWindowPaths.cpp}::PathSeparator.

Referenced by Journal::Events::anonymous_namespace{JournalEvents.cpp}::WindowEventName().

Here is the call graph for this function:
Here is the caller graph for this function:
Journal::WindowPaths::anonymous_namespace{JournalWindowPaths.cpp}::EscapeCharacter
constexpr auto EscapeCharacter
Definition: JournalWindowPaths.cpp:28
wxArrayStringEx
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
Definition: wxArrayStringEx.h:18
Journal::WindowPaths::anonymous_namespace{JournalWindowPaths.cpp}::FindByNameAmongPeers
wxWindow * FindByNameAmongPeers(const wxString &name, const wxWindowList &list)
Definition: JournalWindowPaths.cpp:76
Journal::WindowPaths::anonymous_namespace{JournalWindowPaths.cpp}::PathSeparator
constexpr auto PathSeparator
Definition: JournalWindowPaths.cpp:27
Journal::WindowPaths::anonymous_namespace{JournalWindowPaths.cpp}::PathComponents
void PathComponents(const wxWindow &window, wxArrayStringEx &components)
Definition: JournalWindowPaths.cpp:85