The iedit Control

The ink edit (iedit) control provides easy formatting and manipulation of ink input. It is not designed for text input, and in this regard differs from the other two pen edit controls, hedit and bedit. Think of iedit instead as a convenient drawing area suitable for sketches, diagrams, signatures, doodling pics/PENAPI00090001.gif any sort of pen input that does not need to be recognized as text. However, an application can collect handwritten text as input from an iedit control and later transfer it to an hedit or bedit control for editing, if desired, or send it to a recognizer for recognition.

An iedit control ignores most keyboard input because the user cannot type text into an iedit window. However, an iedit control supports the following keystrokes and key combinations as convenient shortcuts:

Keystroke or key combination
Effect
DEL
Delete selected strokes.
CTRL+X
Cut selected strokes to clipboard.
CTRL+C
Copy selected strokes to clipboard.
CTRL+V or CTRL+P
Paste stroke from clipboard
CTRL+A
Select all strokes.
CTRL+Z
Undo last command.

An iedit window can scroll like any other edit control. Specifying a window style incorporating WS_VSCROLL and WS_HSCROLL creates a scrollable drawing area of 32,767 by 32,767 coordinate units. Scroll bars appear on the iedit window only when ink resides outside the current visible area. This behavior mimics the Control Panel window, which displays scroll bars only when an icon lies hidden beyond the boundaries of the window.

The following sample procedure demonstrates how to use iedit to create a drawing area within a single window. After creating the main parent window, the procedure InitInstance copies the window's coordinates into a RECT structure. It then uses the results when sizing the child iedit window so that the child window entirely overlays its parent.

HWND vhwndMain; // Main window

HWND vhwndIedit; // iedit control window

.

.

.

BOOL InitInstance( HINSTANCE hInstance, int nCmdShow )

{

RECT rect; // Main window rectangle

//

// Create main window

//

vhwndMain = CreateWindow(

"StylusClass", // Window class name

"Stylus Sample Program", // Text for title bar

WS_OVERLAPPEDWINDOW, // Window style

CW_USEDEFAULT, // Default horizontal position

CW_USEDEFAULT, // Default vertical position

CW_USEDEFAULT, // Default width

CW_USEDEFAULT, // Default height

NULL, // No parent

NULL, // Class default menu

hInstance, // Window owner

NULL ); // Unused pointer

if (!vhwndMain) // If can't create window,

return FALSE; // exit

//

// Create iedit control window within main window

//

GetClientRect( vhwndMain, (LPRECT) &rect );

vhwndIedit = CreateWindow(

"IEDIT", // Window class name

NULL, // No title bar

WS_CHILD | WS_VISIBLE | // Window style

WS_HSCROLL | WS_VSCROLL,

0, // Overlay control window

0, // onto parent window

rect.right - rect.left, // Use parent width

rect.bottom - rect.top, // and parent height

vhwndMain, // Parent window handle

(HMENU) CHILD_ID, // Child ID

hInstance, // Window owner

NULL ); // Unused pointer

if (!vhwndIedit) // If problem,

return FALSE; // return error code

SetFocus( vhwndIedit ); // Give control immediate focus

ShowWindow( vhwndMain, nCmdShow ); // Display main window

UpdateWindow( vhwndMain ); // Force WM_PAINT message

return TRUE; // Return success

}

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database