how can i get the skin name

benny5609

09-11-2010 09:22:38

Hi there! :D first time to post on MyGUI, too. :mrgreen:
I have a question, and need some help. :roll:

MyGUI::Window* window = MyGUI::Gui::getInstance().createWidget<MyGUI::Window>("WindowCS", MyGUI::IntCoord(10, 10, 300, 230),
MyGUI::Align::Default, "Main", "first window");

printf("type name:%s__\n \
variable name:%s__\n \
layer name:%s__\n \
class type name:%s__\n \
texture name:%s__\n ",
window->getTypeName().c_str(),
window->getName().c_str(),
window->getLayer()->getName().c_str(),
window->getClassTypeName().c_str(),
window->_getTextureName().c_str());

I just want to get the skin name "WindowCS", seems the functions i use in code are not work.
what widget member function i can use? :shock:
Excuse me for my broken english. :o

my.name

09-11-2010 10:29:40

It is impossible

Altren

09-11-2010 13:24:20

You can save it manually though:
window->setUserString("SkinName", "WindowCS");
// ...
std::string skinName = window->getUserString("SkinName");
By the way - why you need that?

benny5609

09-11-2010 14:08:15

It is impossible
:shock: OK!
One more question about MyGUI::Align

//*****************below code , Align is work
// MyGUI::Window* window = MyGUI::Gui::getInstance().createWidget<MyGUI::Window>("WindowCS", MyGUI::IntCoord(10, 10, 300, 230),
// MyGUI::Align::Bottom|MyGUI::Align::HCenter, "Main", "first window");
// window->setAlign(MyGUI::Align::Bottom|MyGUI::Align::HCenter);
// MyGUI::IntSize oldSize = window->getSize();
// window->_setAlign(oldSize);


//******************below code , Align is not work
MyGUI::Window* window = MyGUI::Gui::getInstance().createWidget<MyGUI::Window>("WindowCS", MyGUI::IntCoord(10, 10, 300, 230),
MyGUI::Align::Bottom|MyGUI::Align::HCenter, "Main", "first window");
// window->setAlign(MyGUI::Align::Bottom|MyGUI::Align::HCenter);
// MyGUI::IntSize oldSize = window->getSize();
// window->_setAlign(oldSize);

:? that means the createWidget 's param MyGUI::Align not work. Is that right?

Altren

09-11-2010 14:28:41

Align is behaviour, not a command, that change position. Widget is centered only after parent's resize. So by calling _setAlign you force widget to update it's position.
Also please don't post commented code. It took some time to figure what code you actually used.