InkEdit control

An InkEdit control collects pen input (ink) on a Tablet PC and converts it to text. It is used with the handwriting recognition engine ("recognizer") that is part of the Tablet PC platform.

Using with animation features

InkEdit controls may not paint correctly when you use animation features.

Properties

InkEdit property

Datatype

Description

AccessibleDescription

String

A description of the control and/or its purpose for use by accessibility tools such as readers for visually impaired users.

AccessibleName

String

A label that briefly describes the control, such as the text in a button or the name of a menu item.

AccessibleRole

AccessibleRole (enumerated)

Describes what kind of user interface element the control is.

Alignment

Alignment (enumerated)

Specifies the alignment of text in the control. Values are:

Center!

Justify!

Left!

Right!

BackColor

Long

Specifies the numeric value of the background color: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference.

Border

Boolean

Specifies whether the control has a border. Values are:

TRUE -- Control has a border.

FALSE -- Control does not have a border.

BorderStyle

BorderStyle (enumerated)

Specifies the border style of the control. Values are:

StyleBox!

StyleLowered!

StyleRaised!

StyleShadowBox!

BringToTop

Boolean

Specifies whether PowerBuilder moves the control to the top of the front-to-back order.

ClassDefinition

PowerObject

An object of type PowerObject containing information about the class definition of the object or control.

DisplayOnly

Boolean

Specifies whether the text is display only and cannot be changed by the user. Values are:

TRUE -- Text cannot be changed by user.

FALSE -- Text can be changed by user.

DragAuto

Boolean

Specifies whether PowerBuilder puts the control automatically into Drag mode. Values are:

TRUE -- When the control is clicked, the control is automatically in Drag mode.

FALSE -- When the control is clicked, the control is not automatically in Drag mode. You have to manually put the control into Drag mode by using the Drag function.

DragIcon

String

Specifies the name of the stock icon or the file containing the icon you want to display when the user drags the control (the ICO file). The default icon is a box the size of the control.

When the user drags the control, the icon displays when the control is over an area in which the control can be dropped (a valid drop area). When the control is over an area that is not a valid drop area, the No-Drop icon displays.

Enabled

Boolean

Specifies whether the control is enabled (can be selected). Values are:

TRUE -- Control can be clicked.

FALSE -- Control cannot be clicked.

FaceName

String

Specifies the name of the typeface in which the text of the control displays (for example, Arial or Courier).

Factoid

String

Specifies a context for ink recognition. Set this property if the input data is of a known type, such as a date or Web address, to constrain the search for a recognition result.

FontCharSet

FontCharSet (enumerated)

Specifies the font character set used for the text in the control. The application must be running on an appropriate version of PowerBuilder under an operating system that supports the selected character set. For a complete list of possible values, see the list of properties for the FontCharSet enumerated datatype on the Enumerated tab page of the Browser.

FontFamily

FontFamily (enumerated)

Specifies the font family (type style) used for the text in the control. Values are:

AnyFont!

Decorative!

Modern!

Roman!

Script!

Swiss!

FontPitch

FontPitch (enumerated)

Specifies the font pitch used for the text in the control. Values are:

Default!

Fixed!

Variable!

Height

Integer

Specifies the height of the control, in PowerBuilder units.

HScrollBar

Boolean

Specifies whether a horizontal scroll bar displays. Values are:

TRUE -- Horizontal scroll bar displays.

FALSE -- Horizontal scroll bar does not display.

IgnorePressure

Boolean

A drawing attribute that specifies whether the drawn ink gets wider as the pressure of the pen tip on the tablet surface increases. Values are:

TRUE -- Pressure from the pen tip is ignored.

FALSE -- The width of the ink increases with the pressure of the pen tip (default).

InkAntiAliased

Boolean

A drawing attribute that specifies whether the foreground and background colors along the edge of the drawn ink are blended (antialiased) to make the stroke smoother and sharper. Values are:

TRUE -- The ink stroke appears smoother and sharper (default).

FALSE -- The ink stroke is not antialiased.

InkColor

Long

A drawing attribute that specifies the current ink color. The default color is black.

InkHeight

Integer

A drawing attribute that specifies the height of the side of the rectangular pen tip in pixels. The default is 1pixel.

InkMode

InkMode (enumerated)

Specifies whether ink collection is enabled and whether ink only or ink and gestures are collected. Values are:

CollectInk! -- Only ink is collected.

CollectInkAndGestures! -- Ink and gestures are collected (default).

InkDisabled! -- Ink collection is disabled (the control behaves like a multiline edit control).

InkTransparency

Integer

A drawing attribute that specifies the transparency of drawn ink. The range of values is from 0 for totally opaque (the default) to 255 for totally transparent.

InkWidth

Integer

A drawing attribute that specifies the width of the pen in pixels. The default is 53 pixels. If the IgnorePressure property is not set, the actual width varies between .5 times the value of the Width property for minimum pressure and 1.5 times its value for maximum pressure.

InsertAsText

Boolean

Specifies whether the ink is inserted as text or as ink. Values are:

TRUE -- The ink is inserted as text (default).

FALSE -- The ink is inserted as ink.

Italic

Boolean

Specifies whether the text in the control is italic. Values are:

TRUE -- Text is italic.

FALSE -- Text is not italic (default).

Limit

Integer

Specifies the maximum number of characters (0 to 32,767) that can be entered in the control (0 means unlimited).

Modified

Boolean

Specifies whether the text in the control has been modified since it was opened or last saved. Modified is the control's "dirty" flag, indicating that the control is in an unsaved state. Values are:

TRUE -- The control has been modified.

