Ejemplo n.º 1
0
        public Rectangle GetSubItemBounds(System.Windows.Forms.ListViewItem listViewItem_1, int int_3)
        {
            int[]     columnOrder = this.GetColumnOrder();
            Rectangle empty       = Rectangle.Empty;

            if (int_3 >= columnOrder.Length)
            {
                throw new System.IndexOutOfRangeException("SubItem " + int_3 + " out of range");
            }
            if (listViewItem_1 == null)
            {
                throw new System.ArgumentNullException("Item");
            }
            Rectangle bounds = listViewItem_1.GetBounds(System.Windows.Forms.ItemBoundsPortion.Label);
            int       num    = bounds.Left;
            int       i;

            for (i = 0; i < columnOrder.Length; i++)
            {
                System.Windows.Forms.ColumnHeader columnHeader = base.Columns[columnOrder[i]];
                if (columnHeader.Index == int_3)
                {
                    break;
                }
                num += columnHeader.Width;
            }
            empty = new Rectangle(num, bounds.Top, base.Columns[columnOrder[i]].Width, bounds.Height);
            return(empty);
        }
Ejemplo n.º 2
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.º 3
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();
            }
        }
Ejemplo n.º 4
0
        private void DoListViewMouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            DevComponents.DotNetBar.Controls.ListViewEx listView = sender as DevComponents.DotNetBar.Controls.ListViewEx;
            System.Windows.Forms.ListViewItem           item     = null;
            if (item == null)
            {
                return;
            }
            switch (listView.Name)
            {
            case "listAddField":
            {
                item = listAddField.GetItemAt(e.X, e.Y);
                System.Drawing.Rectangle rec = item.GetBounds(System.Windows.Forms.ItemBoundsPortion.Entire);
                if (e.X <= listAddField.Columns[0].Width)
                {
                    m_EditObject = item;
                    Form.frmSymbolEdit frm = new GeoSymbology.Form.frmSymbolEdit(this, item.Tag as ISymbol, "");
                    frm.ShowDialog();
                }
                else if (e.X > listAddField.Columns[0].Width && e.X <=
                         listAddField.Columns[0].Width + listAddField.Columns[1].Width)
                {
                    listAddField.Items.Remove(item);
                    item.ImageKey = "";
                    listAllField.Items.Add(item);
                }
            }
            break;

            case "listAllField":
            {
                item = listAllField.GetItemAt(e.X, e.Y);
                listAllField.Items.Remove(item);
                listAddField.Items.Add(item);
                listAddField.SmallImageList.Images.Add(item.Name.Replace("Item", "Symbol"),
                                                       ModuleCommon.Symbol2Picture(item.Tag as ISymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight));
                item.ImageKey = item.Name.Replace("Item", "Symbol");
            }
            break;
            }
        }