IWindow serves as an interface for creating button-like Entities in Glue. Using the IWindow enables you to do the following:
Respond to clicks (release of mouse-button or touch screen)
Respond to pushes (initial press of a mouse-button or touch screen)
Respond to dragging
Prevent click-throughs on overlapping IWindows
For initial information on how to use IWindows in Glue, check out the IWindow in Glue tutorial page. For more information on IWindow in raw code, check out the IWindow code reference page.
The most commonly-used event when using IWindows in Glue is the Click event. The Click event is an event that is raised whenever the user "clicks" on an IWindow. FlatRedBall considers a Click as occurring if:
The user pushes on a button
The user clicks (releases) while still on the button
When these two events occur, then a button's Click event is raised.
Entities that implement IWindow automatically receive an Enabled property. The Enabled property controls whether the GuiManager's Cursor can interact with the Entity. Disabled Entities will not have their GUI events fired. This Enabled property uses explicit implementation which means you can only access this property by casting an instance of your Entity to IWindow. In other words:
The SlideOnClick event is an event that is raised when the user releases the cursor over a given IWindow, but only if the window was not initially clicked on. To contrast with Click, if the user both pushes and releases the cursor over an IWindow, then Click (or ClickNoSlide) will get raised. If the user pushes the cursor off of an IWindow, then releases it on the IWindow, then SlideOnClick is raised.
SlideOnClick is commonly used for drag+dropping elements onto an IWindow.