Advertisement
Guest User

ctrl code bug

a guest
Jun 25th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. void CtrlrPanelCanvas::itemDropped (const SourceDetails &dragSourceDetails)
  2.  
  3. {
  4. ////kalyway add this for the drag component bug in parent box (in edit mode ) ///
  5.  
  6. for (int i = 0; i < getOwner().getSelection().getNumSelected(); ++i)
  7. {
  8. CtrlrComponent* const c = getOwner().getSelection().getSelectedItem (i);
  9.  
  10. if ((bool)c->getProperty(Ids::componentIsLocked) == true)
  11. continue;
  12. ////////////////---------------------------------------------------/////////////////
  13. {
  14. if (dragSourceDetails.description == "__ctrlr_component_selection")
  15.  
  16. {
  17.  
  18. AffineTransform trans = owner.getOwner().getEditor()->moveSelectionToPosition(dragSourceDetails.localPosition.getX(), dragSourceDetails.localPosition.getY());
  19.  
  20. for (int i=0; i<owner.getSelection().getNumSelected(); i++)
  21. {
  22. CtrlrComponent *c = CtrlrComponentTypeManager::getParentIfGroupped(owner.getSelection().getSelectedItem(i));
  23.  
  24. if (c)
  25.  
  26.  
  27.  
  28.  
  29. {
  30. if (CtrlrComponentTypeManager::findType(c) == Ids::uiGroup)
  31. {
  32. CtrlrGroup *g = dynamic_cast<CtrlrGroup*>(c);
  33. if (g)
  34. {
  35. g->setOwned (owner.getSelection().getSelectedItem(i), false);
  36. }
  37. owner.getSelection().getSelectedItem(i)->setBounds (owner.getSelection().getSelectedItem(i)->getBounds().transformed(trans));
  38. }
  39.  
  40. if (CtrlrComponentTypeManager::findType(c) == Ids::uiTabs)
  41. {
  42. CtrlrTabsComponent *t = dynamic_cast<CtrlrTabsComponent*>(c);
  43. if (t)
  44. {
  45. t->setOwned (owner.getSelection().getSelectedItem(i), -1, false);
  46. }
  47. owner.getSelection().getSelectedItem(i)->setBounds (owner.getSelection().getSelectedItem(i)->getBounds().transformed(trans));
  48.  
  49. }
  50. }
  51.  
  52. }
  53. }
  54. }
  55.  
  56. }
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement