Beispiel #1
0
 public CharacterListFrame(IFrame parent)
 {
     this.frame = (IFrame)Global.FrameProvider.CreateFrame(FrameType.Frame, parent.GetName() + "CharacterList", parent);
     this.frame.SetPoint(FramePoint.TOPRIGHT, parent, FramePoint.TOPLEFT, 0, YOffset);
     this.frame.SetWidth(CharacterListButtonHandler.Width);
     this.buttons = new List <CharacterListButtonHandler>();
     SetBackdrop(this.frame, "");
 }
Beispiel #2
0
        public ActionButtonProxy(IFrame parent, IWrapper wrapper)
        {
            if (actionButtonProxyMethods == null)
            {
                actionButtonProxyMethods = wrapper.Wrap <IActionButtonProxyMethods>("_G");
            }

            this.wrapper = wrapper;
            this.button  = Global.FrameProvider.CreateFrame(FrameType.CheckButton, parent.GetName() + "ActionButton" + buttonIndex, parent, "ActionButtonTemplate") as ICheckButton;
            this.button.RegisterForClicks(ClickType.LeftButtonUp, ClickType.RightButtonUp);
            buttonIndex++;
            this.SetupHandlersForTooltips();
            this.IdentifyFrameElements();
        }
Beispiel #3
0
        private object GetValueFromObject(IFrame obj)
        {
            var name = Regex.Replace(obj.GetName(), @"\d+$", string.Empty);

            switch (name)
            {
            case "Editbox":
                return((obj as IEditBox).GetText());

            case "EditField":
                return((obj as IEditFieldFrame).Text.GetText());

            default:
                throw new UiSimuationException(string.Format("Could not get value from object type '{0}'.", name));
            }
        }
Beispiel #4
0
        private void SetValueOnObject(IFrame obj, object value)
        {
            var name = Regex.Replace(obj.GetName(), @"\d+$", string.Empty);

            switch (name)
            {
            case "Editbox":
                (obj as IEditBox).SetText(value as string);
                break;

            case "EditField":
                (obj as IEditFieldFrame).Text.SetText(value as string);
                break;

            default:
                throw new UiSimuationException(string.Format("Could not set value on object type '{0}'.", name));
            }
        }
        public CharacterListToggleObject(IFrame parent, IFrame anchor, Action toggle)
        {
            var frame = (IFrame)Global.FrameProvider.CreateFrame(FrameType.Frame, parent.GetName() + "CharacterListToggleFrame", parent);

            frame.SetAllPoints(anchor);

            this.button = (IButton)Global.FrameProvider.CreateFrame(FrameType.Button, frame.GetName() + "Button", frame);
            this.button.SetHeight(Height);
            this.button.SetWidth(Height);
            this.button.SetNormalTexture(UntoggledTexture);
            this.button.SetPushedTexture(ToggledTexture);
            this.button.SetPoint(FramePoint.LEFT);
            this.button.SetScript(ButtonHandler.OnClick, this.Toggle);

            this.tooltipHandler = new TooltipHandler(this.button);
            this.tooltipHandler.SetTooltip(UntoggledTooltip);

            this.labelFrame = (ITextLabelWithTooltip)Global.FrameProvider.CreateFrame(FrameType.Frame, parent.GetName() + "Text", frame, "GH_TextLabel_Template");
            this.labelFrame.SetPoint(FramePoint.LEFT, Height + 2, 0);
            this.labelFrame.Label.SetText("My Characters");
            this.labelFrame.Tooltip = UntoggledTooltip;
        }
Beispiel #6
0
 public CharacterListButtonHandler(IFrame parent, ProfileFormatter formatter)
 {
     this.Button = (ICharacterListButton)Global.FrameProvider.CreateFrame(FrameType.CheckButton, parent.GetName() + "Button" + ButtonCount, parent, Template);
     ButtonCount++;
     this.Button.SetScript(ButtonHandler.OnClick, this.OnClick);
     this.Button.SetWidth(Width);
     this.Button.SetHeight(Height);
     this.formatter = formatter;
 }