[archived content]

About

A TextBox ? is used for a Control that edits a single formatting of text.

Example

import dfl.all;
void main() {
 auto form = new Form;
 form.dockPadding.all = 5;
 auto currentTextBox = new TextBox;
 currentTextBox.dock = DockStyle.TOP;
 currentTextBox.textAlign = HorizontalAlignment.CENTER;
 currentTextBox.text = "I'm a header!";
 currentTextBox.foreColor = Color(100,255,255);
 form.controls.add(currentTextBox);
 currentTextBox = new TextBox;
 currentTextBox.dock = DockStyle.BOTTOM;
 currentTextBox.textAlign = HorizontalAlignment.RIGHT;
 currentTextBox.text = "I'm a footer!";
 currentTextBox.backColor = Color(255,100,255);
 form.controls.add(currentTextBox);
 currentTextBox = new TextBox;
 currentTextBox.dock = DockStyle.FILL;
 currentTextBox.textAlign = HorizontalAlignment.LEFT;
 currentTextBox.text = "I'm the content";
 form.controls.add(currentTextBox);
 Application.run(form);
}

TODO

Password support?

module dfl.textbox;
public class TextBox : TextBoxBase
{
public final bool acceptsReturn ; [property setter]
public final bool acceptsReturn ; [property getter]
public final CharacterCasing characterCasing ; [property setter]
public final CharacterCasing characterCasing ; [property getter]
protected void onHandleCreated (EventArgs ea);
public final dchar passwordChar ; [property getter]
public final dchar passwordChar ; [property setter]
public final ScrollBars scrollBars ; [property setter]
public final ScrollBars scrollBars ; [property getter]
public final HorizontalAlignment textAlign ; [property setter]
public final HorizontalAlignment textAlign ; [property getter]
[+] Inherited members
acceptsTab appendText backColor backColorChanged borderStyle bottom bounds bringToFront bringUpOne canFocus canSelect canUndo capture clear clearUndo click clientRectangle clientSize contains containsFocus contextMenu contextMenuChanged controlAdded ControlCollection controlRemoved controls copy createControl createControlsInstance created createGraphics createHandle createParams cursor cursorChanged cut defaultBackColor defaultFont defaultForeColor defaultSize defWndProc delayInvoke destroyHandle disable disableVisualStyle displayRectangle dispose disposed dock doubleClick enable enabled enabledChanged findForm focus focused font fontChanged foreColor foreColorChanged fromChildHandle fromHandle getAutoScaleSize getChildAtPoint getLineCount getStyle getTopLevel gotFocus handle handleCreated handleDestroyed hasChildren hasLayout hasLayoutChanged height helpRequested hide hideSelection initLayout invalidate invoke invokeRequired isHandleCreated isMnemonic keyDown keyPress keyUp layout left lines location lostFocus maxLength modified modifierKeys mouseButtons mouseDown mouseEnter mouseHover mouseLeave mouseMove mousePosition mouseUp mouseWheel move multiline name onBackColorChanged onClick onContextMenuChanged onControlAdded onControlRemoved onCursorChanged onDisposed onDoubleClick onEnabledChanged onFontChanged onForeColorChanged onGotFocus onHandleCreated onHandleDestroyed onHasLayoutChanged onHelpRequested onKeyDown onKeyPress onKeyUp onLayout onLostFocus onMouseDown onMouseEnter onMouseHover onMouseLeave onMouseMove onMouseUp onMouseWheel onMove onPaint onPaintBackground onParentChanged onReflectedMessage onResize onRightToLeftChanged onSystemColorsChanged onTextChanged onVisibleChanged opCmp opEquals paint parent parentChanged paste performLayout pointToClient pointToScreen preProcessMessage prevWndProc processKeyEventArgs processMnemonic readOnly recreateHandle recreatingHandle rectangleToClient rectangleToScreen redraw refresh region resetBackColor resetCursor resetFont resetForeColor resetRightToLeft resetText resize resizeRedraw resumeLayout right rightToLeft rightToLeftChanged scrollToCaret select selectAll selectedText selectionLength selectionStart selectNextControl sendBackOne sendToBack setBounds setBoundsCore setClientSizeCore setStyle setVisibleCore show size supportsMouseTracking suspendLayout systemColorsChanged tabStop tag text textChanged textLength top topLevelControl toString undo update updateStyles visible visibleChanged width wndProc wordWrap zIndex
}
public static class TextBox.ControlCollection
{
public void add (Control ctrl);
public bool contains (Control ctrl);
public int indexOf (Control ctrl);
public int length ; [property getter]
public int opApply (int delegate(ref Control) dg);
public int opIndex ; [property getter]
protected final Control owner ; [property getter]
public void remove (Control ctrl);
public void removeAt (int i);
}
public class TextBoxBase : Control
{
public final bool acceptsTab ; [property getter]
public final bool acceptsTab ; [property setter]
public final void appendText (char[] txt);
public Color backColor ; [property getter]
public BorderStyle borderStyle ; [property getter]
public BorderStyle borderStyle ; [property setter]
public final bool canUndo ; [property getter]
public final void clear ();
public final void clearUndo ();
public final void copy ();
public void createHandle ();
protected void createParams (ref CreateParams cp);
public Cursor cursor ; [property getter]
public final void cut ();
public static Color defaultBackColor ; [property getter]
public static Color defaultForeColor ; [property getter]
protected Size defaultSize ; [property getter]
public Color foreColor ; [property getter]
public final uint getLineCount ();
public final bool hideSelection ; [property setter]
public final bool hideSelection ; [property getter]
public final char[][] lines ; [property setter]
public final char[][] lines ; [property getter]
public uint maxLength ; [property setter]
public uint maxLength ; [property getter]
public final bool modified ; [property getter]
public final bool modified ; [property setter]
public bool multiline ; [property setter]
public bool multiline ; [property getter]
protected void onHandleCreated (EventArgs ea);
protected void onReflectedMessage (ref Message m);
public final void paste ();
protected void prevWndProc (ref Message msg);
public final bool readOnly ; [property getter]
public final bool readOnly ; [property setter]
public final void scrollToCaret ();
public final void select (uint start,uint length);
public final void selectAll ();
public char[] selectedText ; [property setter]
public char[] selectedText ; [property getter]
public uint selectionLength ; [property setter]
public uint selectionLength ; [property getter]
public uint selectionStart ; [property setter]
public uint selectionStart ; [property getter]
public uint textLength ; [property getter]
public char[] toString ();
public final void undo ();
protected void wndProc (ref Message msg);
public final bool wordWrap ; [property setter]
public final bool wordWrap ; [property getter]
[+] Inherited members
backColor backColorChanged bottom bounds bringToFront bringUpOne canFocus canSelect capture click clientRectangle clientSize contains containsFocus contextMenu contextMenuChanged controlAdded ControlCollection controlRemoved controls createControl createControlsInstance created createGraphics createHandle createParams cursor cursorChanged defaultBackColor defaultFont defaultForeColor defaultSize defWndProc delayInvoke destroyHandle disable disableVisualStyle displayRectangle dispose disposed dock doubleClick enable enabled enabledChanged findForm focus focused font fontChanged foreColor foreColorChanged fromChildHandle fromHandle getAutoScaleSize getChildAtPoint getStyle getTopLevel gotFocus handle handleCreated handleDestroyed hasChildren hasLayout hasLayoutChanged height helpRequested hide initLayout invalidate invoke invokeRequired isHandleCreated isMnemonic keyDown keyPress keyUp layout left location lostFocus modifierKeys mouseButtons mouseDown mouseEnter mouseHover mouseLeave mouseMove mousePosition mouseUp mouseWheel move name onBackColorChanged onClick onContextMenuChanged onControlAdded onControlRemoved onCursorChanged onDisposed onDoubleClick onEnabledChanged onFontChanged onForeColorChanged onGotFocus onHandleCreated onHandleDestroyed onHasLayoutChanged onHelpRequested onKeyDown onKeyPress onKeyUp onLayout onLostFocus onMouseDown onMouseEnter onMouseHover onMouseLeave onMouseMove onMouseUp onMouseWheel onMove onPaint onPaintBackground onParentChanged onReflectedMessage onResize onRightToLeftChanged onSystemColorsChanged onTextChanged onVisibleChanged opCmp opEquals paint parent parentChanged performLayout pointToClient pointToScreen preProcessMessage processKeyEventArgs processMnemonic recreateHandle recreatingHandle rectangleToClient rectangleToScreen redraw refresh region resetBackColor resetCursor resetFont resetForeColor resetRightToLeft resetText resize resizeRedraw resumeLayout right rightToLeft rightToLeftChanged select selectNextControl sendBackOne sendToBack setBounds setBoundsCore setClientSizeCore setStyle setVisibleCore show size supportsMouseTracking suspendLayout systemColorsChanged tabStop tag text textChanged top topLevelControl toString update updateStyles visible visibleChanged width wndProc zIndex
}
public static class TextBoxBase.ControlCollection
{
public void add (Control ctrl);
public bool contains (Control ctrl);
public int indexOf (Control ctrl);
public int length ; [property getter]
public int opApply (int delegate(ref Control) dg);
public int opIndex ; [property getter]
protected final Control owner ; [property getter]
public void remove (Control ctrl);
public void removeAt (int i);
}

Page last modified on July 03, 2008, at 10:09 PM

AltStyle によって変換されたページ (->オリジナル) /