Ejemplo n.º 1
0
		private DynamicDropDownMenu CreateDropDown(Direction direction)
		{
			DynamicDropDownMenu menu = new DynamicDropDownMenu("", direction);
			menu.VAnchor = VAnchor.ParentCenter;
			menu.MenuAsWideAsItems = false;
			menu.AlignToRightEdge = true;
			menu.Height = defaultButton.Height;

			return menu;
		}
Ejemplo n.º 2
0
		public SplitButton(Button button, DynamicDropDownMenu menu)
			: base(FlowDirection.LeftToRight, HAnchor.FitToChildren, VAnchor.FitToChildren)
		{
			defaultButton = button;
			altChoices = menu;

			defaultButton.VAnchor = VAnchor.ParentCenter;

			AddChild(defaultButton);
			AddChild(altChoices);
		}
Ejemplo n.º 3
0
		public SplitButton(string buttonText, Direction direction = Direction.Down)
			: base(FlowDirection.LeftToRight, HAnchor.FitToChildren, VAnchor.FitToChildren)
		{
			defaultButton = CreateDefaultButton(buttonText);
			altChoices = CreateDropDown(direction);

			defaultButton.VAnchor = VAnchor.ParentCenter;

			AddChild(defaultButton);
			AddChild(altChoices);
		}
Ejemplo n.º 4
0
		public DynamicDropDownMenu Generate(string label = "", TupleList<string, Func<bool>> optionList = null, Direction direction = Direction.Down)
		{
			DynamicDropDownMenu menu = new DynamicDropDownMenu(label, CreateButtonViewStates(label), direction);
			menu.VAnchor = VAnchor.ParentCenter;
			menu.HAnchor = HAnchor.FitToChildren;
			menu.MenuAsWideAsItems = false;
			menu.AlignToRightEdge = true;
			menu.NormalColor = normalFillColor;
			menu.HoverColor = hoverFillColor;
			menu.BorderColor = normalBorderColor;
			menu.BackgroundColor = menu.NormalColor;

			if (optionList != null)
			{
				foreach (Tuple<string, Func<bool>> option in optionList)
				{
					menu.addItem(option.Item1, option.Item2);
				}
			}

			return menu;
		}