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

Method GetDropTargets

src/widgets/ExpandingToolBar.cpp:1215–1249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1213}
1214
1215std::vector<wxRect> ToolBarArea::GetDropTargets()
1216{
1217 mDropTargets.clear();
1218 mDropTargetIndices.clear();
1219 mDropTargetRows.clear();
1220
1221 int numChildren = (int)mChildArray.size();
1222 int i;
1223 int row = -1;
1224
1225 if (numChildren == 0)
1226 return mDropTargets;
1227
1228 for(i=0; i<numChildren; i++) {
1229 int childRow = mRowArray[i];
1230 wxRect childRect = mChildArray[i]->GetRect();
1231
1232 if (childRow != row) {
1233 // Add a target before this child (at beginning of row only)
1234 row = childRow;
1235 mDropTargetIndices.push_back(i);
1236 mDropTargetRows.push_back(row);
1237 mDropTargets.push_back(wxRect(childRect.x, childRect.y,
1238 0, childRect.height));
1239 }
1240
1241 // Add a target after this child (always)
1242 mDropTargetIndices.push_back(i+1);
1243 mDropTargetRows.push_back(row);
1244 mDropTargets.push_back(wxRect(childRect.x+childRect.width, childRect.y,
1245 0, childRect.height));
1246 }
1247
1248 return mDropTargets;
1249}
1250
1251void ToolBarArea::MoveChild(ExpandingToolBar *toolBar, wxRect dropTarget)
1252{

Callers 1

StartMovingMethod · 0.80

Calls 4

wxRectClass · 0.70
clearMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected