Control

Control class.

class Control : DObject , IWindow {
DWORD ldlgcode;
enum _compat;
enum _compat;
HWND hwnd;
ContextMenu cmenu;
DockStyle sdock;
Dstring _ctrlname;
Object otag;
Color backc;
Color forec;
Rect wrect;
Size wclientsz;
Cursor wcurs;
Font wfont;
Control wparent;
Region wregion;
ControlCollection ccollection;
Dstring wtext;
ControlStyles ctrlStyle;
HBRUSH _hbrBg;
RightToLeft rtol;
uint _disallowLayout;
DropTarget droptarget;
LONG wstyle;
LONG wexstyle;
LONG wclassStyle;
CBits cbits;
}

Constructors

this
this()

Construct a new Control instance.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

createGraphics
Graphics createGraphics()

Returns a new Graphics object for this control, creating the control handle if necessary.

delayInvoke
void delayInvoke(void function() fn)

Asynchronously calls a function after the window message queue processes its current messages. It is generally not safe to pass references to the delayed function. Exceptions are not propagated to the caller.

doDragDrop
DragDropEffects doDragDrop(dfl.data.IDataObject dataObj, DragDropEffects allowedEffects)

Perform a drag/drop operation.

invoke
Object invoke(Object delegate(Object[]) dg, Object[] args...)

Synchronously calls a delegate in this Control's thread. This function is thread safe and exceptions are propagated to the caller.

pointToClient
Point pointToClient(Point pt)

Converts a screen Point to a client Point.

pointToScreen
Point pointToScreen(Point pt)

Converts a client Point to a screen Point.

rectangleToClient
Rect rectangleToClient(Rect r)

Converts a screen Rectangle to a client Rectangle.

rectangleToScreen
Rect rectangleToScreen(Rect r)

Converts a client Rectangle to a screen Rectangle.

Properties

hasLayout
bool hasLayout [@property getter]

Get or set whether or not this control currently has its bounds managed. Fires onHasLayoutChanged as needed.

invokeRequired
bool invokeRequired [@property getter]

Returns true if the window does not belong to the current thread.

location
Point location [@property setter]

Property: get or set the X and Y location of the control.

modifierKeys
Keys modifierKeys [@property getter]

Currently depressed modifier keys.

mouseButtons
MouseButtons mouseButtons [@property getter]

Currently depressed mouse buttons.

name
Dstring name [@property setter]

Property: get or set the name of this control used in code.

tag
Object tag [@property setter]

Property: get or set additional data tagged onto the control.

topLevelControl
Control topLevelControl [@property getter]

Returns the topmost Control related to this control.

Static functions

fromChildHandle
Control fromChildHandle(HWND hwChild)

Returns the Control instance from one of its window handles, or null if none.

fromHandle
Control fromHandle(HWND hw)

Returns the Control instance from its window handle, or null if none.

Variables

backColorChanged
Event!(Control, EventArgs) backColorChanged;
click
Event!(Control, EventArgs) click;
contextMenuChanged
Event!(Control, EventArgs) contextMenuChanged;
controlAdded
Event!(Control, ControlEventArgs) controlAdded;
controlRemoved
Event!(Control, ControlEventArgs) controlRemoved;
cursorChanged
Event!(Control, EventArgs) cursorChanged;
disposed
Event!(Control, EventArgs) disposed;
doubleClick
Event!(Control, EventArgs) doubleClick;
dragDrop
Event!(Control, DragEventArgs) dragDrop;
dragEnter
Event!(Control, DragEventArgs) dragEnter;
dragLeave
Event!(Control, EventArgs) dragLeave;
dragOver
Event!(Control, DragEventArgs) dragOver;
enabledChanged
Event!(Control, EventArgs) enabledChanged;
fontChanged
Event!(Control, EventArgs) fontChanged;
foreColorChanged
Event!(Control, EventArgs) foreColorChanged;
giveFeedback
Event!(Control, GiveFeedbackEventArgs) giveFeedback;
gotFocus
Event!(Control, EventArgs) gotFocus;
handleCreated
Event!(Control, EventArgs) handleCreated;
handleDestroyed
Event!(Control, EventArgs) handleDestroyed;
hasLayoutChanged
Event!(Control, EventArgs) hasLayoutChanged;
helpRequested
Event!(Control, HelpEventArgs) helpRequested;
keyDown
Event!(Control, KeyEventArgs) keyDown;
keyPress
Event!(Control, KeyPressEventArgs) keyPress;
keyUp
Event!(Control, KeyEventArgs) keyUp;
layout
Event!(Control, LayoutEventArgs) layout;
lostFocus
Event!(Control, EventArgs) lostFocus;
mouseDown
Event!(Control, MouseEventArgs) mouseDown;
mouseEnter
Event!(Control, MouseEventArgs) mouseEnter;
mouseHover
Event!(Control, MouseEventArgs) mouseHover;
mouseLeave
Event!(Control, MouseEventArgs) mouseLeave;
mouseMove
Event!(Control, MouseEventArgs) mouseMove;
mouseUp
Event!(Control, MouseEventArgs) mouseUp;
mouseWheel
Event!(Control, MouseEventArgs) mouseWheel;
move
Event!(Control, EventArgs) move;
moving
Event!(Control, MovingEventArgs) moving;
paint
Event!(Control, PaintEventArgs) paint;
parentChanged
Event!(Control, EventArgs) parentChanged;
queryContinueDrag
Event!(Control, QueryContinueDragEventArgs) queryContinueDrag;
resize
Event!(Control, EventArgs) resize;
rightToLeftChanged
Event!(Control, EventArgs) rightToLeftChanged;
sizing
Event!(Control, SizingEventArgs) sizing;
systemColorsChanged
Event!(Control, EventArgs) systemColorsChanged;
textChanged
Event!(Control, EventArgs) textChanged;
visibleChanged
Event!(Control, EventArgs) visibleChanged;

Meta