groupwndcreate.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include <precomp.h>
  2. #include "groupwndcreate.h"
  3. #include <api/skin/guitree.h>
  4. #include <api/skin/groupmgr.h>
  5. // 5/15/2002, removed serving of groups by guid xui param, guid is 'non-overriden window guaranteed', groupid is 'allow override implicitly'
  6. /*int GroupWndCreateSvc::testGuid(GUID g) {
  7. return (GuiTree::getGroupDef(g) >= 0);
  8. }
  9. api_window *GroupWndCreateSvc::createWindowByGuid(GUID g, api_window *parent) {
  10. int n = GuiTree::getGroupDef(g);
  11. if (n < 0) return NULL;
  12. return createGuiTreeItem(n, parent);
  13. }*/
  14. ifc_window *GroupWndCreateSvc::createWindowOfType(const wchar_t *windowtype, ifc_window *parent, int i)
  15. {
  16. SkinItem *item = guiTree->enumGroupDefOfType(windowtype, i);
  17. if (item == NULL) return NULL;
  18. return createGuiTreeItem(item, parent);
  19. }
  20. ifc_window *GroupWndCreateSvc::createGuiTreeItem(SkinItem*item, ifc_window *parent)
  21. {
  22. ifc_window *wnd = GroupMgr::instantiate(NULL, GROUP_GROUP, item);
  23. if (!wnd) return NULL;
  24. wnd->setParent(parent);
  25. group_list.addItem(wnd);
  26. num_group_list = group_list.getNumItems();
  27. return wnd;
  28. }
  29. int GroupWndCreateSvc::destroyWindow(ifc_window *w)
  30. {
  31. if (group_list.haveItem(w))
  32. {
  33. group_list.removeItem(w);
  34. WASABI_API_SKIN->group_destroy(w);
  35. num_group_list = group_list.getNumItems();
  36. return 1;
  37. }
  38. return 0;
  39. }
  40. int GroupWndCreateSvc::num_group_list = 0;