Ejemplo n.º 1
0
        public UtilityBar()
        {
            InitializeComponent();
            this.Width  = Screen.GetBounds(this).Width;
            this.Height = 30;
            mb          = new UBMesageBox();
            ubItems     = new IUtilityBarItem[] {
                new UBHeadingSpeed(),
                new UBAltitude(),
                new UBcrs(),
                new UBAPAlt(),
                new UBAPSpd(),
                new UBNav1(),
                new UBNav1Status(),
                new UBAPcrs(),
                new UBNav2(),
                new UBADF(),
                new UBThrottle(),
                new UBTimer(),
                new UBNotes(),
                mb
            };

            int currX = 0;

            for (int i = 0; i < ubItems.Length; i++)
            {
                UserControl uc = (UserControl)ubItems[i];
                uc.Location = new System.Drawing.Point(currX + 1, 0);
                uc.Height   = 30;
                uc.TabIndex = i;
                //Aggiungo il controllo
                this.Controls.Add(uc);
                //ricalcolo l'avanzamento
                currX += uc.Width;
            }
            UpdateView(lastStatus);
        }
Ejemplo n.º 2
0
        public UtilityBar()
        {
            InitializeComponent();
            this.Width = Screen.GetBounds(this).Width;
            this.Height = 30;
            mb = new UBMesageBox();
            ubItems = new IUtilityBarItem[]{
                new UBHeadingSpeed(),
                new UBAltitude(),
                new UBcrs(),
                new UBAPAlt(),
                new UBAPSpd(),
                new UBNav1(),
                new UBNav1Status(),
                new UBAPcrs(),
                new UBNav2(),
                new UBADF(),
                new UBThrottle(),
                new UBTimer(),
                new UBNotes(),
                mb
            };

            int currX = 0;
            for (int i = 0; i < ubItems.Length; i++)
            {
                UserControl uc = (UserControl)ubItems[i];
                uc.Location = new System.Drawing.Point(currX + 1, 0);
                uc.Height = 30;
                uc.TabIndex = i;
                //Aggiungo il controllo
                this.Controls.Add(uc);
                //ricalcolo l'avanzamento
                currX += uc.Width;
            }
            UpdateView(lastStatus);
        }