Example #1
0
        public TopView()
        {
            InitializeComponent();

            SuspendLayout();
            _topViewPanel        = new TopViewPanel();
            _topViewPanel.Width  = 100;
            _topViewPanel.Height = 100;

            center.AutoScroll = true;
            center.Controls.Add(_topViewPanel);

            center.Resize += (sender, e) => _topViewPanel.ParentSize(center.Width, center.Height);

            _visibleHash = new Dictionary <ToolStripMenuItem, int>();

            var visItems = VisibleToolStripButton.DropDown.Items;
            var ground   = new ToolStripMenuItem("Ground");

            visItems.Add(ground);
            _topViewPanel.Ground = ground;
            _visibleHash[_topViewPanel.Ground] = 0;
            _topViewPanel.Ground.ShortcutKeys  = Keys.F1;

            var west = new ToolStripMenuItem("West");

            visItems.Add(west);
            _topViewPanel.West = west;
            _visibleHash[_topViewPanel.West] = 1;
            _topViewPanel.West.ShortcutKeys  = Keys.F2;

            var north = new ToolStripMenuItem("North");

            visItems.Add(north);
            _topViewPanel.North = north;
            _visibleHash[_topViewPanel.North] = 2;
            _topViewPanel.West.ShortcutKeys   = Keys.F3;

            var content = new ToolStripMenuItem("Content");

            visItems.Add(content);
            _topViewPanel.Content = content;
            _visibleHash[_topViewPanel.Content] = 3;
            _topViewPanel.Content.ShortcutKeys  = Keys.F4;

            foreach (ToolStripItem visItem in visItems)
            {
                visItem.Click += VisibleClick;
            }

            _topViewPanel.BottomPanel = bottom;

            MoreObservers.Add("BottomPanel", bottom);
            MoreObservers.Add("TopViewPanel", _topViewPanel);

            ResumeLayout();
        }