Ejemplo n.º 1
0
        private void InitializeComponent()
        {
            _container = new VerticalBox();
            this.Child = _container;

            _hBox = new HorizontalBox();
            _container.Children.Add(_hBox);

            _which = new ComboBox();
            DrawTests.PopulateComboboxWithTests(_which);
            _which.SelectedIndex = 0;
            _which.Selected     += (sender, args) =>
            {
                _area.QueueReDrawAll();
            };
            _hBox.Children.Add(_which);

            _area = new Area(new AreaHandler(this));
            _container.Children.Add(_area, true);

            _hBox = new HorizontalBox();
            _container.Children.Add(_hBox);

            _swallowKeys = new CheckBox("Consider key events handled");
            _hBox.Children.Add(_swallowKeys, true);

            _button        = new Button("Enable");
            _button.Click += (sender, args) =>
            {
                EnableArea(true);
            };
            _hBox.Children.Add(_button);

            _button        = new Button("Disable");
            _button.Click += (sender, args) =>
            {
                EnableArea(false);
            };
            _hBox.Children.Add(_button);
        }
Ejemplo n.º 2
0
            public void Draw(AreaBase area, ref AreaDrawParams param)
            {
                var index = _owner._which.SelectedIndex;

                DrawTests.RunDrawTest(index, ref param);
            }