示例#1
0
        public ComboBox(Point Position, int length, SpriteFont SpriteFont, ComboBoxTexture comboBoxTexture, int ShowAmount = -1)
        {
            Lock                 = false;
            InfoText             = "";
            this.comboBoxTexture = comboBoxTexture;
            int height = Convert.ToInt32((int)SpriteFont.MeasureString("Tj").Y);

            spriteFont = SpriteFont;
            showAmount = ShowAmount;
            offset     = 0;

            Bounds = new Rectangle(Position.X, Position.Y, length - scrollWheelWidth, height);

            if (showAmount != -1)
            {
                _scroller = new Scroller(new Rectangle(Bounds.Right, Bounds.Y, scrollWheelWidth, (ShowAmount + 1) * height), true);
                _scroller.ValueChanged += ScrolleValueChanged;
            }



            _dropDownButton = new Button(new Rectangle(Bounds.Right, Bounds.Y, scrollWheelWidth, height), "v", spriteFont, false);
            _dropDownButton.LeftClickedUp += OnDropDown;

            items       = new List <string>();
            itemsBounds = new List <Rectangle>();
        }
示例#2
0
 public ListBox(Point Position, int Length, int Height, SpriteFont SpriteFont, ComboBoxTexture comboBoxTexture)
     : base(Position, Length, SpriteFont, comboBoxTexture, Height - 1)
 {
     initialize(Position, Length, Height, spriteFont);
 }