MinWin API Reference

minwin

app
button
canvas
combo
component
dialog
event
font
geometry
group
icon
image
label
layout
listbox
menu
multidg
paint
peer
peerimpl
scroll
text
window

minwin.component

A Component is the root of the widget inheritance tree.

class Component;
Abstract base-class for MinWin screen components. Each component has a rectangular bounds, a layout manager, a parent (possibly null), children (possibly none) and siblings (possibly none).

void dispose();
Dispose of the component's children and peer.

abstract void disposePeer();
Dispose of the system resource associated with this object if it owns the peer and the object does not have any parent. It is assumed that an object with a parent will have its peer disposed when the parent is disposed.

char[] name;
Name property used for resource lookup on XWindows and debugging.

void*[char[]] userdata;
Associative array indexed by strings for storing arbitrary data that is associated with the component.

void doCommand(int cmd);
Perform the action defined by cmd. By default the command is passed to the parent.

void requestFocus();
If allowed request the keyboard focus for this component.

abstract void getBounds(inout Rect r);
Fill the rectangle r with the bounds of the component relative to its parent.

abstract void setBounds(inout Rect r);
Move and resize the component to the specified rectangle.

Rect bounds;
Read/write property for bounds.

Point size;
Read/write property for the width and height.

int width;
Read-only property for the width of the component.

int height;
Read-only property for the height of the component.

int userPreferredWidth;
Read/write property for preferred custom width of the component.

int userPreferredHeight;
Read/write property for preferred custom height of the component.

void userPreferredSize(int width, int height);
Set the preferred custom width and height.

Point preferredSize;
Read-only property for the preferred size of the component as computed by the layout manager and/or the custom preferred size.

bool visible;
Read/write property for the visibility of the component and its children.

bool enabled;
Read/write property to enable/disable the component and its children.

PeerForAdd_ getPeerForAdd();
Get the native object that serves as the parent to the peers of the children of this component. The peer of a component does not have to directly contain the peers of its children. The symbol PeerForAdd is an alias for a native peer type (eg, HWND or Widget).

void getPeerOffset(inout int x, inout int y);
Compute the offset of the client area's top left corner in the peer coordinate system.

LayoutManager layoutMgr;
Read/write property for layout manager of the component's children.

bool childLayoutDirty;
Read/write property indicating the child layout needs to be refreshed.

bool parentOwnsLayout;
Read/write property indicating the parent can position this component.

bool parentOwnsVisiblity;
Read/write property indicating the parent can hide or show this component.

void layout(bool validateParent);
Layout children and optionally request parent layout first.

void pack();
Resize component and layout children to honor children's preferred sizes.

void repaint();
Mark the component as needing to be repainted.

void repaint(inout Rect r);
Mark the rectangle r in the component as needing to be repainted.

bool clearBackgroundOnPaint;
Read/write property indicating the component should first repaint the background before calling any paintDelegate.

Component getRootAncestor;
Read-only property to return the root of the component tree.

Component parent;
Read-only property for the parent component or null if no parent.

Component child;
Read-only property for the first child component or null if none.

Component last;
Read-only property for the last child component or null if none.

Component next;
Read-only property for the next sibling component or null if none.

Component prev;
Read-only property for the previous sibling component or null if none.

int opApply(int delegate(inout Component c) dg);
Iterate over children from first to last and apply dg.

void link(Component first, Component second);
Link the next/prev pointers so that first comes before second.

void opCatAssign(Component x);
Concatenate x to the end of the child list.

void addChild(Component x);
Add x to the end of the child list.

void removeChild(Component x);
Remove x from the child list.

class WindowChild: minwin.component.Component;
Abstract class for a component that is a window child. MinWin assumes all heavyweight window children have a common peer type.

WindowChildPeer_ getPeer();
Get the top-most peer, if any, of this component