Exemple #1
0
 public override sealed void Update(float frameTime)
 {
     _clientAreaLeft = new Rectangle(Position, new Size((int)_listboxLeft.Width, (int)_listboxLeft.Height));
     _clientAreaMain = new Rectangle(new Point(_clientAreaLeft.Right, Position.Y),
                                     new Size(_width, (int)_listboxMain.Height));
     _clientAreaRight = new Rectangle(new Point(_clientAreaMain.Right, Position.Y),
                                      new Size((int)_listboxRight.Width, (int)_listboxRight.Height));
     ClientArea = new Rectangle(Position,
                                new Size(_clientAreaLeft.Width + _clientAreaMain.Width + _clientAreaRight.Width,
                                         Math.Max(Math.Max(_clientAreaLeft.Height, _clientAreaRight.Height),
                                                  _clientAreaMain.Height)));
     _selectedLabel.Position = new Point(_clientAreaLeft.Right,
                                         Position.Y + (int)(ClientArea.Height / 2f) -
                                         (int)(_selectedLabel.Height / 2f));
     _dropDown.Position = new Point(ClientArea.X + (int)((ClientArea.Width - _dropDown.ClientArea.Width) / 2f),
                                    ClientArea.Bottom);
     _dropDown.Update(frameTime);
 }
Exemple #2
0
        public override sealed void Update(float frameTime)
        {
            var listboxLeftBounds  = _listboxLeft.GetLocalBounds();
            var listboxMainBounds  = _listboxMain.GetLocalBounds();
            var listboxRightBounds = _listboxRight.GetLocalBounds();

            _clientAreaLeft = new IntRect(Position, new Vector2i((int)listboxLeftBounds.Width, (int)listboxLeftBounds.Height));
            _clientAreaMain = new IntRect(_clientAreaLeft.Right(), Position.Y,
                                          _width, (int)listboxMainBounds.Height);
            _clientAreaRight = new IntRect(new Vector2i(_clientAreaMain.Right(), Position.Y),
                                           new Vector2i((int)listboxRightBounds.Width, (int)listboxRightBounds.Height));
            ClientArea = new IntRect(Position,
                                     new Vector2i(_clientAreaLeft.Width + _clientAreaMain.Width + _clientAreaRight.Width,
                                                  Math.Max(Math.Max(_clientAreaLeft.Height, _clientAreaRight.Height),
                                                           _clientAreaMain.Height)));
            _selectedLabel.Position = new Vector2i(_clientAreaLeft.Right(),
                                                   Position.Y + (int)(ClientArea.Height / 2f) -
                                                   (int)(_selectedLabel.Height / 2f));
            _dropDown.Position = new Vector2i(ClientArea.Left + (int)((ClientArea.Width - _dropDown.ClientArea.Width) / 2f),
                                              ClientArea.Bottom());
            _dropDown.Update(frameTime);
        }