DEV412 TABLET PC SUPPORT IN POWERBUILDER – AN OVERVIEW

Document Sample
DEV412 TABLET PC SUPPORT IN POWERBUILDER – AN OVERVIEW Powered By Docstoc
					DEV412 TABLET PC SUPPORT IN POWERBUILDER –
AN OVERVIEW AND APPLICATION OF THE
TECHNOLOGY




DAVE FISH
TECHNICAL EVANGELIST, SYBASE, INC.
dfish@sybase.com
TABLET PC CONTROLS


PowerBuilder 10.2 supports the Tablet PC platform
and introduces two controls

  InkEdit


  InkPicture


These controls provide the ability to capture ink
input from users of Tablet PCs
INK EDIT CONTROL


The InkEdit control captures and recognizes
handwriting and optionally converts it to text
INK PICTURE CONTROL


The InkPicture control captures signatures,
drawings, and other annotations that do not need
to be recognized as text

You can place a background image in an InkPicture
control, and capture and save a user's annotations
to the picture
USING THE INK CONTROLS


You can insert InkEdit and InkPicture controls in:
  The Window painter
  Visual User Object painter


You can use the InkPicture control in the
DataWindow painter

You can also use an InkEdit edit style in the
DataWindow painter
USING THE INK CONTROLS


  The ink controls are fully functional on Tablet PCs


  On other computers, the InkEdit control behaves like a
   multiline edit control, and InkEdit columns behave like columns
   with the Edit edit style


  If the Microsoft Tablet PC Software Development Kit (SDK)
   1.7 is installed on the computer, InkPicture controls can accept
   ink input from the mouse
INK EDIT CONTROL IN DETAIL


 The InkEdit control on a Tablet PC is like a
 MultiLineEdit control that accepts ink input

 On other PCs, the InkEdit control behaves as a
 MultiLineEdit control and cannot collect ink
INK EDIT CONTROL IN DETAIL


 On a Tablet PC, the InkEdit control collects ink
 from a user in the form of handwriting and can
 handle single or multiple lines of text

 It also recognizes gestures, which are specific pen
 strokes that represent a keyboard action such as
 backspace, space, or tab

 The InkEdit control can convert ink to text, or leave
 it as handwriting
INK EDIT PROPERTIES

Determining how ink is collected

  When the InsertAsText property is set to true (the default), the
   control starts to recognize ink and convert it to text when the
   user stops writing and the RecognitionTimer interval elapses


  The RecognitionTimer property is set to 2000 milliseconds (2
   seconds) by default


  The ink is replaced with text in the font you specify and aligned
   to the left of the control
INK EDIT PROPERTIES

Determining how ink is collected

If you set InsertAsText to false, the ink is not
converted to text
  You might use this setting to allow a user to write a letter or
   memo
  You can then call the RecognizeText function in a button or
   other control to convert the text when the user is ready


The InkMode property determines whether only ink
is collected, or both ink and gestures. It can also
be set to disable ink collection completely
INK EDIT PROPERTIES

You can set drawing attributes to specify the ink's:
  Color
  Height
  Width
  Transparency
  Whether applying more pressure increases the width of the
   stroke (IgnorePressure)
  Whether foreground and background colors are blended
   (InkAntiAliased)
  Whether the tip of the pen (PenTip) is a ball or rectangle
FACTOIDS

If the InkControl will have input of a
specific type, such as a date or email
address, specifying the Factoid
property constrains the ink recognizer's
search for recognition results
USING THE MOUSE FOR INPUT

The UseMouseForInput property lets
you use the mouse instead of the
stylus for input on a Tablet PC
INK EDIT EVENTS

 Gesture             When a gesture has occurred

 RecognitionResult   When a recognition has
                     occurred

 Stroke              When a stroke has occurred.
INK EDIT FUNCTION

 The RecognizeText function forces text recognition
 to occur

 Use this function with the InsertAsText property set
 to false to allow the user more time to enter and
 correct ink input before it is converted to text
USING INKEDIT IN A DATAWINDOW
OBJECT

You can specify InkEdit as a style type on the Edit page in
the Properties view for columns

When the column gets focus, an InkEdit control displays so
that the user can enter text with the stylus or mouse

The text is recognized and displayed, then sent back to the
DataWindow when the column or control loses focus

The InkEdit style in the DataWindow painter supports most
of the properties defined for the InkEdit control in the
Window and User Object painters
DEMONSTRATION




INKEDIT CONTROL
USING THE INKPICTURE OBJECT

The InkPicture control behaves like a Picture
control that accepts annotation

