Esempio n. 1
0
        public ucWriteBlock()
        {
            Orientation = Orientation.Horizontal;

            Button btnWrite = new Button(Program.FontRegular, "Записать", null, Program.ButtonTextColor);
            btnWrite.SetMargin(2);
            btnWrite.VerticalAlignment = VerticalAlignment.Center;
            btnWrite.Background = Program.ButtonBackground;
            btnWrite.Clicked += new EventHandler(btnWrite_Clicked);
            Children.Add(btnWrite);

            cbTrackType = new UpDownComboBox(Program.FontRegular, 130);
            cbTrackType.ButtonDown.Background = cbTrackType.ButtonUp.Background = Program.ButtonBackground;
            cbTrackType.VerticalAlignment = VerticalAlignment.Center;
            cbTrackType.Items.Add("На главном");
            cbTrackType.Items.Add("На программном");
            cbTrackType.SelectedIdx = 1;
            Children.Add(cbTrackType);
        }
        private Tab CreateTabCommon()
        {
            Tab tab = new Tab(Program.FontRegular, "tabCommon", "Общие", null);
            tab.Background = Program.ButtonBackground;
            tab.ForeColor = Program.LabelTextColor;
            tab.IsSelected = true;

            StackPanel panel = new StackPanel(Orientation.Vertical);
            panel.SetMargin(3);

            //BackgroundStackPanel panel = new BackgroundStackPanel(Orientation.Vertical);
            //panel.Background = Program.PanelBackground;
            //panel.Opacity = Program.PanelOpacity;
            //panel.Height = 150;
            //panel.SetMargin(3);

            tab.Content = panel;

            Text txt;
            StackPanel p;

            txt = new Text(Program.FontRegular, "Имя:");
            txt.ForeColor = Program.LabelTextColor;

            p = new StackPanel(Orientation.Horizontal);

            txtName = new Text(Program.FontRegular, "");
            txtName.ForeColor = Program.LabelTextColor;
            txtName.VerticalAlignment = VerticalAlignment.Center;
            p.Children.Add(txtName);

            Button btnKeyboard = new Button(Program.FontRegular, " ... ", null, Program.ButtonTextColor);
            btnKeyboard.SetMargin(2, 0, 0, 0);
            btnKeyboard.VerticalAlignment = VerticalAlignment.Center;
            btnKeyboard.Background = Program.ButtonBackground;
            //btnKeyboard.Clicked += new EventHandler(btnSave_Clicked);
            p.Children.Add(btnKeyboard);

            panel.Children.Add(new ParameterValue(txt, p));

            txt = new Text(Program.FontRegular, "Протокол:");
            txt.ForeColor = Program.LabelTextColor;
            cbProtocol = new UpDownComboBox(Program.FontRegular, 120);
            cbProtocol.ButtonDown.Background = cbProtocol.ButtonUp.Background = Program.ButtonBackground;
            cbProtocol.Items.Add("DCC 14");
            cbProtocol.Items.Add("DCC 28");
            cbProtocol.Items.Add("DCC 128");
            cbProtocol.Items.Add("Selectrix");
            cbProtocol.Items.Add("Motorola 14");
            cbProtocol.Items.Add("Motorola 27");
            cbProtocol.Items.Add("Motorola 28");
            cbProtocol.Items.Add("Motorola Fx 14");
            panel.Children.Add(new ParameterValue(txt, cbProtocol));

            txt = new Text(Program.FontRegular, "Адрес:");
            txt.ForeColor = Program.LabelTextColor;
            UpDownComboBox cbProgCurrentThreshold = new UpDownComboBox(Program.FontRegular, 90);
            cbProgCurrentThreshold.ButtonDown.Background = cbProgCurrentThreshold.ButtonUp.Background = Program.ButtonBackground;
            cbProgCurrentThreshold.Items.Add(3);
            panel.Children.Add(new ParameterValue(txt, cbProgCurrentThreshold));

            //txt = new Text(Program.FontRegular, "Выкл. при коротком замыкании во внешн. бустерах:");
            //txt.ForeColor = Program.TextColor;
            //txt.TextWrap = true;
            //chbShutdownOnExternalShortCircuit = new Checkbox(Program.FontRegular);
            //panel.Children.Add(new ParameterValue(txt, chbShutdownOnExternalShortCircuit));

            //txt = new Text(Program.FontRegular, "Калибровка экрана:");
            //txt.ForeColor = Program.TextColor;
            //Button btnCalibrate = new Button(Program.FontRegular, "Калибровать", Resources.GetBitmap(Resources.BitmapResources.Calibrate), Colors.White);
            //btnCalibrate.ImageSize = 16;
            //btnCalibrate.Width = 90;
            //btnCalibrate.BackgroundImage = Program.ButtonBackground;
            //btnCalibrate.Clicked += new EventHandler(btnCalibrate_Clicked);
            //panel.Children.Add(new ParameterValue(txt, btnCalibrate));

            return tab;
        }