public ColorPickerBox(AControl parent)
            : base(parent)
        {
            HandlesMouseInput = true;

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
        }
Beispiel #2
0
        public DropDownList(AControl parent)
            : base(parent)
        {
            HandlesMouseInput = true;

            m_Font = ServiceRegistry.GetService<IResourceProvider>().GetAsciiFont(1);
        }
Beispiel #3
0
        public Button(AControl owner)
            : base(owner)
        {
            HandlesMouseInput = true;

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
        }
 public ItemGumplingPaperdoll(AControl parent, int x, int y, Item item)
     : base(parent, item)
 {
     m_x = x;
     m_y = y;
     HighlightOnMouseOver = false;
 }
 public ColorPickerBox(AControl parent, Rectangle closedArea, Rectangle openArea, int swatchWidth, int swatchHeight, int[] hues, int index)
     : this(parent)
 {
     m_openArea = openArea;
     m_Index = index;
     buildGumpling(closedArea, swatchWidth, swatchHeight, hues);
 }
        public PaperDollInteractable(AControl parent, int x, int y)
            : base(0, 0)
        {
            Parent = parent;
            Position = new Point(x, y);

            m_World = ServiceRegistry.GetService<WorldModel>();
        }
        public PaperDollInteractable(AControl owner, int x, int y)
            : base(0, 0)
        {
            Owner = owner;
            Position = new Point(x, y);

            m_World = ServiceRegistry.GetService<WorldModel>();
        }
Beispiel #8
0
        public ItemGumpling(AControl owner, Item item)
            : base(owner)
        {
            buildGumpling(item);
            HandlesMouseInput = true;

            m_World = ServiceRegistry.GetService<WorldModel>();
        }
 public ExpandableScroll(AControl owner, int x, int y, int height)
     : base(0, 0)
 {
     Owner = owner;
     Position = new Point(x, y);
     m_expandableScrollHeight = height;
     MakeThisADragger();
 }
Beispiel #10
0
        public DropDownList(AControl owner)
            : base(owner)
        {
            HandlesMouseInput = true;

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_Font = ServiceRegistry.GetService<IUIResourceProvider>().GetAsciiFont(1);
        }
Beispiel #11
0
        public ItemGumpling(AControl parent, Item item)
            : base(parent)
        {
            BuildGumpling(item);
            HandlesMouseInput = true;

            m_World = Service.Get<WorldModel>();
        }
Beispiel #12
0
        public TextEntry(AControl parent)
            : base(parent)
        {
            HandlesMouseInput = true;
            HandlesKeyboardFocus = true;

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
        }
 public PaperDollInteractable(AControl parent, int x, int y, Mobile sourceEntity)
     : base(0, 0)
 {
     Parent = parent;
     Position = new Point(x, y);
     m_isFemale = sourceEntity.Flags.IsFemale;
     SourceEntity = sourceEntity;
     m_World = ServiceRegistry.GetService<WorldModel>();
 }
Beispiel #14
0
        public WorldControl(AControl owner, int x, int y, int width, int height)
            : base(owner)
        {
            Position = new Point(x, y);
            Size = new Point(width, height);

            HandlesMouseInput = true;
            ServiceRegistry.Register<WorldControl>(this);
        }
Beispiel #15
0
 public ScrollBar(AControl owner, int x, int y, int height, int minValue, int maxValue, int value)
     : this(owner)
 {
     Position = new Point(x, y);
     MinValue = minValue;
     MaxValue = maxValue;
     Height = height;
     Value = value;
 }
 public ExpandableScroll(AControl parent, int x, int y, int height, bool isResizable = true)
     : base(0, 0)
 {
     Parent = parent;
     Position = new Point(x, y);
     m_ExpandableScrollHeight = height;
     m_IsResizable = isResizable;
     MakeThisADragger();
 }
Beispiel #17
0
        public WorldViewport(AControl parent, int x, int y, int width, int height)
            : base(parent)
        {
            Position = new Point(x, y);
            Size = new Point(width, height);

            HandlesMouseInput = true;
            ServiceRegistry.Register<WorldViewport>(this);
        }
Beispiel #18
0
 public TextLabel(AControl parent, string[] arguements, string[] lines)
     : this(parent)
 {
     int x, y, hue, textIndex;
     x = Int32.Parse(arguements[1]);
     y = Int32.Parse(arguements[2]);
     hue = Int32.Parse(arguements[3]);
     textIndex = Int32.Parse(arguements[4]);
     buildGumpling(x, y, hue, lines[textIndex]);
 }
Beispiel #19
0
 public ResizePic(AControl parent, AControl createBackgroundAroundThisControl)
     : this(parent)
 {
     buildGumpling(createBackgroundAroundThisControl.X - 4,
         createBackgroundAroundThisControl.Y - 4,
         9350,
         createBackgroundAroundThisControl.Width + 8,
         createBackgroundAroundThisControl.Height + 8);
     Page = createBackgroundAroundThisControl.Page;
 }
Beispiel #20
0
 public GumpPicTiled(AControl owner, string[] arguements)
     : this(owner)
 {
     int x, y, gumpID, width, height;
     x = Int32.Parse(arguements[1]);
     y = Int32.Parse(arguements[2]);
     width = Int32.Parse(arguements[3]);
     height = Int32.Parse(arguements[4]);
     gumpID = Int32.Parse(arguements[5]);
     buildGumpling(x, y, width, height, gumpID);
 }
Beispiel #21
0
        public CheckerTrans(AControl owner, string[] arguements)
            : this(owner)
        {
            int x, y, width, height;
            x = Int32.Parse(arguements[1]);
            y = Int32.Parse(arguements[2]);
            width = Int32.Parse(arguements[3]);
            height = Int32.Parse(arguements[4]);

            buildGumpling(x, y, width, height);
        }
Beispiel #22
0
        public ScrollFlag(AControl parent, int x, int y, int height, int minValue, int maxValue, int value)
            : this(parent)
        {
            Position = new Point(x, y);
            m_SliderExtentTop = y;
            m_SliderExtentHeight = height;

            MinValue = minValue;
            MaxValue = maxValue;
            Value = value;
        }
Beispiel #23
0
 public ResizePic(AControl parent, string[] arguements)
     : this(parent)
 {
     int x, y, gumpID, width, height;
     x = Int32.Parse(arguements[1]);
     y = Int32.Parse(arguements[2]);
     gumpID = Int32.Parse(arguements[3]);
     width = Int32.Parse(arguements[4]);
     height = Int32.Parse(arguements[5]);
     buildGumpling(x, y, gumpID, width, height);
 }
Beispiel #24
0
 public CroppedText(AControl owner, string[] arguements, string[] lines)
     : this(owner)
 {
     int x, y, width, height, hue, textIndex;
     x = Int32.Parse(arguements[1]);
     y = Int32.Parse(arguements[2]);
     width = Int32.Parse(arguements[3]);
     height = Int32.Parse(arguements[4]);
     hue = Int32.Parse(arguements[5]);
     textIndex = Int32.Parse(arguements[6]);
     buildGumpling(x, y, width, height, hue, textIndex, lines);
 }
Beispiel #25
0
 // ============================================================================================================
 // Ctors and BuildGumpling Methods
 // ============================================================================================================
 public TextEntryPage(AControl parent, int x, int y, int width, int height, int pageIndex)
     : base(parent)
 {
     base.HandlesMouseInput = true;
     base.HandlesKeyboardFocus = true;
     IsEditable = true;
     Position = new Point(x, y);
     Size = new Point(width, height);
     PageIndex = pageIndex;
     m_CaratBlinkOn = false;
     m_RenderedText = new RenderedText(string.Empty, Width, true);
     m_RenderedCarat = new RenderedText(string.Empty, 16, true);
 }
        /// <summary>
        /// Creates a RenderedTextList.
        /// Note that the scrollBarControl must be created and added to the parent gump before passing it as a param.
        /// </summary>
        public RenderedTextList(AControl parent, int x, int y, int width, int height, IScrollBar scrollBarControl)
            : base(parent)
        {
            m_ScrollBar = scrollBarControl;
            m_ScrollBar.IsVisible = false;

            HandlesMouseInput = true;

            Position = new Point(x, y);
            Width = width;
            Height = height;
            m_Entries = new List<RenderedText>();
        }
Beispiel #27
0
        public KeyPressControl(AControl parent, int x, int y, int width, int height, int entryID, WinKeys key)
                : base(parent)
        {
            Position = new Point(x, y);
            Size = new Point(width, height);
            Key = key;
            m_RenderedText = new RenderedText(string.Empty, width);
            IsChanged = false;

            HandlesMouseInput = true;
            HandlesKeyboardFocus = true;
            LeadingHtmlTag = "<center><span color='#fff' style='font-family: uni2;'>";
        }
Beispiel #28
0
 public Button(AControl owner, string[] arguements)
     : this(owner)
 {
     int x, y, gumpID1, gumpID2, buttonType, param, buttonID;
     x = Int32.Parse(arguements[1]);
     y = Int32.Parse(arguements[2]);
     gumpID1 = Int32.Parse(arguements[3]);
     gumpID2 = Int32.Parse(arguements[4]);
     buttonType = Int32.Parse(arguements[5]);
     param = Int32.Parse(arguements[6]);
     buttonID = Int32.Parse(arguements[7]);
     buildGumpling(x, y, gumpID1, gumpID2, (ButtonTypes)buttonType, param, buttonID);
 }
Beispiel #29
0
 public StaticPic(AControl parent, string[] arguements)
     : this(parent)
 {
     int x, y, tileID, hue = 0;
     x = Int32.Parse(arguements[1]);
     y = Int32.Parse(arguements[2]);
     tileID = Int32.Parse(arguements[3]);
     if (arguements.Length > 4)
     {
         // has a HUE="XXX" arguement!
         hue = Int32.Parse(arguements[4]);
     }
     buildGumpling(x, y, tileID, hue);
 }
Beispiel #30
0
 public GumpPic(AControl owner, string[] arguements)
     : this(owner)
 {
     int x, y, gumpID, hue = 0;
     x = Int32.Parse(arguements[1]);
     y = Int32.Parse(arguements[2]);
     gumpID = Int32.Parse(arguements[3]);
     if (arguements.Length > 4)
     {
         // has a HUE="XXX" arguement!
         hue = Int32.Parse(arguements[4]);
     }
     buildGumpling(x, y, gumpID, hue);
 }
Beispiel #31
0
 // ============================================================================================================
 // Ctor, Init, Dispose, Update, and Draw
 // ============================================================================================================
 protected AControl(AControl parent)
 {
     Parent        = parent;
     Page          = 0;
     UserInterface = Service.Get <UserInterfaceService>();
 }
Beispiel #32
0
 // ============================================================================================================
 // Child control methods
 // ============================================================================================================
 public T AddControl <T>(AControl c, int page = 0) where T : AControl
 {
     c.Page = page;
     Children.Add(c);
     return(LastControl as T);
 }
Beispiel #33
0
        private void InternalHandleMouseInput()
        {
            // clip the mouse position
            Point clippedPosition = m_Input.MousePosition;

            ClipMouse(ref clippedPosition);

            // Get the topmost control that is under the mouse and handles mouse input.
            // If this control is different from the previously focused control,
            // send that previous control a MouseOut event.
            AControl focusedControl = InternalGetMouseOverControl(clippedPosition);

            if ((MouseOverControl != null) && (focusedControl != MouseOverControl))
            {
                MouseOverControl.MouseOut(clippedPosition);
                // Also let the parent control know we've been moused out (for gumps).
                if (MouseOverControl.RootParent != null)
                {
                    if (focusedControl == null || MouseOverControl.RootParent != focusedControl.RootParent)
                    {
                        MouseOverControl.RootParent.MouseOut(clippedPosition);
                    }
                }
            }

            if (focusedControl != null)
            {
                focusedControl.MouseOver(clippedPosition);
                if (m_MouseDownControl[0] == focusedControl)
                {
                    AttemptDragControl(focusedControl, clippedPosition);
                }
                if (IsDraggingControl)
                {
                    DoDragControl(clippedPosition);
                }
            }

            // Set the new MouseOverControl.
            m_MouseOverControl = focusedControl;

            // Send a MouseOver event to any control that was previously the target of a MouseDown event.
            for (int iButton = 0; iButton < 5; iButton++)
            {
                if ((m_MouseDownControl[iButton] != null) && (m_MouseDownControl[iButton] != focusedControl))
                {
                    m_MouseDownControl[iButton].MouseOver(clippedPosition);
                }
            }

            // The cursor and world input objects occasionally must block input events from reaching the UI:
            // e.g. when the cursor is carrying an object.
            if (!IsModalControlOpen && ObjectsBlockingInput)
            {
                return;
            }

            List <InputEventMouse> events = m_Input.GetMouseEvents();

            foreach (InputEventMouse e in events)
            {
                // MouseDown event: the currently focused control gets a MouseDown event, and if
                // it handles Keyboard input, gets Keyboard focus as well.
                if (e.EventType == MouseEvent.Down)
                {
                    if (focusedControl != null)
                    {
                        MakeTopMostGump(focusedControl);
                        focusedControl.MouseDown(clippedPosition, e.Button);
                        if (focusedControl.HandlesKeyboardFocus)
                        {
                            m_keyboardFocusControl = focusedControl;
                        }
                        m_MouseDownControl[(int)e.Button] = focusedControl;
                    }
                }

                // MouseUp and MouseClick events
                if (e.EventType == MouseEvent.Up)
                {
                    int btn = (int)e.Button;

                    // If there is a currently focused control:
                    // 1.   If the currently focused control is the same control that was MouseDowned on with this button,
                    //      then send that control a MouseClick event.
                    // 2.   Send the currently focused control a MouseUp event.
                    // 3.   If the currently focused control is NOT the same control that was MouseDowned on with this button,
                    //      send that MouseDowned control a MouseUp event (but it does not receive MouseClick).
                    // If there is NOT a currently focused control, then simply inform the control that was MouseDowned on
                    // with this button that the button has been released, by sending it a MouseUp event.

                    EndDragControl(e.Position);

                    if (focusedControl != null)
                    {
                        if (m_MouseDownControl[btn] != null && focusedControl == m_MouseDownControl[btn])
                        {
                            focusedControl.MouseClick(clippedPosition, e.Button);
                        }
                        focusedControl.MouseUp(clippedPosition, e.Button);
                        if (m_MouseDownControl[btn] != null && focusedControl != m_MouseDownControl[btn])
                        {
                            m_MouseDownControl[btn].MouseUp(clippedPosition, e.Button);
                        }
                    }
                    else
                    {
                        if (m_MouseDownControl[btn] != null)
                        {
                            m_MouseDownControl[btn].MouseUp(clippedPosition, e.Button);
                        }
                    }

                    m_MouseDownControl[btn] = null;
                }
            }
        }
Beispiel #34
0
 // ================================================================================
 // Ctor, Init, Dispose, Update, and Draw
 // ================================================================================
 public AControl(AControl parent)
 {
     Parent        = parent;
     Page          = 0;
     UserInterface = ServiceRegistry.GetService <UserInterfaceService>();
 }
Beispiel #35
0
 // ================================================================================
 // Child control methods
 // ================================================================================
 public AControl AddControl(AControl c, int page = 0)
 {
     c.Page = page;
     Children.Add(c);
     return(LastControl);
 }