xuisendparams.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #include <precomp.h>
  2. #include "xuisendparams.h"
  3. #include <api/script/scriptguid.h>
  4. // -----------------------------------------------------------------------
  5. const wchar_t SendParamsXuiObjectStr[] = L"SendParams"; // This is the xml tag
  6. char SendParamsXuiSvcName[] = "SendParams xui object";
  7. // -----------------------------------------------------------------------
  8. SendParams::SendParams():myxuihandle(0) {
  9. }
  10. // -----------------------------------------------------------------------
  11. SendParams::~SendParams() {
  12. pastlist.deleteAll();
  13. }
  14. // -----------------------------------------------------------------------
  15. int SendParams::setXmlParam(const wchar_t *param, const wchar_t *value)
  16. {
  17. int r = SENDPARAMS_PARENT::setXmlParam(param, value);
  18. if (!WCSCASEEQLSAFE(param, L"group") && !WCSCASEEQLSAFE(param, L"target")) {
  19. Pair<StringW, StringW> *pair = new Pair<StringW, StringW>(param, value);
  20. pastlist.addItem(pair);
  21. }
  22. return r;
  23. }
  24. // -----------------------------------------------------------------------
  25. void SendParams::actuator_onPerform(GuiObject *target) { // guaranteed non NULL
  26. SENDPARAMS_PARENT::actuator_onPerform(target);
  27. XmlObject *xtarget = static_cast<XmlObject *>(target->guiobject_getScriptObject()->vcpu_getInterface(xmlObjectGuid));
  28. foreach(pastlist)
  29. xtarget->setXmlParam(pastlist.getfor()->a, pastlist.getfor()->b);
  30. endfor;
  31. }