123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /* This file was generated by Maki Compiler, do not edit manually */
- #include <precomp.h>
- #include "c_checkbox.h"
- #include <api/script/objcontroller.h>
- C_CheckBox::C_CheckBox(ScriptObject *object) : C_GuiObject(object) {
- inited = 0;
- C_hook(object);
- }
- C_CheckBox::C_CheckBox() {
- inited = 0;
- obj = NULL;
- }
- void C_CheckBox::C_hook(ScriptObject *object) {
- ASSERT(!inited);
- ScriptObjectController *controller = object->vcpu_getController();
- obj = controller->cast(object, checkBoxGuid);
- if (obj != object && obj != NULL)
- controller = obj->vcpu_getController();
- else
- obj = NULL;
- int iter = WASABI_API_APP->app_getInitCount();
- if (!loaded || loaded != iter) {
- loaded = iter;
- ontoggle_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onToggle", this);
- setchecked_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setChecked", this);
- ischecked_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isChecked", this);
- settext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setText", this);
- gettext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getText", this);
- }
- inited = 1;
- }
- C_CheckBox::~C_CheckBox() {
- }
- ScriptObject *C_CheckBox::getScriptObject() {
- if (obj != NULL) return obj;
- return C_CHECKBOX_PARENT::getScriptObject();
- }
- void C_CheckBox::onToggle(int newstate) {
- ASSERT(inited);
- scriptVar a = MAKE_SCRIPT_INT(newstate);
- scriptVar *params[1] = {&a};
- WASABI_API_MAKI->maki_callFunction(getScriptObject(), ontoggle_id, params);
- }
- void C_CheckBox::setChecked(int checked) {
- ASSERT(inited);
- scriptVar a = MAKE_SCRIPT_INT(checked);
- scriptVar *params[1] = {&a};
- WASABI_API_MAKI->maki_callFunction(getScriptObject(), setchecked_id, params);
- }
- int C_CheckBox::isChecked() {
- ASSERT(inited);
- return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), ischecked_id, NULL));
- }
- void C_CheckBox::setText(const wchar_t *txt)
- {
- ASSERT(inited);
- scriptVar a = MAKE_SCRIPT_STRING(txt);
- scriptVar *params[1] = {&a};
- WASABI_API_MAKI->maki_callFunction(getScriptObject(), settext_id, params);
- }
- const wchar_t *C_CheckBox::getText() {
- ASSERT(inited);
- return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettext_id, NULL));
- }
- int C_CheckBox::loaded=0;
- int C_CheckBox::ontoggle_id=0;
- int C_CheckBox::setchecked_id=0;
- int C_CheckBox::ischecked_id=0;
- int C_CheckBox::settext_id=0;
- int C_CheckBox::gettext_id=0;
|