How do I determine what window type my Window is, as in Editbox, MultilineEditbox, Button or something else?
With the CEGUI::Window::getType() I only get the looknfeel type which could be ANYTHING in the heart of the dear guy who wrote it (MyGUISheet/Editbox or even MyGUISheet/LeetBoxForJustAboutEverything).
Maybe I don't need it at all? Say I wan't to set readonly on my window.
Code: Select all
static_cast<CEGUI::Editbox*>(m_Window)->setReadOnly(true);
That works.. If the window is an editbox.
I need a function to cast it to the right Window type and then set read only, or abort if the Window type isn't a type who has setReadOnly anyway.
My original plan was something like this
Code: Select all
String type = m_Window->getType().c_str();
if(type == "Editbox")
static_cast<CEGUI::Editbox*>(m_Window)->setReadOnly(mode);
else if(type == "MultiLineEditbox")
static_cast<CEGUI::MultiLineEditbox*>(m_Window)->setReadOnly(mode);
else
Log("Don't set read only on something that can't be...");
Thank you for your help