Customizing the Palettes Panel
You can add your own palettes to the Palettes panel using the .opt file. To add a new palette, define the node that corresponds to the new palette in the tree gadget, and provide the data file containing the objects in that palette. In the option file, you can specify the class of the container that is used to read and display data files. You can also remove a predefined palette and specify the palette that is selected by default.
The Palettes panel is split into two areas. The area at the top of the panel displays a tree gadget, while the bottom area displays a scrolled view. The tree gadget represents the hierarchy of available palettes from which you can choose. A container in the scrolled view displays the contents of the selected palette. Each node in the tree corresponds to a palette descriptor, which is defined by a name, a data file, a label, and the location of the node in the tree. The palette descriptor has its own container.
The container of a palette is created when the palette is selected for the first time. If the container class is specified, Rogue Wave® Views Studio uses the corresponding container information (
IlvStContainerInfo) to create an instance of the specified class. By default, it uses an
IlvGadgetContainer object. If the palette has a specified data file, the created container reads that data file. All the palette containers are hidden, except the one that is attached to the selected palette.
Customize Options
You can use an option file to add new palettes to the Palettes panel, remove predefined palettes, or designate the default palette:
To describe a new palette, use the dragDropPalette option as follows:
dragDropPalette "<palette name>" {
<option-1 <value-1>;
...
<option-n <value-n>;
}
To remove a predefined palette from the tree gadget in the Palettes panel, use the removeDragDropPalette option like this:
removeDragDropPalette "<palette name>"
To specify the palette that is selected by default, use the defaultDragDropPalette option:
defaultDragDropPalette "<palette name>"
Broadcast Messages
Following are the messages that are broadcast when a palette container is initialized or when a palette is selected:
PaletteContainerInitialized The argument is the descriptor of the selected palette. When this message is broadcast, the container is created, its data file is read and the objects in the palette are initialized.
PaletteSelected The argument is the descriptor of the selected palette.
Example
The following example shows how to use options related to the Rogue Wave Views Studio palettes:
// mystudio.opt
studio {
dragDropPalette "MyRootPalette" {
dataFileName "myfile1.ilv";
path -before "Gadgets";
}
dragDropPalette "MyPalette" {
label "My Palette";
bitmap "myicon.gif";
dataFileName "myfile2.ilv";
path "Gadgets" "Miscellaneous";
}
removeDragDropPalette "ViewRectangles";
defaultDragDropPalette "MyRootPalette";
}
Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.