Developing the user interface
Begin by creating a visual part, MyClipboardToolsView, in MyRunSamplePartsApp. After the Composition Editor opens, delete the default Window part on the free-form surface and add a Form part. Next, add the three push buttons so that they line up from left to right. Don't worry about the exact position of the push buttons, because you will set the exact size and position later.
Adding graphics to the push buttons
Because the tool bar will be graphical, instead of using text as the label of the push buttons, use icons. Open the settings for each push button and change the label type property to XmICON and the graphics descriptor property to Icon. In the graphics descriptor window, select the filename containing the icon you want to use and the icon ID. For your convenience, abtico50.dll contains a set of icons you can use. The icon IDs for cut, copy, and paste are 695, 694, and 692, respectively. Also, change the part name of each push button to a more meaningful name, such as CutButton, CopyButton, and PasteButton. This will make adjusting the size and position easier.
Tip icon
If you choose to use your own icon DLL, be sure to build it and place it in your search path (LIBPATH on Linux, PATH on Windows) before you change the settings. If you don't, you will not see your icons until the next time you edit the view.
Adjusting the size and position
There are many different ways to control how the push buttons are sized and positioned when the tool bar is sized and positioned. Here are three possibilities:
1. You could leave each push button's position unchanged when the tool bar is resized, so the push buttons remain where they are and empty space fills the rest of the tool bar. To achieve this effect, the button's edges are attached to the parent's left edge. This is the default when you drop the push buttons inside the form. The problem with this approach is that the buttons won't look very good on different display resolutions.
2. Another alternative gives each push button one third of the space available in the form. So as the tool bar resizes, the push buttons are automatically resized to always fill the space of the tool bar. As a result, no empty space is shown in the tool bar.
This approach works better for different display resolutions, but keep in mind that the picture on the push button will not resize with the push button. It will always remain at its normal size, as shown in the following picture:
3. A third alternative is to position the push buttons so that they are always side-by-side, and each button takes only as much space as it needs. The buttons do not resize with the form. This works best for the tool bar, because the tool bar will resize appropriately for different display resolutions like VGA and XGA as illustrated below.
If you are not familiar with the different kinds of attachment specifications in VAST Platform, you should review Sizing and positioning techniques. Then, set the size and position of each push button, open its settings and select the framing spec property.
After you finish, when you resize the clipboard tool bar, the three push buttons will automatically reflow if they need to, to accommodate the icon graphic. You have completed the user interface for the clipboard tool bar. Next, define the public interface for the tool bar.
Last modified date: 02/16/2021