Just playing around with yoga and unity to see if we could build a ui with it

This commit is contained in:
lukeIam committed 2018-08-27 20:04:20 +02:00
1 parent 15d5b17fd2
commit 6ad1cd7aa8
60 files changed
+3930 -3

No files matched your search

@@ -0,0 +1,40 @@
using System;
using Vocaluxe.UI.AbstractElements;
using Vocaluxe.UI.BasicElements.Text;
namespace Vocaluxe.UI.BasicElements.Button
{
public class CControllerElementButton: CController
{
private CControllerElementText _DescriptionController;
public override void RegisterChild(CController child, string id)
{
Enum.TryParse(id, out EElementButtonComponents parsedId);
switch (parsedId)
{
case EElementButtonComponents.TxtDescription:
_DescriptionController = child as CControllerElementText ?? throw new ArgumentException("TxtDescription must be a text element");
break;
case EElementButtonComponents.Unknown:
break;
default:
throw new ArgumentOutOfRangeException();
}
}
public event EventHandler Clicked;
public void RaiseClicked()
{
Clicked?.Invoke(this, null);
}
public string Description
{
get => _DescriptionController.Text;
set => _DescriptionController.Text = value;
}
}
}