@CopyElements.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class CopyElements : ClosableWindow
  4. {
  5. class ProjListElm // project as list element
  6. {
  7. Str name, path;
  8. UID id;
  9. ProjListElm(C Projects::Elm &src);
  10. ProjListElm(C Project &src);
  11. public:
  12. ProjListElm();
  13. };
  14. class ReplaceElms : ClosableWindow
  15. {
  16. class ElmListElm // project element as list element
  17. {
  18. Str name;
  19. UID id;
  20. Memc<UID> children; // hidden elements merged with this (the parent)
  21. ElmListElm(C UID &elm_id);
  22. static int Compare(C ElmListElm &a, C ElmListElm &b);
  23. public:
  24. ElmListElm();
  25. };
  26. Text text;
  27. Memc<ElmListElm> data;
  28. List<ElmListElm> list;
  29. Region region;
  30. Button copy;
  31. static void Copy(ReplaceElms &re);
  32. void copyDo();
  33. void create();
  34. void check();
  35. };
  36. Memc<Str > elms_data;
  37. List<Str > elms_list;
  38. Memc<ProjListElm> proj_data;
  39. List<ProjListElm> proj_list;
  40. Text elms_text, proj_text;
  41. Region elms_region, proj_region;
  42. Button include_children, include_dependencies, include_parents, copy;
  43. Memc<UID> sel, elms_to_copy, elms_copied, elms_replaced, changed_body, processed_dep, texs_to_copy; // need to be binary sorted
  44. int src_ver;
  45. ProjectHierarchy temp_src , *src ;
  46. Project temp_dest, *dest;
  47. ProjListElm target;
  48. UID root;
  49. ReplaceElms replace_elms;
  50. Pak esenthel_project_pak;
  51. static void Refresh(CopyElements &ce);
  52. static void Copy (CopyElements &ce);
  53. bool canCopy()C;
  54. void create();
  55. void floodSelected(ElmNode &node, bool parent_selected=false, bool parent_removed=false);
  56. void includeTex(C UID &tex_id);
  57. void includeDep(C UID &elm_id);
  58. void includeDep(C GuiObj &obj); // here all objects should include their dependencies
  59. void refresh();
  60. void resize();
  61. void display(C Str &esenthel_project_file=S);
  62. void copyDo();
  63. void drop(Memc<Str> &names, GuiObj *focus_obj, C Vec2 &screen_pos);
  64. void close();
  65. public:
  66. CopyElements();
  67. };
  68. /******************************************************************************/
  69. /******************************************************************************/
  70. extern CopyElements CopyElms;
  71. /******************************************************************************/