steve3d Posted April 2, 2014 Posted April 2, 2014 I'm writing a plugin which can get current focused widget, if this focused widget is WidgetEditLine then plugin do something. Unigine::GuiPtr gui = Unigine::Gui::get(); Unigine::WidgetPtr widget = gui->getFocus(); if(widget->getType() == 25) { // plugin api didn't export the enum for the widget type, so I use value 25 for WidgetEditLine type // then How can I get the correct Unigine::WidgetEditLinePtr? Unigine::WidgetEditLinePtr edit = ...... } I've tried with dynamic_cast, it won't work, so How can I get the correct type?
frustum Posted April 2, 2014 Posted April 2, 2014 Just call WidgetEditLine::create(widget) function to cast the WidgetPtr to the WidgetEditLinePtr type and check the resulted pointer via their .get() function.
steve3d Posted April 3, 2014 Author Posted April 3, 2014 thanks, the result are this https://developer.unigine.com/forum/topic/2553-with-new-widgets-support-in-plugin-api-finally-we-can-have-the-full-ime-support this is very important for our CJK user while under fullscreen mode.
Recommended Posts