Designing Windows > Setting Attachments
 
Setting Attachments
The attachments function allows you to specify how objects in the window change when the window is resized. To specify the attachments for the table gadget in the Employee window so that it will change size proportionally with the window, do the following:
1. Before actually setting the attachments, you need to specify that the columns within the table gadget can also be resized proportionally. In Selection editing mode , double-click the table gadget in the Main window.
The Table Gadget inspector appears.
2. When the table gadget is resized, its columns need to be resized proportionally with it. In the Table Gadget inspector, use the combo box menu to change the Auto Fit field to Proportional. Click Apply.
3. Click the Attachments button in the Editing Modes toolbar of the Main window. Guides appear on the window borders and numbers on the top and left.
The numbers correspond to the weight of the section delimited by the guide. You can ignore these numbers for this example.
4. Set the attachments for the Employee table:
*Drag a line from the left middle handle to the guide on the left border. Release the mouse button when the guide becomes highlighted.
*Drag a line from the top middle handle to the guide on the top border. Release the mouse button when the guide becomes highlighted.
All the other attachments are made by default. This attachment (fixed, elastic, fixed) resizes the gadget proportionally while keeping it at the same distance from the borders.
5. Double-click the Employee table gadget.
The Attachments Inspector panel for the object appears when in Attachments editing mode.
6. To keep the table gadget 10 pixels from the right border, type 10 in the right box of the Attachments Inspector panel as shown in the following figure, then click Apply.
Leave the other boxes with the numbers that appear in them. The table gadget will remain 10 pixels from the right border of the window and from the other borders according to the number of pixels appearing in their respective boxes.
Note: In the Attachments Inspector, you can also click the attachment lines to change their type. They toggle between fixed and elastic when clicked.
For more information about setting attachements, see the Rogue Wave Views Controls User’s Manual.

Version 5.6
Copyright © 2012, Rogue Wave Software, Inc. All Rights Reserved.