Ejemplo n.º 1
0
        public override void DoListValueItemMouseDoubleClick(int x, int y)
        {
            System.Windows.Forms.ListViewItem item = m_ListValueItem.GetItemAt(x, y);
            if (item == null)
            {
                return;
            }

            System.Drawing.Rectangle rec = item.GetBounds(System.Windows.Forms.ItemBoundsPortion.Entire);
            if (x <= m_ListValueItem.Columns[0].Width)
            {
                //·ûºÅ±à¼­
                m_EditObject = item;
                Form.frmSymbolEdit frm = new GeoSymbology.Form.frmSymbolEdit(this, item.Tag as ISymbol, "");
                frm.ShowDialog();
            }
            else if (x > m_ListValueItem.Columns[0].Width &&
                     x <= (m_ListValueItem.Columns[1].Width + m_ListValueItem.Columns[0].Width))
            {
                m_EditObject = item.SubItems[1];
                //·¶Î§±à¼­
                System.Drawing.Point point = new System.Drawing.Point();
                point.X = m_ListValueItem.Columns[0].Width;
                point.Y = rec.Top + (rec.Height - Form.frmDoubleEdit.FormWidth) / 2;
                point   = m_ListValueItem.PointToScreen(point);
                Form.frmDoubleEdit doubleEdit = new GeoSymbology.Form.frmDoubleEdit(this,
                                                                                    (double)item.SubItems[1].Tag, point, m_ListValueItem.Columns[1].Width, "");
                doubleEdit.Show();
            }
            else if (x > (m_ListValueItem.Columns[1].Width + m_ListValueItem.Columns[0].Width) &&
                     x <= (m_ListValueItem.Columns[0].Width + m_ListValueItem.Columns[1].Width + m_ListValueItem.Columns[2].Width))
            {
                m_EditObject = item.SubItems[2];
                //±êÇ©±à¼­
                System.Drawing.Point point = new System.Drawing.Point();
                point.X = m_ListValueItem.Columns[0].Width + m_ListValueItem.Columns[1].Width;
                point.Y = rec.Top + (rec.Height - Form.frmStringEdit.FormWidth) / 2;
                point   = m_ListValueItem.PointToScreen(point);
                Form.frmStringEdit stringEdit = new GeoSymbology.Form.frmStringEdit(this,
                                                                                    item.SubItems[2].Text, point, m_ListValueItem.Columns[2].Width, "");
                stringEdit.Show();
                stringEdit.Location = point;
            }
        }
Ejemplo n.º 2
0
        private void DoListValueItemMouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            System.Windows.Forms.ListViewItem item = listValueItem.GetItemAt(e.X, e.Y);
            if (item == null)
            {
                return;
            }

            System.Drawing.Rectangle rec = item.GetBounds(System.Windows.Forms.ItemBoundsPortion.Entire);
            if (e.X <= listValueItem.Columns[0].Width)
            {
                //符号编辑
                m_EditObject = item;
                Form.frmSymbolEdit frm = new GeoSymbology.Form.frmSymbolEdit(this, item.Tag as ISymbol, "");
                frm.ShowDialog();
            }
            else if (e.X > listValueItem.Columns[0].Width &&
                     e.X <= (listValueItem.Columns[1].Width + listValueItem.Columns[0].Width))
            {
                m_EditObject = item.SubItems[1];
                //范围编辑
                System.Drawing.Point point = new System.Drawing.Point();
                point.X = listValueItem.Columns[0].Width;
                point.Y = rec.Top + (rec.Height - Form.frmDoubleEdit.FormWidth) / 2;
                point   = listValueItem.PointToScreen(point);
                Form.frmDoubleEdit doubleEdit = new GeoSymbology.Form.frmDoubleEdit(this,
                                                                                    (double)item.SubItems[1].Tag, point, listValueItem.Columns[1].Width, "");
                doubleEdit.Show();
            }
            else if (e.X > (listValueItem.Columns[1].Width + listValueItem.Columns[0].Width) &&
                     e.X <= (listValueItem.Columns[0].Width + listValueItem.Columns[1].Width + listValueItem.Columns[2].Width))
            {
                m_EditObject = item.SubItems[2];
                //标签编辑
                System.Drawing.Point point = new System.Drawing.Point();
                point.X = listValueItem.Columns[0].Width + listValueItem.Columns[1].Width;
                point.Y = rec.Top + (rec.Height - Form.frmStringEdit.FormWidth) / 2;
                point   = listValueItem.PointToScreen(point);
                Form.frmStringEdit stringEdit = new GeoSymbology.Form.frmStringEdit(this,
                                                                                    item.SubItems[2].Text, point, listValueItem.Columns[2].Width, "");
                stringEdit.Show();
            }
        }