Example #1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            ControlSelection sel = ControlSelection.Instance;


            FormRichTextBox dialog = new FormRichTextBox(sel.CD.EControl.BackColor);

            //ControlSelection sel = ControlSelection.Instance;
            System.Drawing.Rectangle r = sel.C.RectangleToScreen(sel.C.DisplayRectangle);

            dialog.SetBounds(r.Left - 1, r.Top - 1, r.Width + 26, r.Height + 2);//sel.C.Location;

            dialog.text = (string)value;

            string rtf;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                rtf = dialog.text;
            }
            else
            {
                rtf = (string)value;
            }

            dialog.Dispose();
            return(rtf);
            //}
            //dialog.Dispose();
            //return value;
        }
Example #2
0
        public ControlTextBox(ControlSelection selectcontrol, bool onbase = true)
        {
            IsDragMode = false;
            OnBase     = onbase;
            dYready    = false;
            dXready    = true;

            selectControl = selectcontrol;
            if (!onbase)
            {
                this.SetStyle(ControlStyles.Selectable, false); // Отключение возможностит фокуса
                this.SetStyle(ControlStyles.UserMouse, true);   // Отключить выделение текста по двойному щелчку
                this.SetStyle(ControlStyles.StandardClick, false);
                this.SetStyle(ControlStyles.StandardDoubleClick, false);
                this.ContextMenuStrip = new ContextMenuStrip(); // Отключение контекстного меню

                TabStop = false;
                Cursor  = Cursors.Arrow;

                HideCaret();
            }
            Name = "Ввод текста";
            Text = "Ввод текста";

            this.Location = new Point(0, 0);
        }
Example #3
0
        ContextMenuStrip ContextMenu; //Контекстное меню для контролов


        public ControlSelection(Panel panel, PropertyGrid propGE,
                                PropertyGrid propGQ,
                                PropertyGrid propGT,
                                ListBox listboxtest, TextBox tb, ContextMenuStrip contextMenu)
        {
            ContextMenu          = contextMenu;
            textbox              = tb;
            PanelEdit            = panel;     // Установить обработчик события
            PropertyGridElement  = propGE;
            PropertyGridQuestion = propGQ;
            PropertyGridTest     = propGT;
            ListBoxTest          = listboxtest;
            for (int i = 0; i < 8; i++)
            {
                panels[i] = null;
            }

            instance = this;
        }
Example #4
0
        public ControlRichTextBox(ControlSelection selectcontrol)
        {
            IsDragMode = false;
            dYready    = true;
            dXready    = true;

            selectControl = selectcontrol;
            this.SetStyle(ControlStyles.Selectable, false); // Отключение возможностит фокуса
            this.SetStyle(ControlStyles.UserMouse, true);   // Отключить выделение текста по двойному щелчку
            this.ContextMenuStrip = new ContextMenuStrip(); // Отключение контекстного меню
            TabStop = false;
            Cursor  = Cursors.Arrow;

            HideCaret();

            Name          = "Текст";
            Text          = "Текст";
            this.Location = new Point(0, 0);
        }
Example #5
0
        public ControlPictureBox(ControlSelection scontrol, bool onbase = true)              // Отключение возможностит фокуса
        {
            IsDragMode = false;
            OnBase     = onbase;
            dYready    = true;
            dXready    = true;

            selectControl = scontrol;
            this.SetStyle(ControlStyles.Selectable, false);
            //this.SetStyle(ControlStyles.UserMouse, true);
            //this.SetStyle(ControlStyles.StandardClick, false);

            this.BorderStyle = BorderStyle.FixedSingle;

            TabStop = false;

            Name          = "Рисунок";
            Text          = "Рисунок";
            this.Location = new Point(0, 0);
        }
Example #6
0
        public ControlCheckBox(ControlSelection selectcontrol, bool onbase = true)              // Отключение возможностит фокуса
        {
            IsDragMode = false;
            OnBase     = onbase;
            dYready    = true;
            dXready    = true;

            selectControl = selectcontrol;
            if (!onbase)
            {
                this.SetStyle(ControlStyles.Selectable, false);

                TabStop = false;
            }
            Name = "Флаговая кнопка";
            Text = "Флаговая кнопка";

            this.AutoSize = true;
            this.Location = new Point(0, 0);
        }
