00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include <iostream>
00012 #include "jshandler.h"
00013 #include "jsscripting.h"
00014
00015 EXPORT_VRUT_MODULE_FUNCTIONS( JSScriptingModule )
00016
00017 using namespace VRUT;
00018 using namespace std;
00019
00021 JSScriptingModule::JSScriptingModule(const MODULE_ID & _id,
00022 const wxString & _name, EventHandler * msgSink) :
00023 KernelModule(_id, _name, 0, msgSink)
00024 {
00026 handler = new JSHandler(this);
00027
00029 sceneID = 0;
00030 scriptPath = wxT("../modules/scripting/scripts/test.js");
00031 REGISTER_PARAM_GUI_TEXTCONTROL(sceneParamID, wxT("sceneID"), wxT("0"), wxT("ID of scene to handle."));
00032 REGISTER_PARAM_GUI_TEXTCONTROL(pathParamID, wxT("scriptPath"), scriptPath, wxT("Path of the script."));
00033 REGISTER_PARAM_GUI_BUTTON(runParamID, wxT("runScript"), wxT("runScript"));
00034
00036 kernelMsgSink->UnregisterListener(GetID());
00037 REGISTER_LISTENER(Event::EVT_ALL);
00038
00039 }
00040
00042 JSScriptingModule::~JSScriptingModule()
00043 {
00044 delete handler;
00045 }
00046
00048 void JSScriptingModule::processEvent(wxCommandEvent & evt)
00049 {
00051 Module::processEvent(evt);
00052
00054 handler->ProcessEvent(evt);
00055 while (handler->RunScript())
00056 continue;
00057
00058 }
00059
00060
00062 void JSScriptingModule::kernelRun()
00063 {
00064
00065 }
00066
00067