MCPcopy Create free account
hub / github.com/audacity/audacity / ExploreWindows

Method ExploreWindows

src/commands/GetInfoCommand.cpp:761–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

759
760
761void GetInfoCommand::ExploreWindows( const CommandContext &context,
762 wxPoint P, wxWindow * pWin, int Id, int depth )
763{
764 static_cast<void>(Id);//Compiler food.
765
766 if( pWin->GetName() == "Track Panel" )
767 {
768 wxRect R = pWin->GetScreenRect();
769 ExploreTrackPanel( context, R.GetPosition()-P, depth );
770 return;
771 }
772 wxWindowList list = pWin->GetChildren();
773 size_t lcnt = list.size();
774
775 for (size_t lndx = 0; lndx < lcnt; lndx++) {
776 wxWindow * item = list[lndx];
777 if( !item->IsShown() )
778 continue;
779 wxRect R = item->GetScreenRect();
780 R.SetPosition( R.GetPosition() - P );
781 wxString Name = item->GetName();
782 // Ignore staticLine and StaticBitmap.
783 if( Name.StartsWith( "static" ) )
784 continue;
785 // Ignore anonymous panels.
786 if( Name == "panel" )
787 continue;
788 if( Name.empty() )
789 Name = wxString("*") + item->GetToolTipText();
790
791 context.StartStruct();
792 context.AddItem( depth, "depth" );
793 context.AddItem( Name, "label" );
794 context.AddItem( item->GetId(), "id" );
795 context.StartField( "box" );
796 context.StartArray();
797 context.AddItem( R.GetLeft() );
798 context.AddItem( R.GetTop() );
799 context.AddItem( R.GetRight() );
800 context.AddItem( R.GetBottom() );
801 context.EndArray();
802 context.EndField();
803 context.EndStruct();
804
805 ExploreWindows( context, P, item, item->GetId(), depth+1 );
806 }
807}
808
809namespace {
810using namespace MenuRegistry;

Callers

nothing calls this directly

Calls 15

GetChildrenMethod · 0.80
IsShownMethod · 0.80
SetPositionMethod · 0.80
GetIdMethod · 0.80
GetRightMethod · 0.80
wxStringClass · 0.70
GetNameMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
StartStructMethod · 0.45
AddItemMethod · 0.45
StartFieldMethod · 0.45

Tested by

no test coverage detected