Interface INativeWindow
Defines the interface for a native window.
Inherited Members
Namespace: OpenTK
Assembly: OpenTK.dll
Syntax
public interface INativeWindow : IDisposable
Properties
Bounds
Gets or sets a Rectangle structure the contains the external bounds of this window, in screen coordinates. External bounds include the title bar, borders and drawing area of the window.
Declaration
Rectangle Bounds { get; set; }
Property Value
| Type | Description |
|---|---|
| Rectangle |
ClientRectangle
Gets or sets a Rectangle structure that contains the internal bounds of this window, in client coordinates. The internal bounds include the drawing area of the window, but exclude the titlebar and window borders.
Declaration
Rectangle ClientRectangle { get; set; }
Property Value
| Type | Description |
|---|---|
| Rectangle |
ClientSize
Gets or sets a Size structure that contains the internal size this window.
Declaration
Size ClientSize { get; set; }
Property Value
| Type | Description |
|---|---|
| Size |
Cursor
Gets or sets the MouseCursor for this window.
Declaration
MouseCursor Cursor { get; set; }
Property Value
| Type | Description |
|---|---|
| MouseCursor | The cursor. |
CursorGrabbed
Gets or sets a value, indicating whether the mouse cursor is confined inside the window size.
Declaration
bool CursorGrabbed { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
CursorVisible
Gets or sets a value, indicating whether the mouse cursor is visible.
Declaration
bool CursorVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Exists
Gets a System.Boolean that indicates whether the window has been created and has not been destroyed.
Declaration
bool Exists { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Focused
Gets a System.Boolean that indicates whether this window has input focus.
Declaration
bool Focused { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Height
Gets or sets the external height of this window.
Declaration
int Height { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Icon
Gets or sets the Icon of the window.
Declaration
Icon Icon { get; set; }
Property Value
| Type | Description |
|---|---|
| Icon |
Location
Gets or sets a Point structure that contains the location of this window on the desktop.
Declaration
Point Location { get; set; }
Property Value
| Type | Description |
|---|---|
| Point |
Size
Gets or sets a Size structure that contains the external size of this window.
Declaration
Size Size { get; set; }
Property Value
| Type | Description |
|---|---|
| Size |
Title
Gets or sets the title of the window.
Declaration
string Title { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Visible
Gets or sets a System.Boolean that indicates whether the window is visible.
Declaration
bool Visible { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Width
Gets or sets the external width of this window.
Declaration
int Width { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
WindowBorder
Gets or sets the WindowBorder for this window.
Declaration
WindowBorder WindowBorder { get; set; }
Property Value
| Type | Description |
|---|---|
| WindowBorder |
WindowInfo
Gets the IWindowInfo for this window.
Declaration
IWindowInfo WindowInfo { get; }
Property Value
| Type | Description |
|---|---|
| IWindowInfo |
WindowState
Gets or sets the WindowState for this window.
Declaration
WindowState WindowState { get; set; }
Property Value
| Type | Description |
|---|---|
| WindowState |
X
Gets or sets the horizontal location of this window on the desktop.
Declaration
int X { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Y
Gets or sets the vertical location of this window on the desktop.
Declaration
int Y { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
Close()
Closes this window.
Declaration
void Close()
PointToClient(Point)
Transforms the specified point from screen to client coordinates.
Declaration
Point PointToClient(Point point)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point | A Point to transform. |
Returns
| Type | Description |
|---|---|
| Point | The point transformed to client coordinates. |
PointToScreen(Point)
Transforms the specified point from client to screen coordinates.
Declaration
Point PointToScreen(Point point)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point | A Point to transform. |
Returns
| Type | Description |
|---|---|
| Point | The point transformed to screen coordinates. |
ProcessEvents()
Processes pending window events.
Declaration
void ProcessEvents()
Events
Closed
Occurs after the window has closed.
Declaration
event EventHandler<EventArgs> Closed
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
Closing
Occurs when the window is about to close.
Declaration
event EventHandler<CancelEventArgs> Closing
Event Type
| Type | Description |
|---|---|
| EventHandler<CancelEventArgs> |
Disposed
Occurs when the window is disposed.
Declaration
event EventHandler<EventArgs> Disposed
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
FileDrop
Occurs whenever file dropped on window.
Declaration
event EventHandler<FileDropEventArgs> FileDrop
Event Type
| Type | Description |
|---|---|
| EventHandler<FileDropEventArgs> |
FocusedChanged
Occurs when the Focused property of the window changes.
Declaration
event EventHandler<EventArgs> FocusedChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
IconChanged
Occurs when the Icon property of the window changes.
Declaration
event EventHandler<EventArgs> IconChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
KeyDown
Occurs whenever a keyboard key is pressed.
Declaration
event EventHandler<KeyboardKeyEventArgs> KeyDown
Event Type
| Type | Description |
|---|---|
| EventHandler<KeyboardKeyEventArgs> |
KeyPress
Occurs whenever a character is typed.
Declaration
event EventHandler<KeyPressEventArgs> KeyPress
Event Type
| Type | Description |
|---|---|
| EventHandler<KeyPressEventArgs> |
KeyUp
Occurs whenever a keyboard key is released.
Declaration
event EventHandler<KeyboardKeyEventArgs> KeyUp
Event Type
| Type | Description |
|---|---|
| EventHandler<KeyboardKeyEventArgs> |
MouseDown
Occurs whenever a MouseButton is clicked.
Declaration
event EventHandler<MouseButtonEventArgs> MouseDown
Event Type
| Type | Description |
|---|---|
| EventHandler<MouseButtonEventArgs> |
MouseEnter
Occurs whenever the mouse cursor enters the window Bounds.
Declaration
event EventHandler<EventArgs> MouseEnter
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
MouseLeave
Occurs whenever the mouse cursor leaves the window Bounds.
Declaration
event EventHandler<EventArgs> MouseLeave
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
MouseMove
Occurs whenever the mouse cursor is moved;
Declaration
event EventHandler<MouseMoveEventArgs> MouseMove
Event Type
| Type | Description |
|---|---|
| EventHandler<MouseMoveEventArgs> |
MouseUp
Occurs whenever a MouseButton is released.
Declaration
event EventHandler<MouseButtonEventArgs> MouseUp
Event Type
| Type | Description |
|---|---|
| EventHandler<MouseButtonEventArgs> |
MouseWheel
Occurs whenever a mouse wheel is moved;
Declaration
event EventHandler<MouseWheelEventArgs> MouseWheel
Event Type
| Type | Description |
|---|---|
| EventHandler<MouseWheelEventArgs> |
Move
Occurs whenever the window is moved.
Declaration
event EventHandler<EventArgs> Move
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
Resize
Occurs whenever the window is resized.
Declaration
event EventHandler<EventArgs> Resize
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
TitleChanged
Occurs when the Title property of the window changes.
Declaration
event EventHandler<EventArgs> TitleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
VisibleChanged
Occurs when the Visible property of the window changes.
Declaration
event EventHandler<EventArgs> VisibleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
WindowBorderChanged
Occurs when the WindowBorder property of the window changes.
Declaration
event EventHandler<EventArgs> WindowBorderChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |
WindowStateChanged
Occurs when the WindowState property of the window changes.
Declaration
event EventHandler<EventArgs> WindowStateChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<EventArgs> |