Find array of window names, starting with a top-level window and ending with the given window, or an empty array if the conditions fail for uniqueness of names.
| 83 | // with the given window, or an empty array if the conditions fail for |
| 84 | // uniqueness of names. |
| 85 | void PathComponents( const wxWindow &window, wxArrayStringEx &components ) |
| 86 | { |
| 87 | if ( dynamic_cast<const wxTopLevelWindow*>( &window ) ) { |
| 88 | if ( HasUniqueNameAmongPeers( window, wxTopLevelWindows ) ) { |
| 89 | components.push_back( window.GetName() ); |
| 90 | return; |
| 91 | } |
| 92 | } |
| 93 | else if ( auto pParent = window.GetParent() ) { |
| 94 | // Recur |
| 95 | PathComponents( *pParent, components ); |
| 96 | if ( !components.empty() && |
| 97 | HasUniqueNameAmongPeers( window, pParent->GetChildren() ) ) { |
| 98 | components.push_back( window.GetName() ); |
| 99 | return; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | // Failure |
| 104 | components.clear(); |
| 105 | } |
| 106 | |
| 107 | } |
| 108 |
no test coverage detected