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 creates 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.
When 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.
Table 10-1 indicates the screen sizes of the available view types in the MOPView Manager.
View ID |
View type |
Screen size in pixels |
---|---|---|
1 |
PDA Portrait |
240 x 320 (QVGA) |
2 |
PDA Landscape |
320 x 240 (QVGA) |
11 |
Smartphone Portrait |
176 x 220 |
13 |
Smartphone Square |
220 x 220 |
22 |
VGA Portrait |
480 x 640 |
21 |
VGA Landscape |
640 x 480 |
0 |
Unconstrained |
Custom size (takes the values you set by changing the size of the window in the Layout view, on the Other page of the Properties view, or on the Size tab of the Options dialog box) |
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. The view ID is visible only in source code for objects you save in a particular view.
Response windows are the only window types that do not need to conform to a specific screen size on a handheld device.
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. This list has one additional entry labeled “Design Size Default”. When you select this entry for a window, PocketBuilder resizes the window based on current Size tab settings in the Options dialog box. PocketBuilder also changes the view ID for the window based on these settings. You open the Options dialog box by selecting Design>Options from the Window painter menu.
PocketBuilder can save up to seven views for a window, but only one of each type of MOP view is permitted. (The seven types of MOP view are listed in Table 10-1.) The view ID that PocketBuilder assigns when you select Design Size Default for the window view counts as one of the seven permissible view IDs, and this selection overwrites an existing view that uses the same view ID.
The next time you open a window after selecting Design Size Default for its current MOP view, the IDE Window Size drop-down list displays the view name corresponding to the settings on the Size tab of the Options dialog box at the time you made the selection. Changes that you make on the Size tab affect new windows only. They are not imparted to an existing window unless you select or reselect Design Size Default for that window from the IDE Window Size drop-down list.
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.
Definitions of objects and controls in the source code of a PKL file include the view ID for each MOP view that you set, and the position and dimension properties of all visual objects and controls saved in a particular view. Therefore, when you export a window, all of its MOP views, and the positions of the objects and controls in those views, are included in the exported file. When you copy or inherit from a window, the copied or inherited window retains all MOP views set in the original window. You can also move a window from one PKL to another without losing its MOP views.