jgillett2
25-11-2012 06:33:48
I love MyGUI and it's whole layout. However, I despise the fact that there isn't much tutorial wise explaining a bit more in depth how to use it. I am having an issue getting my Edit Boxes to accept any text. I click it and I type but nothing will work.
I am injecting all mouse/keyboard events.
I am injecting all mouse/keyboard events.
void LBind::CreateBindings(Ogre::SceneManager *mSceneMgr, MyGUI::Gui *mGUI)
{
LuaState = luaL_newstate();
luabind::open(LuaState);
MyGUI::EditPtr TB = mGUI->createWidget<MyGUI::Edit>("EditBox",10,10,300, 26,MyGUI::Align::Default,"Main");
TB->setNeedKeyFocus(true);
TB->setProperty("ReadOnly","false");
SceneManager *SMgr = new SceneManager();
SMgr->Manager = mSceneMgr;
SMgr->mGUI = mGUI;
luabind::module(LBind::LuaState) [
luabind::class_<ButtonGui>("ButtonGui")
.def(luabind::constructor<>())
.def("SetText", &ButtonGui::setText)
,
luabind::class_<SceneNode>("SceneNode")
.def(luabind::constructor<>())
.def("CreateNode", &SceneNode::CreateNode)
.def("AttachObject",&SceneNode::AttachObject)
,
luabind::class_<SceneManager>("SManager")
.def(luabind::constructor<>())
.def("CreateEntity", &SceneManager::CreateEntity)
.def("GetRootNode",&SceneManager::GetRootNode)
.def("CreateButton",&SceneManager::CreateButton)
,
luabind::class_<Entity>("Entity")
.def(luabind::constructor<>())
,
luabind::def("Print", Print)
];
luabind::globals(LuaState)["SMgr"] = SMgr;
try {
luaL_dostring(
LuaState,
""//"SMgr:CreateButton('Main',10,10,300, 26)"//"SMgr:GetRootNode():CreateNode():AttachObject(SMgr:CreateEntity(\"Head\",\"ogrehead.mesh\"))"
);
}
catch(const std::exception &TheError) {
std::cerr << TheError.what() << std::endl;
}
}