Esempio n. 1
0
        private void textBox_0_Leave(object sender, EventArgs e)
        {
            Control control = (Control)sender;
            string  text    = this.listViewSubItem_0.Text;

            this.listViewSubItem_0.Text = control.Text;
            control.Visible             = false;
            this.listViewItem_0.Tag     = null;
            if (this.ValueChanged != null)
            {
                this.ValueChanged(this, new ExListViewEventArgs(this.exlistViewItem_0, this.int_2, text));
            }
            this.exlistViewItem_0 = null;
            this.int_2            = -1;
        }
Esempio n. 2
0
 private void textBox_0_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == '\r')
     {
         string text = this.listViewSubItem_0.Text;
         this.listViewSubItem_0.Text = this.textBox_0.Text;
         this.textBox_0.Visible      = false;
         this.listViewItem_0.Tag     = null;
         if (this.ValueChanged != null)
         {
             this.ValueChanged(this, new ExListViewEventArgs(this.exlistViewItem_0, this.int_2, text));
         }
         this.exlistViewItem_0 = null;
         this.int_2            = -1;
     }
 }
Esempio n. 3
0
        private void EXListView_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
        {
            e.DrawBackground();
            if (e.ColumnIndex == this.int_1)
            {
                e.Graphics.FillRectangle(this.brush_0, e.Bounds);
            }
            if ((e.ItemState & ListViewItemStates.Selected) != 0)
            {
                e.Graphics.FillRectangle(this.brush_1, e.Bounds);
            }
            int num = (e.Bounds.Y + (e.Bounds.Height / 2)) - (e.SubItem.Font.Height / 2);
            int x   = e.Bounds.X + 2;

            if (e.ColumnIndex == 0)
            {
                EXListViewItem item = (EXListViewItem)e.Item;
                if (item.GetType() == typeof(EXImageListViewItem))
                {
                    EXImageListViewItem item2 = (EXImageListViewItem)item;
                    if (item2.MyImage != null)
                    {
                        Image myImage = item2.MyImage;
                        int   y       = (e.Bounds.Y + (e.Bounds.Height / 2)) - (myImage.Height / 2);
                        e.Graphics.DrawImage(myImage, x, y, myImage.Width, myImage.Height);
                        x += myImage.Width + 2;
                    }
                }
                e.Graphics.DrawString(e.SubItem.Text, e.SubItem.Font, new SolidBrush(e.SubItem.ForeColor), (float)x,
                                      (float)num);
            }
            else
            {
                EXListViewSubItemAB subItem = e.SubItem as EXListViewSubItemAB;
                if (subItem == null)
                {
                    e.DrawDefault = true;
                }
                else
                {
                    x = subItem.DoDraw(e, x, base.Columns[e.ColumnIndex] as EXColumnHeader);
                    e.Graphics.DrawString(e.SubItem.Text, e.SubItem.Font, new SolidBrush(e.SubItem.ForeColor), (float)x,
                                          (float)num);
                }
            }
        }
Esempio n. 4
0
        private void EXListView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            EXListViewItem itemAt = base.GetItemAt(e.X, e.Y) as EXListViewItem;

            if (itemAt != null)
            {
                this.listViewItem_0 = itemAt;
                int left = itemAt.Bounds.Left;
                int num2 = 0;
                while (num2 < base.Columns.Count)
                {
                    left += base.Columns[num2].Width;
                    if (left > e.X)
                    {
                        left -= base.Columns[num2].Width;
                        this.listViewSubItem_0 = itemAt.SubItems[num2];
                        this.int_0             = num2;
                        break;
                    }
                    num2++;
                }
                if (base.Columns[num2] is EXColumnHeader)
                {
                    EXColumnHeader header = (EXColumnHeader)base.Columns[num2];
                    if (header.GetType() == typeof(EXEditableColumnHeader))
                    {
                        EXEditableColumnHeader header2 = (EXEditableColumnHeader)header;
                        if (header2.MyControl != null)
                        {
                            Control myControl = header2.MyControl;
                            if (myControl.Tag != null)
                            {
                                base.Controls.Add(myControl);
                                myControl.Tag = null;
                                if (myControl is ComboBox)
                                {
                                    ((ComboBox)myControl).SelectedValueChanged += new EventHandler(this.method_1);
                                }
                                myControl.Leave += new EventHandler(this.textBox_0_Leave);
                            }
                            myControl.Location = new Point(left, base.GetItemRect(base.Items.IndexOf(itemAt)).Y);
                            myControl.Width    = base.Columns[num2].Width;
                            if (myControl.Width > base.Width)
                            {
                                myControl.Width = base.ClientRectangle.Width;
                            }
                            myControl.Text    = this.listViewSubItem_0.Text;
                            myControl.Visible = true;
                            myControl.BringToFront();
                            myControl.Focus();
                        }
                        else
                        {
                            this.textBox_0.Location = new Point(left, base.GetItemRect(base.Items.IndexOf(itemAt)).Y);
                            this.textBox_0.Width    = base.Columns[num2].Width;
                            if (this.textBox_0.Width > base.Width)
                            {
                                this.textBox_0.Width = base.ClientRectangle.Width;
                            }
                            this.textBox_0.Text    = this.listViewSubItem_0.Text;
                            this.textBox_0.Visible = true;
                            this.textBox_0.BringToFront();
                            this.textBox_0.Focus();
                        }
                    }
                    else if (header.GetType() == typeof(EXBoolColumnHeader))
                    {
                        EXBoolColumnHeader header3 = (EXBoolColumnHeader)header;
                        if (header3.Editable)
                        {
                            EXBoolListViewSubItem item2 = (EXBoolListViewSubItem)this.listViewSubItem_0;
                            if (item2.BoolValue)
                            {
                                item2.BoolValue = false;
                            }
                            else
                            {
                                item2.BoolValue = true;
                            }
                            if (this.ValueChanged != null)
                            {
                                this.ValueChanged(this, new ExListViewEventArgs(itemAt, num2, !item2.BoolValue));
                            }
                            base.Invalidate(item2.Bounds);
                        }
                    }
                }
            }
        }