Example #1
0
        /// <summary>
        ///		Create a new control of a particular type.
        /// </summary>
        /// <param name="type">The type of control to create.</param>
        /// <returns>One of ToolbarPopup, ToolbarButton and ToolbarComboBox depending on the type given.</returns>
        private ToolbarControl CreateControl(MsoControlType type)
        {
            ToolbarControl control = null;

            switch (type)
            {
            case MsoControlType.msoControlPopup:
                control = new ToolbarPopup(this);
                break;

            case MsoControlType.msoControlButton:
                control = new ToolbarButton(this);
                break;

            case MsoControlType.msoControlEdit:
            case MsoControlType.msoControlDropdown:
            case MsoControlType.msoControlComboBox:
                control = new ToolbarComboBox(this, type);
                break;
            }
            if (control != null)
            {
                control.InternalTag = InternalTag + "_" + NEXT_TAG;
                NEXT_TAG++;
            }
            return(control);
        }
Example #2
0
 /// <summary>
 ///		Creates a new toolbar control.
 /// </summary>
 /// <param name="parent">The popup menu holding the control.</param>
 /// <param name="type">The type of the control.</param>
 protected ToolbarControl(ToolbarPopup parent, MsoControlType type)
 {
     this.parent = parent;
     this.type   = type;
 }
Example #3
0
 /// <summary>
 ///		Creates a new control.
 /// </summary>
 /// <param name="parent">The popup menu holding the control.</param>
 /// <param name="type">The type of control to create.</param>
 internal ToolbarComboBox(ToolbarPopup parent, MsoControlType type) : base(parent, type)
 {
     items = new ArrayList();
 }
Example #4
0
 /// <summary>
 ///		Creates a new toolbar button.
 /// </summary>
 /// <param name="parent">The popup menu holding the button.</param>
 internal ToolbarButton(ToolbarPopup parent) : base(parent, MsoControlType.msoControlButton)
 {
 }
Example #5
0
 /// <summary>
 ///		Creates the popup menu.
 /// </summary>
 /// <param name="parent">The parent popup menu.</param>
 internal ToolbarPopup(ToolbarPopup parent) : base(parent, MsoControlType.msoControlPopup)
 {
     controlMap = new Hashtable();
     controls   = new ArrayList();
 }