Esempio n. 1
0
        public UIBaseEl(int Height)
        {
            labl_ID = new Label();
            labl_ID.VerticalAlignment = VerticalAlignment.Center;
            labl_ID.Uid = "lblID";

            DPContextMenu = new ContextMenu();
            MenuItem mi = new MenuItem();

            mi.Header = "Удалить";
            mi.Click += RaiseDelClick;

            DPContextMenu.Items.Add(mi);

            Container = new DockPanel();
            ((DockPanel)Container).LastChildFill = false;
            Container.Height = Height;

            Container.ContextMenu = DPContextMenu;
            Container.AllowDrop   = true;

            Container.Children.Add(labl_ID);

            Container.Children.Add(
                UIGenerateHelping.NewGridSplitter(10, Container.Background));

            Container.MouseLeftButtonDown += container_MouseDown;
            Container.Drop += (s, e) => RaiseDrop(this, e.Data.GetData(typeof(AbstrUIBase)));
        }
Esempio n. 2
0
        public UIPageTime(AbstrPageEl pEl)
            : base(47)
        {
            PageTime pt = (PageTime)pEl;

            SetID(pt.ID);

            // Интерфейс для настройки позиции
            Label   lbl_pos = new Label();
            TextBox tbX     = new TextBox();
            TextBox tbY     = new TextBox();

            lbl_pos.Content           = "Позиция";
            lbl_pos.VerticalAlignment = VerticalAlignment.Center;

            tbX.Text = pt.X.ToString();
            tbY.Text = pt.Y.ToString();

            tbX.MaxLength = 3;
            tbY.MaxLength = 3;

            tbX.Width = 25;
            tbY.Width = 25;

            tbX.Height = 23;
            tbY.Height = 23;

            tbX.TextAlignment = TextAlignment.Center;
            tbY.TextAlignment = TextAlignment.Center;

            //

            // Цвет

            UIAcolorBox clrBox = new UIAcolorBox(
                pt.TextColor.GetColor());
            //

            // Размер
            Label   lbl_size = new Label();
            TextBox tbS      = new TextBox();

            lbl_size.Content           = "Размер";
            lbl_size.VerticalAlignment = VerticalAlignment.Center;

            tbS.Text = pt.Size.ToString();

            tbS.Width  = 25;
            tbS.Height = 23;
            //

            // Флаги
            StackPanel spFlasgs = new StackPanel();

            CheckBox cbSecond = new CheckBox();
            CheckBox cbMinut  = new CheckBox();
            CheckBox cbHour   = new CheckBox();

            cbSecond.IsChecked = pt.Second;
            cbMinut.IsChecked  = pt.Minute;
            cbHour.IsChecked   = pt.Hour;

            cbSecond.Content = "сек";
            cbMinut.Content  = "мин";
            cbHour.Content   = "час";

            spFlasgs.Children.Add(cbSecond);
            spFlasgs.Children.Add(cbMinut);
            spFlasgs.Children.Add(cbHour);
            //

            //

            labl_ID.Content = ID.ToString();
            //

            Container.Children.Add(lbl_pos);
            Container.Children.Add(tbX);
            Container.Children.Add(
                UIGenerateHelping.NewGridSplitter(10, Container.Background));
            Container.Children.Add(tbY);

            Container.Children.Add(
                UIGenerateHelping.NewGridSplitter(10, Container.Background));

            Container.Children.Add(clrBox);

            Container.Children.Add(
                UIGenerateHelping.NewGridSplitter(10, Container.Background));

            Container.Children.Add(lbl_size);
            Container.Children.Add(tbS);

            Container.Children.Add(
                UIGenerateHelping.NewGridSplitter(10, Container.Background));

            Container.Children.Add(spFlasgs);

            clrBox.Uid   = "clrBox";
            tbX.Uid      = "tbX";
            tbY.Uid      = "tbY";
            tbS.Uid      = "tbS";
            spFlasgs.Uid = "spF";
            cbSecond.Uid = "cbS";
            cbMinut.Uid  = "cbM";
            cbHour.Uid   = "cbH";
        }
Esempio n. 3
0
        public UIPageString(AbstrPageEl pEl)
            : base(60)
        {
            PageString ps = (PageString)pEl;

            // Интерфейс для настройки позиции
            Label   lbl_pos = new Label();
            TextBox tbX     = new TextBox();
            TextBox tbY     = new TextBox();

            lbl_pos.Content = "Позиция";
            tbX.Text        = ps.X.ToString();
            tbY.Text        = ps.Y.ToString();

            tbX.MaxLength = 3;
            tbY.MaxLength = 3;

            tbX.Width = 25;
            tbY.Width = 25;

            tbX.Height = 23;
            tbY.Height = 23;

            tbX.TextAlignment = TextAlignment.Center;
            tbY.TextAlignment = TextAlignment.Center;

            //

            // Цвет
            UIAcolorBox clrBox = new UIAcolorBox(
                ps.TextColor.GetColor());

            // Размер
            Label   lbl_size = new Label();
            TextBox tbS      = new TextBox();

            lbl_size.Content = "Размер";
            tbS.Text         = ps.Size.ToString();

            tbS.Width  = 25;
            tbS.Height = 23;
            //

            // Текст
            TextBox tbT = new TextBox();

            tbT.Height = 23;
            tbT.Text   = ps.Data;

            DockPanel.SetDock(tbT, Dock.Bottom);
            //

            Container.Children.Add(tbT);

            Container.Children.Add(lbl_pos);
            Container.Children.Add(tbX);
            Container.Children.Add(
                UIGenerateHelping.NewGridSplitter(10, Container.Background));
            Container.Children.Add(tbY);

            Container.Children.Add(
                UIGenerateHelping.NewGridSplitter(10, Container.Background));

            Container.Children.Add(clrBox);

            Container.Children.Add(
                UIGenerateHelping.NewGridSplitter(10, Container.Background));

            Container.Children.Add(lbl_size);
            Container.Children.Add(tbS);


            clrBox.Uid = "clrBox";
            tbX.Uid    = "tbX";
            tbY.Uid    = "tbY";
            tbS.Uid    = "tbS";
            tbT.Uid    = "tbT";
        }