Example #1
0
        /// <summary>
        /// Creates the toolbar buttons.
        /// </summary>
        private void CreateToolbarButtons()
        {
            //create the toolbar buttons
            var uiElements = new List <UIElement>();

            foreach (var b in PreValueModel.Features.Where(x => x.Selected))
            {
                var button = new ButtonUIElement {
                    Alias = b.Value, CssClass = b.Value, Title = b.Text
                };
                //TODO: add the TinyMCE ...
                uiElements.Add(button);
            }

            UIElements = uiElements;
        }
		public void AfterCreateChildElements(UIElement parent)
		{
			// If the UIElement that just finished creating its child elements is an ImageAnTextUIElement,
			// then we want to add in our own button element now.
			if( parent is ImageAndTextUIElement )
			{
				ButtonUIElement btnElem = new ButtonUIElement( parent );
				btnElem.Text = _text;
				btnElem.Rect = new Rectangle(
					parent.RectInsideBorders.Right   + this._insideRight,
					parent.RectInsideBorders.Top    + 1,
					_insideWidth,
					parent.RectInsideBorders.Height - 2
					);			
				btnElem.ElementClick += new UIElementEventHandler( OnEmbeddedButtonClicked );
				parent.ChildElements.Add( btnElem );
			}
		}