Default implementation of the IApplicationWindow interface.
class
|
ApplicationWindow
|
extends
|
ApplicationWindowBase
|
The current size of the application windows client area.
public
virtual
property
|
ClientSize
{
get
set
}
|
||
type
|
Vec2I
|
||
value
|
The size of the window client area. Set to Zero to enable full-screen mode. Use any non-zero value to enter windowed mode. | ||
inherited
|
ApplicationWindowBase.ClientSize
|
Remarks:
If the client size of an application window cannot be set by code (e.g. it is not a top-level window), the client size will remain unchanged and the State property will be Normal.
Does the application window currently have the input focus?
public
property
|
IsFocused
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
application
has
the
input
focus,
false
if
not. |
||
inherited
|
ApplicationWindowBase.IsFocused
|
Is the mouse cursor currently inside the windows client area?
public
property
|
IsMouseInside
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
mouse
cursor
is
inside
the
client
area,
false
if
it
is
outside.
|
||
inherited
|
ApplicationWindowBase.IsMouseInside
|
Returns the lifecycle state of this object.
public
virtual
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
Is the mouse currently captured by the application window?
public
property
|
MouseCaptured
{
get
set
}
|
||
type
|
bool
|
||
value
|
true
if
the
mouse
is
currently
captured,
false
if
not. |
||
inherited
|
ApplicationWindowBase.MouseCaptured
|
Remarks:
While the mouse cursor is captured, the application exhibits the following behaviour:
The mouse cursor to show inside the application window.
public
property
|
MouseCursor
{
get
set
}
|
||
type
|
MouseCursor
|
||
value
|
The mouse cursor. | ||
inherited
|
ApplicationWindowBase.MouseCursor
|
Remarks:
The default value is Default.
Returns the raw handle value of the native resource that is contained in this object.
public
override
property
|
NativeHandle
{
get
}
|
||
type
|
IntPtr
|
||
value
|
The raw handle value. | ||
implements
|
ApplicationWindowBase.NativeHandle
|
Remarks:
The documentation of the implementing class will contain information on how to interpret the raw handle value.
Returns the source for input event.
public
property
|
OnInput
{
get
}
|
||
type
|
IEventGeneric<InputEvent>
|
||
value
|
|
The input event source. | |
inherited
|
ApplicationWindowBase.OnInput
|
Returns the current state of the application window.
public
virtual
property
|
State
{
get
}
|
||
type
|
WindowState
|
||
value
|
The current state. | ||
inherited
|
ApplicationWindowBase.State
|
The current window title.
public
virtual
property
|
Title
{
get
set
}
|
||
type
|
string
|
||
value
|
The
window
title
or
null . |
||
inherited
|
ApplicationWindowBase.Title
|
Remarks:
If the title of an application window cannot be set by code (e.g. it is not a top-level window), the title will remain unchanged.
Creates a new top-level window.
[OwnerReturn]
|
||||
public
static
method
|
Create
(string title,
Vec2I clientSize)
|
|||
type
|
IApplicationWindow
|
|||
params
|
title
|
The window title. | ||
clientSize
|
The client size. If the size is Zero, the window will cover the screen. | |||
returns
|
|
The application window. |
Acquires a strong reference to this disposable object.
[OwnerReturn, ThreadSafe]
|
||||
public
method
|
AcquireTry
()
|
|||
type
|
IDisposable
|
|||
returns
|
this
if
a
new
strong
reference
has
been
acquired,
null
if
this
object
is
already
being
disposed.
|
|||
inherited
|
Disposable.AcquireTry
|
Remarks:
The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
Dispatches a Closing event to all listeners, which should initiate a graceful shutdown of the application.
public
method
|
Closing
()
|
||
inherited
|
ApplicationWindowBase.Closing
|
Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.
[Dispose, OwnerThis, ThreadSafe]
|
||||
public
method
|
Dispose
()
|
|||
inherited
|
Disposable.Dispose
|
Remarks:
The Dispose method silently returns if the object has already been disposed.
Tries to acquire input focus.
public
override
method
|
Focus
()
|
||
type
|
bool
|
||
returns
|
true
if
the
input
focus
has
been
acquired,
false
if
not. |
||
implements
|
ApplicationWindowBase.Focus
|
Is the given keyboard key pressed down?
[Pure]
|
||||
public
method
|
IsDown
(KeyboardKey key)
|
|||
type
|
bool
|
|||
params
|
key
|
The keyboard key. | ||
returns
|
true
if
the
key
is
pressed
down,
false
if
not. |
|||
inherited
|
ApplicationWindowBase.IsDown
|
Is the given mouse button pressed down?
[Pure]
|
||||
public
method
|
IsDown
(MouseButton button)
|
|||
type
|
bool
|
|||
params
|
button
|
The mouse button. | ||
returns
|
true
if
the
button
is
pressed
down,
false
if
not. |
|||
inherited
|
ApplicationWindowBase.IsDown
|
Processes all system messages for this window.
public
virtual
method
|
ProcessSystemMessages
()
|
||
type
|
bool
|
||
returns
|
true
if
the
window
client
area
is
dirty,
false
if
not. |
||
inherited
|
ApplicationWindowBase.ProcessSystemMessages
|
Returns the bounds of the application windows client area.
protected
override
property
|
ClientRect
{
get
}
|
||
type
|
Box2I
|
||
value
|
The client area rectangle, in screen coordinates. | ||
implements
|
ApplicationWindowBase.ClientRect
|
Can
be
set
to
true
in
order
to
make
the
next
call
to
ProcessSystemMessages
return
true
once.
protected
field
|
dirty
|
||
type
|
bool
|
||
inherited
|
ApplicationWindowBase.dirty
|
Relative position of mouse cursor in application window client area.
protected
field
|
mousePosition
|
||
type
|
Vec2I
|
||
inherited
|
ApplicationWindowBase.mousePosition
|
Disposes the managed resources held by a concrete subclass. This method will be called at most once per subclass.
protected
override
method
|
DisposeManaged
()
|
||
inherited
|
ApplicationWindowBase.DisposeManaged
|
Remarks:
This method will only be called when a disposable object is explicitly destroyed by user code calling the Dispose method. It will not be called when the object is collected as garbage by the system.
Overriding methods must call the DisposeManaged method of their base class. The base call should be the last statement.
The DisposeManaged method is called before the DisposeUnmanaged method.
Disposes the unmanaged resources held by a concrete subclass. This method will be called exactly once per subclass.
protected
override
method
|
DisposeUnmanaged
()
|
||
overrides
|
Disposable.DisposeUnmanaged
|
Remarks:
Overriding methods must call the DisposeUnmanaged method of their base class. The base call should be the last statement.
The DisposeUnmanaged method is called after the DisposeManaged method.
Maps the given native virtual keycode to the specified KeyboardKey value.
protected
method
|
KeyCodeMap
(int32 keyCode,
KeyboardKey key)
|
||
params
|
keyCode
|
The native virtual keycode. | |
key
|
The KeyboardKey value. | ||
inherited
|
ApplicationWindowBase.KeyCodeMap
|
protected
override
method
|
MouseCursorSet
(MouseCursor mouseCursor)
|
||
params
|
mouseCursor
|
||
implements
|
ApplicationWindowBase.MouseCursorSet
|
protected
method
|
OnButton
(MouseButton button,
bool pressed)
|
||
params
|
button
|
||
pressed
|
|||
inherited
|
ApplicationWindowBase.OnButton
|
A character value has been typed in.
protected
method
|
OnChar
(char keyChar)
|
||
params
|
keyChar
|
The character value. | |
inherited
|
ApplicationWindowBase.OnChar
|
A keyboard key has been pressed or released.
protected
method
|
OnKey
(int32 keyCode,
bool pressed)
|
||
params
|
keyCode
|
The native virtual keycode. | |
pressed
|
true
if
the
key
has
been
pressed,
false
if
it
has
been
released.
|
||
inherited
|
ApplicationWindowBase.OnKey
|
The mouse cursor has left the application window client area.
protected
method
|
OnMouseLeave
()
|
||
type
|
bool
|
||
returns
|
true
if
the
MouseLeave
event
has
been
sent,
false
if
not.
|
||
inherited
|
ApplicationWindowBase.OnMouseLeave
|
The mouse has moved.
protected
method
|
OnMouseMove
(int32 positionX,
int32 positionY,
int32 wheel)
|
||
params
|
positionX
|
X-coordinate of new position of mouse cursor in application window client area. | |
positionY
|
Y-coordinate of new position of mouse cursor in application window client area. | ||
wheel
|
The mouse wheel movement. | ||
inherited
|
ApplicationWindowBase.OnMouseMove
|
The bounds of the application window have changed.
protected
method
|
OnWindowBoundsChanged
()
|
||
inherited
|
ApplicationWindowBase.OnWindowBoundsChanged
|
The application window has gained or lost focus.
protected
method
|
OnWindowFocus
(bool focussed)
|
||
params
|
focussed
|
true
if
the
window
has
gained
focus,
false
if
it
has
lost
it.
|
|
inherited
|
ApplicationWindowBase.OnWindowFocus
|
Sends an input event to all registered listeners.
protected
method
|
SendInputEvent
(InputEvent inputEvent)
|
||
params
|
inputEvent
|
The input event to send. | |
inherited
|
ApplicationWindowBase.SendInputEvent
|