FALSE -- The control has not been modified.

When the first change is made to a newly opened or saved control, PowerBuilder sets the Modified property to true and triggers the Modified event.

PenTip

InkPenTip (enumerated)

A drawing attribute that specifies whether the pen tip is round or rectangular. Values are:

PenTipBall! -- The pen tip is round (default).

PenTipRectangle! -- The pen tip is rectangular.

Pointer

String

Specifies the name of the stock pointer or the file containing the pointer used for the control.

RecognitionTimer

Long

Specifies the time period in milliseconds between the last ink stroke and the start of text recognition. The default is 2000 (two seconds).

RightToLeft

Boolean

Specifies that characters should be displayed in right-to-left order. The application must be running on an operating system that supports right-to-left display. Values are:

TRUE -- Characters display in right-to-left order.

FALSE -- Characters display in left-to-right order.

Status

InkEditStatus (enumerated)

A read-only property available at runtime that provides the current status of the control so that the user does not need to monitor the Stroke event. Values are CollectingInk!, RecognizingInk!, and Idle!.

TabOrder

Integer

Specifies the tab value of the control within the window (0 means the user cannot tab to the control).

Tag

String

Specifies the tag value assigned to the control.

Text

String

Specifies the text that displays in the control.

TextColor

Long

Specifies the numeric value of the color used for text: -2 to 16,777,215.

TextSize

Integer

Specifies the size of the text in the control, in points.

For backward compatibility, the size is stored as a negative number; for example, 10-point text size is stored as -10.

Underline

Boolean

Specifies whether the text in the control is underlined. Values are:

TRUE -- Text is underlined.

FALSE -- Text is not underlined (default).

UseMouseForInput

Boolean

Specifies whether the mouse can be used for input on a Tablet PC. Values are:

TRUE -- The mouse can be used for input.

FALSE -- The mouse cannot be used for input (default).

Visible

Boolean

Specifies whether the control is visible. Values are:

TRUE -- Control is visible (default).

FALSE -- Control is not visible.

VScrollBar

Boolean

Specifies whether a vertical scroll bar is displayed on the right of the control. Values are:

TRUE -- Vertical scroll bar is displayed.

FALSE -- Vertical scroll bar is not displayed.

Weight

Integer

Specifies the stroke weight of the text in the control; for example, 400 for normal (default) or 700 for bold.

Width

Integer

Specifies the width of the control, in PowerBuilder units.

X

Integer

Specifies the X position (the distance from the left edge of the window), in PowerBuilder units.

Y

Integer

Specifies the Y position (the distance from the top of the window), in PowerBuilder units.


Events

InkEdit event

Occurs

Constructor

When the object is created, immediately before the Open event occurs in the window.

Destructor

When the object is destroyed, immediately after the Close event occurs in the window.

DragDrop

When a dragged control is dropped on the control.

DragEnter

When a dragged control enters the control.

DragLeave

When a dragged control leaves the control.

DragWithin

When a dragged control is within the control.

Gesture

When a gesture has occurred.

GetFocus

Just before the control receives focus (before it is selected and becomes active).

Help

When the user presses the F1 key or drags the context help button (question mark) from the title bar to a menu item or control.

LoseFocus

When the control loses focus (becomes inactive).

Moved

When a control has been changed and loses focus.

Other

When a Windows message occurs that is not a PowerBuilder event.

RButtonDown

When the right mouse button is pressed on the control.

RecognitionResult

When a recognition has occurred.

Stroke

When a stroke has occurred.


Functions

InkEdit function

Datatype returned

Description

ClassName

String

Returns the name of the control.

Clear

Integer

Clears the selected text (if any) from the control (but does not place it in the clipboard).

Copy

Integer

Copies (but does not delete) the selected text (if any) from the control to the clipboard.

Cut

Integer

Cuts (deletes) the selected text (if any) from the control to the clipboard.

Drag

Integer

Starts or ends the dragging of an InkEdit item.

GetContextService

Integer

Creates a reference to a context-specific instance of the specified service.

GetParent

PowerObject

Returns a reference to the name of the parent object.

Hide

Integer

Hides the specified InkEdit item.

Move

Integer

Moves a control or object to a specified location.

Paste

Integer

Inserts the contents of the clipboard (if any) at the insertion point in the control.

PointerX

Integer

Determines the distance from the left edge of an object to the pointer location.

PointerY

Integer

Determines the distance from the top edge of an object to the pointer location.

Position

Integer

Returns the position of the insertion point in the control.

PostEvent

Boolean

Adds the event to the end of the event queue of an object.

Print

Integer

Includes this object in a print job. Only the part visible on the screen is printed.

Resize

Integer

Resizes a control to the specified dimensions.

RecognizeText

Integer

Specifies that ink recognition should occur.

ReplaceText

Integer

Replaces the currently selected text (if any) with the specified string. If no text is selected, the ReplaceText function inserts the text at the insertion point.

SelectedLength

Integer

Returns the length of the selected text (if any) in the control.

SelectedText

String

Returns a string with the selected text (if any) from the control.

SelectText

Long

Selects the text specified by the starting position and length.

SetFocus

Integer

Sets focus for a specified object or control.

SetPosition

Integer

Sets the position of the InkEdit control in the front-to-back order within a window.

SetRedraw

Integer

Controls the automatic redraw of an object after its properties have changed.

Show

Integer

Makes an object or control visible if it is hidden. If the object is already visible, Show brings it to the top.

TriggerEvent

Integer

Triggers a specified event in the control and executes the script for the event.

TypeOf

Object

Returns the type of the control.