lock/pin a window
lock/pin a window
how do you lock the position of a window so it doest move (irrlicht gui window IGUIWindow )
You could try window->setEnabled(false);. If that doesn't work, you have a few options. You could create an event receiver that consumes mouse button events when the element under the cursor is a gui window. Something like this...
Code: Select all
virtual MyEventReceiver::OnEvent(const SEvent& event)
{
if (event.EventType == EET_MOUSE_INPUT_EVENT)
{
if (event.MouseInput.EventType == EMIE_LMOUSE_PRESSED_DOWN || event.MouseInput.EventType == EMIE_LMOUSE_LEFT_UP)
{
const core::position2df point (event.MouseInput.X, event.MouseInput.Y);
gui::IGUIElement* element = gui->getElementFromPoint(point);
assert (0 != element);
return element->getType() == gui::EGUIET_WINDOW;
}
}
return false;
}
Another option is to switch to svn trunk (or wait for 1.6). It got a new function setDraggable.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
It's in IGUIWindow.pin3 wrote:Updated to SVN, no setDraggable funtion though
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm