Table of Contents

Class TextBox

Namespace
OmegaGUI.Render
Assembly
OmegaGUI.dll

A basic edit box

public class TextBox : Control
Inheritance
TextBox
Inherited Members
Extension Methods

Constructors

TextBox(Dialog)

Creates a new edit box control

public TextBox(Dialog parent)

Parameters

parent Dialog

Fields

LeftBorder

public const int LeftBorder = 4

Field Value

int

LowerBorder

public const int LowerBorder = 7

Field Value

int

LowerLeftBorder

public const int LowerLeftBorder = 6

Field Value

int

LowerRightBorder

public const int LowerRightBorder = 8

Field Value

int

RightBorder

public const int RightBorder = 5

Field Value

int

TextLayer

public const int TextLayer = 0

Field Value

int

TopBorder

public const int TopBorder = 2

Field Value

int

TopLeftBorder

public const int TopLeftBorder = 1

Field Value

int

TopRightBorder

public const int TopRightBorder = 3

Field Value

int

blinkTime

protected double blinkTime

Field Value

double

border

protected int border

Field Value

int

caretColor

protected Color4 caretColor

Field Value

Color4

caretPosition

protected int caretPosition

Field Value

int

elementRects

protected Rectangle[] elementRects

Field Value

Rectangle[]

firstVisible

protected int firstVisible

Field Value

int

isCaretOn

protected bool isCaretOn

Field Value

bool

isInsertMode

protected bool isInsertMode

Field Value

bool

isMouseDragging

protected bool isMouseDragging

Field Value

bool
protected double lastBlink

Field Value

double

selectedBackColor

protected Color4 selectedBackColor

Field Value

Color4

selectedTextColor

protected Color4 selectedTextColor

Field Value

Color4

spacing

protected int spacing

Field Value

int

textColor

protected Color4 textColor

Field Value

Color4

textData

protected RichTextBox textData

Field Value

RichTextBox

textRect

protected Rectangle textRect

Field Value

Rectangle

Properties

CanHaveFocus

Can the edit box have focus

public override bool CanHaveFocus { get; }

Property Value

bool

Text

Get or sets the text

public string Text { get; set; }

Property Value

string

Methods

Clear()

Clears the edit box

public void Clear()

CopyToClipboard()

Copy the selected text to the clipboard

protected void CopyToClipboard()

DeleteSelectionText()

Deletes the text that is currently selected

protected void DeleteSelectionText()

GetTextCopy()

Gets a copy of the text

public string GetTextCopy()

Returns

string

HandleKeyboard(WindowMessage, IntPtr, IntPtr)

Handle keyboard input to the edit box

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

Parameters

msg WindowMessage
wParam IntPtr
lParam IntPtr

Returns

bool

HandleMouse(WindowMessage, Point, IntPtr, IntPtr)

Handle mouse messages

public override 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)

Handle all other messages

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

Parameters

hWnd IntPtr
msg WindowMessage
wParam IntPtr
lParam IntPtr

Returns

bool

OnFocusIn()

Update the caret when focus is in

public override void OnFocusIn()

PasteFromClipboard()

Paste the clipboard data to the control

protected void PasteFromClipboard()

PlaceCaret(int)

Set the caret to a character position, and adjust the scrolling if necessary

protected void PlaceCaret(int pos)

Parameters

pos int

RaiseChangedEvent(TextBox, bool)

Raises the changed event

protected void RaiseChangedEvent(TextBox sender, bool wasTriggeredByUser)

Parameters

sender TextBox
wasTriggeredByUser bool

RaiseEnterEvent(TextBox, bool)

Raises the Enter event

protected void RaiseEnterEvent(TextBox sender, bool wasTriggeredByUser)

Parameters

sender TextBox
wasTriggeredByUser bool

Render(Device, float)

Render the control

public override void Render(Device device, float elapsedTime)

Parameters

device Device
elapsedTime float

Reset's the caret blink time

protected void ResetCaretBlink()

SetBorderWidth(int)

Update the border

public void SetBorderWidth(int b)

Parameters

b int

SetCaretColor(Color4)

Update the caret color

public void SetCaretColor(Color4 color)

Parameters

color Color4

SetSelectedBackColor(Color4)

Update the selected background color

public void SetSelectedBackColor(Color4 color)

Parameters

color Color4

SetSelectedTextColor(Color4)

Update the text selected color

public void SetSelectedTextColor(Color4 color)

Parameters

color Color4

SetSpacing(int)

Update the spacing

public void SetSpacing(int space)

Parameters

space int

SetText(string?, bool)

Sets the text for the control

public void SetText(string? text, bool selected)

Parameters

text string
selected bool

SetTextColor(Color4)

Update the text color

public void SetTextColor(Color4 color)

Parameters

color Color4

UpdateRectangles()

Updates the rectangles used by the control

protected override void UpdateRectangles()

Events

Changed

public event EventHandler Changed

Event Type

EventHandler

Enter

public event EventHandler Enter

Event Type

EventHandler