1
0

xuititlebox.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #include <precomp.h>
  2. #include "xuititlebox.h"
  3. // -----------------------------------------------------------------------
  4. const wchar_t ScriptTitleBoxXuiObjectStr[] = L"Wasabi:TitleBox"; // This is the xml tag
  5. char ScriptTitleBoxXuiSvcName[] = "Wasabi:TitleBox xui object";
  6. XMLParamPair ScriptTitleBox::params[] = {
  7. {SCRIPTTITLEBOX_CENTERED, L"CENTERED"},
  8. {SCRIPTTITLEBOX_CONTENT, L"CONTENT"},
  9. {SCRIPTTITLEBOX_SUFFIX, L"SUFFIX"},
  10. {SCRIPTTITLEBOX_TITLE, L"TITLE"},
  11. };
  12. // -----------------------------------------------------------------------
  13. ScriptTitleBox::ScriptTitleBox() : SCRIPTTITLEBOX_PARENT()
  14. {
  15. myxuihandle = newXuiHandle();
  16. CreateXMLParameters(myxuihandle);
  17. }
  18. void ScriptTitleBox::CreateXMLParameters(int master_handle)
  19. {
  20. //SCRIPTTITLEBOX_PARENT::CreateXMLParameters(master_handle);
  21. int numParams = sizeof(params) / sizeof(params[0]);
  22. hintNumberOfParams(myxuihandle, numParams);
  23. for (int i = 0;i < numParams;i++)
  24. addParam(myxuihandle, params[i], XUI_ATTRIBUTE_IMPLIED);
  25. }
  26. // -----------------------------------------------------------------------
  27. ScriptTitleBox::~ScriptTitleBox()
  28. {}
  29. // -----------------------------------------------------------------------
  30. int ScriptTitleBox::setXuiParam(int xuihandle, int xmlattributeid, const wchar_t *xmlattributename, const wchar_t *value)
  31. {
  32. if (xuihandle != myxuihandle)
  33. return SCRIPTTITLEBOX_PARENT::setXuiParam(xuihandle, xmlattributeid, xmlattributename, value);
  34. // Parcel the values out to the window object we multiply inherit from
  35. switch (xmlattributeid)
  36. {
  37. case SCRIPTTITLEBOX_TITLE:
  38. setTitle(value);
  39. break;
  40. case SCRIPTTITLEBOX_CONTENT:
  41. setChildGroup(value);
  42. break;
  43. case SCRIPTTITLEBOX_CENTERED:
  44. setCentered(WTOI(value));
  45. break;
  46. case SCRIPTTITLEBOX_SUFFIX:
  47. setSuffix(value);
  48. break;
  49. default:
  50. return 0;
  51. }
  52. return 1;
  53. }