If the user does not have a Tablet PC, ink can be
entered using the mouse, but the Tablet PC SDK
must be installed on the user's computer to enable
mouse support in the DataWindow painter
USING THE INKPICTURE OBJECT

The InkPicture control does not convert ink to text

You can associate a picture with the control so that the user
can draw annotations on the picture, then save the ink, the
picture, or both

If you want to use the control to capture and save
signatures, you usually will not associate a picture with it

You might use an InkPicture control to display an image of a
process flow chart or a floor plan of a building, and capture
suggested changes that users enter in the form of ink. Using
an image of a garden, a user could mark trees and shrubs to
be removed and indicate where new plants should be added.
INKPICTURE OBJECT USES

You might use an InkPicture control to:

  Display an image of a process flow chart or a floor plan of a
   building, and capture suggested changes that users enter in
   the form of ink


  Using an image of a garden, a user could mark trees and
   shrubs to be removed and indicate where new plants should
   be added


  Annotate a photograph to highlight certain features (insurance
   adjusting)
INKPICTURE OBJECT

In windows and user objects, you can save the
background image, the ink annotations, or both, to
a file or to a blob

In DataWindow objects, both the background
image and saved ink are stored in blob columns in
the database
INKPICTURE OBJECT PROPERTIES

Determining whether and how ink is
collected

  If you set the InkEnabled property to true, the
   control accepts ink input. You need to set this
   property to false before closing the application
   or performing some other actions
INKPICTURE OBJECT PROPERTIES

Determining whether and how ink is
collected

  The CollectionMode property determines
   whether only ink is collected, only gestures, or
   both ink and gestures


  If you want the double-tap gesture to be
   recognized, you must set the CollectionMode
   property to GestureOnly!
INKPICTURE OBJECT PROPERTIES

Determining whether and how ink is
collected

  DynamicRendering determines whether ink is
   rendered as it is drawn


  HighContrastInk specifies whether it is
   rendered as one color when the system is in
   HighContrast mode
INKPICTURE OBJECT PROPERTIES

Setting drawing attributes

  The InkPicture control supports the same
   drawing attributes as the InkEdit control
INKPICTURE OBJECT PROPERTIES

Erasing ink

  The EraserMode property specifies whether
   ink is erased by stroke or point


  EraserWidth sets the width of the eraser in
   pixels


  For a stylus that has an eraser, you can set
   AutoErase to true
INKPICTURE OBJECT PROPERTIES

Using a picture

  Use the PictureFilename property to specify a picture to
   display in the control


  The PictureSizeMode property determines whether the control
   is resized to fit the picture, or the picture is stretched to fit the
   control, centered, or displayed at the top left of the control and
   clipped if necessary
INKPICTURE OBJECT EVENTS

Gesture   Fires when a gesture has occurred

Stroke    Fires when a stroke has occurred
INKPICTURE OBJECT FUNCTIONS

LoadInk        Loads ink from a file or blob

LoadPicture    Loads a picture from a file or blob

ResetInk       Clears ink from the control

ResetPicture   Clears a picture from the control

Save           Saves a picture and optionally any overlay ink
               to a file or blob in one of the following formats:
               bitmap, JPEG, GIF, TIF, or PNG

SaveInk        Saves ink to a file or blob in one of the
               following formats: Ink Serialized Format (ISF),
               GIF, Base-64 encoded ISF, or Base-64 encoded GIF
USING INKPICTURE IN A
DATAWINDOW OBJECT

 When you insert an InkPicture control in the DataWindow
 painter, a dialog box displays to let you specify a blob
 column to store the ink data and another to use as a
 background image

 You must have created the DataWindow object using a table
 that has these blob columns

 After you specify the columns in the dialog box, the
 InkPicture control displays in the DataWindow and its
 Properties view includes a Definition tab page where you
 can view or change the column definitions
USING INKPICTURE IN A
DATAWINDOW OBJECT

 The InkPicture control in the DataWindow painter
 supports most of the properties of the InkPicture
 Window control, with a few limitations:

  You cannot specify a picture name because the picture comes
   from the database


  The SizeMode property does not support resizing the control
   to fit the picture
DEMONSTRATION




INKPICTURE CONTROL
FOR MORE INFORMATION

Tablet PC Information:

http://msdn.microsoft.com/library/default.asp?url=/l
ibrary/en-us/dnanchor/html/tabletpc.asp

Code Examples:

http://powerbuilder.codexchange.sybase.com

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:62
posted:7/11/2010
language:English
pages:33