ApplicationWindowBase

Description

abstract class Tinman.Engine.Application.ApplicationWindowBase

Derived from

Disposable abstract
IApplicationWindow

Extended by

ApplicationWindow

Abstract base class for IApplicationWindow implementations.

To implement an application window, the following steps are necessary:

  • Implement all abstract members.

  • Use KeyCodeMap (preferably in the constructor) to establish a mapping between key codes of the native API and the KeyboardKey enumeration.

  • Setup event handlers using the native API and call into the On* handler methods.

When implementing a top-level application window, the following no-op virtual members should be overridden:

Public / Attributes

IsRecreateNativeWindow


public attribute IsRecreateNativeWindow → (get)

value : bool

true if the native window is being re-created, false if not.

Is the native window being re-created in a call to INativeWindowRecreate.RecreateNativeWindowIfNecessary?

Protected / Constructors

ApplicationWindowBase


protected constructor ApplicationWindowBase → ()

Creates a new instance of ApplicationWindow.

Protected / Methods

KeyCodeMap


protected method KeyCodeMap → (2)

keyCode in : int32

The native virtual keycode.

key in : KeyboardKey

The KeyboardKey value.

Maps the given native virtual keycode to the specified KeyboardKey value.

KeyCodeMap_Win32


protected method KeyCodeMap_Win32 → ()

Creates the virtual keycode mapping for the WIN32 API.

MouseCursorSet


protected abstract method MouseCursorSet → (1)

mouseCursor in : MouseCursor

The new mouse cursor.

Sets the mouse cursor for the window.

MouseTrack


protected abstract method MouseTrack → ()

This method ensures that events are generated when the mouse cursor leaves the window.

OnButton


protected method OnButton → (2)

button in : MouseButton

The mouse button.

pressed in : bool

Pressed or released?

A mouse button event has been received.

OnChar


protected method OnChar → (1)

keyChar in : char

The character value.

A character value has been typed in.

OnKey


protected method OnKey → (2)

keyCode in : int32

The native virtual keycode.

pressed in : bool

true if the key has been pressed, false if it has been released.

A keyboard key has been pressed or released.

OnMessage_Win32


protected method OnMessage_Win32 → (3)

msg in : int32

Message code.

wParam in : int64

Message WPARAM.

lParam in : int64

Message LPARAM.

returns → bool

true if the message has been consumed, false if not.

Processes a window message of the WIN32 API and calls the required handler methods.

If this method returns true, the WIN32 window procedure should return 0.

OnMouseLeave


protected method OnMouseLeave → ()

returns → bool

true if the InputEventType.MouseLeave event has been sent, false if not.

The mouse cursor has left the application window client area.

OnMouseMove


protected method OnMouseMove → (3)

positionX in : int32

X-coordinate of new position of mouse cursor in application window client area.

positionY in : int32

Y-coordinate of new position of mouse cursor in application window client area.

wheel in : int32

The mouse wheel movement.

The mouse has moved.

OnWindowBoundsChanged


protected virtual method OnWindowBoundsChanged → ()

The bounds of the application window have changed.

OnWindowFocus


protected method OnWindowFocus → (1)

focussed in : bool

true if the window has gained focus, false if it has lost it.

The application window has gained or lost focus.

RecreateNativeWindow


[EmptyBody]
protected virtual method RecreateNativeWindow → ()

Re-creates the native window.

RenderException

If a graphics subsystem error has occurred.

Protected / Attributes

ClientRect


protected abstract attribute ClientRect → (get)

value : Box2I

The client area rectangle, in screen coordinates.

Returns the bounds of the application windows client area.

dirty


protected attribute dirty → (bool)

Can be set to true in order to make the next call to IApplicationWindow.ProcessSystemMessages return true once.

MouseButtons


protected abstract attribute MouseButtons → (get)

value : int32

The mouse button state bitmask:
1 : left
2 : right
4 : middle

Returns the states of the mouse buttons.

MouseClip


protected abstract attribute MouseClip → (get,set)

value : Box2I

The clip rectangle, in screen coordinates.

The mouse cursor clip rectangle.

mousePosition


protected attribute mousePosition → (Vec2I)

Relative position of mouse cursor in application window client area.

MousePosition


protected abstract attribute MousePosition → (get,set)

value : Vec2I

The mouse cursor position, in screen coordinates.

Position of the mouse cursor.

MouseVisible


protected abstract attribute MouseVisible → (set)

value : bool

true to show the mouse cursor, false to hide it.

Shows or hides the mouse cursor when hovering the application window.