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

Namespaces

namespace  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}
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
wxWindow * FindByNameAmongPeers(const wxString &name, const wxWindowList &list)
const char * end(const char *str) noexcept
Definition: StringUtils.h:106

References details::end(), 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}
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
void PathComponents(const wxWindow &window, wxArrayStringEx &components)

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: