Example #1
0
 public ButtonWidget(ContainerWidget parentNode, RectangleF positionAndSize)
     : base(parentNode, positionAndSize)
 {
     this.Disabled          = false;
     this.HighLighted       = false;
     this.LuaCommand        = "";
     this.ShortCutString    = new S5String("", "New Button");
     this.ButtonNormal      = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155));
     this.ButtonHover       = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155));
     this.ButtonPressed     = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155));
     this.ButtonDisabled    = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155));
     this.ButtonHighlighted = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155));
     this.ToolTipHelper     = new Tooltip(false, new S5String("", "New Button"), "", false, "");
     this.Update            = new WidgetUpdate("", true);
 }
Example #2
0
        public ButtonWidget(XElement e, ContainerWidget parentNode)
            : base(e, parentNode)
        {
            XElement buttonHelper = e.Element("ButtonHelper");

            this.Disabled       = bool.Parse(buttonHelper.Element("DisabledFlag").Value);
            this.HighLighted    = bool.Parse(buttonHelper.Element("HighLightedFlag").Value);
            this.LuaCommand     = buttonHelper.Element("ActionFunction").Element("LuaCommand").Value;
            this.ShortCutString = new S5String(buttonHelper.Element("ShortCutString"));
            IEnumerable <XElement> buttons = e.Elements("Materials");

            this.ButtonNormal      = new Texture(buttons.ElementAt(0));
            this.ButtonHover       = new Texture(buttons.ElementAt(1));
            this.ButtonPressed     = new Texture(buttons.ElementAt(2));
            this.ButtonDisabled    = new Texture(buttons.ElementAt(3));
            this.ButtonHighlighted = new Texture(buttons.ElementAt(4));
            this.ToolTipHelper     = new Tooltip(e.Element("ToolTipHelper"));
            this.Update            = new WidgetUpdate(e);
        }