c_edit.cpp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /* This file was generated by Maki Compiler, do not edit manually */
  2. #include <precomp.h>
  3. #include "c_edit.h"
  4. #include <api/script/objcontroller.h>
  5. C_Edit::C_Edit(ScriptObject *object) : C_GuiObject(object) {
  6. inited = 0;
  7. obj = NULL;
  8. C_hook(object);
  9. }
  10. C_Edit::C_Edit() {
  11. inited = 0;
  12. obj = NULL;
  13. }
  14. void C_Edit::C_hook(ScriptObject *object) {
  15. ASSERT(!inited);
  16. ScriptObjectController *controller = object->vcpu_getController();
  17. obj = controller->cast(object, editGuid);
  18. if (obj != object && obj != NULL)
  19. controller = obj->vcpu_getController();
  20. else
  21. obj = NULL;
  22. int iter = WASABI_API_APP->app_getInitCount();
  23. if (!loaded || loaded != iter) {
  24. loaded = iter;
  25. onenter_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEnter", this);
  26. onabort_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onAbort", this);
  27. onidleeditupdate_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onIdleEditUpdate", this);
  28. oneditupdate_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEditUpdate", this);
  29. settext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setText", this);
  30. setautoenter_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setAutoEnter", this);
  31. getautoenter_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getAutoEnter", this);
  32. gettext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getText", this);
  33. selectall_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"selectAll", this);
  34. enter_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enter", this);
  35. setidleenabled_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setIdleEnabled", this);
  36. getidleenabled_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getIdleEnabled", this);
  37. }
  38. inited = 1;
  39. }
  40. C_Edit::~C_Edit() {
  41. }
  42. ScriptObject *C_Edit::getScriptObject() {
  43. if (obj != NULL) return obj;
  44. return C_EDIT_PARENT::getScriptObject();
  45. }
  46. void C_Edit::onEnter() {
  47. ASSERT(inited);
  48. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onenter_id, NULL);
  49. }
  50. void C_Edit::onAbort() {
  51. ASSERT(inited);
  52. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onabort_id, NULL);
  53. }
  54. void C_Edit::onIdleEditUpdate() {
  55. ASSERT(inited);
  56. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onidleeditupdate_id, NULL);
  57. }
  58. void C_Edit::onEditUpdate() {
  59. ASSERT(inited);
  60. WASABI_API_MAKI->maki_callFunction(getScriptObject(), oneditupdate_id, NULL);
  61. }
  62. void C_Edit::setText(const wchar_t *txt)
  63. {
  64. ASSERT(inited);
  65. scriptVar a = MAKE_SCRIPT_STRING(txt);
  66. scriptVar *params[1] = {&a};
  67. WASABI_API_MAKI->maki_callFunction(getScriptObject(), settext_id, params);
  68. }
  69. void C_Edit::setAutoEnter(int onoff) {
  70. ASSERT(inited);
  71. scriptVar a = MAKE_SCRIPT_INT(onoff);
  72. scriptVar *params[1] = {&a};
  73. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setautoenter_id, params);
  74. }
  75. int C_Edit::getAutoEnter() {
  76. ASSERT(inited);
  77. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getautoenter_id, NULL));
  78. }
  79. const wchar_t *C_Edit::getText()
  80. {
  81. ASSERT(inited);
  82. return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettext_id, NULL));
  83. }
  84. void C_Edit::selectAll() {
  85. ASSERT(inited);
  86. WASABI_API_MAKI->maki_callFunction(getScriptObject(), selectall_id, NULL);
  87. }
  88. void C_Edit::enter() {
  89. ASSERT(inited);
  90. WASABI_API_MAKI->maki_callFunction(getScriptObject(), enter_id, NULL);
  91. }
  92. void C_Edit::setIdleEnabled(int onoff) {
  93. ASSERT(inited);
  94. scriptVar a = MAKE_SCRIPT_INT(onoff);
  95. scriptVar *params[1] = {&a};
  96. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setidleenabled_id, params);
  97. }
  98. int C_Edit::getIdleEnabled() {
  99. ASSERT(inited);
  100. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getidleenabled_id, NULL));
  101. }
  102. int C_Edit::loaded=0;
  103. int C_Edit::onenter_id=0;
  104. int C_Edit::onabort_id=0;
  105. int C_Edit::onidleeditupdate_id=0;
  106. int C_Edit::oneditupdate_id=0;
  107. int C_Edit::settext_id=0;
  108. int C_Edit::setautoenter_id=0;
  109. int C_Edit::getautoenter_id=0;
  110. int C_Edit::gettext_id=0;
  111. int C_Edit::selectall_id=0;
  112. int C_Edit::enter_id=0;
  113. int C_Edit::setidleenabled_id=0;
  114. int C_Edit::getidleenabled_id=0;