|
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 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
}
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|