Is there a way to monitor a window so that you get an event when it closes (or failing that, an event when the close button is clicked)
Is there are way of making the titlebar or even just the close button not show?
How do you detect a window closing
when the .close() function of a form is issued, the closing event is fired, one of the arguments passed to the closing event is cancel. bascily all you have to do is
and it will stop the form from closing.
Code: Select all
e.Cancel = True
Sorry I wasn't very clear. I meant a Irrlicht window (IGUIWindow).
You only get back an IGUIElement back from the AddWindow function so you do not have access to the CloseButton. I have tried to do a GetElementFromPoint and remove the control but the GetElementFromPoint function does not 'see' the button control. I can't quite see why this is the case as it appears to use the standard mechanism for adding it. I haven't looked at the .Net side of things to see how all this works though.
I am almost at the point of just adding another button on top of the close button and catching its key press event.
You only get back an IGUIElement back from the AddWindow function so you do not have access to the CloseButton. I have tried to do a GetElementFromPoint and remove the control but the GetElementFromPoint function does not 'see' the button control. I can't quite see why this is the case as it appears to use the standard mechanism for adding it. I haven't looked at the .Net side of things to see how all this works though.
I am almost at the point of just adding another button on top of the close button and catching its key press event.
-
- Posts: 22
- Joined: Fri Jun 03, 2005 2:00 pm
- Location: Argentina
I made an application in VS 2003 to take off the doubts that it was a problem of C# Express Beta 2.
The button doesn't work to close the window GUI, neither the BUTTON_CLICKED event works...
The event click that recognizes is that of EventType.MouseInput
Similar to what I comment in another thread, the GUI events ELEMENT_HOVERED and ELEMENT_LEFT work correctly.
EDIT
Extracted of TODO.txt for Irrlicht.NET:
- GUI Environment
and in changes.txt:
- Irrlicht.NET includes now all basic GUI Elements and can capture GUI events. There are
still some features missing, but it is already enough to do simple things like showing
message boxes, displaying images, getting input strings, etc.
The button doesn't work to close the window GUI, neither the BUTTON_CLICKED event works...
The event click that recognizes is that of EventType.MouseInput
Similar to what I comment in another thread, the GUI events ELEMENT_HOVERED and ELEMENT_LEFT work correctly.
EDIT
Extracted of TODO.txt for Irrlicht.NET:
- GUI Environment
and in changes.txt:
- Irrlicht.NET includes now all basic GUI Elements and can capture GUI events. There are
still some features missing, but it is already enough to do simple things like showing
message boxes, displaying images, getting input strings, etc.
Sergio Cossa
Argentina
Argentina
Ah now there's an idea, just capture the mouse event when it is above the button and return true. That will work.
I suppose I could also just wait until Niko gets a bit more done on the GUI - it's not that critical just yet. Hopefully he will implement something a bit like Win32's Styles concept whereby you can control what the window is like nice and simply.
I suppose I could also just wait until Niko gets a bit more done on the GUI - it's not that critical just yet. Hopefully he will implement something a bit like Win32's Styles concept whereby you can control what the window is like nice and simply.