Working with SIP

Vassili Philippov (vasja@spbteam.com), December 07, 2001.

Summary

The main input method on Pocket PC is SIP (Soft Input Panel). There are special SIP related user interface requirements discussed in this article.

Background

SIP related terms Here are some SIP related things:

Show/hide SIP

You can use different functions for showing and hiding SIP. It is recommended to use SHSipPreference function for that. However, sometimes this function does not work and you have to use low-level access to SIP window using FindWindow and ShowWindow functions. Find a window with SipWndClass class and you can treat it as any other window.

Using SHSipPreference function is very simple. Here is a code to show SIP:

SHSipPreference(hWnd, SIP_UP);

and a code to hide it:

SHSipPreference(hWnd, SIP_DOWN);

Auto-show

Standard Pocket PC applications show SIP automatically when the focus is in a typable field. There are at least two ways of implementing such behaviour.

Handling EN_SETFOCUS and EN_KILLFOCUS

You can handle EN_SETFOCUS and EN_KILLFOCUS events for each edit control (use Class Wizard for that) and show SIP in EN_SETFOCUS handler and hide SIP in EN_KILLFOCUS handler.

Using SIPPREF control

You can insert SIPPREF control in your dialog that will automatically show SIP when focus is in a typable control. To add SIPPREF control you can either edit dialog resource in text mode:

  1. Open (Ctrl+O) your resource file (.rc) as a text file (Open as: Text).
  2. Insert the following line in the end of your dialog section (just before END) CONTROL "",-1,WC_SIPPREF,NOT WS_VISIBLE,-10,-10,5,5
  3. Add the following line in the InitInstance method of your application: SHInitExtraControls();

Or you can insert it in the resource editor - insert a custom control and set class name to SIPPREF.

Logo requirements

There exist the following SIP related logo requirements that can be considered as guide lines for developers.

SIP button in the standard location

These requirements will be satisfied automatically if you use only standard functions for working with SIP.

Required: Display New and SIP button controls only in their standard locations. It is not required that an application always displays the New and SIP buttons. However, whenever these controls are displayed, they should be displayed in their standard locations in the bottom left and bottom right, respectively. It is strongly recommended that any application that has the ability to create new data objects uses a New button in the same location and supports the Pocket PC global New functionality for users who have this feature turned on. The SIP control should be displayed continuously in most applications, and be hidden only in a rare case where no input of any kind is possible (e.g. full screen mode of a game). Hiding/showing the SIP button should not be overdone to avoid confusion of when it is available - it is far more confusing to have it flash than to have the SIP control visible in some views where no input is possible.

SIP

To satisfy this requirement do not add edit controls at the bottom of your dialogs. Make sure that edit controls are not covered when SIP is opened.

Required: Applications should handle the Input Panel appearing/disappearing. From the UI perspective, an application should be designed to account for the fact that an 80-pixel high Soft Input Panel (SIP) may be docked in the area immediately above the command bar at any moment, requiring the application to be resized out of the way. The specific requirements are:

  1. All text entry fields must be accessible with the SIP up. This can be accomplished either by placing all edit fields high enough on the screen so that they will not be obscured by an 80 pixel high SIP, or by having a scroll bar when the SIP is displayed (or both).
  2. Applications must resize in response to docked input methods. This includes resizing and/or shifting things like dialog tabs, status bars and other elements as needed, and/or resizing or drawing scroll bars to ensure all UI is accessible while an 80 pixel high SIP is up. Note that a docked input method may be as high as 140 pixels, but applications are not expected to be optimized for a SIP height greater than 80 pixels.

Auto show/hide SIP

Show SIP automatically when typable controls (edit, etc) get focus and hide SIP when non-typable controls (buttons, drop-down lists, etc) get focus.

Recommended: Careful use of automatical hiding/showing the Input Panel. Usability testing shows that gratuitous hiding/showing of the Input Panel has negative performance and user experience implications. Therefore, applications must be very careful when changing the state of the input panel automatically. A good rule of thumb is that the Input Panel should only be shown or hidden if the user is extremely likely to want this behavior. There are two cases where the SIP state should be changed:

  1. All typable common controls have the ability to raise the SIP when they gain focus and lower it when they lose it. This includes edit boxes, multi-line edit controls, editable combo boxes. Applications should take advantage of this support in windows that contain a few typable controls but generally are not input heavy.
  2. Applications may also put the SIP up or down on demand. This is generally useful if the window being displayed is designed for significant input of text (e.g. a new document or card). In this case, the SIP should be put up and stay up while the dialog is displayed, so that the SIP will not flash up and down as a user moves between typable and non-typable controls. An example of a good time to automatically lower the SIP is when launching a game or a dialog that does not accept ASCII input as a significant part of its functionality.

Non-full screen dialogs

Most programs do not use non-full screen dialogs on Pocket PC.

Required: Non-full screen dialogs displayed out of the way of the Input Panel. Any non-full screen dialog should be vertically centered in the area above the standard, 80 pixel high Input Panel when it is displayed. It should be placed in this space even if the Input Panel is not currently displayed, since if a user displays the Input Panel, no part of the dialog will be re-covered. If a dialog is higher than the space available when the Input Panel is displayed, the dialog should be butted against the top of the screen. Message box text should be informative but brief to avoid part of the message box potentially being hidden behind the SIP.

Related resources: