Exemplo n.º 1
0
        public ContextMenuItem(ContextMenuItemEntry entry)
        {
            _entry = entry;

            _label = new Label(entry.Text, true, 1150, 0, style: FontStyle.BlackBorder)
            {
                X = 10,
            };
            Add(_label);

            if (entry.CanBeSelected)
            {
                _selectedPic = new GumpPic(0, 0, 0x838, 0);
                _selectedPic.Initialize();
                _selectedPic.IsVisible = entry.IsSelected;
                Add(_selectedPic);
            }

            Height = 25;


            _label.Y = (Height >> 1) - (_label.Height >> 1);

            if (_selectedPic != null)
            {
                _label.X       = _selectedPic.X + _selectedPic.Width + 5;
                _selectedPic.Y = (Height >> 1) - (_selectedPic.Height >> 1);
            }
            Width = _label.X + _label.Width + 3;

            WantUpdateSize = false;
        }