How do i isable the close button and dragging of an IGUIWindow, cheers.
Ash.
Disabling close/dragging on IGUIWindow's
Just copy CGUIWindow.h/cpp, rename the class, and rip out the mouse dragging code. You could also make it inherit directly from IGUIWindow and remove the min/max/close buttons. Instead of creating the window through the GUI environment, just allocate an instance of your new window type directly...
Or, just use the draw3DWindowBackground() method of the skin to draw what looks like a window.
Code: Select all
IGUIElement* myWindow = new CMyWindow(gui, gui->getRootElement(), 0, core::rect<s32>(10, 10, 80, 80);
myWindow->drop();
-
- Posts: 64
- Joined: Mon Aug 01, 2005 5:06 am
If you still need a clue, here's what I did in the input handler:
if( guienvironment->hasFocus( iguiwindow ))
if( event.MouseInput.Event == EMIE_MOUSE_MOVED )
return true;
something like that, specific to the window you dont want to drag should help you get it donw without altering the engine. It's never a good solution and should not be done for minor stuff like this that should be in the engine, and will hopefully be added one day. I modified the engine because I had no choice and now I am stuck with an older version until I find the time to adapt the new version, so try to avoid that and rather look around if you can do it with some existing tricks![Smile :)](./images/smilies/icon_smile.gif)
if( guienvironment->hasFocus( iguiwindow ))
if( event.MouseInput.Event == EMIE_MOUSE_MOVED )
return true;
something like that, specific to the window you dont want to drag should help you get it donw without altering the engine. It's never a good solution and should not be done for minor stuff like this that should be in the engine, and will hopefully be added one day. I modified the engine because I had no choice and now I am stuck with an older version until I find the time to adapt the new version, so try to avoid that and rather look around if you can do it with some existing tricks
![Smile :)](./images/smilies/icon_smile.gif)