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

Method FindIndexInParent

src/MovableControl.cpp:82–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82int MovableControl::FindIndexInParent() const
83{
84 auto parent = GetParent();
85 if(!parent)
86 return -1;
87
88 if(auto sizer = parent->GetSizer())
89 {
90 for(size_t i = 0, count = sizer->GetItemCount(); i < count; ++i)
91 {
92 if(sizer->GetItem(i)->GetWindow() == this)
93 return static_cast<int>(i);
94 }
95 }
96 return -1;
97}
98
99void MovableControl::OnKeyDown(wxKeyEvent& evt)
100{

Callers 1

GetNameMethod · 0.80

Calls 4

GetParentFunction · 0.85
GetSizerMethod · 0.80
GetWindowMethod · 0.80
GetItemMethod · 0.80

Tested by

no test coverage detected