Multiple Orientation Painter for windows

About the Multiple Orientation Painter

From the Window painter, you can select the View>Runtime MOP Views>MOPView Manager menu item to create multiple views for each PocketBuilder window.

The MOPView Manager can create only views that are based on the types of devices supported by PocketBuilder and the screen orientations available for these devices. When device users switch screen orientations (WM 2003 or higher), the corresponding view for the current orientation displays automatically.

NoteWhen screen orientations do not have a corresponding view If you do not create a specific view for the selected orientation, the last view saved in the Window painter is displayed at runtime. In this case, the objects in the window do not necessarily display in optimal sizes and positions for the user-selected orientation.

Available view types

Table 10-1 indicates the screen sizes of the six available view types in the MOPView Manager:

Table 10-1: Available view types in the MOPView Manager

View type

Screen size in pixels

PDA Portrait

240 x 320 (QVGA)

PDA Landscape

320 x 240 (QVGA)

Smartphone Portrait

176 x 220

Smartphone Square

220 x 220

VGA Portrait

480 x 640

VGA Landscape

640 x 480

Each view type that you add in the MOPView Manager becomes a specific view defined for the current window in the Window painter. To add a view, you select a view type in the rightmost list box of the manager, then click Add. You can delete a specific view by selecting it in the leftmost list box, and then clicking Delete. You click OK to save your view selections. The last view you select before clicking OK becomes the current view.

Changing views at runtime and design time

Views that you add in the MOPView Manager are automatically listed as menu items in the View>Runtime MOP Views menu. At design time you can toggle between different views or between a view and no view at all by selecting these menu items. The current view is listed in the Runtime MOP Views submenu with a check mark beside it.

You can also change views by selecting an item from the IDE Window Size drop-down list on the General page of a window’s Properties view. Selecting “Unconstrained” or changing the size of the window in the Layout view or on the Other page of the Properties view can take you out of all specific views defined for the current window. Response windows are the only window types that do not need to conform to a specific screen size on the handheld device.

Property specificity

For a window with multiple views, the position (x and y) and dimension (width and height) properties of the window and its controls are view-specific. All other window and control properties are window-specific—that is, they apply to all of the defined window views.

The source code in the PKL file includes only the last position and dimension properties saved in the Window painter for the window and its controls. Therefore, when you export a window with MOP views, the MOP views are not included in the exported code. The exported code contains only the most recent position and dimension properties from the original window.

However, when you copy or inherit from a window, the copied or inherited window retains all the MOP views set in the original window. You can also move a window from one PKL to another without losing its MOP views.