Table of Contents

Class Control

Namespace
OmegaGUI.Render
Assembly
OmegaGUI.dll

Abstract base class for all control models

public abstract class Control
Inheritance
Control
Derived
Inherited Members
Extension Methods

Constructors

Control(Dialog)

Create a new instance of a control

protected Control(Dialog parent)

Parameters

parent Dialog

Fields

IsDefault

public bool IsDefault

Field Value

bool

boundingBox

protected Rectangle boundingBox

Field Value

Rectangle

controlId

protected int controlId

Field Value

int

controlX

protected int controlX

Field Value

int

controlY

protected int controlY

Field Value

int

ctrlHotKey

protected Keys ctrlHotKey

Field Value

Keys

ctrlType

protected ControlType ctrlType

Field Value

ControlType

elementList

protected List<Element> elementList

Field Value

List<Element>

enabled

protected bool enabled

Field Value

bool

hasFocus

protected bool hasFocus

Field Value

bool

height

protected int height

Field Value

int

index

public uint index

Field Value

uint

isMouseOver

protected bool isMouseOver

Field Value

bool

localUserData

protected object localUserData

Field Value

object

parentDialog

protected Dialog parentDialog

Field Value

Dialog

visible

protected bool visible

Field Value

bool

width

protected int width

Field Value

int

Properties

CanHaveFocus

Can the control have focus

public virtual bool CanHaveFocus { get; }

Property Value

bool

ControlType

Type of the control

public virtual ControlType ControlType { get; }

Property Value

ControlType

Hotkey

The controls hotkey

public virtual Keys Hotkey { get; set; }

Property Value

Keys

ID

Unique ID of the control

public virtual int ID { get; set; }

Property Value

int

IsEnabled

Is the control enabled

public virtual bool IsEnabled { get; set; }

Property Value

bool

IsVisible

Is the control visible

public virtual bool IsVisible { get; set; }

Property Value

bool

this[uint]

Index for the elements this control has access to

public Element this[uint elementIndex] { get; set; }

Parameters

elementIndex uint

Property Value

Element

Parent

The parent dialog of this control

public Dialog Parent { get; }

Property Value

Dialog

UserData

User specified data

public object UserData { get; set; }

Property Value

object

Methods

ContainsPoint(Point)

Does the control contain this point

public virtual bool ContainsPoint(Point pt)

Parameters

pt Point

Returns

bool

HandleKeyboard(WindowMessage, IntPtr, IntPtr)

Handle the keyboard data

public virtual bool HandleKeyboard(WindowMessage msg, IntPtr wParam, IntPtr lParam)

Parameters

msg WindowMessage
wParam IntPtr
lParam IntPtr

Returns

bool

HandleMouse(WindowMessage, Point, IntPtr, IntPtr)

Handle the mouse data

public virtual bool HandleMouse(WindowMessage msg, Point pt, IntPtr wParam, IntPtr lParam)

Parameters

msg WindowMessage
pt Point
wParam IntPtr
lParam IntPtr

Returns

bool

MsgProc(IntPtr, WindowMessage, IntPtr, IntPtr)

Message Handler

public virtual bool MsgProc(IntPtr hWnd, WindowMessage msg, IntPtr wParam, IntPtr lParam)

Parameters

hWnd IntPtr
msg WindowMessage
wParam IntPtr
lParam IntPtr

Returns

bool

OnFocusIn()

Called when control gets focus

public virtual void OnFocusIn()

OnFocusOut()

Called when control loses focus

public virtual void OnFocusOut()

OnHotKey()

Called when the control's hotkey is hit

public virtual void OnHotKey()

OnInitialize()

Initialize the control

public virtual void OnInitialize()

OnMouseEnter()

Called when mouse goes over the control

public virtual void OnMouseEnter()

OnMouseExit()

Called when mouse leaves the control

public virtual void OnMouseExit()

Refresh()

Refreshes the control

public virtual void Refresh()

Render(Device, float)

Render the control

public abstract void Render(Device device, float elapsedTime)

Parameters

device Device
elapsedTime float

SetLocation(int, int)

Called to set control's location

public virtual void SetLocation(int x, int y)

Parameters

x int
y int

SetSize(int, int)

Called to set control's size

public virtual void SetSize(int w, int h)

Parameters

w int
h int

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

UpdateRectangles()

Updates the rectangles

protected virtual void UpdateRectangles()

Events

MouseEnter

public event EventHandler MouseEnter

Event Type

EventHandler

MouseExit

public event EventHandler MouseExit

Event Type

EventHandler