Zoom Dropdown Customization
The Zoom dropdown of CuteEditor by default displays a predefined
set of zoom ratios. You can easily modify this default set using the
following methods:
1. Edit Dropdown Configuration File (Common.config).
The dropdown configuration file (Common.config) can be found in the
/CuteEditor/Configuration/Shared folder. In dropdown configuration file you can
find the Zoom element which contains the configuration
information for the Zoom dropdown within CuteEditor. By default, it
contains the following format blocks:
You can modify the Zoom element to create your own format block list.
Example:
- <Zoom>
- <item text="400%" value="400"></item>
- <item text="300%" value="300"></item>
- <item text="200%" value="200"></item>
- <item text="100%" value="100"></item>
- <item text="80%" value="80"></item>
- <item text="75%" value="75"></item>
- <item text="66%" value="66"></item>
- <item text="50%" value="50"></item>
- <item text="33%" value="33"></item>
- <item text="25%" value="25"></item>
- </Zoom>
Now the Zoom dropdown contains the following zoom ratios.
2. Programmatically populate the Zoom dropdown:
C# Example:
- if (!IsPostBack) {
- CuteEditor.ToolControl toolctrl=Editor1.ToolControls["Zoom"];
- if(toolctrl!=null) {
- CuteEditor.RichDropDownList dropdown=(CuteEditor.RichDropDownList)toolctrl.Control;
-
- CuteEditor.RichListItem richitem=dropdown.Items[0];
-
- dropdown.Items.Clear();
-
- dropdown.Items.Add(richitem);
-
- dropdown.Items.Add("300%","300");
- dropdown.Items.Add("200%","200");
- dropdown.Items.Add("100%","100");
- dropdown.Items.Add("66%","66");
- }
- }
VB Example:
- If Not Page.IsPostBack Then
- If Not Editor1.ToolControls("Zoom") Is Nothing Then
- Dim dropdown As CuteEditor.RichDropDownList
- Dim richitem As CuteEditor.RichListItem
- dropdown = DirectCast(Editor1.ToolControls("Zoom").Control, CuteEditor.RichDropDownList)
-
- richitem = dropdown.Items(0)
-
- dropdown.Items.Clear()
-
- dropdown.Items.Add(richitem)
-
- dropdown.Items.Add("300%","300");
- dropdown.Items.Add("200%","200");
- dropdown.Items.Add("100%","100");
- dropdown.Items.Add("66%","66");
- End If
- End If