Esempio n. 1
0
        public virtual void doDoubleClick(PanelDoubleBuffered pn, ShapeBase ns)
        {
            parentPanel = pn;
            namingShape = ns;

            if (parentPanel.isNaming)
            {
                parentPanel.AffectingShape.endEditName();
                return;
            }

            parentPanel.AffectingShape = ns;
            parentPanel.isNaming = true;

            txtName = new TextBox();

            //cho class con định vị xong rồi add lên shape theo vị trí đó
            dinhviTextBox(txtName);

            txtName.Text = sName; //hiện tên cũ

            sName = "";
            this.Invalidate();

            this.Controls.Add(txtName);
            txtName.SelectAll();
            txtName.Focus();
            txtName.KeyPress += new System.Windows.Forms.KeyPressEventHandler(txtName_KeyPress);

            //Data type cho attribute
            if (this is AttributeShape)
            {
                if (((AttributeShape)this).attributeChilds.Count == 0)
                {
                    ucDataDescription = new DataDescription();
                    ucDataDescription.Location = new Point(this.Location.X + this.Width + 5, this.Location.Y);
                    parentPanel.Controls.Add(ucDataDescription);

                    //Cho USC nằm lên trên.
                    parentPanel.Controls.SetChildIndex(ucDataDescription, 0);

                    if (((AttributeShape)this).type == AttributeType.Key)
                        ucDataDescription.chkNull.Enabled = false;

                    if (((AttributeShape)this).dataType != null)
                        ucDataDescription.cboDataType.SelectedItem = ((AttributeShape)this).dataType;
                    if (((AttributeShape)this).dataLength != 0)
                        ucDataDescription.txtLength.Text = ((AttributeShape)this).dataLength.ToString();

                    ucDataDescription.chkNull.Checked = ((AttributeShape)this).allowNull;

                    if (((AttributeShape)this).description != "")
                        ucDataDescription.txtDescription.Text = ((AttributeShape)this).description;

                    ucDataDescription.btnOK.Click += new EventHandler(btnOK_Click);
                }
            }
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.pnlDrawBoard = new ERDesigner.PanelDoubleBuffered();
     this.xtraScrollableControl1 = new DevExpress.XtraEditors.XtraScrollableControl();
     this.xtraScrollableControl1.SuspendLayout();
     this.SuspendLayout();
     //
     // pnlDrawBoard
     //
     this.pnlDrawBoard.AutoScrollMargin = new System.Drawing.Size(100, 100);
     this.pnlDrawBoard.BackColor = System.Drawing.Color.White;
     this.pnlDrawBoard.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.pnlDrawBoard.Location = new System.Drawing.Point(0, 0);
     this.pnlDrawBoard.Margin = new System.Windows.Forms.Padding(0);
     this.pnlDrawBoard.Name = "pnlDrawBoard";
     this.pnlDrawBoard.Size = new System.Drawing.Size(2480, 3508);
     this.pnlDrawBoard.TabIndex = 0;
     //
     // xtraScrollableControl1
     //
     this.xtraScrollableControl1.Controls.Add(this.pnlDrawBoard);
     this.xtraScrollableControl1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.xtraScrollableControl1.Location = new System.Drawing.Point(0, 0);
     this.xtraScrollableControl1.Name = "xtraScrollableControl1";
     this.xtraScrollableControl1.Size = new System.Drawing.Size(792, 566);
     this.xtraScrollableControl1.TabIndex = 1;
     //
     // frmDrawBoard
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(792, 566);
     this.Controls.Add(this.xtraScrollableControl1);
     this.DoubleBuffered = true;
     this.Name = "frmDrawBoard";
     this.Text = "Draw Board";
     this.xtraScrollableControl1.ResumeLayout(false);
     this.ResumeLayout(false);
 }