| 759 | |
| 760 | |
| 761 | void 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 | |
| 809 | namespace { |
| 810 | using namespace MenuRegistry; |
nothing calls this directly
no test coverage detected