Manipulate views

Now you learn to control the location and appearance of PowerBuilder painter views. You can add views to a painter workspace by selecting them from the View menu in the workspace menu bar.

You can add multiple views of the same type and you can combine views into a stack of panes with selection tabs at the bottom. You can resize a view by grabbing and dragging the separator bars that surround it or that surround neighboring views in the painter workspace.

These exercises demonstrate how you can change the appearance of Application painter views, but you can manipulate views in all painters in the same way.

Now you:

Add an extra Script view

The default Application painter layout actually has two Script views. One of the Script views displays the script for an Application object event, and the other Script view displays the declared variables for the object instance or the entire application. Both of these Script views are in the same stack of tabbed views (panes).

Now you add a third Script view that is not part of a stack of tabbed panes. You can add multiple Script views to your painter layout, but no two Script views can display the same script at the same time.

  1. Select View > Script from the menu bar.

    A new Script view is displayed. It is not attached to a stack of tabbed panes. It lists the Application object in the left drop-down list box. The other two drop-down lists are empty and the right drop-down list is grayed out.

    If an existing Script view shows the Open event, the new Script view is empty. Otherwise it displays the Open event.

  2. Select the Close event from the second drop-down list box.

    If another Script view is already open to the Close event, an error message as "Script already opened in another script view" is displayed in the PowerBuilder status bar.

Display view title bars

Now you display a view title bar by pinning it to the painter workspace background. If a title bar is unpinned, you see it only when your cursor pauses near the top edge of a view.

  1. Move the cursor to the top of the extra Script view you just added.

    The view title bar rolls down. It contains a pushpin () button on the left and a maximize/minimize button and a close button on the right. The name of the view displays on the left side of the title bar, next to the pushpin button.

  2. Click the pushpin in the title bar

    or

    Right-click the view title bar and click Pinned from the pop-up menu.

    The pushpin button and the Pinned menu item are toggle switches. You can click the pushpin button or the pop-up menu item to pin and unpin the view title bars.

Float and dock views

Now you float and dock a view in the painter workspace. Floating a view enables you to move it around outside the painter frame.

  1. Right-click the title bar of an unstacked view you want to float

    or

    Right-click the tab of a view in a stack of tabbed panes.

    If the title bar is not pinned, move the cursor over the title bar area and wait until it is displayed before you right-click it.

  2. Click Float in the pop-up menu.

    When a view is floated, the Float menu item is not enabled. When a view is docked, the Dock menu item is not enabled.

  3. Drag the view around the screen.

    Notice that the floating property allows you to move the view outside the painter workspace.

  4. Right-click the title bar of the floating view. Click Dock in the pop-up menu.

    The view returns to its original location.

Manipulate tabbed views

Now you separate a view from a stack of tabbed panes and place it above the stack. You then return it to the stack and change its position in the stack.

  1. Press and hold the mouse button on the Function List tab. Drag the tab onto the separator bar that separates the two default stacks in the Application painter. Release the mouse button.

    When you release the mouse button, the Function List view is no longer part of a stack. If you drag the tab too far and release it over the right stack with the Properties view and Non-Visual Object List, the Function List becomes part of that stack.

    Alternate way to float a view from a stack

    If you hold the Ctrl or Shift key down as you drag a tabbed pane from a stack, the pane becomes a floating view.

  2. Press and hold the mouse button on the Function List title bar. Drag it over the stack from which you separated it. Release the mouse button when the gray rectangular outline of the Function List view overlaps the stack.

    The Function List view returns to its original stack, but it is added as the last pane in the stack.

  3. Press and hold the mouse button on the Function List tab. Drag it sideways over the other tabs in the same stack. Release the mouse button when the small gray rectangular outline overlaps another tab in the stack of tabbed panes.

    The Function List view moves to the position in the stack where you release the mouse button.

Save a view layout scheme

You can save view layout schemes for a PowerBuilder painter and use them every time you open the painter.

  1. Arrange the views in the painter as you like.

  2. Select View > Layouts > Manage from the menu bar.

  3. Click the New Layout button in the Layout dialog box.

  4. Enter a name for your layout in the text field, click the background of the dialog box, and then click the x button in the upper right corner of the dialog box to close it.

    Your layout scheme is saved. Now, when you select View > Layouts, you see your layout listed on the cascading menu.

    Saving the toolbars and System Tree layouts

    PowerBuilder saves the customizations you make to the toolbars and System Tree separately from the view layout. It retains those settings and reapplies them to every workspace you access and every view layout you select.

Reset the default view layout scheme

Each PowerBuilder painter has a default view layout scheme. You can always reset the layout scheme to this default layout.

  1. Select View > Layouts from the menu bar.

  2. Choose Default from the cascading menu.

    The default view layout scheme is displayed in the painter workspace.