Using MOP views for DataWindows

Assigning multiple views for a DataWindow object

The DataWindow painter includes a Multiple Orientation Painter view manager that lets you assign runtime layouts which change automatically when an application user changes the orientation of a handheld device or emulator. You can use the View>Runtime MOP Views>MOPViewManager menu item in the DataWindow painter to create multiple views for a DataWindow object with the same orientations available to PocketBuilder windows.

For more information on the available views, see “Multiple Orientation Painter for windows”.

When you open a window containing a DataWindow at runtime, PocketBuilder automatically selects the view of theDataWindow that correlates with the current orientation of the device or emulator. If you do not create a specific view for the selected orientation, the last view saved in the painter is displayed at runtime. In this case, the objects in the DataWindow do not necessarily display with optimal sizes and positions for the user-selected orientation.

Property specificity

For a DataWindow with multiple views, the position (x and y) and dimension (width and height) properties of the DataWindow and its column, text, and control objects are view-specific. However, the height properties of the DataWindow bands are not affected. All other properties are specific to the DataWindow—that is, they apply to all of its defined views.

The definition of a DataWindow object in the source code of a PKL file includes the view ID for each MOP view that you set, and the position and dimension properties of columns, text, and controls saved in the DataWindow for a particular view. Therefore, when you export a DataWindow, 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 DataWindow object, the copied or inherited DataWindow retains all MOP views set in the original window. You can also move a DataWindow object from one PKL to another without losing its MOP views.