Example #7
0
        public ControlButton(ControlSelection scontrol, bool onbase = true)              // Отключение возможностит фокуса
        {
            IsDragMode = false;
            OnBase     = onbase;
            dYready    = true;
            dXready    = true;

            selectControl = scontrol;

            if (!onbase)
            {
                this.SetStyle(ControlStyles.Selectable, false);
                this.SetStyle(ControlStyles.UserMouse, true);
                this.SetStyle(ControlStyles.StandardClick, false);

                TabStop = false;
            }
            Name          = "Кнопка";
            Text          = "Кнопка";
            this.Location = new Point(0, 0);
        }
Example #8
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            Selection = new ControlSelection(panel2, propertyGrid1, propertyGrid3, propertyGrid2, listBox1, null, contextMenuStrip1);

            ArrayCreate = new ArrayCreateElement();
            ArrayCreate.Add(null);
            ArrayCreate.Add(new CreateElementButton());
            ArrayCreate.Add(new CreateElementRichTextBox());
            ArrayCreate.Add(new CreateElementRadioButton());
            ArrayCreate.Add(new CreateElementCheckBox());
            ArrayCreate.Add(new CreateElementTextBox());
            ArrayCreate.Add(new CreateElementPictureBox());
            ArrayCreate.Add(new CreateElementLabel());

            radioButtonPanel0.Text = "";
            radioButtonPanel1.Text = ArrayCreate[1].ToString();
            radioButtonPanel2.Text = ArrayCreate[2].ToString();
            radioButtonPanel3.Text = ArrayCreate[3].ToString();
            radioButtonPanel4.Text = ArrayCreate[4].ToString();
            radioButtonPanel5.Text = ArrayCreate[5].ToString();
            radioButtonPanel6.Text = ArrayCreate[6].ToString();
            radioButtonPanel7.Text = ArrayCreate[7].ToString();

            Test = new ClassTest();
            Test.AddQuestion();

            propertyGrid2.SelectedObject = Test;

            BindingSource binding1;

            binding1               = new BindingSource();
            binding1.DataSource    = Test.ListQuestions;
            listBox1.DisplayMember = "EcranName";
            listBox1.DataSource    = binding1;

            this.Height               = 900;
            this.Location             = new Point(50, 50);
            tabControl1.SelectedIndex = 3;
        }
Example #9
0
        public ControlSubstrate(ControlSelection selectcontrol, Control ctrl, int idxcontrol)
            : base()
        {
            this.SetStyle(ControlStyles.Selectable, false);
            this.SetStyle(ControlStyles.UserMouse, true);

            idx           = idxcontrol;
            Name          = "uc" + idx.ToString();
            selectControl = selectcontrol;
            Ctrl          = ctrl;
            ((IDragControl)Ctrl).selectControl = selectcontrol;

            this.Controls.Add(Ctrl);

            this.SetBounds(0, 0, Ctrl.Width, Ctrl.Height);

            Ctrl.Dock = DockStyle.Fill;

            TabStop = false;

            //BackColor = Color.Transparent;
            //AutoSize = true;
        }
Example #10
0
        public ControlRadioButton(ControlSelection selectcontrol, bool onbase = true)              // Отключение возможностит фокуса
        {
            IsDragMode = false;
            OnBase     = onbase;
            dYready    = true;
            dXready    = true;

            selectControl = selectcontrol;

            if (!onbase)
            {
                this.SetStyle(ControlStyles.Selectable, false);

                TabStop = false;
            }
            Name = "Переключатель";
            Text = "Переключатель";

            //this.AutoSize = false;
            //this.TextAlign = ContentAlignment.BottomRight;
            this.AutoSize = true;
            this.Location = new Point(0, 0);
            //this.SetBounds(0, 0, Width, Height);
        }